Params
Numeric FastLength(5);
Numeric SlowLength(20);
Vars
NumericSeries AvgValue1;
NumericSeries AvgValue2;
Begin
AvgValue1 = AverageFC(Close[1] ,FastLength);
AvgValue2 = AverageFC(Close[1] ,SlowLength);
If(MarketPosition <>1 && AvgValue1> AvgValue2)
{
Buy(1,Close);
}
If(MarketPosition <>-1 && AvgValue1< AvgValue2)
{
SellShort(1,Close);
}
PlotNumeric("MA1",AvgValue1);
PlotNumeric("MA2",AvgValue2);
End
Numeric FastLength(5);
Numeric SlowLength(20);
Vars
NumericSeries AvgValue1;
NumericSeries AvgValue2;
Begin
AvgValue1 = AverageFC(Close[1] ,FastLength);
AvgValue2 = AverageFC(Close[1] ,SlowLength);
If(MarketPosition <>1 && AvgValue1> AvgValue2)
{
Buy(1,Close);
}
If(MarketPosition <>-1 && AvgValue1< AvgValue2)
{
SellShort(1,Close);
}
PlotNumeric("MA1",AvgValue1);
PlotNumeric("MA2",AvgValue2);
End