enarjord / passivbot

Trading bot running on Bybit, Bitget, OKX, GateIO, Binance and Hyperliquid
https://www.passivbot.com
Other
1.1k stars 416 forks source link

ByBit BTCUSDT Ticker? #8

Closed strcat32 closed 3 years ago

strcat32 commented 3 years ago

I tried to backtest BCTUSDT. I changed the following in the backtest.py:

    elif exchange == 'bybit':
        settings = {
        ...
        'inverse': False 
        'symbol': 'BTCUSDT',
        'margin_limit': 1000,

When i try to run the backtest it errors out with:

  File "backtest.py", line 262, in backtest
    liq_price = calc_liq_price(balance, pos_size, pos_price)
UnboundLocalError: local variable 'calc_liq_price' referenced before assignment

Do i need to change something else? Or what do i have to do to make it work with BTCUSDT? It probably is a good strategy to accumulate both BTC and USDT in both tickers to hedge price risk.

Otherwise nice idea and nice bot, dude:) Appreciate the sharing.

enarjord commented 3 years ago

hey there, thanks for your kind words

the bot only works in bybit inverse and binance usdt as of now. haven't added support for bybit usdt futures, nor binance coin margined futures.

to do that, some bigger updates are needed i believe. binance uses a different api for their coin m futures, i don't know about bybit.

also, the binance backtester isn't working at the moment, but it will soon