Can anyone help me solve these two errors? I can't seem to correct them.
{
if (BarsInProgress != 0)
return;
if (CurrentBars[0] < BarsRequiredToTrade)
return;
// Set 1
if (((CrossAbove(HMA1, EMA1, 1))
&& (CrossAbove(TSSuperTrend1.UpTrend, TSSuperTrend1.DownTrend, 1))
&& (Position.MarketPosition == MarketPosition.Flat)))
Draw.ArrowUp(this, @"Buy"+CurrentBar, false, 0, (Low[0] + (-10 * TickSize)), Brushes.Lime);
EnterLong();
else if (((CrossBelow(HMA2, EMA2, 1))
&& (CrossBelow(TSSuperTrend1.UpTrend, TSSuperTrend1.DownTrend, 1))
&& (Position.MarketPosition == MarketPosition.Flat)))
Draw.ArrowDown(this, @"Sell"+CurrentBar, false, 0, (High[0] + (10 * TickSize)), Brushes.Red);
EnterShort();
}
#region Properties
[NinjaScriptProperty]
[Range(1, int.MaxValue)]
[Display(Name="TSPeriod", Order=1, GroupName="Parameters")]
public int TSPeriod
{ get; set; }
[NinjaScriptProperty]
[Range(1, double.MaxValue)]
[Display(Name="Multiplier", Order=2, GroupName="Parameters")]
public double Multiplier
{ get; set; }
[NinjaScriptProperty]
[Range(1, int.MaxValue)]
[Display(Name="Smooth", Order=3, GroupName="Parameters")]
public int Smooth
{ get; set; }
[NinjaScriptProperty]
[Range(1, int.MaxValue)]
[Display(Name="EMAPeriod", Order=4, GroupName="Parameters")]
public int EMAPeriod
{ get; set; }
[NinjaScriptProperty]
[Range(1, int.MaxValue)]
[Display(Name="HMAPeriod", Order=5, GroupName="Parameters")]
public int HMAPeriod
{ get; set; }
#endregion
}
}
1) Invalid expression term 'else' CS1525 Line 112 Column 4
2) ; expected CS1002 Line 112 Column 9
I'm getting a red marker after EnterLong();
Any help will be great,
Thanks,
Chris
Comment