I hope my message finds you well. I am currently trying to test an execution method where if the close of the 1 Minute Candle is below the Low of the 5 Minute Candle the strategy enters short.
I have not quite understood how to accomplish this.
This is the code I wrote, and it does not execute anything:
else if (State == State.Configure)
{
// Additional Data Series
AddDataSeries(Data.BarsPeriodType.Minute, 1);
}
protected override void OnBarUpdate()
{
if (BarsInProgress != 0)
return;
if (CurrentBars[0] < 50)
return;
SimpleEntryLogic();
}
private bool _BreakofLow;
private void SimpleEntryLogic()
{
_BreakofLow = Closes[0][0] < Opens[0][0]; // 5 Minute Bar is Red
_BreakofLow &= Closes[1][0] < Closes[0][0]; // Close of 1 Minute Bar is Below 5 Minute Bar Low
_BreakofLow &= Closes[1][0] < Opens[1][0]; // 1 Minute Bar is Red
if(_BreakofLow)
{
Draw.ArrowDown(this, @"Entry Dot_1 " + Convert.ToString(CurrentBars[0]), true, 0, (High[0] + (5 * TickSize)), Brushes.Red);
}
}

Comment