Login Page - Create Account

Support Board


Date/Time: Sat, 27 Apr 2024 04:45:07 +0000



Alert for moving average condition

View Count: 426

[2021-10-16 15:44:43]
DKtrades - Posts: 33
Hello, I currently have an alert that changes the background color of a region on my chart (region 3; MACD) based on a condition:

Ie it is shown as a green color if the MACD line is both above the signal line and above the zero line:

=AND(ID6.SG1 > 0, ID6.SG1 > ID6.SG2)

(ID6 is my MACD indicator; SG1 is the MACD line and SG2 is the Signal line.)

This works fine and as expected.

I am trying to refine the alert so that the background color is only displayed when the 8EMA is above the 34EMA on my main price chart (region 1).

So it has three parts:

MACD above zero; MACD above signal line; 8EMA above 34EMA.

I tried to add this at the end to get the following:

=AND(ID6.SG1 > 0, ID6.SG1 > ID6.SG2, ID1:SG1 > ID2:SG1)

(ID1 is my 8EMA line and ID2 is my 34EMA line; SG1 for both is the avg.

But this does not work -- I lose my backgrounds altogether.

I don't need an alert just when there is a crossover; but instead want to see it only when the 8EMA is above the 34EMA on that particular candle.

I've looked through the board, and Googled, and studied Study/Chart Alerts And Scanning -- but I can't seem to get this formula right.

Any help is very much appreciated.
[2021-10-17 03:23:45]
Sawtooth - Posts: 3976
You have a syntax error using : after the ID#.
Try this instead:
=AND(ID6.SG1 > 0, ID6.SG1 > ID6.SG2, ID1.SG1 > ID2.SG1)
[2021-10-17 15:59:44]
DKtrades - Posts: 33
Ah yes, I see now -- thank you! Very much appreciated.

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

Login

Login Page - Create Account