Login Page - Create Account

Support Board


Date/Time: Wed, 12 Feb 2025 16:11:42 +0000



[Programming Help] - ID2.SG3 MACD

View Count: 499

[2020-11-03 20:37:12]
Tonkadad - Posts: 235
I have the MACD study and created a condition to place an arrow if a MA of the MACD diff crosses zero, which the below code does.

=AND(CROSSFROMBELOW(ID3.SG1, ID2.SG4) <> 0)

ID3.SG1 = MA of the MACD diff

ID2.SG4 = the zero line of MACD

So far so good, but what I want is to get the signal sooner, before it crosses the zero line, I couldn't find any examples
of the proper way to structure it.

What I want is =AND(CROSSFROMBELOW(ID3.SG1, ID2.SG3, -.5) <> 0)

I changed the 2nd half to reference the MACD bar data (SG2.ID3), but don't know how to specify it to use the (.-5) as the new line in the sand so to speak.
[2020-11-03 21:40:43]
Ackin - Posts: 1865
Try:
=OR(AND(ID3.SG1[-1] < -0.5,ID3.SG1 > -0.5),AND(ID3.SG1[-1] > 0.5,ID3.SG1 < 0.5))

but CROSSFROMBELOW/CROSSFROMABOVE you will find out later ....and the situation may not happen at all

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

Login

Login Page - Create Account