Newbie to the forum here so I hope I am posting in the right place. There is an old indicator in the library called ZigZag Trend that is of interest to me
It is supposed to return +1 for an up trend in the zigzag indicator or -1 for a downtrend. I cannot get it to work on PRT 10.3 – it just returns zero all the time. Can anyone help me by getting it to work or write something similar that does work on 10.3. The image with the listing is a little confusing as it shows the indicator returning zero for a lot of the time where I would have thought it should be +1 or -1 all the time with no zero. I also fully understand that zigzag indicators repaint but what I am looking for is an indicator that returns a value positive or negative that indicates whether at that moment in time (close of candle) the zigzag set at say 1% is trending up or down. This value would be interesting to try out in various strategies I am considering.
This is the answer I made about your question in the library:
You need to change the ‘amnt’ variable to a percentage, so if you set it to 10 it represents a 10% needed for a new zigzag to be found, which is quite enormous for many instruments / timeframe.
So you must lower this value to a valid percentage, 3% for a daily timeframe analysis is acceptable.
To help us continually offer you the best experience on ProRealCode, we use cookies. By clicking on "Continue" you are agreeing to our use of them. You can also check our "privacy policy" page for more information.Continue