-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathEnums.py
56 lines (43 loc) · 940 Bytes
/
Enums.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
45
46
47
48
49
50
51
52
53
54
55
56
import numpy as np
class Assets:
XBTUSD = 0
ETHUSD = 1
XRPZ18 = 2
XRPUSD = 3
XRPXBT = 4
AssetsInverse = {0: 'XBTUSD', 1: 'ETHUSD', 2:'XRPZ18', 3:'XRPUSD', 4:'XRPXBT'}
class Direction:
short = 0
long = 1
@staticmethod
def str(val):
try:
return {0: 'short',
1: 'long'}[val]
except KeyError:
return '{}'.format(val)
class ActionSpace:
# hold leverage and exit trade
n = 2
def sample(s):
np.random.randint(0, s.n)
class StateSpace:
p_long = 0
p_short = 1
elapsed = 2
profit_rel = 3
roll_max_profit_rel = 4
trailing_max_profit_rel = 5
# regr, next tick probabilities, ema, ma
class StatisticsFields:
action = 0
reward = 1
prob_long = 2
prob_short = 3
close_ma = 4
profit = 5
class FillsSchema:
ts = 0
direction = 1
ts_fill_au = 2
price_fill_au = 3