Instead of using crossovers, I am using > and <.
Although these may appear to be too indefinite, they can be executed only when the position is as stated (Long, Short or Flat).
For example:
For // Condition set 1
if (Position.MarketPosition == MarketPosition.Short
&& (LinReg(Close, fast) > (LinReg(Close, slow)[0] + aBuff)))
{
ExitShort(n, "CS.LRS");
}
I am getting the following compiler errors:
The name ‘MarketPositionShort’ does not exist in the current context CS0103
The name ‘PositonMarketPosition’ does not exist in the current context CS0103
Operator > cannot be applied to operands of type ‘NinjaTrader.Indicator.LinReg’
and ‘double’. CS0019
For // Condition set 7
if(Position.GetProfitLoss(Close[0],PerformanceUnit.Currency) > Mn)
{
SetTrailStop ("SS.LRS" , CalculationMode.Price, STS, true);
SetTrailStop ("B.LRS" , CalculationMode.Price, STS, true);
}
I am getting the following compiler error:
The name ‘PerformanceUnitCurrency’ does not exist in the current context CS103
How can I correct these errors?
Comment