Getting alerts on watch list based on study


Hi Hahn, first of all I would like to thank you as I’m learning alot through this page. I had a question about getting alerts on watch list based on study. I am using a study which triggers an up tick during long buy and I want to be alerted on mobile everytime this happens. Thanks

Marked as spam
Posted by (Questions: 2, Answers: 19)
Asked on February 22, 2018 5:44 am
Private answer

Watchlists are not able to generate alerts or notification. However you can build a custom scan and save it. Then from that saved custom scan you can create a dynamic alert. The scan can be set to run against a watchlist of your choosing.

This requires that you learn to work with custom scans. We have an entire category of scan videos and if you are not familiar with scans I encourage you to watch a few of them. If you don’t know how to create a dynamic alert from a saved custom scan you can see that in action towards the end of this video:


Marked as spam
Posted by (Questions: 37, Answers: 3786)
Answered on February 22, 2018 9:27 am
Thanks Hahn. I tried your suggestion by setting up the custom scan with study against watchlist but it didn’t trigger any alerts. I created a watch list with all the tickers and created the scan with below custom study. Could you please suggest what could be wrong here? I am expecting it to trigger notifications every time the condition is met for all tickers. Also note that I already have the correct setup for notifications. Script: input opentime = 0930; input closetime = 1600; input EMA_F = 10; input EMA_S = 20; def AP = GetAggregationPeriod(); def daily = if AP >= AggregationPeriod.DAY then 1 else 0; def isopen = if daily then 1 else if SecondsFromTime(opentime) >= 0 and SecondsTillTime(closetime) >= 0 then 1 else 0; def crossover = if ExpAverage(close, EMA_S)[1] > ExpAverage(close, EMA_F)[1] and ExpAverage(close, EMA_S) def trigger = if isopen and crossover then 1 else 0; def orderprice = close; plot UpSignal = trigger; UpSignal.SetDefaultColor(Color.UPTICK); UpSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
( at February 23, 2018 7:22 pm)

Did you watch the video I linked in my previous response? Because I don’t see you mention the additional steps required to create a dynamic alert from the saved custom scan. I only see you mention the creation of the scan itself.

To save you time, I will let you know that the instructions for creating a dynamic alert from a saved custom scan begins at the 29:50 mark of the video.

( at February 23, 2018 8:01 pm)

Yes, I have created a dynamic alert and is active.

( at February 24, 2018 6:40 am)
Private answer

Attaching screen shot for your reference

Marked as spam
Posted by (Questions: 2, Answers: 19)
Answered on February 23, 2018 7:32 pm
Private answer

Don’t forget to check you notification settings. If you don’t have things setup in this screen nothing will work. Screenshot below for details.

Marked as spam
Posted by (Questions: 37, Answers: 3786)
Answered on February 24, 2018 8:48 am
Yes, I’ve all of these checked but still didn’t receive any alerts.
( at February 24, 2018 9:10 am)

Do you have both the “Send email to:” and “Send text to:” fields filled out and confirmed? Are you able to receive notifications from price based alerts and study alerts? We are getting down the final straws here.

( at February 24, 2018 9:33 am)
Yes, I’ve checked all of them and yes I am getting price based alerts too. Study alerts, this is the only study I am trying to use and it’s not working. I want to mention another thing that I tried is that I created another custom scan against live nasdaq scanner and same thing happened, it triggered few alerts on it though but not on the most active stocks that I could choose to trade from. So to sum up, two behaviors – 1. No triggers for scan against watch list. 2. Few triggers for scan against live nasdaq scanner but not on most active stocks (or I should say best stocks) which was also there on the list.
( at February 24, 2018 9:59 am)

Well I can’t test this on my side while markets are closed. But I did create and save a scan based on your code. Then created a dynamic alert from that. I set it to 5 min time frame. I’ll let you know if I get accurate list of notifications on Monday. I’m going to run this one against all Optionable stocks.

( at February 24, 2018 12:31 pm)

Sure thank you. I’ve it set for 1 min time frame.

( at February 24, 2018 12:47 pm)
I request you if possible please run it on 1 min time frame as I see very few upticks for 5 min frame so you can match the exact same scenario what I’m having
( at February 24, 2018 12:55 pm)

My list of stocks is quite large so I am not worried about getting signals on a 5 min time frame. More to the point, I am using the 5 min time frame because I am well aware of the limitations of Thinkorswim’s data processing. 1 min time frame is great for charts. But there are 2-4 min delays in processing Watchlists and scans. Minimum 2-4 min delays. High volume market conditions can cause those delays to slip considerably. So whenever you are testing to find out where the problem is, always try higher time frames to see if that fixes them. just part of the troubleshooting process.

