
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,
I m new to mql5 and also for programming. I have a little problem I can't solve alone.
I have written a little EA for buying or selling if a signal is occurred.
For example: I wan't to buy once the price is obove EMA 20 and than the next trade should only be opened at the opposite direction when the price is below the EMA 20 and so on.
Short: by if the price is above EMA20 than stop until the price falls below the EMA20 and sell, and so on.
Is this only doable with a while or for loop or is there a simple function or an other way to solve this? I don't have find a sulotion in the manual.
Thanks for any help.
edit
One thing more to say, the trade should run until the stop loss or take profit is hitten.