how to count zigzag moves

Forums ProRealTime English forum ProBuilder support how to count zigzag moves

Viewing 5 posts - 1 through 5 (of 5 total)
  • #215033

    Hi

    I would like to count the quantity of zigzag moves of an index/security of a chart

    ex: zigzag moves of 5% of the SPX index

    I have tried a few things but what I get is kind strange,  is it possible? The last attempt was this one but it gives an error message (the following variable is undefined: count )

    thank you

    a= ZigZagPoint[10](close)
    b=count[a]
    c=cumsum (b)
    return c

    #215034

    Firstly, COUNT is not defined anywhere thus can’t be used.

    Secondly, ZIGZAG returns a value each bar, it doesn’t count swing points, so counting it will return a huge number.

    Thirdly, you can count swing points with this code, but it’s useless as it’s a repainting, so it may change any swing point several bars after they have already been counted as you will easily spot on a 1-second TF (see my attached pic):

     

     

    #215036
    JS

    (Sorry same time as Roberto)

    Hi,

    You can try this one…

    I think the calculation of the ZigZag is incorrect, for example if I set a 5% change (from bottom to top or vice versa) then the number of change (points) is incorrect…??

    #215045

    Thank you  it works,  just return totalcount

     

     

     

    #215058

    Two is better than one 🙂

     

     

    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