I have an algo that buys/sells and then exits at the end of the candle, or rather the open of the next candle after the exit signal is issued as I am trading with CalculateOnBarClose = True. On rare occasions, the algo may get several entry signals in a row.
If the second trade signal is in the same direction as the first then I would get a sequence of events like:
@12:00 close of candle: go long signal generated
@12:01 open of candle: long actioned
@12:01 close of candle: exitlong is declared, followed by a go long signal again
@12:02 open of candle: only the first long is exited (i.e a short trade is made) with no second long entered at this same open price
If the second signal is a trade in the opposite direction there is no issue and I could get a long to exit a short in conjunction with a long entry at the same open price. Is this by design in NinjaTrader? Is this due to NinjaTrader not wanting to appear to wash trade? Is the simplest solution to simply not exit at all if a second long entry in a row is signalled?
Cheers,
darmbk.
Comment