Python / MT5 implementation copy_rates_from_pos stopped not working...



I was running a script on MT5 using the python library.

Everything was running ok until the mt5.copy_rates_from_pos method suddenly stopped working. It returns an empty list. Other methods like history_deals_get...etc are working just fine. I have tried the following:

  • Disabling Antivirus.
  • Reinstall MT5
  • enable /disable algo trading.
  • use different pairs eg. EURUSD, EURUSD.a ...etc
  • Downgrade python to 3.8, 3.9 ... etc
  • Downgrade the MT5 library to previous releases.
  • Try in a different laptop with better specs (to check if the problem is memory.. etc)

I don't know what else should I do. Is there any way I can "reset" the connection between python and MT5? Also is there a way to uninstall Mt5 recent updates? Or perhaps installing a previous version? 

I appreciate any ideas 

Thank you



I believe I found the source of the problem. MT5 pull out the historical data from the brokers database. It seems that brokers restrict the access to this data for demo accounts.

Issue closed.