I would need that my strategy in reality mode checks only the candles starting from the moment I initialized it,
example if it activates it on 15/02/2023 at 15:00 he must consider the candles only from this moment on,
I have made several attempts but have not given the hoped for outwards, below part of my code that does not work:
protected override void OnBarUpdate()
{
if (CurrentBars[0] < BarsRequiredToTrade || CurrentBars[0] < 0 || CurrentBars[1] < 0)
return;
if (BarsInProgress == 0)
{
if (State != State.Historical)
{
if (Count - 1 == CurrentBar && Bars.IsFirstBarOfSession )
{
// i want enter here only when last bar on the right of the screen it's loaded
Check();
}
}
else
{
Check();
}
}
}
Could you help me?
Regards

Comment