-
Notifications
You must be signed in to change notification settings - Fork 3
/
Trader.py
44 lines (28 loc) · 976 Bytes
/
Trader.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import threading
import time
import numpy
class Trader:
"""
Implantez ici votre algorithme de trading. Le marche est accessible avec la
variable Market. Les differentes fonctions disponibles sont disponibles dans
le fichier API et expliquees dans le document de la competition
"""
#Nom de l'equipe:
equipe = ''
def __init__(self, API):
self.API = API
self.API.setEquipe(self.equipe)
"""Function called at start of run"""
def run(self):
"""You can add initialization code here"""
self.t = threading.currentThread()
while getattr(self.t, "run", True):
try:
self.trade()
except:
pass
time.sleep(0)
"""Your trading algorithm goes here!
The function is called continuously"""
def trade(self):
pass