StopOrderManager
Stop order manager implementation.
Implements: IStopOrderManager
Methods
public bool Cancel(long transactionId, StopOrderInfo info)
result = stopOrderManager.Cancel(transactionId, info)
Cancel a stop order.
- transactionId
- Transaction ID of the stop order.
- info
- Cancelled stop order info.
Returns: if the stop order was found and cancelled.
public IReadOnlyList<StopOrderTrigger> CheckPrice(SecurityId securityId, decimal price, DateTime time)
result = stopOrderManager.CheckPrice(securityId, price, time)
Check price against all registered stop orders for the given security.
- securityId
- Security ID.
- price
- Current market price.
- time
- Current time.
Returns: List of triggered stop orders with resulting orders to submit.
public static OrderRegisterMessage CreateResultingOrder(StopOrderInfo info, DateTime time)
result = StopOrderManager.CreateResultingOrder(info, time)
Builds the order a stop places when it fires: a limit order at the price its condition asks for, resolving a percentage against the level it fired at, or a market order when it names no price at all.
- info
- The stop that fired.
- time
- When it fired.
Returns: The order to place.
public IReadOnlyList<long> GetStopIds(SecurityId securityId)
result = stopOrderManager.GetStopIds(securityId)
Get the stop orders resting on the given security.
- securityId
- Security ID.
Returns: Transaction IDs of the stop orders registered for the security, empty when none rest on it.
public void Register(StopOrderInfo info)
stopOrderManager.Register(info)
Register a new stop order.
public bool Replace(long origTransactionId, StopOrderInfo newInfo)
result = stopOrderManager.Replace(origTransactionId, newInfo)
Atomically replace an existing stop order with a new one.
- origTransactionId
- Transaction ID of the stop order to replace.
- newInfo
- New stop order info.
Returns: if the old stop order was found and replaced.