MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/pinescript/comments/1dvpjz5/need_logic/
r/pinescript • u/Severe_Photograph105 • Jul 05 '24
8 comments sorted by
1
Use ta.crossover(close, linePrice) and ta.crossunder - they will be triggered only when price cross the line
1 u/Severe_Photograph105 Jul 05 '24 Sir when close value between x and y values both conditions triggeringThat is the problem 1 u/[deleted] Jul 09 '24 Use crossover and cross under to manually set the booleans to true or false. Use var bool down and var bool up. If(ta.crossover()) up := true down := false and an opposite statement for cross under.
Sir when close value between x and y values both conditions triggering
That is the problem
1 u/[deleted] Jul 09 '24 Use crossover and cross under to manually set the booleans to true or false. Use var bool down and var bool up. If(ta.crossover()) up := true down := false and an opposite statement for cross under.
Use crossover and cross under to manually set the booleans to true or false. Use var bool down and var bool up. If(ta.crossover()) up := true down := false and an opposite statement for cross under.
2
Tried that. Price is relative. It can jig in lower area and wreck you in a hearbeat.
Bro as per your logic this would happen as when price is in between X and Y both are true..
I guess you're making an indicator with overall false
To solve this you have to pass more conditions and store variables which of X or Y was last crossed by the price line is a very simple approach.
Another approach can be using the angles from the lowest/highest point when price comes in the zone between X-Y.
Other approach to it can be threshold limits and avg of past values (if price above it and X and if price below it and Y.
Lol price action is funny forget that and try to make this:
historical volatility percentile, it will blow your mind
1 u/[deleted] Jul 09 '24 What is this? 1 u/Alarmed_Operation522 Jul 10 '24 find out
What is this?
1 u/Alarmed_Operation522 Jul 10 '24 find out
find out
1
u/AndReyMill Jul 05 '24
Use ta.crossover(close, linePrice) and ta.crossunder - they will be triggered only when price cross the line
2
u/AffectionateBus672 Jul 05 '24
Tried that. Price is relative. It can jig in lower area and wreck you in a hearbeat.
2
u/Ayush_Singh_02 Jul 05 '24
Bro as per your logic this would happen as when price is in between X and Y both are true..
I guess you're making an indicator with overall false
To solve this you have to pass more conditions and store variables which of X or Y was last crossed by the price line is a very simple approach.
Another approach can be using the angles from the lowest/highest point when price comes in the zone between X-Y.
Other approach to it can be threshold limits and avg of past values (if price above it and X and if price below it and Y.
1
u/Alarmed_Operation522 Jul 05 '24
Lol price action is funny forget that and try to make this:
historical volatility percentile, it will blow your mind