keithd0120:
Mt5 only maintains a single trade position for each symbol and further trades just alter the size of the position I am attempting to write a few different EAs but cannot figure out how to 'fix' one problem I am having. I've been able to modify my ideas slightly to accommodate what MQL5 is ultimately doing, but I would like to still test using my original thoughts...
Your broker can over ride this if they offer a hedging account but most don’t
Paul Anscombe #:
Mt5 only maintains a single trade position for each symbol and further trades just alter the size of the position
Mt5 only maintains a single trade position for each symbol and further trades just alter the size of the position
Your broker can over ride this if they offer a hedging account but most don’t
Thank you for the information. So let's then assume I obtain a hedge account (or for testing purposes, open a hedged demo account in MT5), are there any configuration changes code-wise that will need to take place, or will the code above work as described in the article?

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 am attempting to write a few different EAs but cannot figure out how to 'fix' one problem I am having. I've been able to modify my ideas slightly to accommodate what MQL5 is ultimately doing, but I would like to still test using my original thoughts...
After going through a handful of logic in the EA, if it makes it through the if/else statements, I have it hitting a buyNOW() function that houses the MQLTradeRequest and OrderSend() operators/functions. What is happening is each time the EA is sending the request it is, for lack of better words, 'adding' or modifying the previous position to include the new position of a particular volume and updating the take profits and stop loss entirely. For example, if the EA had previously bought 1 lot EURUSD at 1.08 with TP/SL at 1.11/1.07, then a second at 1.10 with TP/SL 1.13/1.09, there would not be two separate positions of 1 lot with those TP/SL, but instead one position of 2 lots, TP/SL 1.13/1.09, essentially taking an update from the second request. This may be by design, however I would like to see how to code it to be reminiscent of how the One-Click trading looks when manually trading, i.e. individual positions for each 'click' trade with their own take profits and stop losses. I've tinkered a little bit with CTrade but ended up having a little better luck with MQLTradeRequest... Any ideas?
Below is what I am working with now: