gmag11 / MetaTrader5-Docker-Image

Docker image that runs Metatrader 5 with VNC web server
MIT License
107 stars 51 forks source link

name 'datetime' is not defined on docker server side #4

Closed ugofiasconaro closed 6 months ago

ugofiasconaro commented 6 months ago

Hi I have problem of datetime on the docker server side as I show you on the attached screenshot. Do You Know what the problem could be? Thank You.

Screenshot 2024-04-26 231854

Best Regards.

ugofiasconaro commented 6 months ago

Hi, I have reached my goal by replacing the following python method:

From this: mt5.copy_rates_from('EURUSD',mt.TIMEFRAME_D1,utc_from,10) To this: mt5.copy_rates_from_pos('EURUSD',mt.TIMEFRAME_D1,0,10)

Thank You. Best Regards.

gmag11 commented 5 months ago

Thank you for sharing

lucas-campagna commented 4 months ago

Run this mt5.exec("import datetime")