Features of the mql5 language, subtleties and tricks - page 292

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
Sometimes you need to look at all the properties of a symbol, chart, position, order, historical trade/order, etc.
There are a ton of property values that can be added, removed, etc.
Basically, you can succinctly get the values of these properties through such a preset.
Application.
This is how we get all the values of a symbol.
This way - transactions.
In general, the principle should be clear.
Result.
This is how it will be with the symbol.
If, suddenly, MQ decide to give access to commissions in the trading platform (this year 18 years since the beginning of development), the script will show it at once....
// All properties of the deal into a string. string DealToString( const long Ticket )
With and without HistoryDealSelect( Ticket ) different results, I checked.
With and without HistoryDealSelect( Ticket ) different results, checked.
Placing a transaction in the available history table and printing transaction properties are functionalities that do not overlap.
Running the script without HistoryDealSelect()
I add HistoryDealSelect() and run the script
The worst thing you can do in the function of printing a deal is to put HistoryDealSelect into it.
The worst thing you can do in a transaction printout function is to put a HistoryDealSelect in it.
What do you suggest?
To be satisfied with zeros in the printout?
The script prints zeros in this form
If HistoryDealSelect is uncommented, it prints all fields correctly.
Forum on trading, automated trading systems and testing trading strategies
Features of mql5 language, subtleties and techniques of work
Aleksandr Slavskii, 2025.02.13 13:18
The script prints zeros in this form
If HistoryDealSelect is uncommented, it prints all fields correctly.
Has such a script been published? Try to fix DealToString, we'll discuss it. It is not clear to me at all what we are talking about.
Has such a script been published? Try fixing DealToString, we'll discuss it. I don't understand at all what we are talking about.
Okay. Never posted.
Someone else did.
Well, we're not suckers, we know how to use analogies. But here's the catch, the analogy doesn't work. Not good.
And seriously, I don't understand how to use your code to print all the fields of a transaction.
Let's take an example of a specific task. Let's say we have saved a ticket of a deal in the Expert Advisor and after some time we need to print out everything related to this deal.
HistoryDealSelect is the right way to do it, and you say that it is a mauvais thing to do. How would it not be mauvais?how would that not be considered voguish?
Like in the script above.
At most, you can insert it into a function, but I wouldn't recommend it.
Sometimes you need to look at all the properties of a symbol, chart, position, order, historical trade/order, etc.
There are a ton of property values that can be added, removed, etc.
Here is my attempt using these 2 little macros:
Getting a ton of information from the platform:
Terminal info:
Chart info:
Symbol info:
Positions and deals:
Orders:
Print enumerations:
Test script:
Forum on trading, automated trading systems and testing trading strategies
Peculiarities of mql5 language, subtleties and techniques of work
amrali, 2025.02.14 05:37
Have done exactly what I warned about.
Forum on trading, automated trading systems and testing trading strategies
Peculiarities of mql5 language, subtleties and techniques of work
fxsaber, 2025.02.13 13:08
The worst thing you can do in the function of printing a deal is to put HistoryDealSelect in it.
Even that is not done.
Forum on trading, automated trading systems and testing trading strategies
Features of the mql5 language, subtleties and techniques of work
fxsaber, 2025.02.13 14:35
The maximum you can put in a function, but I wouldn't recommend doing that.
Example of viciousness.
Architecture.
Forum on trading, automated trading systems and testing trading strategies
Peculiarities of mql5 language, subtleties and techniques of work
fxsaber, 2025.02.13 10:23 AM
Putting a trade into the available history table and printing out the properties of a trade are functionalities that do not overlap.