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
[...] Why does MT4 & MT5 introduce OrderCloseReason() or something?
Don't know... But it's solvable, so it's not a big deal.
Yeah... where can I keep an update of SL & TP then, OrderComment()?
Lots of new goodies in MT5, btw, more kudos than complaints all in all.
Yeah... where can I keep an update of SL & TP then, OrderComment()?
Na, I wouldn't recommend it (IMHO). See my previous remark about server's overwriting comments (https://www.mql5.com/en/forum/123668/page2#267154). Since I wrote that post I have found cases were more than 6 characters are overwritten by the server (for example -> https://www.mql5.com/en/forum/124167), so I wouldn't trust it altogether.
If it's virtual TP/SL, then just keep their values in an array. But you would have to built persistence capabilities into the EA, otherwise these values will be lost in case of total failure (Terminal restart, power out, etc.).
Na, I wouldn't recommend it (IMHO). See my previous remark about server's overwriting comments (https://www.mql5.com/en/forum/123668/page2#267154). Since I wrote that post I have found cases were more than 6 characters are overwritten by the server (for example -> https://www.mql5.com/en/forum/124167), so I wouldn't trust it altogether.
If it's virtual TP/SL, then just keep their values in an array. But you would have to built persistence capabilities into the EA, otherwise these values will be lost in case of total failure (Terminal restart, power out, etc.).
"...If it's virtual TP/SL..." we're still on the subject of checking whether an order is closed by an SL/TP/Other right? If it's a virtual then we would know the closing price and how it was close.
Have you solved the persistence layer capabilities Gordon? Thanks.
"...If it's virtual TP/SL..." we're still on the subject of checking whether an order is closed by an SL/TP/Other right? If it's a virtual then we would know the closing price and how it was close.
Exactly. The question only arises when there's server-side TP/SL and additionally the EA might or might not close orders manually under certain circumstances....
Have you solved the persistence layer capabilities Gordon?
Thanks,
https://forum.mql4.com/25078. - offers much great insights but one thing I can take from it is that MT4 (maybe -5 too, to date), is not accommodating many aspects of 'Automated Trading'.
Right now what I'm trying to achieve is the 'Virtually Automated Trading' with as little 'apprehension' as possible. I simply cannot do (yet) that many precautionary workarounds, that even veterans like fbj need to hack. If the developers are ready to make it really accountable for traders to trade Automated then, by all means I will unleash an EA on live account unattended for x months/years.
Hmmm.... Maybe I'm missing something, but are there any cases where the following won't be enough?
// I assume here that an equality of sl_diff and tp_diff is impossible...?
In fact there are 3 scenarios in the closed orders,
1. The price hit the TakeProfit value. (TP)
2. The price hit the StopLoss value. (SL)
3. After some time, the trader closed the order manually without hit TP/SL.
My question is: How to know the 3 different closed reasons for my historical orders? Thanks.
Can I get the order closed reason from the colors?
Because I found
1. if the order is closed by SL, the stoploss value color is red,
2. If the order is closed by TP, the takeprofit value color is green.
3. If the order is closed manually, the values colors are not changed.
Thanks.