¿ªÔÆÌåÓý

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

Re: question about server support and login best practice

 

Thank you Richard for pointing that out and huge thanks for maintaining IBC (and all your prior efforts in IBController as I learned).


On Sat, Feb 20, 2021 at 7:26 PM Richard L King <rlking@...> wrote:

No no no!

?

IBController is a defunct project that is no longer maintained.

?

It was superseded three ?years ago by IBC, which you can find at

?

?

IBC is fully maintained (by me as it happens) and works with every version of TWS/Gateway (a new release is imminent to cope with a change by IBKR in the installation location for the macOS version of TWS/Gateway 981.2r).

?

I don't know why the current owner of the old IBController project persists in not marking it as defunct: it is in no-one's interest to leave it in its current state.

?

Richard

?

?

?

From: [email protected] <[email protected]> On Behalf Of Alex Gorbachev
Sent: 20 February 2021 18:37
To: [email protected]
Subject: Re: [TWS API] question about server support and login best practice

?

I think you should look at IBController -?

Official from IBRK.

?

Or check a docker image like this -?

?

I took the latter and adapted for me.

I also managed to hack my way into running IB gateway on Google Colab to experiment.

?


Re: question about server support and login best practice

 

Sorry for the delayed?reply.. It worked out of the box for me but it uses an old version of the gateway.
I tweaked it to adjust to the latest gateway version but I am currently just using a bastardised version to run inside Google Colab (has to jump through some hoops) for my ongoing experiments.

There are some other docker examples available if you google.

On Sat, 20 Feb 2021 at 16:50 dent <1152dent@...> wrote:

how is your docker image working out for you Alex? GREAT intel by the way. I was wondering about this and the github is EXCELLENT!! thanks so much

On 2/20/21 12:36 PM, Alex Gorbachev wrote:
I think you should look at IBController -?
Official from IBRK.

Or check a docker image like this -?

I took the latter and adapted for me.
I also managed to hack my way into running IB gateway on Google Colab to experiment.

Alex

On Fri, 19 Feb 2021 at 07:37 Stuart Cracraft via <smcracraft=[email protected]> wrote:
My sens is that the current nature of IB is to provide two tools which either can be run.

One is a headful client cumbersmoe and poor UI called TWI and the other is a thinner client.

But that NEITHER of these can be programmed to?

?a) autostart at system boot (I run my clients on AWS and need absolutely no U/I.
? ? ?It is all done in CLI, with NO DESKTOP, to AUTOMATE it.

?b) NEVER require human interaction for the server to authenticate and login to the
? ? ?IB sservers to make paper and cash trades

?c) avoid a ¡°Sunday required U/I human login¡± - what is that? It went out in the 1970¡¯s¡­

My sense is that IB is backwards on the above, does not provide a mechanism for
serverless auto-login password WITHOUT mouse, keyboard, etc. but potentially
with the account + password sitting in a file, run automatically by a Unix/Linux (I use
Ubuntu) daemon, and doing the automation needful with HANDS-OFF.

Please correct me if my above perception is correct or incorrect and then the next question
is why possibly IB would not correct the above and take the final step to automate it all
the way out. This is supposed to be a platform to automate both paper and cash trading
to fully remove emotion and human activity from most market decisions about what to buy
and sell, when to do so, for improved performance.

The best analogy is , , and other platforms
which do ALL the selection and analysis robotically, the rebanacing robotically, and minimize all
human error, as the markets are too error-prone for humans to be in may confer extra security
in situations requiring robotic, boring, precise analysis and actions taken.

Pardon for the length of this question but I never got what think is a bottom line answer from
this list for the above

Stuart Cracraft

P.S. When replying to this email, please ensure you cc my personal email at smcracraft@...

And thanks for taking your time.



Re: How place orders before AND after market hours?

 

That isn't working.? Can you elaborate?? Calling outsideRth(true) does not allow me to trade both before and after market hours.? Details above in my first message.? This apparently requires the correct combination of calling outsideRth(true) and settings in TWS.


