U.S. Dollar / Japanese Yen
Education
Updated

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

1 447
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 )
=====
Note
次の講座
Pine講座㊹ バックテスト|Volty Expan Close Strategy の解説

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.