程序化和量化交易...吧 关注:109贴子:69
  • 0回复贴,共1

双均线交易系统源码

取消只看楼主收藏回复

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


IP属地:云南1楼2017-01-05 09:07回复