Params
Numeric Length1(10);
Numeric Length2(20);
Numeric Length3(30);
Numeric Length4(7);
Vars
NumericSeries XAvgValue1;
NumericSeries XAvgValue2;
NumericSeries XAvgValue3;
NumericSeries MA1;
Begin
PlotNumeric("EMA1",XAverage(Close, Length1));
PlotNumeric("EMA2",XAverage(Close, Length2));
PlotNumeric("EMA3",XAverage(Close, Length3));
MA1= AverageFC(Close,Length4);
PlotNumeric( "MA1" , MA1[5] );
//
If
(MarketPosition 1 XAvgValue1>XAvgValue2)
{
Buy(1,Open);
}
If
(MarketPosition -1 XAvgValue1{
SellShort(1,Open);
}
PlotNumeric("PL",Portfolio_TotalProfit);
End