I would have only one execution (entry long / short / stop loss ) per bar, I'm trying to use IsFirstTickOfBar, in historical data seems to work, but doesn't work while the bar is creating
I use Calculate.OnEachTick, a bool var bExe
this is my code
On bar update
if (IsFirstTickOfBar)
bExe = true;
if (Position.Quantity == 0 && bEsegui) {
enter position and set stop loss
bExe = false
else
if (bExe and other condition)
set stop loss
When the stopp loss is performed in last bar I want the enter position on the next bar
Comment