Can you help me find the reason for not triggering the draw? (I am checking these conditions; the others are working properly).
I am trying to add a condition for my strategy:
Primary Timeframe 60 minutes
Secondary Timeframe 15 minutes
The condition will run on each tick and on the secondary timeframe:
If the current high crosses above the previous high, draw a vertical line.
If the current low crosses below the previous low, draw a vertical line.
The code I wrote goes like this:
...
else if (State == State.Configure)
{
AddDataSeries(Data.BarsPeriodType.Minute, 15);
}
else if (State == State.DataLoaded)
{
MAX1 = MAX(Highs[1], 1);
MIN1 = MIN(Lows[1], 1);
}
}
protected override void OnBarUpdate()
{
if (BarsInProgress != 0)
return;
if (CurrentBars[1] < 1)
return;
// Set 1
if (CrossAbove(Highs[1], MAX1, 1))
{
Draw.VerticalLine(this, @"max1 Vertical line_1", 0, Brushes.Lime, DashStyleHelper.Solid, 2);
}
// Set 2
if (CrossBelow(Lows[1], MIN1, 1))
{
Draw.VerticalLine(this, @"max1 Vertical line_2", 0, Brushes.Red, DashStyleHelper.Solid, 2);
}
}
}

Comment