Macd cross line below 0
-
Hello,
I'm coding a strategy that consists in buy when the MACD lines are below the 0 and they cross up (main&signal). After the cross they can go above the 0 but what matters is that, at the time of crossing up, they are below the 0.Right now on my fxdreema, as soon as the lines of the macd go above the 0 line, the EA stops looking for the trade and that's not what I want.
The EA should stop looking for the trade only when the macd lines crosses down again. Doesnt matter if it is above the 0 line or not.How can I put this in my fxdreema in order to the EA still look for a trade even if the macd is now above the 0 line?
I'll attach an image for better understanding
Any help would be much appreciated!!
Thank you very much!!

-
@renatojjs You are requiring both crossing conditions to be true at the exact same time and that will always never happen. The fast MACD line will almost always cross up BEFORE the slow line. You should select a different combination of conditions to be checked that are more likely to happen on the chart.
-
@l-andorrà thank you for the fast response!
Maybe I'm not explaining in the best way, I'll send an image bellow for better understanding.

Thank you very much for the help
-
@renatojjs Then you wil need a variable (a boolean one for example) identifying the exact moment in which the correct crossing happens. While the variable is 'true', you can seacrh for other conditions to be met. Once an opposte crossing happens the variable is moved to 'false' again.
-
@l-andorrà thank you for the help!
After searching in the forum I found one topic with an answer of yours that talked about using the boolean variables and i've been trying to implement it but it seem's I cannot make it work
I'm also trying to make an EA of another strategy using stochastic but the main concept is the same as this one (KD lines of the stoch crossed up and are above the 20 line and after this I need to fulfill other conditions before enter a trade, so i think I need more than 1 variable) and I can't figure out how to do this.
I made another topic for this strategy with a clear explanation of what I would like to do (https://fxdreema.com/forum/topic/11945/after-a-condition-is-true-wait-for-another-condition-and-only-then-enter-a-position)If you can explain how to proper use these boolean variables and how to make them work I would be very grateful
Once again thank you very much for all the help
-
@renatojjs Can you please specify which project is the one you are interested in?
-
@l-andorrà sorry I'm mixing topics, my mistake!
So if you can help me on the other one wich I think it's a little more complex I'd appreciate it
I'll send the link bellow with all the explanations of my doubts:Thank you once again for the support!!
-
@renatojjs Ok. So please do not conitnue this thread. We'll move to that one.