psemdel / py-trading-bot

Trading-bot in python using django, vertorbt lib and interactive-brokers
MIT License
166 stars 38 forks source link

error in connecting to localhost/8000 #38

Closed ben1628 closed 4 months ago

ben1628 commented 4 months ago

Got this error message

[7226:7253:0711/110123.812492:ERROR:bus.cc(399)] Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory found

[7226:7253:0711/110123.872812:ERROR:bus.cc(399)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")

psemdel commented 4 months ago

Hi, what send you this message? I suppose you are at the connection between IB and the bot. If so, check the port in settings.py

API configurations

"IB_LOCALHOST":'127.0.0.1', "IB_PORT": os.environ.get("IB_PORT",7496), #IB Gateway 4001, TWS 7496

As written, IB Gateway is on port 4001 and TWS is on port 7496.

ben1628 commented 4 months ago

Been a while thanks

ben1628 commented 4 months ago

Okay, back from holiday and trying this again.

I got this message when I ran this command

xdg-open http://localhost:8000/start_bot

[2779:2806:0719/090037.370386:ERROR:bus.cc(399)] Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory

So it seems to be missing a file

ben1628 commented 4 months ago

Since I'm using wsl2, I can access the site from the windows side. So I just start any browser and do http://localhost:8000/start_bot