Can anyone pls make this AFL -

mohan.sic

Well-Known Member
#1
As per their formulas,

PVI ( positive volume index): Either increases or decreases only when current volume is greater than previous volume. If volume is less than previous volume PVI remains unchaged.

NVI (negative volume index): Either increases or decreases only when current volume is less than previous volume. If volume is greater than previous volume NVI remains unchaged.

Hence for any data point either PVI will change or NVI will change. Both cant change at same time. If PVI value changes NVI remains unchaged and vice-versa.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
My request is, please write a code which will represent changes in both indicators at same time.

pls name it PNVI.

PNVI[0] will be 100.

Then after in next data point if pvi increases by 0.5 PNVI will become 100.5 or if pvi decrease by 0.5 PNVI will be 99.5

But if current volume is less than previous volume, pvi will remain unchanged. Then obviously NVI will change. Then change in NVI will be shown in PNVI.


( as pvi and nvi are inbuilt no need to define them seperately in formula)
-----------------------------------------------------------------------------------------------

Here we know that for any data point either pvi will change or nvi will change. both will not change at same time.
So what ever the value change in either pvi or nvi, we are showing that change in our indicator.
If the change in the indicator value is positive, we are adding that change to PNVI or if it is negative we are deducting it from PNVI value.


regards
 

Similar threads