开云体育

ctrl + shift + ? for shortcuts
© 2025 开云体育

Why is this order invalid and rejected?


 








I originally submitted this combo order with api and got invalid combo order error.? I then entered in TWS desktop and got the same error. I‘m not sure if this is a bug on the TWS side or not?


 

Probably because you don’t have equal number of contracts in each leg?

On Sun, Sep 5, 2021 at 12:50 <groups@...> wrote:







I originally submitted this combo order with api and got invalid combo order error.? I then entered in TWS desktop and got the same error. I‘m not sure if this is a bug on the TWS side or not?


 

thanks for the reply.? Hmm, I didn't know that we need equal number of contracts in each leg.? Is this a limitation for combo with >=3 legs?


 

On Mon, Sep 6, 2021 at 06:10 AM, <groups@...> wrote:
Hmm, I didn't know that we need equal number of contracts in each leg.? Is this a limitation for combo with >=3 legs?
Ultimately, that's a "custom" combo order.? Not all exchanges allow them, so TWS isn't going to allow it on a smart route.? I'm not sure if they'll allow it on a directed route either, there's so little flow of those orders, they prove more annoying than they're worth.

Now if you're always going to execute them MKT, you can send them to me and I'll gladly rip you off executing them.??


 

Thanks for the reply.

Actually I don't even need it to be guaranteed.? Smart routed or not also doesn't matter to me.? Would it be possible?
What I really want to do is to check the margin difference if I close all these positions but so far I haven't found a way to do so programatically.


 

On Mon, Sep 6, 2021 at 04:17 PM, @jiamin wrote:
What I really want to do is to check the margin difference if I close all these positions but so far I haven't found a way to do so programatically.
That's probably the other reason they don't allow it, the orders you included don't margin against each other well.??

In this case, you're best off with a +4 and -1 call spread..? and then the long puts as a second order.? And then add the margin's from each.??


 

Thanks for the reply.? I am thinking about how to decouple the combo, get the margin of smaller pieces and aggregate them together.? Should I always split into calls and puts and stocks and add them together?? or split into long positions and short positions and take the maximum?? I cannot sort my head clear how should the "splitting" logic work so that I can implement them.?

Also,? is it possible to access the margin report programatically?? I know with flex query it is possible to get it with api, but i am not sure if it's possible with margin report.?


 

On Tue, Sep 7, 2021 at 01:10 PM, @jiamin wrote:
Thanks for the reply.? I am thinking about how to decouple the combo, get the margin of smaller pieces and aggregate them together.? Should I always split into calls and puts and stocks and add them together?? or split into long positions and short positions and take the maximum?? I cannot sort my head clear how should the "splitting" logic work so that I can implement them.?
You need to separate them into standard combos.. if you don't know what those are, I'd suggest you go take an options course.. and well, you probably shouldn't be trading options if you don't already know the basics for options and margining.? Or more accurately, IB should not be allowing you to trade options if you haven't proven competence already.


 

The central question, I want to know the maintenance margin impact of this order.?

There are obviously multiple ways to separate this non-standard combo.? So the question is Which way to separate this combo into standard combos so that the question in the first line can be solved.? ?Can you provide some answers in this case? More specially?
-- What will be your way to separate into smaller combos? For example,? into calls and puts
-- and how to combine the maintenance? margin of smaller combos? For example, add?


 

Honestly I think you may want to zoom out, you are fixated on a particular solution that might not even really solve your problem.?? Can you explain more about your strategy and why you need those orders in the first place?

Options are a very slippery slope and you should definitely tread carefully... if you don't know what you're doing you really should go learn first before playing with the API.


On Wed, Sep 8, 2021 at 6:13 AM <groups@...> wrote:
The central question, I want to know the maintenance margin impact of this order.?

There are obviously multiple ways to separate this non-standard combo.? So the question is Which way to separate this combo into standard combos so that the question in the first line can be solved.? ?Can you provide some answers in this case? More specially?
-- What will be your way to separate into smaller combos? For example,? into calls and puts
-- and how to combine the maintenance? margin of smaller combos? For example, add?


 

I know what I am doing. Thanks for checking with me.?

Now with the API,? I am just in "read-only" mode.? And the current task is to read out the margin report of my portfolio, namely the maintenance margin of each symbol.? ?If you are familiar with the margin report provided by interactive broker,?? this is what I want to get, programatically.? And if's not possible, I want to get an approximation.? Does this "read-only" look reasonable?


 

