websocket WIP 3

This commit is contained in:
2025-04-29 19:32:43 +03:00
parent c612d5b8d4
commit f70126af46
4 changed files with 112 additions and 88 deletions

View File

@ -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