MetaTrader 5 Python User Group - how to use Python in Metatrader - page 69

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
@Almaz
The first time the copy_xxx_xxx functions are run, when the terminal has not started for some time,
functions immediately return the available result with missing history, without waiting for history swap synchronization.
It means that the first function call returns the result with missing history.
Only subsequent calls will return the correct result, when the history is swapped.
Is it possible to fix this issue? And functions copy_xxx_xxx wait for history to be swapped on the first call.
copy_ticks or copy_rates? What is the build of the terminal?
@Almaz
The first time the copy_xxx_xxx functions are run, when the terminal has not started for some time,
functions immediately return the available result with missing history, without waiting for history swap synchronization.
It means that the first function call returns the result with missing history.
Only subsequent calls will return the correct result, when the history is swapped.
Is it possible to fix this issue? And the copy_xxx_xxx functions will wait for history to be swapped on the first call.
Read Organizing Data Access, it has nothing to do with the Python library. This is standard behavior, you need to handle such situations and re-request the history after the terminal swap it.
This is a one time thing, so it is not critical. You can always keep the existing history up to date if you work with the terminal from a script all the time.
copy_ticks or copy_rates? Which build of the terminal?
Used copy_rates, but I think copy_ticks will be the same, but haven't checked.
Build 2470
Read Organize Data Access, it has nothing to do with the Python library. This is standard behaviour, you need to handle such situations and re-request the history after the terminal bounces it.
This is a one time thing, so it is not critical. You can always keep the existing history up to date if you work with the terminal from the script all the time.
I have read this section, it is related to Mql5.
And in general it's strange that you allow the Copy function to receive incorrect data, without waiting for the history to be swapped out and giving the result.Or are you implying that you need to organizeCheckLoadHistory in the same way?
Why not to introduce this function as standard? For Mql and Py library.
I read this section, it refers to Mql5.
And in general it's strange that you allow incorrect data in Copy function, without waiting for history swap and giving the result.Or are you implying that you need to organiseCheckLoadHistory in the same way?
Why not introduce this function as standard? For Mql and Py library.
If you work in MQL5, the questions inOrganizing Access to Data section are not so special. We have studied this section far and wide. And we use it.
Why do you think it should be different for Python?
After all, the main core is MQL5 and you have to know it. And only after that you need to apply Python.
I read this section, it refers to Mql5.
And in general it's strange that you allow incorrect data in Copy function and do not wait for the history to be loaded and return the result.Or are you implying that you need to organiseCheckLoadHistory in the same way?
Why not introduce this function as standard? For Mql and Py library.
Python library allows to request data from MetaTrader 5 terminal on the general basis regardless of the way it was requested - manually, via MQL5 or using the script from Python.
The developer of MQL5 programs and Python scripts is responsible for the logic and organization of working with data.
Afternoon
Is there an option to connect to the terminal via PowerShell? if anyone knows how, I would be grateful for information
No experience with python, so would like to use what I know best))
Good day!
I've connected libraries, python is communicating with Mt5, I'm getting account information but quotes are not loading in any way. Can you help me?
Python version 3.7.6
Result:
Good day!
I've connected libraries, python is communicating with Mt5, I'm getting account information, but the quotes are not loading in any way. Can you help me?
Python version 3.7.6
Result:
Please insert code correctly (use button
)
Please insert the code correctly (use the button)
Thank you for the design, I will take it into account.