MQL4 code help

 

Firstly, I'm fairly a novice with MQL4.  My indicator 'template' is based on EABuilder... most of what I do is swapping out conditions and customising the variables a bit, but never really writing code from scratch.

 

My issue is that when I'm adding if() conditions to a buffer, it all has to occur on the same candle for the indicator to alert.  What I want to do, for example, is:  "If MACD crosses signal line... wait until the ADX+/- also cross in the same direction... whenever it does (or if during the next x candles), then alert."

 

Is there any way to write conditions across multiple candles like this?  Any kind of template I may be able to go off of?  The MQL4 "tutorial" is helpful, but isn't much of a tutorial and I don't really have the time to learn MQL4 from the ground up.

 

EABuilder is a great start but it means I have to do 3-4 custom indicators when ideally, I should be able to code my conditions all into one.  Any ideas would be helpful.  Thanks!

 
forbidinjustice My indicator 'template' is based on EABuilder...
  • We hate EA builder
  • You couldn't be bothered to learn mql4, therefor there is no common language for us to communicate.
  • There are only two choices: learn to code it, or pay someone. We're not going to code it FOR you. We are willing to HELP you when you post your attempt (using SRC) and the nature of your problem, but we are not going to debug your hundreds lines of code.
  • EA builder makes bad code counting up while closing multiple orders.
  • EA builder makes bad code Bars is unreliable (max bars on chart) volume is unreliable (miss ticks) Always use time
  • EA builder makes bad code Not adjusting for 4/5 digit brokers
  • EA builder makes bad code not adjusting for ECN brokers.
  • EA builder makes bad code not checking return codes.
  • EATree uses objects on chart to save values - not persistent storage (files or GV+Flush.) No recovery (crash/reboot.)
Reason: