Questions from Beginners MQL5 MT5 MetaTrader 5 - page 224

 
Algo:

And even if it is one, shouldn't the MT give out the history for that second? I.e. doesn't it output the history within the specified boundaries, INCLUDING the boundaries themselves?

But anyway, I've tried writing both dtStartTime = TimeCurrent() - 1, and dtStartTime = TimeCurrent() - 10. Doesn't work.

It should. But as you see, problems do occur. We will wait for answers from the experts. See what they have to say.
 
I read the Alpha thread on ForexSystems. Yep. ) The question is removed. ) It's their hiccups (let's call it that, neutrally).
 
Trader Opium shared the signal of the author of Opium Trader
I am happy for this trader,
Fortuna
Increase: 988%
I will say, offended by the creator of this adviser, if anyone is interested in the adviser, write to the author, in a private message nickname Sahip, about the sale and other things no one ever sell anything, as the author's work and will be the author, about who and how trades, trades robot, I sometimes just close on the movement, and opened a couple of deals on the pair of dollar ruble!
Now, as for how and how long the trade will run, it will be a paid service while I am alive, I will use it for free one month, then the minimum...
Comment- Like 3 minutes ago - Edit- Delete
 
Good evening! I'm baffled by a problem. How can an EA pull information from the history about the last closed trade in particular closed it. TakeProfit or StopLoss. I looked in the manual, but so far I have no ideas how to implement it. Maybe I looked in the wrong place. I will thank in advance if anyone will help. Correction. The problem is with receiving a signal from the selected order about how it was closed, i.e., what function returns the message that a position was closed at Stop Loss.
 
I asked the same question 10 pages ago - look at the history of my comments. The short answer is: no way.
 
ESolo:
Good evening! I'm having a problem and I'm puzzled. How can an EA pull information from the history about the last closed trade in particular closed it. TakeProfit or StopLoss. I looked in the manual, but so far I have no ideas how to implement it. Maybe I looked in the wrong place. I will thank in advance if anyone can help. Correction. The issue is exactly with receiving a signal from the selected order about how it was closed, i.e., what function returns the message that a position was closed at Stop Loss.
This is an interesting question. I have just realized that there are no special markers that specify whether the order is related to a TakeProfit or StopLoss position. Therefore, Algo's answer is correct: Unfortunately, we cannot know.
 
When I asked the same question, someone on the forum told me that in MT5, it is better to forget about stop-loss and take-profit orders and place independent stop and limit orders instead. When one of them triggers, the second one should be withdrawn independently. Having looked into the question, I was convinced that he was absolutely right. It is not the safest solution (given the possibility of a disconnection with the server), but there is no other. It's the only way to identify any order and any transaction in the history, as they can be assigned a magik. And for trades made at stop loss or take profit, the magic is always zero.
 
Algo:
When I asked the same question, someone on the forum told me that in MT5, it is better to forget about stop-loss and take-profit orders and place independent stop and limit orders instead. When one of them triggers, the second one should be withdrawn independently. Having looked into the question, I was convinced that he was absolutely right. It is not the safest solution (given the possibility of a disconnection with the server), but there is no other. It's the only way to identify any order and any transaction in the history, as they can be assigned a magik. And the trades made at stop-loss or take-profit always have zero magic.
I did that)) and I did not write an empty theoretical statement, but my own, albeit so far small, accumulated experience.
 
I didn't argue with that. ) I only added that this method has disadvantages, which I also know about not from theory, and voiced them. ) And there is no other way.
 
ESolo:
Good evening! I'm having a problem and I'm puzzled. How can an EA pull information from the history about the last closed trade in particular closed it. TakeProfit or StopLoss. I looked in the manual, but so far I have no ideas how to implement it. I have not looked in the right place. I will thank in advance who will help. Correction The problem is with receiving a signal from the selected order on how it closed, i.e. what function and what function returns it, saying that the position was closed at Stop Loss.
Doesn't the broker write in the comments? Then we can use our own comments specifying sl/tp. Will it work?
Reason: