开拓者 TB EMA均线交易系统源码,仅供参考
作者:开拓者 TB 来源:cxh99.com 发布时间:2013年03月11日
- 咨询内容:
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] );//程序化交易 www.cxh99.com
If
(MarketPosition <>1 && XAvgValue1>XAvgValue2)
{
Buy(1,Open);
}
If
(MarketPosition <>-1 && XAvgValue1<XAvgValue2)
{
SellShort(1,Open);
}
PlotNumeric("PL",Portfolio_TotalProfit);
End