websocket WIP 3
This commit is contained in:
14
src/bybit.py
14
src/bybit.py
@ -7,7 +7,7 @@ from pybit.unified_trading import WebSocket
|
||||
import options
|
||||
import credentials
|
||||
|
||||
import arbus
|
||||
import jsonProcessing
|
||||
|
||||
|
||||
async def getClient(apiKey, apiSecret, testnet):
|
||||
@ -54,7 +54,7 @@ async def socketStrategy(pair: str, params):
|
||||
# 'stopDelta',
|
||||
# 'orderSize'
|
||||
|
||||
paramsDict = await arbus.parseParams(params)
|
||||
paramsDict = await jsonProcessing.parseParams(params)
|
||||
|
||||
ws = WebSocket(
|
||||
testnet = options.testnet,
|
||||
@ -79,9 +79,9 @@ async def socketStrategy(pair: str, params):
|
||||
)
|
||||
|
||||
i = 0
|
||||
t = await arbus.checkPair(pair)
|
||||
t = await jsonProcessing.checkPair(pair)
|
||||
while t:
|
||||
t = await arbus.checkPair(pair)
|
||||
t = await jsonProcessing.checkPair(pair)
|
||||
if t != 1:
|
||||
# ws.exit()
|
||||
# ws_private.exit()
|
||||
@ -97,12 +97,12 @@ async def socketStrategy(pair: str, params):
|
||||
async def strategy(client: HTTP, pair: str, params):
|
||||
startTime = time.time()
|
||||
print('Starting strategy with ', pair)
|
||||
paramsDict = await arbus.parseParams(params)
|
||||
paramsDict = await jsonProcessing.parseParams(params)
|
||||
|
||||
i = 0
|
||||
t = await arbus.checkPair(pair)
|
||||
t = await jsonProcessing.checkPair(pair)
|
||||
while t:
|
||||
t = await arbus.checkPair(pair)
|
||||
t = await jsonProcessing.checkPair(pair)
|
||||
if t != 1:
|
||||
break
|
||||
|
||||
|
||||
Reference in New Issue
Block a user