14 Commits

Author SHA1 Message Date
Martin-Molinero 0cda5c7f0d Improve brokerage WS default rate limits (#8486)
API Tests / build (push) Has been cancelled
Benchmarks / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
Report Generator Tests / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
- Improve brokerage WS default reconnection rate limits
- Minor cleanup in WebSocketClientWrapper
2024-12-27 12:55:21 -03:00
Martin-Molinero 2bc41e0e32 Websocket improvements (#6585)
Benchmarks / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
* Dynamically set wait time on WS error

- Dynamically adjust wait time on websocket error

* Avoid subscribing multiple times to message events

- Avoid websocket subscription multiple times to message events during
  disconnection/connection cycle

* Add Dispose Brokerage WebSocket Subscription Manager
2022-08-26 10:53:28 -03:00
Adalyat Nazirov 07b6572bf9 Support Binance Margin trading (#6173)
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
* change BinanceBrokerageModel

* supply spot vs margin endpoint as parameter

* wip

* send margin order for margin account

* "NEW" means that the order has been accepted by the Binance engine.

* fix cash balance

* use JsonConverters for account parsing

* unit tests

* fixup

* lazy connect

* fix connection

* allow api client to be null if DQH only

* make method private

* more unit tests

* fix Dispose

* fix tests

* fix IsConnected condition

* run test as additional

* add some comments

* improve unit tests

* improve null checks

* tidy up the code
2022-02-04 17:30:39 -03:00
Ronit Jain 926ac3879a Add try-catch and null check (#6038)
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
2021-11-03 20:07:47 -03:00
Ronit Jain 5083433f68 Inital brokerage setup commit (#5905)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
2021-09-07 22:05:36 -03:00
Ronit Jain 7881aeb3a5 Websocket-refactor for websocket message data as text and binary (#5833)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
* websocket-refactor for websocket message  as text and binary

Initial commit

websocket support for text and binary messageData

code style fixes

test fix

* delete un-used file

* zerodha websocket textMessage parse

* messageData class abscration

* Empty

Co-authored-by: Martin-Molinero <martin@quantconnect.com>
2021-08-10 17:40:07 -03:00
Martin-Molinero 611326b140 WebSocketClient improvements (#5799)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
- Take lock to refresh client to avoid null reference
  exception
- Reduce gate rate
- Use extension methods to await tasks
- Avoid copying the data multiple times
2021-07-28 15:17:08 -03:00
Stefano Raggi 0c4e577885 BitfinexBrokerage updates (#5787)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
* Update BinanceBrokerage to handle more than 512 symbols

* Address review

- fetch symbol weights only if required
- remove code duplication

* Add rate limiting for new connections

* Update WebSocketMessage to include the websocket instance

* Handle resubscriptions on reconnect

* Address review

* Address review

* Remove unnecessary locking

* WebSocketClientWrapper updates

- remove allocation of receive buffer on each message
- add missing lock in Close method
- log message data when message type is Close
- fix race condition after unexpected websocket close

* Set WebSocketClientWrapper task to LongRunning

* Add missing check in GetHistory

* Fix exceptions with Binance downloader

- closes #5794

* Update Bitfinex symbols in symbol properties database

* Update BitfinexBrokerage to use BrokerageMultiWebSocketSubscriptionManager

* Address review

* Remove unnecessary locking

* Remove old channels on resubscription
2021-07-28 11:10:12 -03:00
Stefano Raggi f44eb64c97 Remove WebSocketSharp from AlpacaBrokerage 2020-07-30 14:06:22 +02:00
Stefano Raggi 385a8209a0 Fix thread safety in WebSocketClientWrapper.Send 2020-05-25 15:26:31 +02:00
Stefano Raggi 0478daccd3 Address review 2020-05-20 17:04:42 +02:00
Stefano Raggi d19953c21e Add missing Dispose 2020-05-19 16:53:26 +02:00
Stefano Raggi b86a729ccb Address review 2020-05-19 14:52:38 +02:00
Stefano Raggi 1fe660a35f Update GDAXBrokerage to use System.Net.WebSockets instead of WebSocketSharp 2020-05-19 08:40:34 +02:00