traileriana

Price/OBV divergence

Shows agreement or disagreement between the direction of the the price and the on-balance volume. When they disagree, the price is supposed to follow the OBV (or so they say.)
オープンソーススクリプト

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

免責事項

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

チャートでこのスクリプトを利用したいですか?
//@version=2
study("Price/OBV divergence", "Price/OBV")
period = input(30, "Period")

// tanh(v) => (exp(v) - exp(-v))/(exp(v) + exp(-v))
// dema(x, p) => 2*ema(x, p) - ema(ema(x, p), p)

obv = cum(change(close) > 0 ? volume : change(close) < 0 ? -volume : 0*volume)

c = sign(change(ema(close, period)))
o = sign(change(ema(obv  , period)))

cc = c == o ? c : c/3*2
oo = o == c ? o : o/3*2

plot(cc, style=columns, transp = 50, color = red )
plot(oo, style=columns, transp = 50, color = blue)