LazyBear

Indicator: Postivie / Negative Volume Indices

514
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)