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
Question: From which section can I download the MQL5 manual as a chm or pdf file? The link https://www.mql5.com/files/docs/mql5_russian.chm works, but which section should I download it from? It used to be from the Documentation section, but now it is only online documentation.
Are there no links available from the Documentation section of the website(https://www.mql5.com/ru/docs)?
The transaction is active only at the moment of the transaction so nothing can be changed/zeroed. Do you mean a closing magic order? In manual trading, a magik is not assigned to the orders as well as to the trades on the basis of which the orders are placed.
The sequence is as follows:
- a pending order was placed by the Expert Advisor with a non-zero magic number
- the order was triggered and the position opened
- the position is closed manually
Question: will this closed trade have a non-zero magic number or will it be zero?The sequence is as follows:
- a pending order was placed by the Expert Advisor with a non-zero magic number
- the order was triggered and the position opened
- this position was closed manually
Question: will this closed trade have a non-zero magic number or will it be zero?Answer: Properties of trades
A deal is a reflection of the fact that a trade operation has been executed on the basis of an order containing a trade order. Each deal is described by properties that allow obtaining information about it. Toread the values of the properties, the functions of the HistoryDealGet...()type are used , which return values from the corresponding enumerations.
For the HistoryDealGetInteger() function
ENUM_DEAL_PROPERTY_INTEGER
Identifier
Description
Type
DEAL_ORDER
Order on the basis of which the trade was executed
long
DEAL_TIME
Deal execution time
datetime
DEAL_TYPE
Deal type
ENUM_DEAL_TYPE
DEAL_ENTRY
Deal direction - market entry, market exit or reversal
ENUM_DEAL_ENTRY
DEAL_MAGIC
Magic number for the deal (see ORDER_MAGIC)
long
DEAL_POSITION_ID
Identifier of the position, in the opening, modification or closing of which this deal was involved. Each position has a unique identifier, which is assigned to all deals performed on the instrument during the life time of the position.
long
This has also been tried:
The result is also a null value returned.As I understand it, before retrieving the properties of a particular transaction you need to select it using - HistoryDealSelect
HistoryDealSelect
Selects the deal in the history for further access to it through the appropriate functions. Returns true if the function completes successfully. Returns false when the function fails. To get the information about the error, you need to call the GetLastError() function.
TheHistoryDealSelect(
ulong ticket//ticket of the deal
);
Parameters
ticket
[in] Ticket
Returned value
Returns true if successful, otherwise false.
You don't quite get it right.
HistoryDealGetTicket also selects the deal.
You don't quite get it right.
HistoryDealGetTicket also selects the deal.
No, you're doing it right. It's just that when you set an order (make a trade) manually, Magic is not set (default = 0). That's what it's designed for, so that the EA can distinguish its own transactions from all other transactions. If you want to link all operations on a position, EA and manual, use POSITION_IDENTIFIER, it will be the same for all transactions.
So what you are saying is that with this sequence of operations:
the resulting deal will have a zero magic number in the history and there will be no way to get it?
So what you are saying is that with this sequence of operations:
the resulting deal will have a zero magic number in the history and there is no way to get it?
A deal's magic is determined by the order's magic as a result of the execution of which it was performed. But when manually sending a request to perform a deal (order), can you set a magik? Yes, the resulting deal will have a zero magic number in the history. It can be obtained and it will be 0 (which means that the magician is not set).
Maybe we are talking about different things? In the order you have given, there would be two trades, the first one was triggered and the second one - when the position was manually closed, its magic number would be 0.The magik of a transaction is determined by the magik of the order that caused it to be executed. And manually sending a request for a transaction (order), can you set a magik? Yes, the resulting deal will have a zero magic number in the history. It can be obtained and it will be 0 (which means that the magician is not set).
Maybe we are talking about different things? In the sequence given by you, there would be two trades, the first order triggered, the deal with a magic number set in the order and the second one - when the position was closed manually, its magic number would be 0.