OrderLifecycleManager

StockSharp.MatchingEngine

Order lifecycle manager implementation.

Implements: IOrderLifecycleManager

Properties

Count
public int Count { get; }
value = orderLifecycleManager.Count

Count of active orders.

Methods

Clear
public void Clear()
orderLifecycleManager.Clear()

Clear all orders.

GetActiveOrders
public IEnumerable<EmulatorOrder> GetActiveOrders()
result = orderLifecycleManager.GetActiveOrders()

Get all active orders.

Returns: Enumeration of all active orders.

GetActiveOrders
public IEnumerable<EmulatorOrder> GetActiveOrders(string portfolioName)
result = orderLifecycleManager.GetActiveOrders(portfolioName)

Get all active orders for a portfolio.

portfolioName
Portfolio name to filter active orders.

Returns: Active orders for the specified portfolio.

GetActiveOrders
public IEnumerable<EmulatorOrder> GetActiveOrders(SecurityId securityId)
result = orderLifecycleManager.GetActiveOrders(securityId)

Get all active orders for a security.

securityId
Security identifier to filter active orders.

Returns: Active orders for the specified security.

GetActiveOrders
public IEnumerable<EmulatorOrder> GetActiveOrders(string portfolioName, SecurityId? securityId, Sides? side)
result = orderLifecycleManager.GetActiveOrders(portfolioName, securityId, side)

Get all active orders matching filter.

portfolioName
Optional portfolio name filter.
securityId
Optional security id filter.
side
Optional side filter.

Returns: Active orders matching the specified filters.

GetExpiredOrders
public IEnumerable<EmulatorOrder> GetExpiredOrders(DateTime currentTime)
result = orderLifecycleManager.GetExpiredOrders(currentTime)

Get orders that have expired as of the given time.

currentTime
Time to check expirations against.

Returns: Expired orders at the specified time.

GetOrder
public EmulatorOrder GetOrder(long transactionId)
result = orderLifecycleManager.GetOrder(transactionId)

Get an active order by transaction ID.

transactionId
Transaction id of the order to retrieve.

Returns: The matching EmulatorOrder or null if not found.

ProcessTime
public IEnumerable<EmulatorOrder> ProcessTime(DateTime currentTime)
result = orderLifecycleManager.ProcessTime(currentTime)

Process time passage and return expired orders.

currentTime
Current time to process expiries.

Returns: Orders that expired during processing.

RegisterOrder
public bool RegisterOrder(EmulatorOrder order, DateTime currentTime)
result = orderLifecycleManager.RegisterOrder(order, currentTime)

Register a new active order.

order
Order to register.
currentTime
Current time for expiry calculation.

Returns: True if registered, false if already exists.

RemoveOrder
public bool RemoveOrder(long transactionId)
result = orderLifecycleManager.RemoveOrder(transactionId)

Remove an order from active orders.

transactionId
Transaction id of the order to remove.

Returns: True if removed, false if not found.

TryGetOrder
public bool TryGetOrder(long transactionId, EmulatorOrder order)
result = orderLifecycleManager.TryGetOrder(transactionId, order)

Try to get an active order by transaction ID.

transactionId
Transaction id to look up.
order
When method returns true, contains the found order.

Returns: True if order was found, otherwise false.

TryRemoveOrder
public bool TryRemoveOrder(long transactionId, EmulatorOrder order)
result = orderLifecycleManager.TryRemoveOrder(transactionId, order)

Remove and return an order.

transactionId
Transaction id of the order to remove.
order
When method returns true, contains the removed order.

Returns: True if the order was removed, otherwise false.