diary/20090926
こんどはストキャスを利用
昨日のプログラムをMACDではなく,ストキャスティックス利用に変えてみました.
strategy Stochas_k4;
input lots = 1 ;
vars mas(series), mal(series), i(number);
begin
Bollinger_Bands_all(close, 21, 2.5, 0);
Stochastics();
mas := sma(close, 5);
mal := sma(close, 25);
if crossdown (mas, mal) then exitlong();
if crossup(close, Bollinger_Bands_all.line_upper) then exitlong();
if crossup (Stochastics.k, Stochastics.pk) then begin
exitshort();
i := back(Stochastics.k);
if (Stochastics.k[i] < 20) then
buy(lots);
end;
if crossup (mas, mal) then exitshort();
if crossdown(close, Bollinger_Bands_all.line_lower) then exitshort();
if crossdown(Stochastics.k, Stochastics.pk) then begin
exitlong();
i := back(Stochastics.k);
if (Stochastics.k[i] > 80) then
sell(lots);
end;
end.
ドル円での結果は
1時間足,12勝17敗,139pips
4時間足,16勝21敗,-212pips
日足,13勝36敗,-435pips
となり,芳しくない.複雑なロジックはすぐに通用しなくなるので,なるべく避けたいのだが,もう少し複雑に(フィルターを加える)しなくては使い物にならないようだ.

