¿ªÔÆÌåÓý

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

Re: Stop loss and take profit for single leg of option combo

Matthias Frener
 

No idea about how to solve this technically, just my cents about the general idea:
I would re-think the whole algo, trying to avoid stop-orders on options completely.
In general, when you use stops on options you will face many issue like: how do you trigger? On last trade price? This can cause huge slippage, because if that contract does not trade for hours while the bid/ask moves against you, your order does not trigger as well. Trigger on the bid/ask? Will stop you out each time spread widens or IV increases, even if the underlying does not move at all.
To manage risk on your option positions, I would rather look into hedging strategies than relying on stop-orders.
If you do debit spreads, set spread and position size up in a way so that it reflects the risk you want to take. You cannot lose more than the premium you paid, so unless you have over-leveraged, there is no need for stop-loss (isn't that the whole point why do a spread vs just a naked long?).
If you do credit spreads, delta (sell/buy the underlying against your options position) and gamma hedging?(you already do, it's the long leg)?is usually the better choice than stopping out in a hurry at the worst possible moment.


Re: Excel DDE formula reference (to transmit orders) available?

 

I think this DDE technology is just designed to get data from IB and not to send data (orders) to IB. I don't know if this will be available in a future... in order to be able to send orders


El dom, 12 sept 2021 a las 10:47, Marcus (<marcus.riemenschneider@...>) escribi¨®:
Hello guys,
can anyone please tell me the correct syntax how orders are transmitted from Excel to TWS via DDE?

On this website I can only see how data can be received but there is no description how orders are transmitted:


I want to transmit stop limit orders with a bracket order (tp and sl) and I saw in a video that I have to do this with a parent order and two child orders but I have no idea where I find a syntax similar to this formula which I found on the website above:?=S[twsuser]|tik!'id[reqestId]?req?[symbol]_[sectype]_[exchange]_[currency]_~/'

Any help is appreciated.


Re: reqFundamentalData not working this week

 

Looks like this is only calendar, RESC is still not available, I am looking for analyst estimate so I can easily compare earning report, is there an easy way to do it


Excel DDE formula reference (to transmit orders) available?

Marcus
 

Hello guys,
can anyone please tell me the correct syntax how orders are transmitted from Excel to TWS via DDE?

On this website I can only see how data can be received but there is no description how orders are transmitted:


I want to transmit stop limit orders with a bracket order (tp and sl) and I saw in a video that I have to do this with a parent order and two child orders but I have no idea where I find a syntax similar to this formula which I found on the website above:?=S[twsuser]|tik!'id[reqestId]?req?[symbol]_[sectype]_[exchange]_[currency]_~/'

Any help is appreciated.


Re: reqFundamentalData not working this week

 

umm .. I'm not an expert at this, but has reqFundamentalData been depreciated and replaced with something else?

Current reference to reqFundamentalData .

Alternate way to request fundamental data .

KH


Re: reqFundamentalData not working this week

 

Hi all,
Is there any solution for above issue??
I have same issue with RESC (?Code: 430 - The fundamentals data for the security specified is not available.)

Thanks.
Gen.


Stop loss and take profit for single leg of option combo

 

I plan to have an algorithm using following strategy:
1. Open option spread with long and short leg.
2. Set stop loss and take profit for short leg only, since it is more important to close this short than to wait for fill on both legs.
3. Optionally close long leg if there is a fill.

I tried creating a bracket order, which would handle steps 1 and 2, unfortunately child orders need to have the same legs as parent order, so that didn't work.
Unless there is something I am missing I am considering one of these ideas:
1. Open order for long leg -> listen to execution reports -> open order for short leg with bracket stop loss and take profit.
This would ensure that short leg is always bracketed, but might create issues from legging into position
2. Open order for long-short spread -> listen to executions -> open stop loss and take profit orders for short leg, in OCA group.
This would ensure ensure proportional execution of the spread, but might leave short leg without bracket orders.

Any suggestions?


erlang ibkr interface

 

hey guys
i am a long time lurker and had a quick query and was wondering if someone might have encountered a similar problem ie trying to ibkr api from erlang beam vm and might have a possible pointer or solution
?
the link shows erlang being used to place orders
but i cannot find?an erlang based library to access the ibkr tws api?
i was wondering if you had access to such a solution even home brewed and are not unwilling to share ?
if not would be good to have pointers as erlang has nice soft real time guarantees that would be beneficial?to our order management?system?


Re: Why is this order invalid and rejected?

 

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.


Re: Why is this order invalid and rejected?

 

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.??


Re: Why is this order invalid and rejected?

 

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?


Re: Does option combo guarantee full execution of leg ratios?

 

Quantity 1 with ratio 5 and 5 is invalid.?
You have to change it to quantity 5 with ratio 1 and 1.? And in that case, it would be possible that only 2 out of 5 combos are filled.?


Re: Why is this order invalid and rejected?

 

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.?


Re: Why is this order invalid and rejected?

 

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?


Re: Why is this order invalid and rejected?

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?


Re: Why is this order invalid and rejected?

 

"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.??


Re: Why is this order invalid and rejected?

 

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.?


Re: Does option combo guarantee full execution of leg ratios?

 

Thank you


Re: Does option combo guarantee full execution of leg ratios?

 

Ratio is always guaranteed, but not the quantity. For instance, if your final order is 3 butterflies: +3 CALL 4395?? -6 CALL 4420?? +3 CALL 4445, then you need first to find the smallest leg ratio possible (Greatest Common Factor) and the order would then be: +1 CALL 4395?? -2 CALL 4420?? + 1 CALL 4445 with an order qty of 3.
Maybe only one butterfly will be executed, and 2 will be left working, but for sure the ratio of the 3 legs executed will be respected (+1 -2 +1). A combo contract is executed 'as is' or not.


Re: Does option combo guarantee full execution of leg ratios?

 

You can still get partial fills like you describe. Then it depends also on which options you choose. Not all combos can be transmitted as guaranteed.