MetaTrader 5 Python User Group - the summary - page 20

To add comments, please log in or register
nicholish en
2693
nicholish en  

@Sergey Golubev can you please make the admin team aware that there is a bug-inducing typo in the docs? 


Here is the page with the error.

https://www.mql5.com/en/docs/integration/python_metatrader5/mt5copyratesfrom_py


The typo is the timeframe for 1 month. 

TIMEFRAME_MON1
Documentation on MQL5: Integration / MetaTrader for Python / copy_ticks_from
Documentation on MQL5: Integration / MetaTrader for Python / copy_ticks_from
  • www.mql5.com
# create 'datetime' object in UTC time zone to avoid the implementation of a local time zone offset                  time      bid      ask  last  volume       time_msc  flags  volume_real 0 2020-01-10 00:00:00  1.11051  1.11069   0.0       0  1578614400987    134          0.0...
Sergey Golubev
Moderator
117611
Sergey Golubev  
nicholish en:

@Sergey Golubev can you please make the admin team aware that there is a bug-inducing typo in the docs? 


Here is the page with the error.

https://www.mql5.com/en/docs/integration/python_metatrader5/mt5copyratesfrom_py


The typo is the timeframe for 1 month. 

"to pocket" feature does not work for me so I am having the difficulties to copy post (copy with translation with the link to the original post)
from here to the Russian forum -



You can try to post on Russian Python thread here https://www.mql5.com/ru/forum/306688/page72

If not so let me know, and I will post on that thread using html feature (but it will take some time):


Sergey Golubev
Moderator
117611
Sergey Golubev  
nicholish en:

@ Сергей Голубев, не могли бы вы сообщить команде администратора, что в документах есть опечатка, приводящая к ошибкам ?


Вот страница с ошибкой.

https://www.mql5.com/en/docs/integration/python_metatrader5/mt5copyratesfrom_py


Опечатка является сроком на 1 месяц.

TIMEFRAME_MON1

Yes, I reported to the key thread.
Post #717

Sergey Golubev
Moderator
117611
Sergey Golubev  
nicholish en:

@Sergey Golubev can you please make the admin team aware that there is a bug-inducing typo in the docs? 


Here is the page with the error.

https://www.mql5.com/en/docs/integration/python_metatrader5/mt5copyratesfrom_py


The typo is the timeframe for 1 month. 

As I see - it was corrected here https://www.mql5.com/en/docs/integration/python_metatrader5/mt5copyratesfrom_py
Documentation on MQL5: Integration / MetaTrader for Python / copy_rates_from
Documentation on MQL5: Integration / MetaTrader for Python / copy_rates_from
  • www.mql5.com
# create 'datetime' object in UTC time zone to avoid the implementation of a local time zone offset                                              time     open     high      low    close  tick_volume  spread  real_volume 0 2020-01-08 12:00:00  1.11382  1.11385  1.11110  1.11199         9354       1            0...
Pouria_mzn
5
Pouria_mzn  
nicholish en:

You can't do much because the terminal blocks when it's downloading rate data from the trade server. Even if you use async, threading, multiprocessing, you still run into the issue of a blocked terminal on subsequent calls. You could spawn multiple processes connected to multiple terminals and use one worker to handle priority fast tasks and another to handle a queue of long running blocking requests. 

Hi, 

Could you  please elaborator on how to do this "spawn multiple processes" ? I've been trying to achieve this by using multiprocessing and timeout in process.join(timeout=10), but that doesn't seem to work, the terminal gets stuck on updating a ticker and dosen't move on to the next. my code locks something like this:


def rates(ticker):
    utc_to = dt.datetime(year=2020, month=7, day=30)
    utc_from = utc_to - dt.timedelta(days=30)
    with mt5.connected():
        rates = mt5.copy_rates_range(ticker, mt5.TIMEFRAME_D1, utc_from, utc_to)
        print(pd.DataFrame(rates))

def main():
    tickers = ['tick1', 'tick2', 'ticker3', 'ticker4', ...]
    for ticker in tickers:
        p2 = Process(target=rates, args=(ticker,))
        p2.start()
        p2.join(timeout=10)
        p2.terminate()


if __name__ == "__main__":
    main()

8317001
71
8317001  

Hi, Can anyone advise how to add account info after the datetime expiry in mql4 file


datetime expiry=D'2022.7.21 00:00';

//====================================================================================================================================================//

//OnInit function

//====================================================================================================================================================//

int OnInit()

  {

//------------------------------------------------------

//Started information

  


   

   ExpertName=WindowExpertName();

   EASymbol=Symbol();

   if(StringLen(EASymbol)>6) SymbolExtension=StringSubstr(EASymbol,6,0);

//------------------------------------------------------

To add comments, please log in or register