}
else if (State == State.Configure)
{
}
else if (State == State.DataLoaded)
{
dinput1 = dinput(Close, 5, 1, 1, 1, true, false, true, 1, 1, true, 9, 1 Minute, Brushes.Green, Brushes.Red, Brushes.Red, Brushes.Green);
SetProfitTarget("", CalculationMode.Percent, Profit1);
SetStopLoss("", CalculationMode.Percent, Loss1, false);
}
}
protected override void OnBarUpdate()
{
if (BarsInProgress != 0)
return;
if (CurrentBars[0] < 1)
return;
// Set 1
if ((Times[0][0].TimeOfDay >= TimeOpen.TimeOfDay)
&& (Times[0][0].TimeOfDay <= Closetime1.TimeOfDay)
&& (dinput1.TUp[0] > 0))
{
EnterLong(Convert.ToInt32(DefaultQuantity), "");
}
// Set 2
if ((Position.MarketPosition == MarketPosition.Long)
&& (Times[0][0].TimeOfDay >= Exittime1.TimeOfDay))
{
ExitLong(Convert.ToInt32(DefaultQuantity), "", "");
}
The mark in blue 1 Minute is wrong, please how must be the correct write?
Regards
Comment