yuya_takahashi_

Pine講座㊸ バックテスト|Pivot Extension Startegy の解説

Education
FX:USDJPY   U.S. Dollar / Japanese Yen
Pivot high、Pivot lowを検出して
順張りしていくStrategyです。

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

※ 解説はコードの中で

※ コピペする場合は以下の変更を行ってください
[](全角の角括弧)→(半角の角括弧)
(全角スペース)→(半角スペース)

=====
//@version=4
strategy( "Pivot Extension Strategy の解説" ,overlay=true )

//計算用の設定値
leftBars = input(4)
rightBars = input(2)

//pivot high、pivot lowの算出
ph = pivothigh(leftBars, rightBars)
pl = pivotlow(leftBars, rightBars)

//pivot lowに該当する数値がある
if (not na(pl))
//成行で買いエントリー
strategy.entry("PivExtLE", strategy.long, comment="PivExtLE")

//pivot highに該当する数値がある
if (not na(ph))
//成行で売りエントリー
strategy.entry("PivExtSE", strategy.short, comment="PivExtSE")

//確認用で描画
plot( ph ,style=plot.style_circles ,color=color.red ,linewidth=3 )
plot( pl ,style=plot.style_circles ,color=color.red ,linewidth=3 )
=====
Comment:
次の講座

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

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

小次郎講師のチャート情報局
bit.ly/2GvLAEp
Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.