How create an alert when the squeeze histofram value changes to 1


0
0

Like when the background is red in color and the value is 0. I want an alert firing when value changes to 1 and green background.

Attachments:
RESOLVED
Marked as spam
Posted by (Questions: 1, Answers: 2)
Asked on January 5, 2018 1:34 pm
1222 views
0
Private answer

Simple answer. We cannot set alerts on a watchlist in Thinkorswim.

Marked as spam
Posted by (Questions: 37, Answers: 4087)
Answered on January 5, 2018 3:12 pm
0
Private answer

Thanks or I would’ve wasted so much time doing this..

Marked as spam
Posted by (Questions: 1, Answers: 2)
Answered on January 5, 2018 4:51 pm
0
Private answer

Something occurred to me after posting my initial response. In another post we did provide code that enabled a scan to pick up the number of red dots. I know you are asking to pick up stocks with one green dot so bare with me.

We can use the code used in the custom watchlist and adapt it for a scan. The scan can then be applied to a watchlist, creating a dynamic watchlist. But you want an alert so…

You can also save the scan and use it to create a dynamic alert. This requires that you put together a couple of different techniques demonstrated in another video: Thinkorswim Overnight Scan Alert

It is towards the very end of that video where I demonstrate how to save a custom scan and use it to create a dynamic alert.

We get our base code from this video: Thinkorswim Watchlist TTM Squeeze Dots

We adapt the code provided in that video as follows:

input price = CLOSE;
input length = 20;
input nK = 1.5;
input nBB = 2.0;
input alertLine = 1.0;
def squeezeDots = TTM_Squeeze(price, length, nK, nBB, alertLine).SqueezeAlert;
def alertCount = if squeezeDots[1] == 0 and squeezeDots == 1 then 1 else if squeezeDots == 1 then alertCount[1] + 1 else 0;
plot scan = alertCount == 1;

This will scan for all stocks where there is one green dot, the first green dot after exiting the squeeze. Once you build and save the scan, it can then be used to generate your dynamic alert and dynamic watchlist.

Let me know if you need further details on putting this all together. Have fun!

Marked as spam
Posted by (Questions: 37, Answers: 4087)
Answered on January 5, 2018 9:24 pm
0
Private answer

Works like a charm. Appreciate it.

Marked as spam
Posted by (Questions: 1, Answers: 2)
Answered on January 6, 2018 9:52 am