MACD High/low or MACD crosses 0
-
Hello guys,
I'd like to create EA where pending order will be opened based on MACD histogram highest or lowest or where MACD crosses 0.So, for example as screenshot below, open pending order where the last MACD highest (from lets say the last 100 candlesticks). OR another possibility is to open pending order where the last MACD crosses 0.
Any helpful hints/tips highly appreciated! Thank you


-
@andrewfrank The second condition searching dor 0 crossing is easy. You can do this:

Finding the 'highest/lowest' is more difficult. How is a high or low defined? Is it a local high, daily high or something else? Depending on that definition dfferent results can be obtained.
-
@l-andorrà Thanks for the response.
For the crossing 0, I was actually looking where the EA can look up the past candles and set the pending order where MACD crosses 0 from the last (lets say) 100 candlesticks.
So basically as in the example above, the EA will always look the last 100 candlestick to find MACD crosses 0 to set the pending order.

The same situation with MACD highest and lowest.
Lets say find where MACD highest from the last 100 candlesticks. and set the pending order..Hopefully I explained more clearly this time.
Thanks!Btw, I have seen some Q&A regarding this. but not sure I understood correctly.
such as: http://fxdreema.com/forum/topic/11074/how-can-i-found-cci-overbought-oversold-dynamic-high-low-value-by-candle-price-or-candle-id/16And here's my project, if you could have some time to look: https://fxdreema.com/shared/nbNyERE5e
-
@andrewfrank Then you will need a loop searching for that info in the past. But what's the point of searching for a crossing 100 candles away? What if there are more in between?
-
@l-andorrà Thanks again.
the 100 candles are just the range. It should find the most current or the last one where it crosses the 0 level (or the highest).
For example above, within 100 candles, set the pending order where the MACD crosses below 0 level, which is shown in magenta arrow.Could you give me example or redirect me how to use the loop as you mentioned?
Thanks!
-
@andrewfrank In HERE, is how to count the candles from macd going above or below.
-
@jstap Thanks a lot!
Follow up question: If I want to find the last high from the certain range, lets say last 100 candle stick, should I adjust your setting to this one belowYour setting:

to this one:

Thanks!!
-
@andrewfrank This will put the highest price from range into a variable, can't use the same variable that is on the loop, every time the loop starts it will cause confliction with the variable value.
-
@jstap
Ok. Thanks!
Sorry, but I have to ask more questions:- Should I put different variables to find the MACD range as below?

- And then I need your setting with different variable that is supposed or able or to find the MACD above?

Here I set my project if you could look it up: https://fxdreema.com/shared/imdtPQcHc
-
@andrewfrank If you use that loop and put the variable in the end candle of market properties, you will get the candle value from that range. Normally use a different variable with a different calculation, otherwise conflicts will happen.
-
@jstap ah ok. Did you mean like this?

-
@andrewfrank I mean put the loop variable into the end candle ID cell, by using the candle id you are limiting result to 1 candle, if the candle low is the highest macd then it will work but very restrictive.
-
@jstap
hmm.. If I put the loop variable into end candle ID as below screenshot,- how it can identify the range (I was referring to the last 100 candles for examples)?
- Does it need another variable (see question mark in the screenshot)?

Thanks for the help!
-
@andrewfrank You would need another variable, this will give you the highest value since the cross.
-
@jstap ah ok. Sorry I am still trying to figure it out.
So basically if the loop will look the highest macd since the macd cross above 0, then
I have to change from this:

To this?

-
@andrewfrank The loop will give you the current candle count (range) macd is <> 0, checking for a value with market properties will give you the ID/value of a condition in this range.