I am trying to build a strategy which enters a long position when the price crosses above the Bollinger band. I want to take the tread on the start of next candle/bar from when the condition is met.
I used the strategy builder and wrote the following condition:
if ((CrossAbove(Close, Bollinger1.Upper, 1)) && (Times[0][0].TimeOfDay >= TimeStart.TimeOfDay) && (Times[0][0].TimeOfDay <= TimeEnd.TimeOfDay)) { BackBrush = Brushes.CornflowerBlue; EnterLong(Convert.ToInt32(DefaultQuantity), ""); }
This works fine when back testing. It takes trade on the next candle after the cross over as it should:
As seen in the image above, the trade is taken on the start of next candle once the cross over condition is met. But, this is not the case during live trading.
During live trading it enters the trade on the same candle after the cross over and it does this every time.
So, what should I be doing differently to ensure it takes trade on the start of the following candle once the cross over condition is met.
Please guide me. Thank you for your time and help!
Comment