Would someone please help me create a scanner with mobile alerts?
Someone shared the 9 Count indicator with me but is there a way to create a mobile alert when the red or green arrow appears? Thank you in advance.
Someone shared the 9 Count indicator with me but is there a way to create a mobile alert when the red or green arrow appears? Thank you in advance.
Code:
declare lower;
def SetUpCount = CompoundValue(1, if close > close[4]
then SetUpCount[1] + 1
else if close < close[4]
then 0
else SetUpCount[1], 1);
def Count = if SetUpCount == 0 or
SetUpCount == SetUPCount[1]
or setupcount > 9
then double.nan
else SetUpCount;
def SetUpCount2 = CompoundValue(1, if close < close[4]
then SetUpCount2[1] - 1
else if close > close[4]
then 0
else SetUpCount2[1], 1);
def Count2 = if SetUpCount2 == 0 or
SetUpCount2 == SetUPCount2[1]
or setupcount2 > 9
then double.nan
else SetUpCount2;
plot countline = if setupcount > 8 then 9 else if setupcount2 < -8 then -9 else if setupcount > 0 then setupcount else if setupcount2 < 0 then setupcount2 else 0;
countline.setdefaultColor(color.cyan);
plot zero = 0;
zero.setdefaultColor(color.gray);
plot nine = 9;
nine.setdefaultColor(color.gray);
plot neg_nine = -9;
neg_nine.setdefaultColor(color.gray);
plot dwnarrw = if countline[-1] crosses below 9 then 9 else double.nan;
plot uparrw = if countline[-1] crosses above -9 then -9 else double.nan;
dwnarrw.setpaintingStrategy(paintingStrategy.ARROW_DOWN);
dwnarrw.setlineWeight(3);
uparrw.setpaintingStrategy(paintingStrategy.ARROW_UP);
uparrw.setlineWeight(3);
alert(uparrw crosses above -9, "", Alert.Bar, Sound.Bell);
alert(dwnarrw crosses above 9, "", Alert.Bar, Sound.Bell);
# Alerts
Alert(uparrw, " ", Alert.Bar, Sound.Chimes);
Alert(dwnarrw, " ", Alert.Bar, Sound.Bell);
# End Code