On Wed, Sep 8, 2021 at 09:08 PM, @jiamin wrote:
Does this "read-only" look reasonable?
Does this "read-only" task look reasonable?


 

On Wed, Sep 8, 2021 at 09:08 PM, @jiamin wrote:
I know what I am doing. Thanks for checking with me.?
Evidence seems to be to the contrary if you ask me, you seem to be stumbling on basic building blocks regarding how margin works...

Anyhow, split the custom combo into "regular" combos which have offsetting margin legs.? and then, yes, add..? It'll all be an approximation, as IB tends to be extremely conservative with the margin buffers.? But short of building your own PM margining system and plugging in all of the IB rules and factors, it's the closest you'll get.

or call the margin report directly and parse the xml for yesterday's values.?


 

"Now if you're always going to execute them MKT, you can send them to me and I'll gladly rip you off executing them. "

Can you really send a transaction directly to another individual to fill?

On Mon, Sep 6, 2021, 6:41 AM Peter Drier <peter.drier@...> wrote:
On Mon, Sep 6, 2021 at 06:10 AM, <groups@...> wrote:
Hmm, I didn't know that we need equal number of contracts in each leg.? Is this a limitation for combo with >=3 legs?
Ultimately, that's a "custom" combo order.? Not all exchanges allow them, so TWS isn't going to allow it on a smart route.? I'm not sure if they'll allow it on a directed route either, there's so little flow of those orders, they prove more annoying than they're worth.

Now if you're always going to execute them MKT, you can send them to me and I'll gladly rip you off executing them.??


Nick
 

开云体育

That was a tongue-in-cheek remark. The OP was saying that using market orders is a good way to get a bad price.


On 9/9/2021 1:01 PM, Bruce B wrote:

"Now if you're always going to execute them MKT, you can send them to me and I'll gladly rip you off executing them. "

Can you really send a transaction directly to another individual to fill?


 

On Thu, Sep 9, 2021 at 06:19 PM, Peter Drier wrote:
Anyhow, split the custom combo into "regular" combos which have offsetting margin legs.? and then, yes, add
If you mean splitting into calls and puts and then add, it is very far from an approximation.?

calls only


puts only


and altogether



By splitting into calls and puts and then add,? the result will be?12903 + 11487 = 24390
But the actual margin is?13073
To me, this is a very bad approximation.? What do you think? Do you have a better way?


 

On Thu, Sep 9, 2021 at 06:19 PM, Peter Drier wrote:
call the margin report directly
is there a way to do this programmatically?? I would love to know.?


 

Yeah, thought so but thought maybe you have a way over the counter or something.

Is there any way for anyone to transfer their shares to anyone else? I hear from IBKR that it is not possible. Only person to same person with another broker is possible but not husband to wife for example.

On Thu, Sep 9, 2021, 1:22 PM Nick <news1000@...> wrote:

That was a tongue-in-cheek remark. The OP was saying that using market orders is a good way to get a bad price.


On 9/9/2021 1:01 PM, Bruce B wrote:
"Now if you're always going to execute them MKT, you can send them to me and I'll gladly rip you off executing them. "

Can you really send a transaction directly to another individual to fill?


 

On Thu, Sep 9, 2021 at 08:37 PM, Bruce B wrote:
Yeah, thought so but thought maybe you have a way over the counter or something.
?
Is there any way for anyone to transfer their shares to anyone else? I hear from IBKR that it is not possible. Only person to same person with another broker is possible but not husband to wife for example.
Yes, I was kidding with my original comment.? One would have to set up a BD to be able to do that, but on the promise of MKT orders only, I'd go through the trouble and gladly keep the half spread on option leap orders..??

And no, you can't transfer shares to a different account because there's no price.? You might have a "value" for your shares, but you legally need a print (with an exchange) to get shares from one account to another.? Technically this could be a cross, where both accounts buy/sell at the same price so there's no spread.? But a broker is (usually) only going to do that if they're getting a per share commission in the process.??


 

On Thu, Sep 9, 2021 at 08:18 PM, @jiamin wrote:
By splitting into calls and puts and then add,? the result will be?12903 + 11487 = 24390
But the actual margin is?13073
To me, this is a very bad approximation.? What do you think? Do you have a better way?
Like I said before: split the custom combo into "regular" combos which have offsetting margin legs.??

I didn't mean splitting into calls and puts.? Or else I would have said that.? We're in a technical forum and I'm a technical person. You're best off assuming I'm being very literal.??

So, go back and get some education on how margin works for options. puts/calls is not the split you want for this case, and that should be very obvious to anyone who's taken the most basic of ~2 day options courses.