erdewit / ib_insync

Python sync/async framework for Interactive Brokers API
BSD 2-Clause "Simplified" License
2.76k stars 726 forks source link

The order still in "pendingSubmit". #138

Closed fabio11c closed 5 years ago

fabio11c commented 5 years ago

Hi, I'm having a problem with the "Ordering" notebook, when I try to place an order, the order stills in the "pendingSubmit" status.

This is the code:

from ib_insync import * util.startLoop()

ib = IB() ib.connect('127.0.0.1', 7497, clientId=13)

limitOrder = LimitOrder('BUY', 100, 0.05) limitTrade = ib.placeOrder(contract, limitOrder)

limitTrade

And when I try to change the quantity of the order, it shows this error message:

"ValueError: invalid literal for int() with base 10: b'1.7976931348623157E308' ERROR:ib_insync.client:Peer closed connection"

Can you help me?

hadrianl commented 5 years ago

it doesn't seem like changing the quantity.u did place a limitOrder.

hadrianl commented 5 years ago

just make sure the price and the quantity are available for this contract

fabio11c commented 5 years ago

Hi hadrianl, I'm trying this code in a paper trading account.

How can I see if the price and quantity are available for the contract?

fabio11c commented 5 years ago

I trying to put prices nearly to the bid/ask and the order stills in "pendingSubmit" status.

erdewit commented 5 years ago

A paper trading account only fills orders during market hours (unlike the old edemo account).

I've tried the ordering notebook and it runs okay.