CTLでシステムトレード(旧為替の一歩)
| フロントページ | 新着 | 一覧 |
<-domain ijino tamedesu

diary/20090923

マーフィ手法にはエッジがない?

マーフィ手法のCTLが完成した.

 strategy super_bollinger_marfy;
 input lots = 1;
 vars psigma(series), msigma(series),
    i(number), center_line(series), c_line(series),
    cl1(number), cl2(number);
 begin
 Bollinger_Bands1();
 center_line := SMA(close, 21);
 Chikou_Span(21);
 c_line := Chikou_Span.line;
 psigma := Bollinger_Bands1.line_upper;
 msigma := Bollinger_Bands1.line_lower;
 i := back(c_line);
 if i-21 <= front(center_line) then return;
 cl1 := center_line[i];
 cl2 := center_line[i-1];
 if crossup(close, psigma) and (cl1 - cl2 > 0)
 and (c_line[i] > close[i-21]) then buy(lots);
 if crossdown(close, psigma) then exitlong();
 if crossdown(close, msigma) and (cl1 - cl2 < 0)
 and (c_line[i] < close[i-21]) then sell(lots);
 if crossup(close, msigma) then exitshort(); 
 end.

14行目のif文がポイントだ.これがないと実行時にエラーとなる.このCTLを日足でバックテストしてみると,一昨年がマイナス,昨年はプラスで,今年はマイナスになる.時間軸を60分足にしても30分足にしても今年はマイナスだ.どうやらマーフィ手法はエッジがなくインチキだということになる.信用していたのにショックだ.