Alert for SAR Crossover


0
0

Pete

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: 7, Answers: 6)
Asked on January 10, 2019 11:13 am
19 views
0
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: 35, Answers: 1594)
Answered on January 13, 2019 9:35 am