init and deinit return an int, so you must use
return(0);
Assign values to your variables in start not globally or their values will not change.
Check whether an order is already open before opening a new order. You may get a new order opening every tick.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi Guys
So I have a strategy that I have been using in Mexcel, but I want to be able to backtest it on Metatrader. Only problem is that I have no prior experience in MQL4. The idea of my strategy is to use the 15min, 30min, and 1 hr timeframes (i will write the strategy and laymans terms but I have also attached how far I have gotten in writing my EA. Let me know if I'm on the right track or not).
Must be true for 15 min, 30 min, and 1hr timeframes: if 8 Period EMA > 16 Period EMA, if ADX > 20 and ADX < 40, if RSI > 50
If all these criteria are met, a BUY signal is entered when the price intersects with the 8EMA on the 15 min chart.
For a sell signal everything is the opposite except for the ADX conditions, which stay the same.
Also, I know it's possible but I don't know how I would be able to use this ea to scan these criteria for all possible currency pairs, and not just look at one pair. If any of you know how that would be awesome.