FINterpreter
Pine Script Rookie
Pine Script Rookie
Posts: 6
Joined: January 12th, 2022
Contact: TradingView Profile

Re: Identifying Higher Lows/Lower Highs

Wow. That is precisely what I was looking for.
I cannot thank you enough!
I'm still working through my course and not comfy with VAR yet, so I'm going to try my best to reverse-engineer that for a short signal as well.
I'm fairly confident I can do it! If I run into any issues I'll send you what I have so far, and if you have some time I would greatly appreciate your assistance.

Again, thank you. I cannot wait until I'm able to lend people a hand with Pine.
Cheers!

processingclouds
Pine Script Master
Pine Script Master
Posts: 115
Joined: January 30th, 2022

Re: Identifying Higher Lows/Lower Highs

Hey,

Great it solved your issue.

VAR , think of it as a storage that will not change on each bar unless specifically told to so.

e.g. So first value is defined as using
var x = 100

x will stay 100 on each bar

we can further add something like :
if (close > ta.ema(close,10))
x := x + 1

This will add 1 to x, whenever close price is above ema thus adding count of number of bars above ema to 100.


If you have any issues, or want to think of implementing an idea to script, just send a message. I will try to help as much as i can.

Return to “Pine Script Q&A”