up vs down volume ratio

Forums ProRealTime English forum ProBuilder support up vs down volume ratio

  • This topic has 4 replies, 4 voices, and was last updated 1 year ago by avatarAlfy.
Viewing 5 posts - 1 through 5 (of 5 total)
  • #205952

    Good afternoon guys, I’m trying to build a ratio of up vs down volume over the last 50 trading days. So I’m looking to calculate the ratio of volume on days when the stock closed higher on the day vs the volume on days when the stock closed lower. I’ve attempted to create the code but I don’t think I’ve done it correctly. Can someone take a look please? Any help much appreciated

     

     

     

    #205953

    What are you expecting to see that you are not seeing … presumably not attached (see at red arrowhead)?

     

    1 user thanked author for this post.
    #205955

    Add these two lines at the very beginning, as a variable which hasn’t been modified will retain the previous value so that it always happens that both variables have some value, be it the current one or a prior one:

    1 user thanked author for this post.
    #205956
    JS

    Hi @Alfy

    Try this…

     

    #205958

    Thanks Roberto, your advice fixed the problem and the numbers make much more sense now.

    Best regards

    1 user thanked author for this post.
Viewing 5 posts - 1 through 5 (of 5 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login