Re: How place orders before AND after market hours?

 

¿ªÔÆÌåÓý

You have to set the parameter rth.

Only works for supported markets/products




On 26 Feb 2021, at 09:22, FreeGoldRush <mike@...> wrote:

?Just wanted to give this one more chance to find some expertise.? Is anyone placing orders through the API both before and after market hours?


Re: How place orders before AND after market hours?

 

Just wanted to give this one more chance to find some expertise.? Is anyone placing orders through the API both before and after market hours?


Re: "update order" VS "cancel and creating order"

 

Well, I made the formula up based upon the US portion of the fee table and . There is also the article on that sheds more light on what this is about and the fine print under the examples:
Many exchanges charge fees to their members for orders that are cancelled or modified, and IB charges certain related fees to its customers to help cover these exchange fees. Please note however, that the Modify/Cancel fees listed above are not intended to be a direct "pass-through" of exchange fees. The Modify/Cancel fees that IB charges to its customers may be higher or lower than the fees that an exchange may impose on IB. IB may charge Modify/Cancel fees to its customers for orders sent to exchanges that do not impose such fees, or vice versa.
Just looking at this again I would probably change the wording slightly to:

In the US on each day, no fees are due unless (#Order Modifications + #Order Cancellations) / (#Order Executions) > 25

I don't know for sure, but I assume your example would work like this:
  • You'd get a credit of $0.25 since there was an order execution
  • You also get charged $0.01 since there was an order cancellation
  • So you end up with a net credit of $0.24
  • If that was the only order that day, you'd own nothing, the credit will expire, and you'd start from scratch the next day
But you could reach out to IB for clarification.and let us know what they say.



On Thu, Feb 25, 2021 at 01:41 AM, <tegicof991@...> wrote:
On Wed, Feb 24, 2021 at 12:10 PM, JR wrote
to pay fees if your ratio of (#Orders Cancelled or Modified / #Orders Executed) > 25
Thanks for these facts. Can you provide any IB link to the description of this formula?

You say, the above formula is only valid for direct routed orders, not for SMART.

The #Orders Executed is a little vague for me: Imagine an order with order quantity of 20. If 10 was filled, and 10 not, will this order be registered as already executed? If I cancel the order (where 10 is already filled, and the remaining 10 is discarded), will this order be registered as executed?
So (#Orders Cancelled or Modified / #Orders Executed) = 1 (the quantity of 10 canceled) = 1 (the quantity of 10 filled) < 25. Correct?


Re: "update order" VS "cancel and creating order"

 

On Wed, Feb 24, 2021 at 12:10 PM, JR wrote
to pay fees if your ratio of (#Orders Cancelled or Modified / #Orders Executed) > 25
Thanks for these facts. Can you provide any IB link to the description of this formula?

You say, the above formula is only valid for direct routed orders, not for SMART.

The #Orders Executed is a little vague for me: Imagine an order with order quantity of 20. If 10 was filled, and 10 not, will this order be registered as already executed? If I cancel the order (where 10 is already filled, and the remaining 10 is discarded), will this order be registered as executed?
So (#Orders Cancelled or Modified / #Orders Executed) = 1 (the quantity of 10 canceled) = 1 (the quantity of 10 filled) < 25. Correct?


Re: "update order" VS "cancel and creating order"

 

Is this what you were looking for?

Modifying or cancelling "directed" API orders incur fees. SMART routed orders do not.
But executions get you credits so you only actually have to pay fees if your ratio of (#Orders Cancelled or Modified / #Orders Executed) > 25

From

Cancel/Modify Orders

United StatesUnited States flag
Asset/Order Origin Routing Venue Fee per Order 1 Execution Credit 2
API/CTCI Smart N/A None N/A
TWS Directed and Smart All None N/A
API/CTCI Directed All USD 0.01 USD 0.25 per API/CTCI Directed execution

Orders with a time in force that specifies an expiration time, such as GTC, will be assessed cancel fees according to the above schedule.

for cancel/modify fee examples.


Europe Middle East Africa (EMEA)European Union flag
Asset/Order Origin Routing Venue Fee per Order 1 Execution Credit 2
Direct Routed Order TGATE EUR 0.50 EUR 2.50 per TRADEGATE execution in the same product on the same day

Notes:

  1. Unless otherwise specified, the per-order fee applies to both order cancellations and modifications.
  2. Execution credits are applied against cancel or modify fees for the day. Execution credits cannot exceed cancel/modify fees.


On Wed, Feb 24, 2021 at 02:35 PM, Despair wrote:
I can't remember where I found it but I'm 99% sure I read it somewhere on IB's website. And for my understanding it also makes sense. The cancelation fees purpose is to inhibit HFT like behaviour and this only makes sense for direct routed orders since it simply can't work SMART routed anyway.
Updating an order no matter how it is routed doesn't incur a fee.


Re: "update order" VS "cancel and creating order"

 

I can't remember where I found it but I'm 99% sure I read it somewhere on IB's website. And for my understanding it also makes sense. The cancelation fees purpose is to inhibit HFT like behaviour and this only makes sense for direct routed orders since it simply can't work SMART routed anyway.
Updating an order no matter how it is routed doesn't incur a fee.


Re: "update order" VS "cancel and creating order"

 

I am convinced - updating is better.
Btw, I think updated limit orders are (like new ordes) re-queued into the official orderbook again. But yes, updating is also better for the OrderEfficiencyRatio.

After all, one thing, is not clear for me:

> Despair: only direct routed orders incur a cancelation fee while SMART-routed order don't

Where do you get this information? Is this also valid for updating orders or does upating orders will not incur any fees at all (independent if SMART or not). It's not transparent for me when cancelation fee incurs and when not and if updating orders also involves any fees. Would be great if anyone can share his/her experience.


Re: Shortcut for running number of subscriptions lines/rows left?

 

Thanks for the helpful shortcut.

1- This shows number of TWS / API data subscription lines available (which is always same??) and Top Market Data Count (currently being used).

2- It does not show Market Depth Trader Level (II) usage I think. Or at least that should be using the subscriptions lines but I only see total available subscription lines and not what is being used by Market Depth Trader Level (II).

Is there another shortcut or way in either TWS or API that I can see #2 above?

Thanks,

On Tue, Feb 23, 2021, 5:32 PM ds-avatar <dimsal.public@...> wrote:
Ctrl Alt =

§ã§â, 24 §æ§Ö§Ó§â. 2021 §Ô., 00:45 Bruce B <bruceb444@...>:
Hi,

I have searched but couldn't find on the mailing list and not sure where I read it but there is a shortcut (maybe hotkey) one can use to show the number of rows subscribed to watchlist or market depth level 2. Can someone please post it?

Also, is the same available via API or one has to keep their own tally in their program?

Thanks,


Re: "update order" VS "cancel and creating order"

 

On Tue, Feb 23, 2021 at 11:41 PM, <tegicof991@...> wrote:
I cannot find the benfits of one (cancel_and_create) over the other (editing)
Better to edit:
1.Faster (one operation instead of two)
2. you keep your orderid
3. you also keep your OrderRef, if ever you use it to track/classify your orders
4. If ever you have linked orders (OCA), you keep them linked. If you cancel the parent order, all dependent orders will be cancelled too, and you need to re-create them all


Re: "update order" VS "cancel and creating order"

 

Besides all limitations I'd recommend always if feasible to update an existing order. This is MUCH faster than canceling and resubmitting.

For cancelation fees, isn't it true that only direct routed orders incur a cancelation fee while SMART-routed order don't?


Re: "update order" VS "cancel and creating order"

 

Yes, but I think this only a recommendation and NOT a regulation (which, if not satisfied, can punish you in any way). Does anyone has encountered problems when not fullfilling the "order efficiency ratio"? Don't think so.


Re: "update order" VS "cancel and creating order"

 

Hey, did you even bother to click through to order efficiency policy guidelines from the api web page you linked? "Modification vs. Cancellation - logic which acts to cancel and subsequently replace orders should be substituted with logic which simply modifies the existing orders."

§ã§â, 24 §æ§Ö§Ó§â. 2021 §Ô., 01:43 <tegicof991@...>:

>ds-avatar: may not count under IBKR reasonable order cancellation policy, whereas canceling it will,

I don't understant this. I cannot find any such restriction in . So where do you have this information?


Re: "update order" VS "cancel and creating order"

 

>ds-avatar: may not count under IBKR reasonable order cancellation policy, whereas canceling it will,

I don't understant this. I cannot find any such restriction in . So where do you have this information?


Re: "update order" VS "cancel and creating order"

 

According to there are no hints of any such limitations or any additional information regarding the differences of cancel_and_create versus editing order (besides the "15 active orders per contract per side per account"). It's clear that editing will have the same orderId, but in my case, that's not important for me. And I cannot find any of such costs you describe.

1. I think, (correct me if I'm wrong) IB will charge for changing or cancel orders in dependent to the exchange.
2. The threshold you have to watch with frequent modifications is a maximum of 50 orders per second being sent to the TWS - that's ok. However, I cannot find any other restrictions and the important thing, why I'm asking: I cannot find the benfits of one (cancel_and_create) over the other (editing).

What are your experience? Which one you favour and why?


Re: Shortcut for running number of subscriptions lines/rows left?

 

Ctrl Alt =

§ã§â, 24 §æ§Ö§Ó§â. 2021 §Ô., 00:45 Bruce B <bruceb444@...>:

Hi,

I have searched but couldn't find on the mailing list and not sure where I read it but there is a shortcut (maybe hotkey) one can use to show the number of rows subscribed to watchlist or market depth level 2. Can someone please post it?

Also, is the same available via API or one has to keep their own tally in their program?

Thanks,


Re: "update order" VS "cancel and creating order"

 

You can unconditionally reuse order id when updating it. Also I believe updating the order may not count under IBKR reasonable order cancellation policy, whereas canceling it will, but I'm not completely sure so you might want to check this if it's important for you.

§ã§â, 24 §æ§Ö§Ó§â. 2021 §Ô., 00:54 <tegicof991@...>:

Can someone share experience about what is prefered when editing an existing order?

Should I "cancel it and create a new one" or should I only "edit it" (for example the quantity or price)? What is easier to handle? What must be take into consideration? I think (correct me if I'm wrong), for the official orderbook or the broker, "editing a limit order" is the same as "cancel the limit order and create a new one", because the order is re-queued anyway. So when using the TWS API, it does also not make any differences if "(1) editing an order" or "(2) cancel it and create a new one": (1) = (2). Am I right? Or are there hidden costs (cancellation fee or editing fee) I'm not aware of?

Thanks for your feedback.


Re: "update order" VS "cancel and creating order"

 

I can't answer your question fully but here are two things to consider or add to your question.


1- There are costs (not to TWS but yes to API)? and there is a threshold you have to watch with frequent modifications or IBKR will warn and suspend you?!

2- You have to first answer if there is a benefit to modifying an order VS cancelling and resubmitting (i.e. time advantage in an HFT environment might be faster with modify OR you might still want to get executed even if couldn't modify in time). If that is the case then you want Modify only anyways. But if that is not a concern then disregard #2 and only refer to #1 above.

-Bruce

On Tue, Feb 23, 2021, 4:54 PM <tegicof991@...> wrote:
Can someone share experience about what is prefered when editing an existing order?

Should I "cancel it and create a new one" or should I only "edit it" (for example the quantity or price)? What is easier to handle? What must be take into consideration? I think (correct me if I'm wrong), for the official orderbook or the broker, "editing a limit order" is the same as "cancel the limit order and create a new one", because the order is re-queued anyway. So when using the TWS API, it does also not make any differences if "(1) editing an order" or "(2) cancel it and create a new one": (1) = (2). Am I right? Or are there hidden costs (cancellation fee or editing fee) I'm not aware of?

Thanks for your feedback.