Page 1 of 1

need to convert code from version 2 to version 5

Posted: Sat Dec 09, 2023 9:46 pm
by funasoft
This is the code:

zigzag() =>
_isUp = close >= open
_isDown = close <= open
_direction = _isUp[1] and _isDown ? -1 : _isDown[1] and _isUp ? 1 : nz(_direction[1])
_zigzag = _isUp[1] and _isDown and _direction[1] != -1 ? ta.highest(2) : _isDown[1] and _isUp and _direction[1] != 1 ? ta.lowest(2) : na

I get this error : Undeclared identifier '_direction'


thanks !