I'm working with CalculateOnBarClose = true on 60 minutes bars.
Te idea is to send orders only if the strategy is flat, positions are closed with market orders sent when a condition is met.
Theoretically if I'm currently long and at the end of current bar I send a market order to close my position, next bar I should do nothing as at the end of this bar I'm still long (I'm flat only on the open of next bar), yet my strategy sends orders also in the bars where positions are closed with MKT orders.
I detect positions with variable IsFlat as get return Positions[0].MarketPosition == MarketPosition.Flat
Am I considering in some wrong way the moment the position is closed or am I mistaking something else?
Thansk, bye
Smodato
Comment