示例#1
0
async def create_bybit_bot(config: dict):
    from bybit import Bybit

    bot = Bybit(config)
    await bot._init()
    return bot
示例#2
0
async def create_bybit_bot(user: str, config: str):
    from bybit import Bybit
    bot = Bybit(user, config)
    await bot._init()
    return bot
示例#3
0
import pytest
import os
from bybit import Bybit

KEY = os.environ['BTKEY']
SECRET = os.environ['BTSECRET']

bt = Bybit()
bt.auth(KEY, SECRET)

@pytest.mark.parametrize("bt",[(bt)])
def test_get_symbols(bt):
    assert len(bt.get_symbols()) > 0
    
@pytest.mark.parametrize("bt",[(bt)])
def test_get_klines(bt):
    klines = bt.get_klines('BTCUSD', '15', '1563367231')
    print(klines)
    print(f'len klines: {len(klines)}')

if __name__ == "__main__":
    test_get_klines(bt)