
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 refer to the article: https://www.mql5.com/en/articles/2299 (from 2016):
New trading constants
Due to the addition of the new Close By operation type, the new trading properties have appeared as well:
My goal (without any specific trading strategy in my mind, but just to see and check what might work) is to place a pending order that partially closes another pending order (after it will have become an open position of course) or to close an open position with a pending order.
SL and TP of a position always close the whole position. It is possible to (partially) close an open position partially with another open position, see Trade.mqh.
Now I would like to have placed pending orders that (partially) close the open position and that I could push up and down depending on the market development - as I said, an academic scenario.
Attached is a test EA tuned on the period D'2022.10.05 00:00' to D'2022.10.06 00:00' and EURUSD so that the StopLimit order does not fail on prices.
There is a nice profit, but I know the price trend - honi soit qui mal y pense ;)
Here is the debugger journal 'designed' in N++:
My question: is it possible to use pending orders as kind of SL & TP (how? I failed what ever I tried) to close positions partially?
Or are the 'new' options from 2016 just for queries to the trade history?
PS: Unfortunately MQ makes no difference in their English documentation: order can mean a pending order or any order send to the server :(