0

Tradingviews documentation didn't bring me further. I am struggling to use the ZigZag Library. I have found a even better library, I would like to apply.

How do I access the last and previous last high and low values?

This is what I tried yet:

import niquedegraaff/Absolute_ZigZag_Lib/10 as pivotLib
latestHigh = pivotLib.getLastHigh(pivotLib)
prevHigh = pivotLib.getHigh(pivotLib, 2)

latestLow = pivotLib.getLastLow(pivotLib)
prevLow = pivotLib.getLow(pivotLib, 2)

instead of pivotLib for 'this' I also tried 'close' and 'pivotLib.Pivot' etc.

Sebastian
  • 13
  • 3
  • Alternativly I could use the TV ZigZagLib but this is even less documented. There are no example. Would be really happy about some help – Sebastian Jun 29 '23 at 09:30

1 Answers1

0

if your latest high is in latestHigh,
you can access the previous high with :

prevHigh = latestHigh[1]
G.Lebret
  • 2,826
  • 2
  • 16
  • 27
  • The problem is pivotLab. Since the argument for the get_methods isn't accepted. This is the error I get with 1: "Cannot call 'pivotLib.getLastLow' with argument 'this'='1'. An argument of 'literal int' type was used but a 'Pivot[] type from niquedegraaff/Absolute_ZigZag_Lib/10' is expected." – Sebastian Jun 29 '23 at 16:58