Add audio alerts to stochastic indicator?

A

aman

New member
Thank you for helping in advance, this probably is get answered but I can't seem to find it.
I like to add an audio alert on this one.
Thanks!

Code:
input direction = {default "Long", "Short"};
input tradeSize = 100;
input KPeriod = 10;
input DPeriod = 10;
input priceH = high;
input priceL = low;
input priceC = close;
input averageType = AverageType.SIMPLE;
def SlowD = reference StochasticFull(80, 20, KPeriod, DPeriod, priceH, priceL, priceC, 3, averageType).FullD;
def pivotLow = low > low[1] and low[1] < low[2] and low[2] < low[3];
def pivotHigh = high < high[1] and high[1] > high[2];
plot pivotLowReversal = ( pivotLow and close > high[1] ) or ( pivotLow[1] and close > high[2] and low > low[2] and high[1] < high[2] );
plot exitLong = SlowD < SlowD[1] and SlowD[1] < SlowD[2] and Highest(pivotLowReversal[0], 2) == 0;
def entry;
def exit;
switch (direction) {
case "Long":
    entry = pivotLowReversal;
    exit = exitLong;
case "Short":
    entry = no;
    exit = no;
}
;
 
Last edited by a moderator:

Similar threads

Top