On Balance Volume Script

Optuma Forums Optuma Scripting On Balance Volume Script

This topic contains 2 replies, has 2 voices, and was last updated by Avatar Liam 3 months, 2 weeks ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #54143
    Avatar
    Liam
    • Topics: 4
    • Replies: 4
    • Posts: 8

    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:

    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,

    #54145
    Darren
    Darren
    • Topics: 43
    • Replies: 299
    • Posts: 342

    Hi Liam,

    That’s a pretty good way of doing it. The Accumulate function is ACC() so your last line would be ACC(V3).

    Put it in a Show View tool and it will match the OBV tool, allowing you to tweak it as required.

    Note the you can use CLOSE(1) for the previous close instead of using the OFFSET function, or you could remove VAR1 altogether and use the CHANGE() function in VAR2:

    VAR2 = IF(CHANGE()> 0,1,-1);

    #54147
    Avatar
    Liam
    • Topics: 4
    • Replies: 4
    • Posts: 8

    Great, many thanks.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

Pin It on Pinterest

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close