else if (State == State.Configure)
{
AddDataSeries(BarsPeriodType.Tick, 1);
}
Everything works normally in the strategy loading the chart with Range 100, 30 days.
The problem arises when I load a chart with lets say 200 bars.
In this condition, no Draw appears on the chart, no trades, and the values disappear from the Output Window.
I noticed that the code with problems seems to be this, but I cannot understand what the error may be. I would appreciate any possible help.
(.....)
protected override void OnBarUpdate()
{
if (CurrentBar < BarsRequiredToTrade)
{
return;
}
if (Bars.IsFirstBarOfSession)
{
currentPnL = 0;
}
if((Calculate == Calculate.OnEachTick && BarsInProgress != 2) || (Calculate == Calculate.OnBarClose && BarsInProgress != 0))
return;
if (CurrentBars[0] < 1 || CurrentBars[1] < 0)
return;
Comment