開拓者 TB EMA均線交易系統(tǒng)源碼,僅供參考
作者:開拓者 TB 來源:cxh99.com 發(fā)布時(shí)間:2013年03月11日
- 咨詢內(nèi)容:
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.tumamayizhan.com
If
(MarketPosition <>1 && XAvgValue1>XAvgValue2)
{
Buy(1,Open);
}
If
(MarketPosition <>-1 && XAvgValue1<XAvgValue2)
{
SellShort(1,Open);
}
PlotNumeric("PL",Portfolio_TotalProfit);
End