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
Skrypt open-source

Zgodnie z prawdziwym duchem TradingView, autor tego skryptu opublikował go jako open-source, aby traderzy mogli go zrozumieć i zweryfikować. Brawo dla autora! Możesz używać go za darmo, ale ponowne wykorzystanie tego kodu w publikacji jest regulowane przez Dobre Praktyki. Możesz go oznaczyć jako ulubione, aby użyć go na wykresie.

Wyłączenie odpowiedzialności

Informacje i publikacje przygotowane przez TradingView lub jego użytkowników, prezentowane na tej stronie, nie stanowią rekomendacji ani porad handlowych, inwestycyjnych i finansowych i nie powinny być w ten sposób traktowane ani wykorzystywane. Więcej informacji na ten temat znajdziesz w naszym Regulaminie.

Chcesz użyć tego skryptu na wykresie?
//
// @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)