forked from edeng23/binance-trade-bot
-
Notifications
You must be signed in to change notification settings - Fork 33
/
backtest.py
18 lines (16 loc) · 802 Bytes
/
backtest.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from datetime import datetime
from binance_trade_bot import backtest
if __name__ == "__main__":
history = []
for manager in backtest(datetime(2021, 1, 1), datetime.now()):
btc_value = manager.collate_coins("BTC")
bridge_value = manager.collate_coins(manager.config.BRIDGE.symbol)
history.append((btc_value, bridge_value))
btc_diff = round((btc_value - history[0][0]) / history[0][0] * 100, 3)
bridge_diff = round((bridge_value - history[0][1]) / history[0][1] * 100, 3)
print("------")
print("TIME:", manager.datetime)
print("BALANCES:", manager.balances)
print("BTC VALUE:", btc_value, f"({btc_diff}%)")
print(f"{manager.config.BRIDGE.symbol} VALUE:", bridge_value, f"({bridge_diff}%)")
print("------")