Here's the version with the prior 60 minute bar
else if (State == State.Configure)
{
AddDataSeries(Data.BarsPeriodType.Minute, 60);
AddDataSeries(Data.BarsPeriodType.Minute, 30);
}
else if (State == State.DataLoaded)
{
SMA1 = SMA(Close, Convert.ToInt32(StopSma));
SMA1.Plots[0].Brush = Brushes.Goldenrod;
AddChartIndicator(SMA1);
SetProfitTarget("", CalculationMode.Ticks, 200);
SetStopLoss("", CalculationMode.Ticks, 50, false);
}
}
protected override void OnBarUpdate()
{
if (BarsInProgress != 0)
return;
if (CurrentBars[0] < 1
|| CurrentBars[1] < 1)
return;
// Set 1
if ((Close[0] > Open[0])
&& (Closes[1][1] > Opens[1][1])
&& (Close[1] < Open[1]))
{
EnterLongLimit(Convert.ToInt32(DefaultQuantity), Median[0], "");
}
thanks,
David
Comment