File tree Expand file tree Collapse file tree 2 files changed +9
-22
lines changed Expand file tree Collapse file tree 2 files changed +9
-22
lines changed Original file line number Diff line number Diff line change 1- name : Test | MetaTrader5 Integration Test
1+ name : Test | Integration Test
22
33on : [push]
44
7070 env :
7171 MT5_LOGIN : ${{ secrets.MT5_LOGIN }}
7272 MT5_PASSWORD : ${{ secrets.MT5_PASSWORD }}
73+ MT5_SERVER : " 'MetaQuotes-Demo'"
74+ MT5_PATH : " C:\\ Program Files\\ MetaTrader 5\\ terminal64.exe"
7375 run : |
74- python -c "import os, MetaTrader5 as mt5
75- print('Python version:', os.sys.version)
76- print('MetaTrader5 version:', mt5.__version__)
77- for i in range(10):
78- try:
79- if mt5.initialize(login=int(os.getenv('MT5_LOGIN')),
80- password=os.getenv('MT5_PASSWORD'),
81- server='MetaQuotes-Demo',
82- path='C:\\Program Files\\MetaTrader 5\\terminal64.exe'):
83- print('MT5 initialized successfully')
84- print(mt5.terminal_info())
85- mt5.shutdown()
86- exit(0)
87- print(f'Attempt {i+1} failed')
88- except Exception as e:
89- print(f'Error: {str(e)}')
90- import time; time.sleep(10)
91- print('All attempts failed')
92- exit(1)"
76+ python -c tests/integration/test_mt5_connection.py
Original file line number Diff line number Diff line change 55print ('Testing MT5 initialization...' )
66
77success = False
8- for attempt in range (12 ):
9- if mt5 .initialize ():
8+ for attempt in range (10 ):
9+ if mt5 .initialize (login = int (os .getenv ('MT5_LOGIN' )),
10+ password = os .getenv ('MT5_PASSWORD' ),
11+ server = os .getenv ('MT5_SERVER' ),
12+ path = os .getenv ('MT5_PATH' )):
1013 print ('MT5 initialized successfully' )
1114 mt5 .shutdown ()
1215 success = True
You can’t perform that action at this time.
0 commit comments