-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparameters.py
More file actions
99 lines (68 loc) · 1.7 KB
/
Copy pathparameters.py
File metadata and controls
99 lines (68 loc) · 1.7 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
from binance.helpers import interval_to_milliseconds
import json
with open('settings/parameters.json') as f:
parameters = json.load(f)
def asset1():
"""returns the first traded asset (ex: BNB in BNBUSDT)
Returns:
string
"""
return parameters['asset1']
def asset2():
"""returns the second traded asset (ex: USDT in BNBUSDT)
Returns:
string
"""
return parameters['asset2']
def symbol():
"""returns the traded symbol (ex: BNBUSDT)
Returns:
string
"""
return asset1()+asset2()
def interval():
"""returns the time interval as a string:
1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 3d
Returns:
string
"""
return parameters['interval']
def interval_seconds():
"""returns the time interval in seconds
Returns:
int
"""
return int(interval_to_milliseconds(interval())/1000)
def rounding():
"""returns the minimum rounding that has to be done, is specific for traded symbol pair
Returns:
string
"""
return int(parameters['rounding'])
def short_span():
"""returns the span of the short average
Returns:
string
"""
return int(parameters['short_span'])
def long_span():
"""returns the span of the long average
Returns:
string
"""
return int(parameters['long_span'])
def database():
"""returns a boolean to indicate if a database should be used
Returns:
boolean
"""
return json.loads(parameters['database'].lower())
if __name__ == "__main__":
print(symbol())
print(interval())
print(rounding())
print(interval())
print(interval_seconds())
print(short_span())
print(long_span())
print(database())