You need to check the return value from OrderSend() to know if it has worked or not, if it hasn't worked why are you trying to do the OrderModify ?
For a Buy you buy at Ask, for a Sell you sell at Bid . . . . not at Close[1]
Your position size calculation will probably not work for pairs other than XXXUSD.

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
I wrote an expert advisor that does what it is intended to do on a demo account (EURUSD 1 hour chart). When I try to test it with strategy tester on the same pair and timeframe I get very strange opened positions.
Anyone interested to give some feedback/help? the mql4 is attached