-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug_example.py
More file actions
38 lines (33 loc) · 1.11 KB
/
debug_example.py
File metadata and controls
38 lines (33 loc) · 1.11 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
# debug_example.py
from src.data_loader import DataLoader
from src.genetic_optimizer import GeneticOptimizer
try:
import cudf
import cupy as cp
import numba.cuda as cuda
NUM_GPU = cp.cuda.runtime.getDeviceCount()
USING_CUDF = NUM_GPU > 0
except:
cudf = None
cp = None
cuda = None
USING_CUDF = False
NUM_GPU = 0
def debug_single():
data_loader = DataLoader()
data_loader.import_ticks()
data_loader.resample_data()
params = [
0, 2, 4, 8, 16, 8, 4, # VWAP
10, 20, 30, 40, 50, 100, 200, # VPVR
8, 10, 12, 14, 16, 18, 20, # RSI
8, 21, 5, 8, 21, 5, 8, 21, 5, 8, 21, 5, 8, 21, 5, 8, 21, 5, 8, 21, 5, # MACD
20, 2.0, 20, 2.0, 20, 2.0, 20, 2.0, 20, 2.0, 20, 2.0, 20, 2.0, # BBands length, std_dev (7 timeframes)
14, 14, 14, 14, 14, 14, 15, # ATR length (7 timeframes)
14, 14, 14, 14, 14, 14, 14, # ASD length (7 timeframes)
0.6, 0.6 # Model thresholds (buy, sell)
]
go = GeneticOptimizer(data_loader, session_id="debug123")
go.debug_single_individual(params)
if __name__ == "__main__":
debug_single()