You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
730 B
32 lines
730 B
# -*- coding: utf-8 -*-
|
|
|
|
import time
|
|
import logging
|
|
from binance.binance_trader import BinanceTrader
|
|
from binance.utils import config
|
|
|
|
format = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
|
|
logging.basicConfig(level=logging.INFO, format=format, filename='grid_trader_log.txt')
|
|
logger = logging.getLogger('binance')
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
|
|
config.loads('./conf/config.json')
|
|
trader = BinanceTrader()
|
|
|
|
|
|
|
|
while True:
|
|
try:
|
|
print(trader.get_avg_price_5min())
|
|
print(trader.get_price_change_percent_24h())
|
|
#trader.grid_trader()
|
|
time.sleep(200)
|
|
|
|
except Exception as error:
|
|
print(f"BA catch error: {error}")
|
|
time.sleep(5)
|
|
|