9 Count Lower Indicator

tommylala

New member
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.

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

1625169167093.png
 
@tommylala You can simply create a scan that references this Study and check for either plot dwnarrw or plot uparrw is true and then creating an Alert based on the results of the scan so you will be alerted whenever a symbol is added to or, optionally removed from, the list...
 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Thank you @rad14733
I am not good with coding or creating things on TOS. I tried what you were referring to. Would you kindly let me know if this is correct?
 

Attachments

  • 1.PNG
    1.PNG
    107.7 KB · Views: 258
  • 2.PNG
    2.PNG
    111.3 KB · Views: 214
@rad14733 I've been scanning for the past weeks and I didn't get an alert when the green up arrow appeared. I don't think the alert is working.

Do you have any recommendations?
 

Attachments

  • tos.PNG
    tos.PNG
    268.5 KB · Views: 231
this is strange. I checked again but the green arrow disappeared. If the arrow was showing for yesterday, then it disappeared today when price went down. I am not sure what is happening.
 

Attachments

  • dd.PNG
    dd.PNG
    283.5 KB · Views: 211

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
351 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top