High of Day/Low of Day ALERT

AlleyCat

New member
VIP
In TOS there is a High of Day/Low of Day Bubble activation option. Thus if you choose to activate that option, when Price hits a High of Day, a Bubble appears that says High of Day. Same occurs when Price hits a Low of Day.

What is not available is an option to also be alerted when Price hits High or Low of Day. Is there a code available that can accomplish this, OR is there something I'm missing within TOS that can accomplish this. Thanks.
 
Last edited by a moderator:
In TOS there is a High of Day/Low of Day Bubble activation option. Thus if you choose to activate that option, when Price hits a High of Day, a Bubble appears that says High of Day. Same occurs when Price hits a Low of Day.

What is not available is an option to also be alerted when Price hits High or Low of Day. Is there a code available that can accomplish this, OR is there something I'm missing within TOS that can accomplish this. Thanks.

this will find when a new high of day happens, or a new low of day.
a tiny arrow is drawn and an alert beep goes off.
can turn on test lines to verify data.

set up for normal trading hours , 9:30 to 4

Code:
#higherlowerofday
#https://usethinkscript.com/threads/high-of-day-low-of-day-alert.18510/
#High of Day/Low of Day ALERT

def na = double.nan;
def bn = barnumber();

input start = 0930;
input end = 1600;
def firstbar = (secondsfromTime(start) == 0);
def daytime = if secondsfromTime(start) >= 0 and secondstillTime(end) > 0 then 1 else 0;

def hi = if bn == 1 then 0
 else if !daytime then 0
 else if firstbar then high
 else if daytime then max(high, hi[1])
 else hi[1];

def lo = if bn == 1 then 0
 else if !daytime then 0
 else if firstbar then low
 else if daytime then min(low, lo[1])
 else lo[1];

def hihi = if firstbar then 0
else if daytime and hi != hi[1] then 1
else 0;

def lolo = if firstbar then 0
else if daytime and lo != lo[1] then 1
else 0;

alert(hihi, "higher high" ,alert.BAR, sound.DING);
alert(lolo, "lower low" ,alert.BAR, sound.bell);

plot zhihi = hihi;
zhihi.SetPaintingStrategy(PaintingStrategy.BOOLEAN_WEDGE_up);
zhihi.SetDefaultColor(Color.cyan);
zhihi.setlineweight(2);
zhihi.hidebubble();

plot zlolo = lolo;
zlolo.SetPaintingStrategy(PaintingStrategy.BOOLEAN_WEDGE_DOWN);
zlolo.SetDefaultColor(Color.yellow);
zlolo.setlineweight(2);
zlolo.hidebubble();

#---------------------

input test_lines = no;
plot zhi = if test_lines and hi > 0 then hi else na;
plot zlo = if test_lines and lo > 0 then lo else na;

addverticalline(test_lines and hihi, "-", color.green);
addverticalline(test_lines and lolo, "-", color.red);
#addverticalline(test_lines and firstbar,"-", color.cyan);
#
 

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

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
534 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