yuya_takahashi_

Pine講座㊶ バックテスト|Stochastics Slow Strategy の解説(ストキャスの途転戦略)

Éducation
yuya_takahashi_ Mis à jour   
FX:USDJPY   Dollar Américain / Yen japonais
逆張りの途転戦略ほど
怖いものはありません。

この戦略は、
ガッツリトレンドが出たときに
もれなく大負けしてしまいますね。

損切りを設定する必要があります。

※ TradingView内蔵のストラテジーを
  上から順番に解説しています

※ 解説はコードの中で

=====
//@version=4
strategy("Stochastic Slow Strategy の解説", overlay=false)

//ストキャスの設定諸々
length = input(14, minval=1)
OverBought = input(80)
OverSold = input(20)
smoothK = 3
smoothD = 3

//ストキャスの算出
k = sma(stoch(close, high, low, length), smoothK)
d = sma(k, smoothD)

//ストキャスの値があることを確認
if (not na(k) and not na(d))
//%Kが20よりも下で%Dを上抜けしたとき
if (crossover(k,d) and k < OverSold)
//成行買い(売りがある場合は途転買い)
strategy.entry("StochLE", strategy.long, comment="StochLE")
//%Kが80よりも上で%Dを下抜けしたとき
if (crossunder(k,d) and k > OverBought)
//成行売り(買いがある場合は途転売り)
strategy.entry("StochSE", strategy.short, comment="StochSE")

//確認用で描画
plot(k)
plot(d,color=color.red)
hline(OverSold)
hline(OverBought)
=====
Commentaire:
次の講座

小次郎講師公式インジケーターのお申込
bit.ly/2vdSV4Q

小次郎講師のLINE@
bit.ly/2VZQFu3

小次郎講師のチャート情報局
bit.ly/2GvLAEp
Clause de non-responsabilité

Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.