Alert in Watchlist Not Working


0
0

Hello Pete,  I’m slowly learning thinkscript etc. and have put together a script for a column in watchlists.  It’s intensive I know but it works Mostly!  🙂  It monitors 5 minutes of volume compared to avgvol.  The part that doesn’t work is the alert I put into it.  Essentially I am thinking the alert should pop up and ring for any stock the watchlist that has a sudden increase over the last 5 minutes.  Yet, the alert never happens, (it’s set in the code for vavd > 350), even though I’m watching the values on a stock break that barrier.   I would appreciate your feedback on this issue!  Below is the code.

eclare lower;
def vav = VolumeAvg(length = 200).Vol;
def vavg = VolumeAvg(length = 200).VolAvg;

plot vavd = ((vav – vavg)/vavg)*100;

def rng1 = vavd > 350;
def rng2 = vavd < 999;
def rng3 = vavd > 1000;
def rng4 = vavd < 1999;
def rng5 = vavd > 2000;
def rng6 = vavd < 2999;
def rng7 = vavd > 3000;
def rng8 = vavd < 3999;
def rng9 = vavd > 4000;

assignBackgroundColor(
if rng1 && rng2 then color.BLUE
else if rng3 && rng4 then color.VIOLET
else if rng5 && rng6 then color.ORANGE
else if rng7 && rng8 then color.GREEN
else if rng9 then color.LIGHT_GREEN
else color.DARK_GRAY);

Alert(vavd > 350, “5 Minute Volume Increase! : ” + vavd, alert.BAR, Sound.Ring);

 

Thank You In Advance!

Marked as spam
Posted by (Questions: 5, Answers: 1)
Asked on March 21, 2019 8:35 am
167 views
0
Private answer

There is no way to create any sort of alerts from code that resides in a custom column of a watchlist.

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on April 6, 2019 8:28 am