|
Crypto backtesting
|
Variables | |
| api_key = os.getenv('BINANCE_API_KEY') | |
| api_secret = os.getenv('BINANCE_API_SECRET') | |
| client = Client(api_key, api_secret) | |
| info = client.get_account() | |
| int | non_zero_balances = 0 |
| open_orders = client.get_open_orders() | |
| reader = csv.reader(file) | |
| date = row[0] | |
| dt = datetime.strptime(date, '%Y-%m-%d %H:%M:%S') | |
| exchange_and_symbol = row[1] | |
| tokens = exchange_and_symbol.split('-') | |
| symbol = tokens[1] + tokens[2] | |
| symbol_spot = client.get_symbol_ticker(symbol=symbol) | |
| price = float(symbol_spot['price']) | |
| eth_price = float(symbol_spot['price']) | |
| binance.api_key = os.getenv('BINANCE_API_KEY') |
Definition at line 8 of file binance.py.
| binance.api_secret = os.getenv('BINANCE_API_SECRET') |
Definition at line 9 of file binance.py.
| binance.client = Client(api_key, api_secret) |
Definition at line 14 of file binance.py.
| binance.date = row[0] |
Definition at line 37 of file binance.py.
| binance.dt = datetime.strptime(date, '%Y-%m-%d %H:%M:%S') |
Definition at line 38 of file binance.py.
| binance.eth_price = float(symbol_spot['price']) |
Definition at line 57 of file binance.py.
| binance.exchange_and_symbol = row[1] |
Definition at line 41 of file binance.py.
| binance.info = client.get_account() |
Definition at line 17 of file binance.py.
| int binance.non_zero_balances = 0 |
Definition at line 20 of file binance.py.
| binance.open_orders = client.get_open_orders() |
Definition at line 28 of file binance.py.
| binance.price = float(symbol_spot['price']) |
Definition at line 52 of file binance.py.
| binance.reader = csv.reader(file) |
Definition at line 33 of file binance.py.
Definition at line 47 of file binance.py.
Definition at line 51 of file binance.py.
| binance.tokens = exchange_and_symbol.split('-') |
Definition at line 44 of file binance.py.