0
votes

I wish to extract the last 3 high and lows of Zigzag.

In Metatrader4 it's possible to just call the builtin indicator to do it

zz = iCustom(symbol,PERIOD_M5,"ZigZag",ExtDepth,ExtDeviation,ExtBackstep,0,zzzz);

Any such possibility for Pinescript?

1

1 Answers

0
votes

There is no zigzag built-in in Pine, so you will need to use custom calcs and save the values as you go or use valuewhen() to fetch historical values once they have been calculated. You can search the PL for zigzag indies.