First time posting here.
I'm trying to make an indicator to calculate some levels from previous bars.
With the code :
else if (State == State.Configure)
{
BarsPeriodType bpt;
if (Enum.TryParse(timeFrame1.ToString(), out bpt))
{
AddDataSeries(bpt, tfValue);
if (showOutput) Print("Added time series: " + bpt + " value: " + tfValue);
}
}
}
protected override void OnBarUpdate()
{
if (CurrentBars[0] < BarsRequiredToPlot || CurrentBars[1] < BarsRequiredToPlot)
return;
if (BarsInProgress == 0)
{
int b = (State == State.Realtime) ? 1 : 0;
MID[0] = (Highs[1][b] + Lows[1][b])/ 2;
But when i try to add more levels to plot, code compiles but doesn't plot anything on the chart:
else if (State == State.Configure)
{
BarsPeriodType bpt;
if (Enum.TryParse(timeFrame1.ToString(), out bpt))
{
AddDataSeries(bpt, tfValue);
if (showOutput) Print("Added time series: " + bpt + " value: " + tfValue);
}
}
}
protected override void OnBarUpdate()
{
if (CurrentBars[0] < BarsRequiredToPlot || CurrentBars[1] < BarsRequiredToPlot || CurrentBars[2] < BarsRequiredToPlot)
return;
if (BarsInProgress == 0)
{
int b = (State == State.Realtime) ? 1 : 0;
MID[0] = (Highs[1][b] + Lows[1][b])/ 2;
MID2[0] = (Highs[2][b] + Lows[2][b])/2;
MID3[0] = (MID[0] + MID2[0])/2;
Thank you.

Comment