I’m curious about the VPN indicator by Markos Katsanos, but I’m struggling to convert the code. Does anyone know how to code this?
“The VPN indicator calculates the difference of up day volume and down day volume, divided by the total volume. A day is an up day when its typical price – the average of high, low, and close – is higher than yesterday’s typical price plus 1/10 ATR. The opposite is true for down days. The result is multiplied by 100 and smoothed with a 3-day EMA.”
This is my poor attempt, would appreciate if someone could point me in the right direction.
VPN Indicator
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// VPN INDICATOR
//The VPN indicator calculates the difference of up day volume and down day volume, divided by the total volume. A day is an up day when its typical price - the average of high, low, and close - is higher than yesterday’s typical price plus 1/10 ATR. The opposite is true for down days. The result is multiplied by 100 and smoothed with a 3-day EMA. The C code of this indicator:
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.