Hi all, I’m new to scripting and have been working through the training which is great.
If I was to do OBV manually (I know there is the OBV function, but I wish to change some of the internal variables) with scripting what would the code be? I can’t work out how to get it to accumulate, ie adds to the previous value.
Here is my attempt:
VAR1 = CLOSE() - OFFSET(CLOSE(), OFFSET=1); VAR2= IF(VAR1 > 0,1,-1); VAR3 = VAR2 * VOL(); VAR3 + OFFSET(VAR3, OFFSET=1)
I know it should be Offset=1 + Offset=2 + Offset=3 + …Offset=8425… but this doesnt work in practice as every instument has a different start date.
It would be great if someone can paste the OBV script here.
Many thanks,