hackingthemarkets / tradingview-interactive-brokers

TradingView Interactive Brokers Integration using Webhooks
149 stars 58 forks source link

Disconnects w/out Notice #3

Open Brandon168 opened 2 years ago

Brandon168 commented 2 years ago

After long durations (~>4 hours) the code continues to run but no trades are executed. It seems IBKR is disconnecting.

Test:

Expected:

Actual:

I was able to fix this by removing the async code and then using a loop to periodically call ib.sleep() and ib.positions() on a loop. I've been unable to get ib.sleep() to work within async. I'd love to see how to remedy this.

cris-quantsoft commented 1 year ago

Hi Brandon! Can you send me the code that fix this problem? I receive only one order and after that I don't receive orders

Regards

Brandon168 commented 1 year ago

@cris-quantsoft my code isn't the best but here you go: https://github.com/Brandon168/Trading-View-IBKR