Skip to content

Commit

Permalink
upd
Browse files Browse the repository at this point in the history
  • Loading branch information
m5l14i11 committed Sep 10, 2024
1 parent 9990437 commit be9a69a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
4 changes: 2 additions & 2 deletions exchange/_bybit_ws.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ async def _connect_to_websocket(self):
self.ws = await websockets.connect(
self.wss,
open_timeout=None,
ping_interval=30,
ping_timeout=15,
ping_interval=18,
ping_timeout=10,
close_timeout=None,
)

Expand Down
7 changes: 1 addition & 6 deletions risk/_actor.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,16 +112,11 @@ async def _handle_position_risk(self, event: NewMarketDataReceived):
indexes = list(range(num_positions))
random.shuffle(indexes)

current_index = 0

for _ in range(num_positions):
shuffled_index = indexes[current_index]
for shuffled_index in indexes:
processed_positions[shuffled_index] = await self._process_market(
event, self._position[shuffled_index]
)

current_index = (current_index + 1) % num_positions

self._position = tuple(processed_positions)

async def _trail_position(self, event: TrailEvent):
Expand Down

0 comments on commit be9a69a

Please sign in to comment.