Questions from Beginners MQL5 MT5 MetaTrader 5 - page 477
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
The script for MT4 will not work on Five, it has very different trading functions.
The script for MT4 will not work on Five, it has very different trading functions.
Could you please tell me something? How can I know programmatically, not logically, how a market order was closed - by TP, SL or by market?
Compare the closing price with TP, SL. If they almost match - the answer is there. If they don't coincide, then the answer is also there.
That's what I asked, how not by comparison? In the terminal the orders are tinted, it means they have a flag about how they were closed.
It's not quite clear to me how to arrange "almost" - slippage can be too much to compare.
That's what I asked, how not by comparison? In the terminal the orders are tinted, so they have a flag about how they were closed.
It's not quite clear to me how to organise "almost" - slippage can be too much for comparison.
Could you please tell me something? How can I know programmatically, not logically, how a market order was closed - by TP, SL or by market?
In the commentary of a closed on stoploss, attributed to [sl], closed on takeprofit, attributed to [tp].
Are you awake?
With "almost" is solved individually in each case in its own way. This is one thing in a slow market and another thing in a fast one.
Yeah, that's why I'm looking for a universal solution - if the information is needed on the next bar after the order has been closed, then it is not so difficult to evaluate the volatility, but if it is after a day, then I have to count the number of bars that have passed and the volatility that was there.
In the comment of a closed by stoploss we attribute [sl], of a closed by takeprofit we attribute [tp].
Thanks - I will try to read it now!
And there is no such comment in the tester, right?