Audible alerts on TTM Scalper


0
0

Hi Mr. Hahn,

On the post “How to add audible alert/notification to TTM Scalper Alert”, I tried to create an alert by copy/pasting the solution posted by Sergio, but I am getting an exception.

com.devexperts.tos.thinkscript.runtime.TooComplexException: The complexity of the expression suggests that it may not be reliable with real-time data.

Specifically, it is happening here:

plot CandleOpen = open;
plot CandleClose = close;

Can you please recheck the solution, and let me know if I am making a mistake.  To me, Sergio’s code looks syntactically correct.

Thank you.

Marked as spam
Posted by (Questions: 1, Answers: 0)
Asked on July 8, 2022 8:38 am
142 views
0
Private answer

First, and most important detail, anytime you reference an online resource of any kind it's best to provide a direct link to that resource. So here is a link to the post you referenced in your question:

https://www.hahn-tech.com/ans/how-to-add-audible-alertnotification-to-ttm-scalper-alert/

Anyone else coming across this post will be able to get the full context of that solution by viewing that previous post I linked above.

Second, and just as important detail, is to realize the solution provided in that post is for a chart study. And as a chart study is works just fine. The error message you reported in your question tells me that you attempted to use this code in either a Study Filter on the MarketWatch-Alerts tab of Thinkorsiwm. Or you tried to apply this code to a Study Filter of a custom scan. Neither of these tools are able to support the code for the TTM_ScalperAlert chart study.

So the error message you received is telling you that it simply will not work. If you search this forum for the error message "TooComplexException" you will find this issue has already been addressed in this forum. Here is just one example:

https://www.hahn-tech.com/ans/thinkorswim-error-toocomplexexception/

There is no solution in most cases. And for the TTM_ScalperAlert, there is no solution at all. Completely impossible to do this on the current version of Thinkorswim.

How can we be sure? By cutting the code down to only those elements which are required to trigger the alert, as follows:

input minSwing = 0.0;
def HighPivot = TTM_ScalperAlert(minSwing).PivotHigh;
def LowPivot = TTM_ScalperAlert(minSwing).PivotLow;
def Alert1 = HighPivot[2] == yes;
def Alert2 = LowPivot[2] == yes;
plot scan = Alert1;
#plot scan = Alert2;

IF you wanted to convert the code from the solution you referenced, this is the only form that would be acceptable. I have removed all of the elements which were required to make this work as a chart study. However you will find that after we have removed everything else, the error message is still present. Which tells us with 100% certainty that it is the TTM_ScalperAlert itself which is triggering the error message and NOT any of the other components of the chart study.

Perhaps at some point in the future the Study Alert and/or the custom scans will be upgraded to support the TTM_ScalperAlert. But for now it's completely impossible.

Marked as spam
Posted by (Questions: 37, Answers: 4084)
Answered on July 8, 2022 2:58 pm