¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io
Date

Re: Paper trade p&l not updating

 

Just to update.
IB did not bother to reply to any of the tickets.

P&l not updating accurately in net liquidation value and total cash, confirmed by myself (UK) and our trader (Ukraine) on paper accounts for the last week.

Issue was also raised in chat support, but no avail.?

And... as of this morning, normal performance is restored. Got to love the way they handled it. Really gives you confidence.

Best wishes,

M


On Wed, 29 Jul 2020, 17:47 mark collins via , <mark.collins=[email protected]> wrote:

Am I the only one who has many hours of the same p&l being reported for paper accounts?!?

@Josh are there any relevant faults on the servers that have been logged since Sunday night?

It makes paper trading utterly useless.

Best wishes,

M



Does anyone know how the system will respond under the following situation?

 

If an investment account has a funding level at $X, and there are stock orders for different stocks trying to buy such as $A, $B, $C, or $D.
Where A<X but A+B >X.

Would the IB trading system allow placing all the four orders first, until some orders are filled and making the total sum of investment larger than X??
In order words, does the system check/deduct account balance when placing an order or until the order is filled?

Assume it is for the case of a cash account without margin borrowings.


Re: Open Tick, tick ID 14

 

I looked at time and sales in TWS for the period you reported and the very first tick at 08:00:04.364 is not even on the tape, while some of those ticks that are on the tape are not on SWB. This just contributes to the suspicion that it could be a glitch indeed.

Regarding the opening price, note that quite a lot could depend on the details of your request and on IB's interpretation of opening price for it. Generally speaking, opening price is simply the price of the first trade in respective stock on a specific trading venue. However in US if a request is made for a stock with SMART routing rather than a data request for any particular exchange, the opening price will the price of the official opening on the stock's primary exchange, usually produced during a special opening auction that can complete well after some other trades happen on the broader market. Whether something similar applies to the stock you are researching, and how IB interprets that, could potentially lead to different outcomes.


Re: Getting invalid prices by following the relevant market rules.

 

Thanks,

That's interesting - I hadn't realised there was a price multiplier - I
guess that's why I've been falling off the end of their list.

But by the sound of things, this still means my price of 1068.5 should
be ok? That's the price that got rejected. This price is available in
TWS to set as limit.

Looking at the market price rule 1918 within the context of your price
multiplier, my price of 1068.5, would be applicable to the bucket with
low edge 10.0 and increment of 0.01 (i.e. 1 pence).
That would mean I'd have to trade at either 1068 or 1069, no?

If that's true, why do I see increments of 0.5 in the TWS order entry
screen?