( at February 24, 2018 1:17 pm)
Got it. What you just said makes me think that the problem could be because of this delay and 1 min time frame. I’m also going to try with 5 min time frame on Monday and update it here. Thanks Pete.
( at February 24, 2018 1:34 pm)

I received the following list of ticker symbols from the alert I set up over the weekend. The time stamp on these are 1:00 pm ET using the 5 min time frame (extended hours set to NO): HLT, MSCC, RYAM, NVO, EDU, UL, Z, BUFF, ERJ, BWA

( at February 26, 2018 11:26 am)

Thanks Pete for confirming. Even I got few alerts when I set it for 5 min time frame. But still I didn’t get the alerts for more active stocks which was also on the list. Can you think of why it’s happening? Example like for today I had AKER, TAHO, TTPH, MNKD, ACHN also on the list, but I didn’t get even single alert for these. But if I look at the charts, I can see up ticks for all of these.

( at February 26, 2018 2:59 pm)

Next thing you should check is the start and end times. I know that Thinkorswim tells us that scans are always based on Eastern Time frame, regardless what our chart are set to or what time zone we are in. However I noticed that I did not get any signals until 11am local. Which is 1pm ET. Which is well beyond the start time of 9:30. Play around with that start and end time. in fact, take it out altogether to start with. Then if it solves all the problems, add it back in and adjust until you figure out what time zone they have that thing set to.

( at February 26, 2018 3:58 pm)

Thanks Pete for your suggestion. I’m trying to remove the start and end time but the code is not working. Could you suggest how the code should be modified?

( at February 26, 2018 7:57 pm)

You only need to change this line of code from:
def isopen = if daily then 1 else if SecondsFromTime(opentime) >= 0 and SecondsTillTime(closetime) >= 0 then 1 else 0;

To this:
def isopen = yes;

( at February 27, 2018 7:49 am)

Thanks Pete, I have made the change. Also because of delay of alert and scan, I thought of adding code to read last 2 or 3 candle sticks to look for up signal for which I added this code, but didn’t seem to work.

plot UpSignal = trigger;

def alerttrigger = if UpSignal or UpSignal[1] or UpSignal[2] then 1 else 0;

So this should look for Uptick in the current candle and last 2 candles and alert if it exists on either of them. Do you think its correct or need change?

( at February 27, 2018 6:03 pm)

Yes that should do the trick. I employ a different technique. First thing I will mention is that you do not need an if statement on your last line of code. You can simply use:
def alerttrigger = UpSignal or UpSignal[1] or UpSignal[2];

Ok? Because that right there is a true/false statement. It evaluates to 1 or 0 entirely on it’s own.
The technique I use is a bit more scalable.
def alerttrigger = Highest(UpSignal, 3) > 0;

This evaluates to true if UpSignal has been true in any of the last three bars, including the current bar on the chart. Want to search the last ten bars? change the 3 to a 10.

( at February 27, 2018 6:10 pm)

Thanks Pete, thats a great suggestion. I will apply this and update here tomorrow how it works.

( at February 27, 2018 7:00 pm)

Hi Pete, tried all the suggestions but didn’t work as expected. What else can be done?

( at February 28, 2018 3:35 pm)

Define “work as expected”. What was expected and what was the result?

( at February 28, 2018 4:05 pm)

I expected it to alert on all stocks on watchlist whenever there is an uptick but it didn’t do the same. It did alert though for few but not for most active stocks. What am I missing here?

( at February 28, 2018 6:03 pm)

I will need the list of stocks that were included in the alerts. A separate list of stocks that were excluded from the list. The list of stocks that were excluded should be confirmed to have valid signals occurring within the time span covered by the scan. You will provide the time span covered by your scan.

You will also make sure your charts are set to “Start Aggregation Period At Market Open = NO”

If in doubt, provide additional information to make sure I have all the variables that could possibly affect the results.

( at February 28, 2018 7:01 pm)

Sure, I will capture all of this tomorrow and provide you the list for both. Time span will be anywhere between 0930 to 1600 only, but will give you the exact time when the alert should have triggered.

Could you tell me how to set “Start Aggregation Period At Market Open = NO”

( at February 28, 2018 8:20 pm)

