Hull Moving Average Alert & Autotrade Almost On Thinkorswim


Hi Mr. Hahn, I viewed your excellent video, “Thinkorswim AutoTrade Almost”, with the ambition of creating a Hull Moving Average Alert and ‘Autotrade’. It does not appear the Hull Moving Average Study in Thinkorswim even allows for an alert when the moving average changes direction. Is it possible to be alerted the moment the Hull changes direction, and is it possible to place the kind of semi-autotrade orders you helpfully describe in your video with this Study metric? Incidentally, I found your answer to a prior query about the Hull Moving Average in this Q&A blog, but when I place the code you provided another user, it does not change color when moving up and down as the Study provided in Thinkorswim does. If possible, I’d prefer to use the built-in code to avoid possible errors. Thank you for any assistance.

Marked as spam
Posted by (Questions: 3, Answers: 8)
Asked on March 1, 2020 5:43 pm
Private answer

The Condition Wizard on Thinkorswim will allow you to construct this very simply with just a few clicks of the mouse. Here is the code I just generated using the condition wizard:

HullMovingAvg() from 1 bars ago is less than HullMovingAvg() from 2 bars ago and HullMovingAvg() is greater than HullMovingAvg() from 1 bars ago

This signal will match up with the very first candle where the HullMovingAvg study changes from downtrend to uptrend.

Wondering how you can learn how to use the Condition Wizard? Check the following video showing several examples:

Marked as spam
Posted by (Questions: 39, Answers: 3734)
Answered on March 1, 2020 5:56 pm
Thank you for taking the time to address my question. I'm having trouble understanding the logic of the last part of this code --"HullMovingAvg() is greater than HullMovingAvg() from 1 bars ago". Should this not be "HullMovingAvg() is less than the HullMovingAvg() from 1 bar ago?" Many thanks for any insight? HullMovingAvg() from 1 bars ago is greater than HullMovingAvg() from 2 bars ago and HullMovingAvg() is less than HullMovingAvg() from 1 bars ago
( at March 3, 2020 2:32 pm)
No, this code was generated directly from the Condition Wizard. There is no reason to question the code it produces. But since you inquired, the correct syntax is "bars" and not "bar", even if the number of bars is singular.
( at March 3, 2020 4:32 pm)
Thank you. Terribly sorry that only had time to tinker with this today 3 days after you thoughtfully posted. I'm not understanding something very basic about this problem. When I go to the Alerts section and pull up the Hull Moving Average, which I set to 14, do I set the parameters to 'true' or 'as value' or some other parameter prior to placing the Condition Wizard that you note above? Also, is this the best place to work with the code or should I being doing it under the Chart setting?
( at March 4, 2020 1:02 pm)
All you need to do is copy and paste the code from my answer. If you need to adjust the length of the Hull moving average you can do so by editing each of the two conditions.
( at March 4, 2020 1:31 pm)
I love this. I recently started trading Spy by using the Hull moving average and have had some recent success. I love your posts about it and I wanted to set up an automated alert for it. My question is what time frames is this for? I.E. I like the 10 day 30-minute chart.
( at August 29, 2021 7:42 am)
The code itself has no time frame. You set the time frame at the top of the code editor.
( at August 29, 2021 8:33 am)