PythonMetaTrader5 1.0.8__tar.gz → 1.0.9__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PythonMetaTrader5
3
- Version: 1.0.8
3
+ Version: 1.0.9
4
4
  Summary: Connect MT5 with Python
5
5
  Home-page: https://github.com/Akinzou/MetaTrader5-Python
6
6
  Author: Wiktor Jelen
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  name = PythonMetaTrader5
3
- version = 1.0.8
3
+ version = 1.0.9
4
4
  author = Wiktor Jelen
5
5
  author_email = wiktorjn@gmail.com
6
6
  description = Connect MT5 with Python
@@ -2,6 +2,7 @@
2
2
  import time
3
3
  from MetaTrader5 import *
4
4
  import colorama
5
+ import pyautogui
5
6
 
6
7
  colorama.init()
7
8
 
@@ -144,8 +145,13 @@ class Broker:
144
145
  print(self.RetCodes[r.retcode])
145
146
  print(colorama.Style.RESET_ALL)
146
147
  time.sleep(0.5)
147
- if not(lenpositions) or r.retcode == 10027:
148
+ if not(lenpositions):
148
149
  break
150
+ if r.retcode == 10027:
151
+ print(colorama.Fore.GREEN + "Enabling algotrading", str(self.log), symbol)
152
+ print(colorama.Style.RESET_ALL)
153
+ time.sleep(1)
154
+ pyautogui.hotkey('ctrl', 'e')
149
155
 
150
156
  if not close:
151
157
  SpacerStart()
@@ -175,7 +181,10 @@ class Broker:
175
181
  print(self.RetCodes[r.retcode])
176
182
  print(colorama.Style.RESET_ALL)
177
183
  if r.retcode == 10027:
178
- break
184
+ print(colorama.Fore.GREEN + "Enabling algotrading", str(self.log), symbol)
185
+ print(colorama.Style.RESET_ALL)
186
+ time.sleep(1)
187
+ pyautogui.hotkey('ctrl', 'e')
179
188
  time.sleep(0.5)
180
189
 
181
190
 
@@ -206,8 +215,13 @@ class Broker:
206
215
  print(colorama.Fore.RED + "ERROR CAN NOT OPEN", str(self.log), ": long ", symbol)
207
216
  print(self.RetCodes[r.retcode])
208
217
  print(colorama.Style.RESET_ALL)
209
- if r.retcode == 10027 or r.retcode == 10016:
218
+ if r.retcode == 10016:
210
219
  break
220
+ if r.retcode == 10027:
221
+ print(colorama.Fore.GREEN + "Enabling algotrading", str(self.log), symbol)
222
+ print(colorama.Style.RESET_ALL)
223
+ time.sleep(1)
224
+ pyautogui.hotkey('ctrl', 'e')
211
225
  time.sleep(0.5)
212
226
 
213
227
 
@@ -241,7 +255,10 @@ class Broker:
241
255
  print(self.RetCodes[r.retcode])
242
256
  print(colorama.Style.RESET_ALL)
243
257
  if r.retcode == 10027:
244
- break
258
+ print(colorama.Fore.GREEN + "Enabling algotrading", str(self.log), symbol)
259
+ print(colorama.Style.RESET_ALL)
260
+ time.sleep(1)
261
+ pyautogui.hotkey('ctrl', 'e')
245
262
  time.sleep(0.5)
246
263
 
247
264
 
@@ -273,8 +290,13 @@ class Broker:
273
290
  print(colorama.Fore.RED + "ERROR CAN NOT OPEN", str(self.log), " short ", symbol, " sl ", sl)
274
291
  print(self.RetCodes[r.retcode])
275
292
  print(colorama.Style.RESET_ALL)
276
- if r.retcode == 10027 or r.retcode == 10016:
293
+ if r.retcode == 10016:
277
294
  break
295
+ if r.retcode == 10027:
296
+ print(colorama.Fore.GREEN + "Enabling algotrading", str(self.log), symbol)
297
+ print(colorama.Style.RESET_ALL)
298
+ time.sleep(1)
299
+ pyautogui.hotkey('ctrl', 'e')
278
300
  time.sleep(0.5)
279
301
 
280
302
 
@@ -325,7 +347,10 @@ class Broker:
325
347
  print(self.RetCodes[r.retcode])
326
348
  print(colorama.Style.RESET_ALL)
327
349
  if r.retcode == 10027:
328
- break
350
+ print(colorama.Fore.GREEN + "Enabling algotrading", str(self.log), symbol)
351
+ print(colorama.Style.RESET_ALL)
352
+ time.sleep(1)
353
+ pyautogui.hotkey('ctrl', 'e')
329
354
  time.sleep(0.5)
330
355
 
331
356
  else:
@@ -369,7 +394,10 @@ class Broker:
369
394
  print(self.RetCodes[r.retcode])
370
395
  print(colorama.Style.RESET_ALL)
371
396
  if r.retcode == 10027:
372
- break
397
+ print(colorama.Fore.GREEN + "Enabling algotrading", str(self.log), symbol)
398
+ print(colorama.Style.RESET_ALL)
399
+ time.sleep(1)
400
+ pyautogui.hotkey('ctrl', 'e')
373
401
  time.sleep(0.5)
374
402
 
375
403
 
@@ -419,8 +447,13 @@ class Broker:
419
447
  print(colorama.Style.RESET_ALL)
420
448
  time.sleep(0.5)
421
449
 
422
- if not lenpositions or r.retcode == 10027:
450
+ if not lenpositions:
423
451
  break
452
+ if r.retcode == 10027:
453
+ print(colorama.Fore.GREEN + "Enabling algotrading", str(self.log), symbol)
454
+ print(colorama.Style.RESET_ALL)
455
+ time.sleep(1)
456
+ pyautogui.hotkey('ctrl', 'e')
424
457
 
425
458
  if not len(limit_orders):
426
459
  SpacerStart()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PythonMetaTrader5
3
- Version: 1.0.8
3
+ Version: 1.0.9
4
4
  Summary: Connect MT5 with Python
5
5
  Home-page: https://github.com/Akinzou/MetaTrader5-Python
6
6
  Author: Wiktor Jelen