Lumiwealth / lumibot

Backtesting and Trading Bots Made Easy for Crypto, Stocks, Options, Futures, FOREX and more
GNU General Public License v3.0
762 stars 142 forks source link

Websocket streaming for tradier #458

Open dodofarm opened 1 month ago

dodofarm commented 1 month ago

I see that it's mentioned in tradier.py it's mentioned that websocket streaming isn't supported yet.

Do we have an ETA for that?

grzesir commented 1 month ago

It is not currently on the roadmap. If you would like to build it then we offer our Pro Plan for free to anyone developing lumibot.

Robert Grzesik 347-635-3416

On Thu, May 23, 2024 at 1:23 PM dodofarm @.***> wrote:

I see that it's mentioned in tradier.py https://github.com/Lumiwealth/lumibot/blob/88d0b9e6d5fd86a7f7d44adb5cb64fbdcd0a7a5f/lumibot/brokers/tradier.py#L24 it's mentioned that websocket streaming isn't supported yet.

Do we have an ETA for that?

— Reply to this email directly, view it on GitHub https://github.com/Lumiwealth/lumibot/issues/458, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIYQK4XTAHYLR7KH2YL7K3ZDYQ2JAVCNFSM6AAAAABIGCUIV6VHI2DSMVQWIX3LMV43ASLTON2WKOZSGMYTGNBXG44TINQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

dodofarm commented 1 month ago

I just briefly looked through the code. As far as I can see websockets aren't implemented at all yet.

So this would require to essentially also make significant changes to strategy.py since currently it's purely poll-based, am I correct here?

Once that is done connecting to the Tradier streaming API would be more or less simple.

grzesir commented 1 month ago

I was under the impression that Alpaca uses websockets for trade notifications, and Tradier does as well.

If you mean websockets for pricing data then I believe you are correct.

On Thu, May 23, 2024 at 1:46 PM dodofarm @.***> wrote:

I just briefly looked through the code. As far as I can see websockets aren't implemented at all yet.

So this would require to essentially also make significant changes to strategy.py since currently it's purely poll-based, am I correct here?

Once that is done connecting to the Tradier streaming API would be more or less simple.

— Reply to this email directly, view it on GitHub https://github.com/Lumiwealth/lumibot/issues/458#issuecomment-2127726796, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIYQK63PS3AHDHSCKADCQLZDYTPRAVCNFSM6AAAAABIGCUIV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRXG4ZDMNZZGY . You are receiving this because you commented.Message ID: @.***>

jimwhite commented 1 month ago

I've not tried it but the Interactive Brokers code appears to have streaming for price bars:

https://github.com/Lumiwealth/lumibot/blob/88d0b9e6d5fd86a7f7d44adb5cb64fbdcd0a7a5f/lumibot/brokers/interactive_brokers.py#L1033

https://github.com/Lumiwealth/lumibot/blob/88d0b9e6d5fd86a7f7d44adb5cb64fbdcd0a7a5f/lumibot/strategies/strategy.py#L3208

grzesir commented 1 month ago

Yes that’s true, it uses a mechanism where you run a function called something like start_realtime_bars() (could be misspelling it). However last I checked this was not working - and to be honest isn’t architected the best.

On Thu, May 23, 2024 at 2:20 PM Jim White @.***> wrote:

I've not tried it but the Interactive Brokers code appears to have streaming for price bars:

https://github.com/Lumiwealth/lumibot/blob/88d0b9e6d5fd86a7f7d44adb5cb64fbdcd0a7a5f/lumibot/brokers/interactive_brokers.py#L1033

https://github.com/Lumiwealth/lumibot/blob/88d0b9e6d5fd86a7f7d44adb5cb64fbdcd0a7a5f/lumibot/strategies/strategy.py#L3208

— Reply to this email directly, view it on GitHub https://github.com/Lumiwealth/lumibot/issues/458#issuecomment-2127779627, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIYQK655PSKJR2YJNGES2DZDYXPZAVCNFSM6AAAAABIGCUIV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRXG43TSNRSG4 . You are receiving this because you commented.Message ID: @.***>

dodofarm commented 1 month ago

well I settled on using Tradier so I'll make sure to take a look at adding websocket streams to the bot.

Thanks for the inputs and will comment here or create a pr when needed.

grzesir commented 4 weeks ago

Ok awesome, just let me know when you’re ready.

Btw did I mention that we give the pro plan for free to lumibot developers? Let me know if you plan to add some features to Lumibot and if you’re interested in the pro plan

Robert Grzesik 347-635-3416

On Sun, May 26, 2024 at 11:10 AM dodofarm @.***> wrote:

well I settled on using Tradier so I'll make sure to take a look at adding websocket streams to the bot.

Thanks for the inputs and will comment here or create a pr when needed.

— Reply to this email directly, view it on GitHub https://github.com/Lumiwealth/lumibot/issues/458#issuecomment-2132254296, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIYQK3BCOUV6MNJEPFXA5DZEH3PVAVCNFSM6AAAAABIGCUIV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMZSGI2TIMRZGY . You are receiving this because you commented.Message ID: @.***>

dodofarm commented 3 weeks ago

Yep, reached out to you on discord! We can talk about the changes there.