bneta1980
Pine Script Rookie
Pine Script Rookie
Posts: 1
Joined: October 7th, 2021

alertcondition

Hi,

I would like to define 2 alert condition which will trigger one after the other in the exact order.

I defined:
alertcondition(condition1 == 1)
alertcondition(condition2==2)

and added matching alerts:
alert(2)
alert(1)

however they are triggering in the wrong order
2
1

is there a way to add priority to alertcondition in order to force it triggering first alert1 and then alert2?
if not, how can I force 1 to be trigger before 2?

thanks

Deep-Wave
Pine Script Master
Pine Script Master
Posts: 44
Joined: September 4th, 2020
Contact: TradingView Profile

Re: alertcondition

Hi there,
as far as I know and understand it, the logic behind the alerts is that they trigger once the coded condition for the alerts becomes true.
If I want a specific alert to trigger first, I would focus on the underlying condition that has to become true first and change the code accordingly ...
I hope this makes sense to you. Maybe with some more information on what it is you are trying to do I could offer more help

Best of luck with your coding :cool:

Return to “Pine Script Q&A”