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
The copy_tick functions are not working now. last_error() returns (1, "success"), however the functions only return empty arrays.
Terminal version: 2375
Python package version: 5.0.31
Test to reproduce:
Have you seen CopyTicksRange ?
Note
The CopyTicks() function allows requesting and analyzing all received ticks. The first call of CopyTicks() initiates synchronization of the symbol's tick database stored on the hard disk. If the local database does not provide all the requested ticks, then missing ticks will be automatically downloaded from the trade server. Ticks beginning with the from date specified in CopyTicks() till the current moment will be synchronized. After that, all ticks arriving for this symbol will be added to the tick database thus keeping it in the synchronized state.
Try to call one more time later
Bug report - package version 5.0.30
1. The functions [history_deals_get, history_deals_total, history_orders_get, history_orders_total, ...all of the copy_funcs] all have a fundamental flaw, and that is the parameter "from". From is a reserved keyword in python and cannot be used as a parameter name. This prevents the creation of pythonic adapter functions due to the naming conflict. The following will not even compile:
5. history_deals_get (and perhaps other functions) are inconsistent with their return type. Some functions return None when there is no data to return and other functions return an empty tuple. These functions all need to be consistent. They should all return the same object in the case of no data -- instead of some returning None and some returning an empty tuple.
1. We don't have "from" named parameter in this functions, all range parameters are unnamed.
5. history_deals_get, history_orders_get are different from orders_get, positions_get, they don't have default parameters and they can't called with empty parameters. They fail in this situation and return Null.
Have you seen CopyTicksRange ?
Try to call one more time later
It's still not working for me. Any other suggestions?
Tested with:
It's still not working for me. Any other suggestions?
Tested with:
What "EPM20" symbol? Does it have ticks in 3min?
We checked on standard symbols, all works normally:
Ok. I found the reason it wasn't working, and I'm curious to see why....
The issue was actually with this line of code.
time_to = datetime.utcnow()
Where my broker is on UTC time and I am on EST. The fix was to use
time_to = datetime.now()
...but I'm really not sure how or why this works. Any ideas?
1. We don't have "from" named parameter in this functions, all range parameters are unnamed.
5. history_deals_get, history_orders_get are different from orders_get, positions_get, they don't have default parameters and they can't called with empty parameters. They fail in this situation and return Null.
I realized that after looking at the package and realizing that it's a limitation of the C-functions. I am making a drop-in adapter package to make all the core API functions capable of handling keyword args. Have you considered including a stub file with type-hinting?
I made a pythonic wrapper to act as a drop-in replacement for the MetaTrader5 package. This runs python on top of the MetaTrader5 package and makes the API interface a bit more pythonic.
Features include:
See more:
https://pypi.org/project/pymt5adapter/
https://github.com/nicholishen/pymt5adapter
Is it too late to request that the API be modified to return dict objects instead of namedtuple objects? All of the namedtuple objects currently returned from the API cannot be pickled which breaks multi-processing. It is therefore necessary to run all data returned from the API through a recursive function that touches every point of data in order to ensure that all nested namedtuples are converted back to dictionaries which is highly inefficient.
Hello,
I could not install MetaTrader5 by:
pip install MetaTrader5
I got the following error:
ERROR: Could not find a version that satisfies the requirement MetaTrader5 (from versions: none)
ERROR: No matching distribution found for MetaTrader5
Knowing that I am on MAC laptop and I have Python 3.7.6
Thanks in advance to provide me the solution