Bits of 1918 rule:
}, PriceIncrement {
m_lowEdge: 5.0
m_increment: 0.005
}, PriceIncrement {
m_lowEdge: 10.0
m_increment: 0.01
}, PriceIncrement {
m_lowEdge: 20.0
m_increment: 0.02
}, PriceIncrement {

Best,
G.

On Thu, 30 Jul 2020 12:43:57 -0700
"Josh via groups.io" <jb201448@...> wrote:

Correcting my math in the previous post:

A price of 1077 for an instrument with price multiplier 100
corresponds to:

LowEdge 10, Interval 1/200

1/200 * (100 price magnifier) = 0.5 minTick



Re: Getting invalid prices by following the relevant market rules.

 

Correcting my math in the previous post:?
?
A price of 1077 for an instrument with price multiplier 100 corresponds to:
?
LowEdge 10, Interval 1/200
?
1/200 * (100 price magnifier) = 0.5 minTick?
?
?


Re: Getting invalid prices by following the relevant market rules.

 

Just to report back, unfortunately my "hack" didn't work and I yet
again had orders being rejected for allegedly not conforming to minimum
price variation.

But when I look in TWS, the price that was rejected via the API is
available in the pop-up list of prices when I click LMT PRICE on the
order entry screen.

Completely baffled. Have opened a support ticket with IB.

On Thu, 30 Jul 2020 05:26:51 -0700
dominic.keeley@... wrote:

Actually these are related but slightly different issues.
In you case from what I understood the increments are missing from
the increments list as the prices are higher than the increments
listed? In my case my prices are within the increments listed, but
the increments are just plain wrong - both ways it's not ideal! ;-)



Re: Open Tick, tick ID 14

 

Hmm OK, thanks.?
I checked a few other feeds and I got the same sort of thing. Maybe they had a weird technical glitch that day. So as far as you are aware this should be the opening price that the current trading day then?


Re: How to combine BracketOrder and "MOC"

 

¿ªÔÆÌåÓý

?

The child orders are placed in an OCA group, so generally speaking, only one order will execute and the others will be cancelled.

?

However, OCAs are not magic, and there are rare situations where more than one order is filled. A case I could imagine is where you have an OCA with two stop (or stop-limit) orders to catch a breakout in either direction from a narrow trading range. Conceptually at least, there is a possibility in a frantic market that it could move one way (triggering one order) and then rapidly reverse, triggering the other before IB has had time to react and cancel it. In practice I suspect this is unlikely nowadays, because for most exchanges these days stop and stop-limit orders are not native but are simulated by IB. So provided the first order's fill notification reaches IB quickly enough, it should be able to avoid triggering the second order when it's trigger price is posted.

?

An example of an exchange where stop-limit orders are native is Globex, according to IB's exchange listings.

?

My point about being careful was literally, just be careful! Don't make any unnecessary assumptions. For example, if you put a 'good till date' on the stop-loss order, make very sure through testing that it will be honoured in a timely fashion so you don't end up with your stop-loss order still active at the same time as your position-closing order is active. Whether this would be a good approach or not, I don't know offhand.? The easiest way is probably just to modify the stop-loss order so that it is instantly triggered, provided there's little or no chance of what I described above happening.

?

The way I do it, cancelling existing orders and then placing a position-closing order only when all cancellations have been confirmed, still has a finite risk from the connection dropping or the exchange crashing in those few milliseconds, but that would be seriously bad luck: but anyway it's impossible to remove all risk.

?

?

From: [email protected] <[email protected]> On Behalf Of rognorak@...
Sent: 30 July 2020 14:53
To: [email protected]
Subject: Re: [TWS API] How to combine BracketOrder and "MOC"

?

Hi Richard?

I am curious, since it is a bracket with a 3rd child, will the system ensure only one order fills, and scale all 3 bracket orders on a partial fill.?

You mentioned in a prior post to be careful one order executes, but it's always been my understanding that a bracket ( not oca ) will do this with all the children when set up correctly.?

If not, perhaps since the 3rd order is ' good after time ' wetwe cantcan makepmake and stop loss children have a ' good till date ' on them, but I don't think it should be necessary.?

Apologies because I am unable to test this right now myself, but this post got my attention because I want to do the exact same thing and haven't gotten to it yet.?

Thanks?


Re: How to combine BracketOrder and "MOC"

 

From my experience, TWS always automatically combines child orders in an OCA group.


Re: Open Tick, tick ID 14

 

It looks pretty bizzare to me that you get multiple different prices for this tick for the same day indeed. I don't know if this request was made before or after the regular trading start, but I never even receive this tick until trading starts for US stocks anyway. For a US stock that has official open price print on the exchange where it is listed, you should get that one price with this tick. Typically it will be the price of the?special opening cross for the day, and one that then gets reflected in historical data. It's pretty straighforward for this kind of stocks.


Re: How to combine BracketOrder and "MOC"

 

Hi Richard?

I am curious, since it is a bracket with a 3rd child, will the system ensure only one order fills, and scale all 3 bracket orders on a partial fill.?

You mentioned in a prior post to be careful one order executes, but it's always been my understanding that a bracket ( not oca ) will do this with all the children when set up correctly.?

If not, perhaps since the 3rd order is ' good after time ' wetwe cantcan makepmake and stop loss children have a ' good till date ' on them, but I don't think it should be necessary.?

Apologies because I am unable to test this right now myself, but this post got my attention because I want to do the exact same thing and haven't gotten to it yet.?

Thanks?


Re: next valid order id

 

Partial quote from Francois G: "reqId (used in any function NOT related to orders) may start from 1 every time you start your app, and should increment by 1 at every request, as long as you use your app."
This increment is not always necessary. If you use reqId for a certain request and that request is completed (e.g. with historical data, or contract details) you can re-use the same reqId for any next request. The same holds if you submit a request and then submit a cancellation of the request. In such cases is it not necessary to increment the request counter.


Open Tick, tick ID 14

 

Is anyone using the Open Tick, tick ID 14?



I'd initially hoped it was the open price for the day based on the description.

"Current session's opening price. Before open will refer to previous day. The official opening price requires a market data subscription to the native exchange of the instrument."

But then when I saw that I had different OPEN prices in different market data feeds opened on the same instrument and exchange at different times I guessed "session" must relate to the opening price as the market data feed was opened.

Now however when I check further, within a single market data feed I'm getting multiple different OPEN prices, all within a 10 minute period.

Does anyone have any idea what this tick contains?

2020-07-13 08:00:04.364, G3TA, SWB, OPEN, 37.371
2020-07-13 08:02:21.819, G3TA, SWB, OPEN, 37.306
2020-07-13 08:04:16.678, G3TA, SWB, OPEN, 37.56
2020-07-13 08:06:32.103, G3TA, SWB, OPEN, 37.55
2020-07-13 08:07:33.824, G3TA, SWB, OPEN, 37.23


Re: Getting invalid prices by following the relevant market rules.

 

Actually these are related but slightly different issues.?
In you case from what I understood the increments are missing from the increments list as the prices are higher than the increments listed?
In my case my prices are within the increments listed, but the increments are just plain wrong - both ways it's not ideal! ;-)


Re: Close order cannot be created because rounded order size is 0

 

You probably have to call the?appropriate?trading desk during working hours and create orders through them.?


On Thu, Jul 30, 2020 at 2:08 PM Graham Bygrave <graham@...> wrote:
Probably over a year ago I mistakenly bought a TSE stock - 4502 - and
can't close the position, no matter how hard I try.

I get the error:
Close order cannot be created because rounded order size is 0

How do I get free of this thing?

Thanks,
Graham.





--
Best regards,
Chernikov Aleksandr,
e-mail:?me@...
skype:?
RU:?+7-904-179-49-78


Close order cannot be created because rounded order size is 0

 

Probably over a year ago I mistakenly bought a TSE stock - 4502 - and
can't close the position, no matter how hard I try.

I get the error:
Close order cannot be created because rounded order size is 0

How do I get free of this thing?

Thanks,
Graham.


Re: Getting invalid prices by following the relevant market rules.

 

Agreed. I think it's poor show. For live trading it's inexcusable.

I (hopefully) solved my issue by tacking on increments to the 1918 rule
I get back from IB: [1000, 0.5];[2000, 1.0];[10000, 5.0]. Will see in
the trade this afternoon.

Best,
G.

On Thu, 30 Jul 2020 03:17:22 -0700
dominic.keeley@... wrote:

I've had this issue repeatedly, particularly with one specific
European exchange. Orders get rejected even though the price conforms
to the published market rule and price increment at the time. IB
eventually admitted there was an issue and that they had "fixed" it.
This was for an attempted LIVE order I attempted to place a month and
a half earlier lol. The way I could resolve it in some cases was by
manually changing the market rule I used for that exchange to the
rule used for a different exchange where I never had a problem, but
that doesn't always work. I would say that the issue lies either with
the exchange not informing IB of an update to the market rules, but
if you enter an order manually via the TWS then it tells you what the
allowed price increment is, so it's odd that TWS know the correct
increment, but the API doesn't know...



Re: Getting invalid prices by following the relevant market rules.

 

I've had this issue repeatedly, particularly with one specific European exchange. Orders get rejected even though the price conforms to the published market rule and price increment at the time. IB eventually admitted there was an issue and that they had "fixed" it. This was for an attempted LIVE order I attempted to place a month and a half earlier lol.
The way I could resolve it in some cases was by manually changing the market rule I used for that exchange to the rule used for a different exchange where I never had a problem, but that doesn't always work.
I would say that the issue lies either with the exchange not informing IB of an update to the market rules, but if you enter an order manually via the TWS then it tells you what the allowed price increment is, so it's odd that TWS know the correct increment, but the API doesn't know...


Re: How to combine BracketOrder and "MOC"

 

¿ªÔÆÌåÓý

You should never take something you read about the API at face value, for example "I recall seeing a posting claiming you can't add a third child.".

?

It doesn't matter who posts it, we all make mistakes, so you always need to do your own verification.

?

As it happens, what you recalled is untrue: you can certainly add a third child order. I just did it: parent limit order, child limit target order, child stop stop-loss order, child market 'good after time' order. As it happens that particular bracket order was rejected because the contract I was using (the DAX future FDAX SEP 20) has an absurdly high initial margin requirement, and my paper trading account doesn't have enough funds in it. But an earlier attempt, using an additional MIT target order instead of the timed market order, with a different contract (ZU0) worked fine.

?

What I also discovered is that MOC orders are not accepted at the exchanges and for the products (futures) that interest me. The description of MOC orders on IB's website ¨C see ? ¨C includes a link to a list of supported exchanges: this includes DTB (which is where the DAX futures are), but MOC's weren't allowed with the FDAX SEP 20 contract, so it's all a bit hit-and-miss.

?

?

?

?

From: [email protected] <[email protected]> On Behalf Of erezkaplan90@...
Sent: 30 July 2020 07:33
To: [email protected]
Subject: Re: [TWS API] How to combine BracketOrder and "MOC"

?

Hi guys,

Thanks for? your insights.
>>>The solution must surely be to add a third child MKT order,?
I recall seeing a posting claiming you can't add a third child.

I will combine? - (Keep it Simple? && Better Safe than Sorry) - and use Richards concept

>>>Actually I just monitor the time, and a minute before the close I cancel the unfilled bracket order orders and then submit a market order.

Will update if I have new insights after?
implementation.


Re: next valid order id

 

Nick is right about orderId and reqId.
Maybe should we precise that reqId (used in any function NOT related to orders) may start from 1 every time you start your app, and should increment by 1 at every request, as long as you use your app. But when you close your app, there is no need to record which last reqId was used You can start from 1 again at the next session.