What I am trying to do is have an alarm after the last maximum point is plotted.
The def Signal line is not correct can some one explain, Thanks.
def sma1 = SimpleMovingAvg(close, 10);
def Signal = Alert.BAR, Sound.Ring;
Alert(Signal == 1, "NewHighIsDone", Alert.BAR, Sound.Ring);
plot sma1higher = if sma1 > sma1[1] then sma1 else Signal and Double.NaN;
sma1higher.SetLineWeight (1);
================================================
I also tried to use some code from halcyonguy
that is not working for me either.
#up
alert(a, "up", alert.bar, sound.ding);
#down
alert(b, "down", alert.bar, sound.bell);
input barsback = 8;
# check if current high is higher than prev x bars
# these will be 1 or 0 , true or false
def ishigher = ( high > highest( high[1], barsback) );
def islower = ( low < lowest[1], barsback) );
then use ishigher as the trigger variable in 1 alert function, and use islower in the other alert.
The def Signal line is not correct can some one explain, Thanks.
def sma1 = SimpleMovingAvg(close, 10);
def Signal = Alert.BAR, Sound.Ring;
Alert(Signal == 1, "NewHighIsDone", Alert.BAR, Sound.Ring);
plot sma1higher = if sma1 > sma1[1] then sma1 else Signal and Double.NaN;
sma1higher.SetLineWeight (1);
================================================
I also tried to use some code from halcyonguy
that is not working for me either.
#up
alert(a, "up", alert.bar, sound.ding);
#down
alert(b, "down", alert.bar, sound.bell);
input barsback = 8;
# check if current high is higher than prev x bars
# these will be 1 or 0 , true or false
def ishigher = ( high > highest( high[1], barsback) );
def islower = ( low < lowest[1], barsback) );
then use ishigher as the trigger variable in 1 alert function, and use islower in the other alert.
Last edited: