-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpreparation_data.py
30 lines (26 loc) · 1.17 KB
/
preparation_data.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
from main import *
import glob, subprocess, json, re, shutil, os
from utils import * # dont use or use function name.
sim_files_list = glob.glob(os.getcwd() + "/simulations/*") # hungarian notation list...
strategies_dir_list = glob.glob(os.getcwd() + "/extensions/strategies/*/") # hungarian notation
strategies = []
binance_products = []
json_binance_products = []
binance_selectors = []
exchange = 'binance'
all_products = 'visi_Produktai.json' # dont do lithuanian naming.
def get_strategy_names():
print(sim_files_list, strategies_dir_list)
for strategy_name in strategies_dir_list:
strategies.append(strategy_name.split("/")[-2])
def get_binance_selector():
read_from_file(all_products, binance_products)
for y in binance_products:
binance_selectors.append(exchange + '.' + y['asset'] + '-' + y['currency'])
def check_if_crypto_pair_exists(crypto_pair):
for x in binance_selectors:
if x.endswith(crypto_pair) == True:
print("Crypto pair found...")
return
print("Crypto pair doesnt EXIST")
exit() # i use exit, because in a case crypto pair doesnt found i want script to be terminated.