accidentje

4/2 pivot levels

Plots...
  • Confirmed highs when 1. it's higher than the 4 prior (lower) highs AND 2. higher than the 2 following (lower) highs.
  • Confirmed lows when 1. it's lower than the 4 prior (higher) lows AND 2. lower than the 2 following (higher) lows.
オープンソーススクリプト

TradingViewの精神に則り、このスクリプトの作者は、トレーダーが理解し検証できるようにオープンソースで公開しています。作者に敬意を表します!無料で使用することができますが、このコードを投稿で再利用するには、ハウスルールに準拠する必要があります。 お気に入りに登録してチャート上でご利用頂けます。

免責事項

これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。

チャートでこのスクリプトを利用したいですか?
study(title="4/2 pivot levels", shorttitle="4/2 pivot", overlay=true)
//
useAlternativeTF = input(false)
AlternativeTF = input("W")
tf = useAlternativeTF ? AlternativeTF : period
//
h0 = security(tickerid, tf, high[0])
h1 = security(tickerid, tf, high[1])
h2 = security(tickerid, tf, high[2])
h3 = security(tickerid, tf, high[3])
h4 = security(tickerid, tf, high[4])
h5 = security(tickerid, tf, high[5])
h6 = security(tickerid, tf, high[6])

l0 = security(tickerid, tf, low[0])
l1 = security(tickerid, tf, low[1])
l2 = security(tickerid, tf, low[2])
l3 = security(tickerid, tf, low[3])
l4 = security(tickerid, tf, low[4])
l5 = security(tickerid, tf, low[5])
l6 = security(tickerid, tf, low[6])
//
pivoth = h2 > h1 and h2 > h0 and h6 < h2 and h5 < h2 and h4 < h2 and h3 < h2 ? h2 : pivoth[1]
pivotl = l1 < l0 and l2 < l0 and l6 > l2 and l5 > l2 and l4 > l2 and l3 > l2 ? l2 : pivotl[1]
//
plot(pivoth, color= pivoth != pivoth[1] ? na : red, linewidth=2)
plot(pivotl, color= pivotl != pivotl[1] ? na : green, linewidth=2)