Keyboard Shortcuts
Likes
- Twsapi
- Messages
Search
Re: A couple of questions regarding the C++ Tws api client
It sounds like you are struggling with some of the concepts, Arthur. Such as how Orders may have Executions that become Trades and change the Account Position. If you have not done so yet, fire up TWS, do some manual trading and look at the various windows (orders, trades, account). Every major function in TWS has a corresponding set of requests and responses within TWS API. TWS API is very flexible and you could envision a complex scenario where orders are placed by several clients and, unless you use IBGW for the connection with IBKR, manually through TWS. In order ro manage that correctly:
The and sections have more detail. The C++ compile issue you are experiencing is going on for a while (since the introduction of the Decimal data type during the transition of V9 to V10) and you can find many posts about this in our forum. ´³¨¹°ù²µ±ð²Ô On Fri, Jul 28, 2023 at 11:22 AM, <aSchwenk64@...> wrote:
I try my approach with a set Master Client ID. This sounds interesting. |
Re: trying to get working version of TWS C++ API
i downloaded from ? the linux version. If you have windows go with windows because on linux you have to fix an error first get it build.
If the api client is good enough i cant say, because i am currently working on it my self. try to get it build first then try connect it to the trader work station |
Re: A couple of questions regarding the C++ Tws api client
On Fri, Jul 28, 2023 at 04:22 PM, aSchwenk64@... wrote:
That's been brought up before here. |
Re: A couple of questions regarding the C++ Tws api client
I try my approach with a set Master Client ID. This sounds interesting.
Concerning the bug: If you try to compile the code under linux, you will get errors because the attached libbid.a and so are in Windows format . One need to replace it with the linux version. |
Re: trying to get working version of TWS C++ API
I am happy with any OS where TWS C++ API works -- Windows or Linux. Are you saying that what IB itself provides (no third party GitHub repo) is good enough? I am looking for a few test cases to get market data and then submit and cancel a limit order with?configurable parameters (instrument, limit price etc)? On Fri, Jul 28, 2023 at 12:14?PM <aSchwenk64@...> wrote: Hi, |
Re: A couple of questions regarding the C++ Tws api client
On Fri, Jul 28, 2023 at 03:18 PM, aSchwenk64@... wrote:
You're welcome.
The short answer is: so that you can automate your trading and make or lose money in quantities and time-frames never imagined before :-) But, I suspect the crux of your question may be getting lost in translation. So, apologies in advance if my answer sounds flippant.
You've jammed quite a bit into this so I'll only address what stands out to me which is that you may have neglected to set and use a .
No, but sometimes I wish I were so I could help them avoid some of their questionable design decisions and fix bugs they're "too busy for", lol. Seriously though... if you really think you've found a bug, emailing the feedback address is not be the best course of action. I'd suggest that you first establish, beyond doubt, that it is a bug by bringing the issue up to their support team. More often than not they'll help address the misunderstanding and then triage the bug, internally, if it really exists. If you visit you'll find helpful resources along with an option, further down the page, to report problems and bugs. -Good luck |
Re: A couple of questions regarding the C++ Tws api client
Thank you for clarifying this.
The second question is, why there is such a thing like api orders ? As i see it all the provided callbacks can't see sent orders that are listed in the api tab. if i set the transmit-flag to false in the order object the order is stored in the api tab but i cant "reach" them anymore (and i already looked in the documentation). BTW. Are you a developer at IB ? I found an error in the linux version of the client and emailed it to feedback@... but didn't get any reply. I post the mail here if this is of any use. |
Re: A couple of questions regarding the C++ Tws api client
On Fri, Jul 28, 2023 at 03:10 PM, Malcolm Haylock wrote:
There's a lot of lingo to get used to, it's all part of the fun! As Malcolm mentioned... you don't close an , you close a position. A is established once an order is filled. -Good luck |
Re: A couple of questions regarding the C++ Tws api client
¿ªÔÆÌåÓýThis is a problem with nomenclature. Your order is not open, but you have an open position.You were correct in your first email. To close the position just do the opposite in a new order. Malcolm
|
Re: A couple of questions regarding the C++ Tws api client
Hi,
i place an order and i get the following: ExecDetails. ReqId: -1 - EUR, CASH, USD - 000132b0.64c2e326.01.01, 9, 20000, 20000, 2 OrderStatus. Id: 9, Status: Filled, Filled: 20000, Remaining: 0, AvgFillPrice: 1.10343, PermId: 1476143489, LastFillPrice: 1.10343, ClientId: 0, WhyHeld: , MktCapPrice: 0 This states (i'm not mistaken) that the sent order was executed. If i check the tws server there is a position with -20.000 (as it was a sell order). Then i try to close it by executing ->? m_pClient->cancelOrder(m_orderId, ""); It states: Error. Id: 9, Code: 10147, Msg: OrderId 9 that needs to be cancelled is not found. As i see it, the order is still open. If i send a buy order with +20.000 in quantity i can close it. Cancel implies for me, that if the order isn't executed i can cancel it but not to close an opened order regards, |
Re: A couple of questions regarding the C++ Tws api client
¿ªÔÆÌåÓýHi ArthurMaybe I¡¯m misunderstanding your question, but a filled order does not need to be closed. As far is IB are concerned, a filled order is history. Malcolm
|
Re: A couple of questions regarding the C++ Tws api client
Hello Malcolm,
as a matter of fact i work with the documentation and i'm well aware of the cancel_order function. If my order is filled i get an error that it's not possible to cancel an order that's already filled. Due to this, i suppose that canceling orders is when they are not active. And this is the confusing part. So again my question: What is the proper way of closing an order ? Shall i save the quantity, direction (Buy / Sell) and "construct" an order to "neutralize" the existing one or is there a simpler approach to this ? regards, Arthur |
Re: A couple of questions regarding the C++ Tws api client
¿ªÔÆÌåÓýSounds like you might not have found the documentation, which should be able to help with many things:Malcolm
|
A couple of questions regarding the C++ Tws api client
Dear community,
i have been working with the tws api client (c++) for more than two weeks now. Even after carefully studying the code provided by Interactive Brokers i couldn't manage to find a suitable closing function for the opended Orders. So my first question is: - How is that done properly ? Shall i create a new order to "neutralize" the old one ? For example "Long apple stock with? quantity 3" shall be neutralized with "Sell apple stock with quantity3" . IS this always matched correctly by TWS ? The second one is, why are there "api orders", what is that and why it is different from active orders . This is confusing and i couldn't find an explanation in the documentation. The third and last (for now) is, can it be guaranteed, that for every symbole there is a history of 1 minute candles that at least is, 2-3 weeks in duration ? Thanks in advance, Arthur |
Re: Cancel order lag - sometimes when lag they can fill
well not 100% sure exactly why buti shut off the other instance of the same ticket symbol and just have one going. I watched the price move to the price level while order was cancelled and it was in cancelled state in TWS and it didnt filll. After numerous cancels and resend new orders - everything seems to be well. So interesting that is. thankfully also :) |
Re: I have a hard time doing Paper Trading
Thank you once again ! On Wed, Jul 26, 2023 at 9:20?PM ´³¨¹°ù²µ±ð²Ô Reinold via <TwsApiOnGroupsIo=[email protected]> wrote:
|