|
風心 發表於 14-2-13 17:01
感謝大大提醒
我把同一個策略丟到另一台電腦上跑是正常的
給你一個範例,玩玩看吧
把買賣條件改成你的測測看吧
_SECTION_BEGIN("Background_Setting");
SetChartBkColor(1);
SetChartOptions(2,chartShowArrows|chartShowDates|chartWrapTitle);
SetChartBkGradientFill(1, 1, 1);
GraphXSpace = Param("Zoom/In Out",100,-50,150,1);
_SECTION_END();
_SECTION_BEGIN("Backtest Setting");
SetPositionSize(1, spsShares);
SetOption("InitialEquity", 1000000);
SetOption("CommissionMode", 3);
SetOption("CommissionAmount", 1000);
RoundLotSize = 1;
PointValue = 200;
_SECTION_END();
_SECTION_BEGIN("Trading Rules");
barcomplete = BarIndex() < LastValue(BarIndex());
Length1 = 30;
Length2 = 300;
Mae1 = AMA( C, 2 / (length1 + 1 ) );
Mae2 = AMA( C, 2 / (length2 + 1 ) );
Plot(Mae1, "", 7, 1);
Plot(Mae2, "", 6, 1);
Buy = C>MAe1 AND C>MAe2 AND barcomplete;
Short = C<MAe1 AND C<MAe2 AND barcomplete;
BuyPrice = CoverPrice = C;
ShortPrice = SellPrice = C;
Buy = Cover = ExRem(Buy, Short);
Short = Sell = ExRem(Short, Buy);
PlotShapes(IIf(Buy, shapeDigit1, shapeNone), 9, 0, WMA(O,10)-2*ATR(15), 6);
PlotShapes(IIf(Short, shapeDigit1, shapeNone), 10, 0, WMA(O,10)+2*ATR(15), 0);
_SECTION_END();
_SECTION_BEGIN("Charts");
SetBarFillColor(IIf(O>C,19,24));
PlotOHLC(O,H,L,C,"",IIf(O>C,34,32),64+4096);
_SECTION_END();
|
評分
-
查看全部評分
|