LazyBear

Indicator: Postivie / Negative Volume Indices

516
More info at www.investopedia.com/terms/p/pvi.asp

I have included both NVI and PVI. Enjoy :)

List of my free indicators: bit.ly/1LQaPK8
List of my indicators at Appstore: blog.tradingview.com/?p=970
オープンソーススクリプト

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

免責事項

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

チャートでこのスクリプトを利用したいですか?
//
// @author LazyBear
// @credits http://www.investopedia.com/terms/p/pvi.asp
// Calculation of the PVI depends on how current volume compares with the previous 
// day's trading volume. If current volume is greater than the previous day's volume, 
// PVI = Previous PVI + {[(Today's Closing Price-Yesterday's Closing Price)/Yesterday's Closing Price)] 
//   x 
// Previous PVI}. If current volume is lower than the previous day's volume, PVI is unchanged.
// 
study(title = "Positive Volume Index [LazyBear]", shorttitle="PVI_LB")

length=input(365)
showEMA=input(true, title="Show EMA?", type=bool)
START_VALUE=100
pvi=(volume > volume[1]) ? nz(pvi[1]) + ((close - close[1])/close[1]) * (na(pvi[1]) ? pvi[1] : START_VALUE) : nz(pvi[1])
hline(0)
plot(pvi)
plot(showEMA ? ema(pvi, length) : na, color=orange, linewidth=2)