Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1429

 
Sergey Dymov HistoryDealGetInteger

HistoryDealGetInteger function to request something there..... I don't understand anything, honestly. Please, kind people, explain it humanely.

An order is an order or a request to perform an action, it has its own ticket, a transaction is an action on the received order, it has its own transaction ticket and order number (ticket) Just an order can be executed by several transactions, And there is also a position, which is generated by a transaction on the order. The position has its own ticket and stores the transaction number and order number. That's in 5k.

in 4k, a trade order and a position is a market order.

 
Rustam Ayupov #:
Hello ! I'm exploring MT5 terminal with all its amazing possibilities. And now, with time the problem of some incomprehensible limitation of the terminal in timely processing of quotations started to grow, while in demo mode. For the sake of risk diversification I trade with minimum volumes, if possible with the largest number of currency pairs. I opened ten currency pairs at six brokers and Roboforex was the first to start slowing down...then the others also started slowing down with loading of quotes. With all this machine is underloaded, I want to load it more) Processor is loaded 20-70 percent, 16 gigs of RAM more than 60% is not loaded, SSD drive, for swap there is plenty of everything, Internet 100mbit, fibre optic. Is it really the limit of MT5 terminal? Or is the problem in limited servers of brokers? Any limits for each trader separately? Enlighten me ? How to add speed of quotes loading ? THANK YOU.

I did unsynchronisation of processes in the terminal. It helped. The thing is that most 99% of programmes are not adapted to these features, as well as the terminal itself.

 
Valeriy Yastremskiy #:

An order is an order or request to perform an action, it has its own ticket, a transaction is an action on the received order, it has its own transaction ticket and order number (ticket) Just an order can be executed by several transactions, And there is also a position, which is generated by a transaction on the order. The position has its own ticket and stores the transaction number and order number. It's in 5k.

in 4k, a trade order and a position is a market order.

Okay. Thank you, kind man.

 

Hello. Can you please tell me how to find a triggered order on a ticket in MQL5 and see that it closed at take profit? In MQL4 it was so easy.

 
Mihail Nefedov take profit? In MQL4 it was so easy.

Hello Michael, I haven't tried searching in this way myself, but I suppose that using the MqlTradeTransaction structure you can request the price at which the order was closed and its take profit price and then compare them with each other.

Regards, Vladimir.

 
MrBrooklin #:

Hi Michael, I haven't tried searching this way myself, but I suppose that using the MqlTradeTransaction structure you can query the price at which the order was closed and its take profit price, and then compare them with each other.

Regards, Vladimir.

In OnTradeTransaction you can track the closing only at the moment of closing. And after that, there is no position at all. Therefore, it is a thankless task to search the history. In this case we need to rearrange the whole control algorithm.

 
Alexey Viktorov #:

In OnTradeTransaction you can only track the closing at the moment of closing. And after that, there is no position at all. Therefore, it is a thankless task to search the history. In this case, the whole control algorithm must be rearranged.

Good evening, Alexey! Do you have a better option?

Regards, Vladimir.

 
MrBrooklin #:

Good evening, Alexei! Is there a better option?

Regards, Vladimir.

It all depends on what you want. If you need to determine how a position was closed at the moment of its closing, you can't do better than control in OnTradeTransaction. If you need to determine how a certain position was closed from the history, then you need to go through the deals in the history. And we should also take into account that not every transaction of closing a position has a magik.

In general, it is a real pain in the arse... But with some experience it can be done.

 
Mihail Nefedov #:
Good evening! Does anyone know how to find a triggered order in MQL5, knowing its ticket, and view its profit? Where and what to look for, read a lesson on this topic.

First of all, understand the terminology. Understand that in mt4 an order and in mt5 are 3 different concepts. Order->Transaction->Position.

Profit in history can be viewed only for a deal. But the ticket of a deal is different from the ticket of a closed position. The only thing that unites order, deal and position is position ID.

 
Alexey Viktorov, thank you. I will look into it.
Reason: