Login Page - Create Account

Support Board


Date/Time: Thu, 02 May 2024 15:57:58 +0000



[Programming Help] - Audio Alert When Price Close to EMA

View Count: 975

[2020-07-25 10:48:12]
User854129 - Posts: 3
Hi. I use a 5 minute chart with an 8 EMA for the NQ & ES. I need an audio alert when the NQ price is 10 points or less from the EMA, and when the ES price is 4 points or less from the EMA. Would this require a professional programmer, or are their instructions for me to do this my self? Thanks very much.
[2020-07-25 16:03:52]
cmet - Posts: 537
This is easy to do using the study called Color Bar Based on Alert Condition.

I'm assuming you are looking for an audio alert when price is approaching from above or below and your EMA is ID:1.

You could use formulas for the alert that might look like these (or combine them using the OR statement). These use the close although you could use high or low depending on preference:

Approaching From Below: AND(C >= ID:1.SG1 - 40*ticksize, C[-1] < ID:1.SG1[-1] - 40*ticksize)
Approaching From Above: AND(C <= ID:1.SG1 + 40*ticksize, C[-1] > ID:1.SG1[-1] + 40*ticksize)

For 4 points you just change the 40 to a 16 for ticksize.
Date Time Of Last Edit: 2020-07-26 02:47:16
[2020-07-25 18:36:25]
Geni Rose Hendin - Posts: 4
Thanks so much! Follow up question. I want to know as soon as price is only 10 (NQ) or 4 (ES) from the EMA. I don't want to wait for the bar close or H/L. I just need to need when the price is there at any time during the 5 min bar. How would I adjust the formula for that? Once again, my biggest thanks!
Date Time Of Last Edit: 2020-07-25 18:36:54
[2020-07-25 18:54:39]
cmet - Posts: 537
If you want it to alert every single time it is 10 or 4 ticks away you can simply use this:

C = ID:1.SG1 + 40*ticksize
C = ID:1.SG1 - 40*ticksize

or

C = ID:1.SG1 + 16*ticksize
C = ID:1.SG1 - 16*ticksize

Then on the Alerts tab you want to uncheck everything but "Enabled".

C is the same as Last Price so it should go off everytime that level is touched.

If you wanted a visual reference on the chart itself you can add an 8 period Moving Average Envelope, set it to Fixed Value and use 2.5 (10 ticks) and 1 (4 ticks) in the Fixed Value setting.

You have the option then of creating the alerts based on the upper and lower bands.
Date Time Of Last Edit: 2020-07-26 02:44:36
[2020-07-25 19:07:04]
Geni Rose Hendin - Posts: 4
Thanks so much. I can't wait to try it!
[2020-07-26 02:46:37]
cmet - Posts: 537
You're welcome. Saw you asked for points, not ticks. Updated those formulas to reflect that.

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account