简体   繁体   中英

How are alert triggered pine script

I have little experience programming.

I have script that recognises a doji candle and changes the colour to yellow.

First can you write a script that create a alert fi=unction for a colour change?

Secondly how do you create a alert to change a colour of a candle what function is chosen from the conditions pull down menu that starts from crossing.... and ends with.... moving % down?

Could I chose for example when the candle is recognised as a doji 1.Moving up % in 1 bar OR 2. Moving up.20 in 2 bars?

to set the alert?

Cheers

You need to write your own code for that.

You probably have something like this in your code:

barcolor(cond ? color.yellow : na)

Use that condition that changes the color to yellow to trigger your alerts.

fire_alert = not cond[1] and cond  // Only trigger the alert once
alertcondition(fire_alert, "Color changed", "Color changed to yellow")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM