Need to create an audible alert for new 10-minute HIGH/LOW...

TheGrimmReaper

TheGrimmReaper

New member
I'm new to Thinkscript and would like to create a simple audible alert each time a given symbol makes a new 10-minute high (compared to the previous 10-minute period) and a new 10-minute low (again, compared to the previous 10-minute period). No pop-up required, just an audible alert to notify me when a new 10-minute high or low is reached on a symbol compared to the previous 10-minute time period. Thanks!
 
C

Chadnash

New member
VIP
Hi! I’ve been working on something similar to add to watchlist column... was creating it as part of a strategy... when I get just this part handled I will post the code.
 
TheGrimmReaper

TheGrimmReaper

New member
Hi! I’ve been working on something similar to add to watchlist column... was creating it as part of a strategy... when I get just this part handled I will post the code.
Thank you so much, whatever you come up with is greatly appreciated!
 
C

Chadnash

New member
VIP
Hey there... I played around a bit with this today. Its so funny how you want the indicators during trading day, but then no time to really test or work on them during those hours haha :)

There are actually a few other quick examples I found around related to this (a few from @Len20), and none of them I know of directly would cause a audible alert but I will do some testing. I know you can create alerts easily when a watchlist changes

This is for 15 minutes although honestly I think for the watchlist you have to actually set the aggregation period up at the top... So if you chose 5 minutes, and set the value of bars to 2 it would be 10 minutes price change. Also, this is currently dollar amount price difference and its actually that many bars 'past' so if you were looking at this towards the end of a 5 minute bar it could almost be 20 minutes. This could always be tweaked to get current high or low of that bar and not close... and you can uncomment out the lines above it if you want the percent value and not the dollar amount.

I will tweak the code a bit so that even if it can't be audible alert, it could display a specific color if maybe the value was in a range above or below a certain amount. I think this is a start to what you're looking for though, feel free to comment and let me know your thoughts.

https://tos.mx/LTEmLSP

Code:
def agg = AggregationPeriod.FIVE_MIN;

input barsAgo = 3;

def price = close;
def oldPrice = close[barsAgo];

#plot change = Round(100 * ((price / oldPrice) - 1), 1);
#change.AssignValueColor( if change < 0 then Color.RED else Color.GREEN);

plot gap = (price -oldPrice);
gap.assignValueColor(if gap > 0 then color.green else if gap < 0 then color.red else color.black);

Thanks!

Chad
nashtech.xyz
 
Last edited by a moderator:

Similar threads

Top