I'm having a hard time figuring out how to code the Relative Volume in Easylanguage. The RVol is a real time indicator and changes its value every minute (I'm using 1 min chart). Going straight to the point, here's what I'm trying to do:
1) Calculate the accumulated volume from the beginning of the session until "now". Let's say the session starts at 10:00 and it's now 11:35. The first step would be to accumulate the total volume traded today (quantity, no financial) from 10:00 to 11:35. This I managed to do:
Lets say the value I get is 109
2) This is where things get tricky. I need to calculate the average value of the variable above for previous sessions (from beginning of session until "now"). Let's say I want the average of 5 previous sessions. Example:
Day -1: accumulated volume from 10:00 to 11:35 = 150
Day -2: accumulated volume from 10:00 to 11:35 = 73
Day -3: accumulated volume from 10:00 to 11:35 = 85
Day -4: accumulated volume from 10:00 to 11:35 = 94
Day -5: accumulated volume from 10:00 to 11:35 = 113
Average = 103
3) Calculate the ration between (1) and (2). In other words: 109/103 = 1.058 which is my Rvol.
I'm using a really simple Easylanguage software here in Brazil, so complex formulas and scripts are not able to be used (yeah, that's ridiculous!).
Thanks a lot!
Can you help answer these questions from other members on futures io?