ZigZag HiLo

Remove from Favorite Scripts Add to Favorite Scripts


Pine Script 4 complains line 36: zigzag = na with this error: "Value with NA type cannot be assigned to a variable that was defined without type keyword".
Figured out to modify it to this:

36| float zigzag = na

to get it passed.
+4 Reply
does this repaint?
+1 Reply
Hi @sherwind
Firstly, thank you so much for your great work, because based on your script I've made my own indicator.
Is it possible to change something in your script do draw current trend line? I've tried to use bartstate.isrealtime but it doesn't work like I want.
Did you intend to reproduce or emulate the built in zigzag indicator?
Nice initiative but your script does not work when I compare both on the same chart, and peak/trough are odd
Hi this is great, However when I ran the code there was an error compiling "Script could not be translated from: |B|trend := na(trend", I shall be please if you kindly tell me how this could be solved please
sherwind asikoge
Hi @asikoge, it sounds like a copy-pasting issue. Try adding the script to favorites as described at Hope that helps.
Home Stock Screener Forex Screener Crypto Screener Economic Calendar How It Works Chart Features Pricing Refer a friend House Rules Help Center Website & Broker Solutions Widgets Charting Solutions Lightweight Charting Library Blog & News Twitter
Profile Profile Settings Account and Billing Referred friends Coins My Support Tickets Help Center Ideas Published Followers Following Private Messages Chat Sign Out