Not-In Query


Category:
0
0

Pete: Can you please help me create a Not-in-Query to find stocks that meet my scan conditions but are not in my custom watch list? I am new to Thnkscript so do not know the commands that can find (or indicate can’t find) symbols in a watchlist.

Marked as spam
Posted by (Questions: 11, Answers: 16)
Asked on May 5, 2018 11:20 am
79 views
0
Private answer

If I understand your question correctly, there is no way to do this in Thinkorswim. The watchlist you select to run the scan against is the entire universe of stocks the scan can see. There is now way to tell the scan, “search every ticker symbol that is not in this list”.

Marked as spam
Posted by (Questions: 37, Answers: 4087)
Answered on May 5, 2018 12:21 pm
0

May be this is the answer but just in case I did not state my question clearly, lets say My scan is looking at all optionable stocks – not just those in the watch list. The custom query is : all stocks meeting two conditions, say (1) close > open. And (2) not found in cusom list “UpYesterday”. Wondering if there is a command that references this watch list to see if it were already in this list. If not, the new stocks with close>open are to be displayed in the answer.

( at May 5, 2018 4:49 pm)
0
Private answer

I appreciate you taking the time to state this in more detail. Because you never know, sometimes there is a way. In your specific case, there is not. The code in Thinkscript is completely blind to any and all watchlists. So you will need to find another way to achieve the same goal. Whatever code used to identify the stocks in the “UpYesterday” watchlist. Let’s say that code is exactly the same as condition 1. Which is close > open. That same code will need to be adapted to work within your study filter. Which could look something like this: close[1] <= open[1]. This will only work if your time frame is set to daily, and only if this represents the exact condition that puts items into the “UpYesterday” watchlist.

Marked as spam
Posted by (Questions: 37, Answers: 4087)
Answered on May 5, 2018 4:59 pm
0

Got it. So there is no way to access manually created watchlusts through reference. Pity that TOS provides interface to access custom watchlists through the scan-in field but will not give a command to do that.

( at May 5, 2018 5:25 pm)