Login Page - Create Account

Support Board


Date/Time: Fri, 21 Feb 2025 18:29:15 +0000



[User Discussion] - Setting alert type based on condition

View Count: 460

[2021-01-19 18:20:58]
User811394 - Posts: 1
Hello,
I'm trying to write my first alert in SC but I'm having some trouble. Wondering if anyone here can provide some assistance?
The basic pseudo code is below, using some of the syntax that SC uses:

If((ID1.SG1[0] - ID1.SG[-1] <= 200) AND (ID2.SG1 > ID3.SG1)
THEN SoundAlert1

OR

If((ID1.SG1[0] - ID1.SG[-1] >= 200) AND (ID3.SG1 > ID2.SG1)
THEN SoundAlert2


I am not clear on whether it is even possible to use different types of alerts with one condition formula and also the proper format/syntax. I've tried going through this link already:
Study/Chart Alerts And Scanning: Alert Formula Examples
[2021-01-23 13:05:27]
Sawtooth - Posts: 4174
Only one alert sound is available per alert formula. To get a separate sound for each condition, put each formula in the Alerts tab of any two studies.

Use this syntax:

Alert1:
=AND(ID1.SG1 - ID1.SG1[-1] <= 200, ID2.SG1 > ID3.SG1)

Alert2:
=AND(ID1.SG1 - ID1.SG1[-1] >= 200, ID3.SG1 > ID2.SG1)

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

Login

Login Page - Create Account