MACD Signal

3 replies

A4X

Subscriber, bbp_participant, community, 4 replies.

Visit profile

6 years ago #112983

Hi All.. I have just purchased EA wizard and new to this forum. I am looking to convert my current trading strategy to a more automated system. I have been live trading Forex for a couple of years.

 

I have a question about using the MACD indicator in an EA.. the question being how to make a true / false or crossover type signal for the MACD when it changes direction.

 

My strategy include the use of the MACD and I need to basically check whether it is going down (below zero line) and then moving up or is going up (above zero line) and then turning down.

 

Hopefully the attached image will assist.

 

Thanks in advance for the assistance

 

 

File: MACD.jpgMACD.jpg

0

Mark Fric

Administrator, sq-ultimate, 3 replies.

Visit profile

6 years ago #128025

Hello,

 

if I understand correctly you want to check when the value of indicator is breaking from going odw to going up, right?

 

You can use Shift parameter for that, the simplest version of your condition would be:

 

IF

MACD(…)[3] > MACD(…)[2]   <– this means the value of MACD 3 candles ago is higher than its value 2 candles ago, so it goes down

and

MACD(…)[2] < MACD(…)[1]  <– this means the value of MACD 1 candle ago is higher than its value 2 candles ago, so it goes up now

THEN

.. do something

 

Every indicaotr and price has a Shift parameter that you can use to get the value of this indicaotr X bars ago. Shift=0 means actual candle, Shift=1 means previous candle, and so on.

Mark
StrategyQuant architect

0

A4X

Subscriber, bbp_participant, community, 4 replies.

Visit profile

6 years ago #129116

Hello Mark,

 

It has been a while since you kindly posted a reply to my questions but I have been working on some other projects. I am now back reviewing my trading strategy.

 

I do understand the response you posted in that I can check the value of the current bar (in MACD) relative to a chosen previous bar value. However in the MACD indicator there are 2 values, please see the image I previously attached to this post. How would I set up Strategy Quant to show when the histogram value is lower or higher than the signal line i.e a cross-over has occurred. I believe I understand the principle of setting up Strategy Quant but for the MACD I’m not sure how to isolate the 2 printed values to check when they cross-over.

 
Many thanks in Advance

0

Mark Fric

Administrator, sq-ultimate, 3 replies.

Visit profile

6 years ago #129263

yes, MACD has two output values – Signal is the line and Main is the histogram value.

 

You can easily use this in EA Wizard, when you select MACD indicator you can choose which output value to use in its parameters.

So you can create a condition that compares histogram and line on the same candle, for example:

 

MACD(…, Signal)[1] > MACD(…, Main)[1]

Mark
StrategyQuant architect

0

Viewing 4 posts - 1 through 4 (of 4 total)