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