Alert for SAR Crossover



Could your help me with an audible alert for the SAR Crossover for the bearish/bullish….

#wizard input: crossingType
#wizard text: Inputs: acceleration factor:
#wizard input: accelerationFactor
#wizard text: acceleration limit:
#wizard input: accelerationLimit

input accelerationFactor = 0.02;
input accelerationLimit = 0.2;
input crossingType = {default Bearish, Bullish};

def sar = ParabolicSAR(accelerationFactor=accelerationFactor, accelerationLimit=accelerationLimit);

plot signal = crosses(sar, close, CrossingType == CrossingType.Bearish);

signal.DefineColor(“Bullish”, GetColor(5));
signal.DefineColor(“Bearish”, GetColor(6));
signal.AssignValueColor(if crossingType == CrossingType.Bullish then signal.color(“Bullish”) else signal.color(“Bearish”));

signal.SetPaintingStrategy(if crossingType == CrossingType.bullish
then PaintingStrategy.BOOLEAN_ARROW_UP
else PaintingStrategy.BOOLEAN_ARROW_DOWN);


Marked as spam
Posted by (Questions: 29, Answers: 22)
Asked on January 10, 2019 11:13 am
Private answer

Add this line to the bottom of the code you provided with your question:

Alert(signal, "SAR Crossing", Alert.BAR, Sound.RING);

Marked as spam
Posted by (Questions: 36, Answers: 2022)
Answered on January 13, 2019 9:35 am