StrategyBase.Orders is a collection of all orders that the managed order entry API maintains.
I find this collection is populated and I can find the last filled order with this code:
IEnumerable<Order> myLongEntryOrders = OrdersFilled( "LE", OrderAction.Buy);
public IEnumerable<Order> OrdersFilled(String strOrderName, OrderAction orderAction)
{
return m_ninjaStrategy.Orders.Where(o => o.Name == strOrderName && o.OrderAction == orderAction && o.Filled > 0);
}
However it doesn’t work in the Strategy Analyzer (SA). When run in SA I find that
Position.MarketPosition != Position.Flat && Orders.Count == 0
Is the SA considering the Orders collection to be a part of the Performance object and only populating it at the end of the run?
I wrote my strategy to use the Orders property/object rather maintain my own orders collection. But if SA doesn’t populate it then I can’t use the Orders collection at all. By the time I finish developing a strat that must use my own Orders collection I would not bother to switch back to the StrategyBase version of it when running live.
I attached a screen shot showing MarketPosition.Postiion == MarketPostiion.Long.
I also attached the strategy I used to demonstrate.
You can run it in SA as well as in Replay and you'll see the difference in the output window.
Can you confirm and log as a bug?

Comment