Class TradeOperation
- Namespace
- ATAS.Indicators.Trading
- Assembly
- ATAS.Indicators.dll
A trading operation the platform is about to send to the broker (OnCheckAsync(TradeOperation, CancellationToken)), or one it has done and only reports (OnOperationObserved(TradeOperation)). Every value is a copy taken when the platform built the operation; the platform builds it, the public setters exist so that an interceptor's own tests can build one too.
Not in ATAS 8.0.15 yet: available from the next version.
public sealed class TradeOperation
- Inheritance
-
objectTradeOperation
- Extension Methods
Constructors
TradeOperation()
Initializes an operation; the platform sets the values (an interceptor's tests may too).
public TradeOperation()
Properties
Account
The account the operation trades on.
public AccountSnapshot Account { get; init; }
Property Value
Actor
Who performs the operation.
public TradeActor Actor { get; init; }
Property Value
BatchId
The id shared by the operations that are decided together — the two orders of an OCO pair, the orders of a group
account on its accounts; null for a single operation. If one of them is rejected, none is sent.
public long? BatchId { get; init; }
Property Value
- long?
CreatedBy
Who created the order the operation is about (for a modify or cancel, this may differ from Actor): for information only; Unknown if the platform cannot tell.
public TradeActor CreatedBy { get; init; }
Property Value
GroupAccountId
The group account the operation comes from, when the trader placed it on a group of accounts and this operation
is the part of one account of the group (Account); otherwise null.
public string? GroupAccountId { get; init; }
Property Value
- string
IsPositionFlipping
True if the operation can turn the position to the other side (a sell larger than a long position).
public bool IsPositionFlipping { get; init; }
Property Value
- bool
IsPositionIncreasing
True if the operation can make the position larger: an order that adds to it or opens it from flat, and a modify whose requested terms are such an order (whether or not the modify changes the quantity).
public bool IsPositionIncreasing { get; init; }
Property Value
- bool
IsRejectable
True if the interceptor may reject the operation. Closes, Go flat and the platform's protective orders are only
reported (false), and only as long as they do not increase or flip the position.
public bool IsRejectable { get; init; }
Property Value
- bool
IsReplay
True for an operation on a Market Replay account.
public bool IsReplay { get; init; }
Property Value
- bool
IsSimulation
True for an operation on a simulated account.
public bool IsSimulation { get; init; }
Property Value
- bool
Kind
What the operation does.
public TradeOperationKind Kind { get; init; }
Property Value
MarketTimeUtc
The market time of the operation (UTC): the replay time on a Market Replay account, otherwise TimeUtc. Use it for rules about trading hours.
public DateTime MarketTimeUtc { get; init; }
Property Value
- DateTime
OperationId
The id of the operation, unique within the platform session; OperationId refers to it.
public long OperationId { get; init; }
Property Value
- long
Order
The order being placed, or for ModifyOrder the requested new terms;
null for the other kinds.
public OrderSnapshot? Order { get; init; }
Property Value
Position
The position of Account in SecurityId when the operation was built (the position
being closed for ClosePosition); null when there is no instrument.
public PositionSnapshot? Position { get; init; }
Property Value
Protection
The requested change for ChangeProtection; null for the other kinds.
public ProtectionChange? Protection { get; init; }
Property Value
SecurityId
The instrument; null for ClosePositions and GoFlat.
public string? SecurityId { get; init; }
Property Value
- string
TimeUtc
When the operation was built (UTC, wall clock).
public DateTime TimeUtc { get; init; }
Property Value
- DateTime
WorkingOrder
The order as it works now, for ModifyOrder and
CancelOrder; null for the other kinds.
public OrderSnapshot? WorkingOrder { get; init; }