1) Market condition analysis is based on 15-second bars which are loaded as the primary data series.
2) A tick data series is added with during State.Configure.
3) Unmanaged Limit entry orders to go Long or Short are placed within OnBarUpdate() while processing the 15-second bars.
4) ProfitTarget/StopLoss OCO orders are created during tick data series processing after an entry limit order has filled.
I understand the necessity of assigning Order objects myself within OnOrderUpdate() to keep track of track of the current states of orders and I am doing that. My question is whether I also need to keep track of Long, Short or Flat market positions myself or whether something generally similar to this within OnBarUpdate() will be reliable:
if (position.MarketPosition == MarketPosition.Long)
{
(Conditionally do something ...)
}
else if (position.MarketPosition == MarketPosition.Short)
{
(Conditionally do something ...)
}
else // Flat
{
(Conditionally do something ...)
}

Comment