I want to check on the strategy start are there any working orders placed on the instrument and are any other strategies running on the instrument.
How to do it in a thread safe way?
Can I just do it like this:
#region check is no working orders on instrument
List<Order> alive_orders = new List<Order>();
for( int i = 0; i < Account.Orders.Count; i++ )
{
var order = Account.Orders[i];
if( !Order.IsTerminalState( order.OrderState ) && order.Instrument == Instrument )
{
alive_orders.Add( order );
}
}
Or should I do it another way?
Comment