1. I highly recommend using the MQL5 Wizard:
- in this way you will get the correct file (blank).
2. Please create a new file using the MQL5 Wizard and I will show you (step by step) how to code the Expert Advisor correctly.
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
Good day, I was wondering if anyone can help me, I am developing an EA and it's almost done but I am struggling with one thing: I need a working if statment that can check that
A) the current local time is not 9AM, or 1PM or 4PM,
B) check that there is only one or less active trade on the currency,
C) that the position type is a sell or a buy
D) if a sell and the current price is equal or greater than the open price (meaning its a loss) it must close the trade
E) and if the position type is abuy and the current price is smaller or equal to the open price (also meaning a loss) it must close the trade.
Below is my code can someone please help me take a look at it and help me fix it to do the above mentioned things, many thanks in advance :)