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
Hello Everyone,
Please I am still learning to code EA with MQL5 language however I wrote a code that involved selection of closed orders. There was no error when I run it but during implementation the EA failed to open buy order while opening of sell order was okay.
The position select for sell is meant to open new sell orders when trade continues to trend downwards and open first buy when it trends upwards. Afterwards subsequent buy will be opened by buy select as trade continues to trend upwards.
In a nutshell, apart from first sell order which serves as reference point for price, the EA is meant to always open buy order when price goes up by take profit (TP) value and open sell when it reverses by same value. In each case, if there is any open order due to close according to set TP value, EA must wait for its closing before opening new order along trend direction.
The code is pasted below, kindly assist and thanks in advance for your assistance: