#region Variables
privateint myInput0 = 1; // Default setting for MyInput0
#endregion
bool HasTradedLong = false;
protectedoverridevoid Initialize()
{
Add(PeriodType.Minute, 60);
SetProfitTarget(50);
SetStopLoss(45,false);
CalculateOnBarClose = true;
}
protectedoverridevoid OnBarUpdate()
{
if (Bars.FirstBarOfSession)
{
HasTradedLong = false;
}
if (BarsInProgress != 0)
return;
// Condition set 1
if (Closes[1][0] > SMA(BarsArray[1], 200)[0]
&& !HasTradeLong);
{
HasTradedLong = true;
EnterLongLimit(1000, Close[0], "");
}
}
Thanks Bertrand

Comment