forked from itsXactlY/BTQuant
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mimic_binance_forward_trading.py
46 lines (33 loc) · 1.14 KB
/
mimic_binance_forward_trading.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
from imports import *
from live_strategys.QQE_Hullband_VolumeOsc import *
# JackRabbitRelay
_coin = 'PEPE'
_collateral = 'USDT'
_exchange = 'mimic'
_account = 'JackRabbit_SubaccountName' # Change me, im a dummy name :)
_asset = f'{_coin}/{_collateral}'
_amount = '69' # Dollar amount
_amount = float(_amount)
def run():
cerebro = bt.Cerebro(quicknotify=True)
store = binance_store.BinanceStore(
api_key=api,
api_secret=sec,
coin_refer=_coin,
coin_target=_collateral,
testnet=False)
broker = store.getbroker()
cerebro.setbroker(broker)
broker = store.getbroker()
cerebro.setbroker(broker)
# Fix datetime usage
from_date = dt.datetime.now(dt.timezone.utc) - dt.timedelta(minutes=6*15)
data = store.getdata(
timeframe_in_minutes=1,
start_date=from_date)
data._dataname = f"{_coin}{_collateral}"
cerebro.addstrategy(QQE_Example, exchange=_exchange, account=_account, asset=_asset, amount=_amount, coin=_coin, collateral=_collateral, backtest=False)
cerebro.adddata(data=data, name=data._dataname)
cerebro.run()
if __name__ == '__main__':
run()