Can someone please explain my error?
Much appreciated.
{
if ((Position.MarketPosition == MarketPosition.Flat)
&& (ToTime(Time[0]) <= endTradingInTime)
&& (ToTime(Time[0]) >= startTradingInTime))
{
if ((XavTrend1 == 5)
&& (XavTrend2 == 5)
&& (ScalpTrader == 1)
&& (adxlong_in > ADXlong)
&& (dm.DiPlus[i]>dm.DiMinus[i])
&& (Close[0] > sma_in))
{
EnterLong(lots, "UT+UT IN");
SetTrailStop("UT+UT IN",CalculationMode.Ticks,24,false);
if (printtolog == true) Print("LONG TRADE UT UT IN-----------RGAuto:" );
}
if ((XavTrend1 == -5)
&& (XavTrend2 == -5)
&& (ScalpTrader == 2)
&& (adxshort_in > ADXshort)
&& (dm.DiPlus[i]<dm.DiMinus[i])
&& (Close[0] < sma_in))
{
EnterShort(lots, "DT+DT IN");
SetTrailStop("DT+DT IN",CalculationMode.Ticks,24,false);
if (printtolog == true) Print("SHORT TRADE UT UT IN-----------RGAuto:");
}
else if ((Position.MarketPosition == MarketPosition.Flat)
&& (ToTime(Time[0]) <= endTradingOutTime)
&& (ToTime(Time[0]) >= startTradingOutTime))
if ((XavTrend1 == 5)
&& (XavTrend2 == 5)
&& (ScalpTrader == 1)
&& (adxlong_in > ADXlong)
&& (Close[0] > sma_in))
{
EnterShort(lots, "UT+UT OUT");
if (printtolog == true) Print("SHORT TRADE UT UT OUT-----------RGAuto:");
}
if ((XavTrend1 == -5)
&& (XavTrend2 == -5)
&& (ScalpTrader == 2)
&& (adxshort_in > ADXshort)
&& (Close[0] < sma_in))
{
EnterLong(lots, "DT+DT OUT");
if (printtolog == true) Print("LONG TRADE DT DT OUT-----------RGAuto:" );
}
}
}

Comment