I just posted a screenshot for that setting. For your scan. Do not use a start and end time. Use the code without any time setting whatsoever. We are trying to reduce things to the simplest terms. Use an intraday time frame with Extended trading hours off. Keep it as simple and basic as possible. This is only a moving average crossover. Millions of these are working correctly every day.

( at February 28, 2018 8:44 pm)
So here are the results: I didn’t get any alerts till 1010 EST and then I got many alerts throughout the day but none of them were useful and not the most active ones. I got alerts for tickers like TRVN, BICX, TOO, UEC, TTS and so on, but none of them were good enough to trade. All of these ticker alerts I got from my scan against NASDAQ scanner. I had most active and top tickers on my NASDAQ scanner like HLIT(Uptick at 0954), TNDM(Uptick at 1518), BPMX(Uptick at 1139) and so on but didn’t get alerts for any of these. I had tickers on my watchlist like NEPT(Uptick at 0948 EST), MNGA(Uptick at 1033 EST), TENX(Uptick at Alerts at 0957 EST, 1435 EST, 1451 EST), SWN(Uptick at 1130 EST, 1330 EST, 1439 EST,1515 EST, 1551 EST) but didn’t get single alert for any of these. I am not sure whats wrong. I feel I might need to add few more filters to the script or to the scanner so it doesn’t alert for useless tickers but not sure what it is.
( at March 1, 2018 6:19 pm)

You were using a 1 min time frame?

( at March 1, 2018 8:04 pm)

No, I used both 3 and 5 min time frames. I like 3 min more as it works well with the study.

( at March 1, 2018 8:22 pm)

Ok, sorry but I cannot help you. I asked you to set the scan to 5 min time frame. You seem to lack some basic troubleshooting skills. That’s all you lack. You seem to have a good grasp of everything else. But you don’t seem to understand how to break things down into their most basic elements so that each individual piece can be tested and verified.

This thread has continued on long enough. I am closing the thread. There is nothing here that is benefiting our other visitors of the site.

I suspect that what you are actually seeking is some way to improve the quality of the signals. Even though you are talking about “missing signals”.

I wish you the best of luck. Hope you find some answers.

( at March 2, 2018 9:06 am)

Hi Pete, I am still using the 5 min time frame. I never mentioned that I am “only” using 3 min time frame but what I said is it produces more accurate signals. I have two different scan setups for both time frames, its never a bad idea to troubleshoot with different inputs. I am still trying to troubleshoot and would expect to see if you can help me out.

( at March 3, 2018 8:52 am)

This is all the more help I can provide. I built a scan and saved it. This link will allow you to load the scan onto your system. I tested it and everything works fine. If this does not work for you the issues are not in the code. I would really have no idea where else to look, having already covered every square inch of this issue in my previous response. Here is the link to the scan:

Note this scan has the start time and end time disabled. Good luck to you.

( at March 3, 2018 10:48 am)
Private answer

Hi Peter, I have a question about your Vol Profile study. Is it possible to have a watchlist column that displays green or red when a buy/sell alert fires with a look back of a few candles? I have this feature currently with some other studies that when a change occurs the watchlist indicates it with color or number. Then I can focus on only charts with signals. Thank you

Marked as spam
Posted by (Questions: 0, Answers: 2)
Answered on February 25, 2018 8:12 am

Two things. First, your question is completely outside the scope of this post. We don’t want to confuse others who visit this post and run across a new question that has nothing to do with the context of the original poster. Second, we do not provide solutions to premium indicators in the free Q&A forum. You may post your question directly to me by filling out the contact form at the bottom of this webpage:
If it is possible, a modification fee would apply. In addition to the full purchase price of the indicator.

( at February 25, 2018 8:29 am)
Private answer

For any scans you run for intraday time frames, make sure you adjust this setting. Turn off “Start Aggregation at Market Open”. Screenshot attached.

Marked as spam
Posted by (Questions: 37, Answers: 3786)
Answered on February 28, 2018 8:42 pm

Thanks. I have updated the same in my chart settings

( at February 28, 2018 9:47 pm)
Hi I know this is an older thread, but wondering if anyone knows how to stop/remove an alert created with a scan/watchlist. I created a scan alert using the "Alert when scan results change" and I can't figure out how to STOP it now; when I access that same menu there is no option to stop or remove the scan alert, only change it, and all the while new alerts are being created/triggered.
( at December 15, 2021 6:36 pm)
MarketWatch tab, select the "Alerts" section of that tab. All active alerts are listed in the bottom section of that view. Cancel any alerts you need to from there.
( at December 15, 2021 6:46 pm)