How to add audible alert/notification to TTM Scalper Alert


0
0

A viewer asks:

I use TTM_ScalperAlert as my trigger point to get in an out of a trade. Is it possible to add sound to this alert? If so, can you show me what I need to do?

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Asked on April 22, 2017 9:50 am
3935 views
1
Private answer

#TTM Scalper Audible Alert by Sergiouz Trader
#Keep CandleOpen and CandleClose Hidden, these are purposed to provide audible alert only to the TTM_Scalper_Alert by John Carter.

input minSwing = 0.0;

def HighPivot = TTM_ScalperAlert(minSwing).PivotHigh;
def LowPivot = TTM_ScalperAlert(minSwing).PivotLow;

plot CandleOpen = open;
plot CandleClose = close;

CandleOpen.SetDefaultColor(Color.UPTICK);
CandleOpen.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
CandleOpen.HideBubble();
CandleOpen.HideTitle();
CandleOpen.Hide();
CandleClose.SetDefaultColor(Color.DOWNTICK);
CandleClose.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
CandleClose.HideBubble();
CandleClose.HideTitle();
CandleClose.Hide();

def Alert1 = CandleOpen and HighPivot [2] == yes;
Alert(Alert1, "Trending Down", Alert.Bar, Sound.Ding);
def Alert2 = CandleClose and LowPivot [2] == yes;
Alert(Alert2, "Trending Up", Alert.Bar, Sound.Ding);

Marked as spam
Posted by (Questions: 0, Answers: 5)
Answered on January 27, 2021 1:16 am
0
Private answer

I have a two part answer to make sure I cover this subject for future visitors to this FAQ.

The first part is that I have tested and found it is not possible to get this indicator to trigger an audible alert on a chart. The reason it does not work is likely the result of how it was written. (details in the second part of my answer below). Of course I don’t have access to the source code so I cannot confirm. But the fact you can’t get this thing to trigger an audible alert leads me to believe it was constructed in a way that makes the alerts fail to function.

I can tell you from experience you are not likely to get the results you seek. The scalper alert is programmed to look 2-3 bars forward, only changing the color of the bar once the signal is confirmed 2-3 bars later. So you can never check if the scalper alert triggered in the previous bar. Now, perhaps you can check if scalper alert triggered 4 bars back. But by then the price has moved and you loose the advantage of an early entry you are seeking. The Scalper alert looks like it gives perfect signals that make lots of profit. But because of the 2-3 bar delay in confirming the signal, it can never be traded on a live chart.

A few more details:

This also means you can not use this indicator in a Study Alert. How about a Scan? I haven’t tried that yet. If you are interested in the answer, post a question and I’ll investigate.

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on April 22, 2017 9:58 am
0
Hello guys, picking up where you guys left off. I’m in the process of testing this indicator for 30 minutes to 2 hours trades as part of a combination of technical analysis and indicators. During this process I want to have audibled alerts so that I don’t have to be staring at the screen all the time. During my research I came across this post and was a kind of let down for not being able to use auditable alerts. But thanks to my very low level programming skills and many thanks to you Pete I was able to add audible alerts. I saw the post and watched the video about the TTM Trend Alerts and that increased a little my knowledge on thinkscript, by watching you using reference to the original TTM Trend indicator to create the TTM Trend Alert, I thought mimicking that code, I could be able to create the audible alert for the TTM Scalper Alert. CONTINUED BELOW
( at November 23, 2020 2:38 pm)
0
That being said after couple of ours of trial and error, I was about to give up, but then it came to my mind that all that I needed was to match ”==” the up and down arrows with additional code to trigger the alerts. Then it’s when it came to my mind to plot up and down arrows to every single bar on the chart but keep these hidden(was able to code show arrows just for the same day but I figured I might be switching to daily, weekly or monthly time frames for reference and the indicator won’t work, I also kind of wanted to plot for the past two bars only but I do not know how, this would of been how I wanted the final form of the code). After that the rest is history, I mean the rest is code, and was able to successfully get the audible alerts, below is the code. Just as the TTM Trend Alert, this indicator needs to go along with the TTM Scalper Alert to visualize the arrows as this custom indicator only provides sounds not plots. (Not sure why the forum won’t let me space out the code, remember each line of code ends with ”;” the semicolon )
( at November 23, 2020 2:38 pm)
0
#TTM Scalper Audible Alert by Sergiouz Trader #Keep CandleOpen and CandleClose Hidden, these are purposed to provide audible alert only to the TTM_Scalper_Alert by John Carter. input minSwing = 0.0; def HighPivot = TTM_ScalperAlert(minSwing).PivotHigh; def LowPivot = TTM_ScalperAlert(minSwing).PivotLow; plot CandleOpen = open; plot CandleClose = close; CandleOpen.SetDefaultColor(Color.UPTICK); CandleOpen.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP); CandleOpen.HideBubble(); CandleOpen.HideTitle(); CandleOpen.Hide(); CandleClose.SetDefaultColor(Color.DOWNTICK); CandleClose.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN); CandleClose.HideBubble(); CandleClose.HideTitle(); CandleClose.Hide(); def Alert1 = CandleOpen and HighPivot [2] == yes; Alert(Alert1, ”Trending Down”, Alert.Bar, Sound.Ding); def Alert2 = CandleClose and LowPivot [2] == yes; Alert(Alert2, ”Trending Up”, Alert.Bar, Sound.Ding);
( at November 23, 2020 2:39 pm)
0
Hi Sergio, Thank you very much for persevering through to the solution. I have marked this post as "Unresolved" so that you can post this as your solution in the box below. Posting your code as a solution will allow you to properly format your code and it will show up as the best solution for this question. I checked your solution on the chart and it seems the issues I had previously identified as limitations are no longer present. The signals are consistently displayed 2 bars back from the current bar. In my previous testing that was not the case (it could be anywhere from 1-4 bars back). Clearly they have made a change which makes this possible now.
( at November 24, 2020 9:55 am)
0
Thanks for the reply Pete, I thought I had replied back. I have reposted the code as the solution.
( at January 27, 2021 1:18 am)

About Pete Hahn

For those trying to contact me about our professional services you will find all those details here: https://www.hahn-tech.com/about/ Any questions not related to our professional services or premium indicators should be directed to the comment section of the applicable video or you may post a question in our Q&A Forum: https://www.hahn-tech.com/thinkorswim-forum-topics/