Keyboard Shortcuts
Likes
- Twsapi
- Messages
Search
Re: Sync local database to portfolio
I think his point is, that the total shares in a position doesn't matter via IBKR because strategies are managed, executed, and tracked separately. Pull a query of all open shares across positions, and you have what should equal IBKRs numbers. There's no way to 'tag' shares via strategs or keep things separate in IBKR like that unless you use different accounts or designate specific instruments to only specific strategies, but, you can develop and build out something out on your end that does keep track of this all. On Sat, Jan 22, 2022, 3:24 PM Bennie <ken360@...> wrote:
|
Re: Sync local database to portfolio
I manage a multistrategy portfolio, and actively track all holdings.? Basically, whenever i have an execution, I make a record of the shares, symbol, price, order action, and strategy via the refid.? At that point it's easy to aggregate by by symbol, strategy, or whatever else you're interested in.
On Saturday, January 22, 2022, 12:34:35 PM EST, Bennie <ken360@...> wrote:
Care to elaborate on how it functions? |
Re: Sync local database to portfolio
I have this setup in AWS timestream db for my personal acct On Sat, Jan 22, 2022 at 10:16 AM Bennie <ken360@...> wrote:
|
Sync local database to portfolio
I am running several trading algorithms in one account. I want to keep track of the holdings in each algo. Portfolio returns the account holdings, but I can find no way to categorize them by algorithm. Orders, Trades, Fills, Executions have an orderRef tag that can be used. Has anyone found a good way to track holdings by strategy? Do you have to periodically poll the Trades to update the database? Where this gets messy is when an Order partially fills, leaving openOrders. Example: Strategy A has 100sh AAPL. Strategy B has 200sh AAPL. Strategy B sells 50sh AAPL. I want to be able to query and know the holdings of each strategy separately, giving Strategy A: 100sh AAPL. Strategy B: 150sh AAPL. Hoping someone has solved this and can share their findings. Thanks. |
Re: Fix Pegged order type?
Yes, I see the same. My orders are placed via a script as well, and I don't click the update button and the trail order has worked fine on its own. The one thing I haven't been able to figure out is how to know what is the current value of the fix pegged order once it's triggered....maybe if I get the order via API and examine it, maybe there is a field that has the value, but I cant see any such thing in TWS. Let us know if anyone knows how to do that.
|
Re: reqPositions API returns nothnig
¿ªÔÆÌåÓý
I'm still having trouble with it.? I updated my IB TWS Gateway to the latest yesterday (10.12.2i) and I was able to pull my positions a couple of times and thought that the issue was the version of IB Gateway.? However, now this morning, it does not work.?
I am using the Java version and I also updated the TWS API.? I don't think the issue is related to my code because it has not changed in months.? Also, when I enable logging on my IB Gateway, I see the following:
Positions were not received for accounts: ***
So to me, that says that the Gateway successfully submitted the request, but received nothing in return.? I see my positions in TWS Desktop and I suspect that uses the same API.? Not sure why I cannot receive the positions via the Gateway.
From: [email protected] <[email protected]> on behalf of tjisana.lewis@... <tjisana.lewis@...>
Sent: Thursday, January 20, 2022 10:14 AM To: [email protected] <[email protected]> Subject: Re: [TWS API] reqPositions API returns nothnig ?
Crow,
Today, reqContractDetails() is returning no data for me at all - was working yesterday and before.? Tried all sorts of debugging to no avail - wonder if someone else is having the same issue.? Did your problem resolve? |
Re: Problem with WHATIF-orders
I'm still fighting with this problem but could now at least isolate that it seems to only occur with options on their expiration day. So if I send an WHATIF order for an option (or a spread) on its last trading day. It would be great if somebody would try to reproduce the problem.
|
Re: Connectivity between IB and Trader Workstation has been lost
A few things you could check. Which installer for TWS do you use? The the "regular" installer that automatically and frequently updates TWS to the next version, or the "offline installer" that requires manual installation of new versions? I can't find the link right now, but IBKR recommends the "offline installer" versions of TWS/IBGW in case you use the "Auto Restart" feature. Otherwise, you might run into these relogin-failures when the auto-restart triggers an auto-update. "Stable" 981 and "latest" 10.12 versions have a pretty high update frequency lately, At least weekly. Not sure what time zone you are in (e.g. what 5am means). But you should schedule the daily restarts well outside of the daily maintenance windows. We are restarting at 16:45 US/Central time and have not seen a failure in a year or two. ´³¨¹°ù²µ±ð²Ô |
Re: reqHistoricalData() for OTC only works if first typed symbol in TWS
The plot thickens.? Found this in the TWS API docs:
"For instance, a historical data request for a pink sheet (OTC) stock which trades on ARCAEDGE will require the subscription "OTC Global Equities" or "Global OTC Equities and OTC Markets" for ARCAEDGE in addition to the regular subscription (e.g. "OTC Markets")" You must have the "OTC Markets" and "OTC Global Equities" subscriptions.? "OTC Markets" is not included in the "US Securities Snapshot and Futures Value Bundle" even though it says, "...?and OTC Markets quotes".? ?Apparently being able to receive a quote is not the same as receiving market data. But this doesn't cover everything.? A contract search for the stock AAIGF returns nothing.? What subscription is needed for this?? The "Market Data Assistant" is unable to find anything for this symbol yet Think or Swim over at TD Ameritrade pulls it up. |
reqHistoricalData() for OTC only works if first typed symbol in TWS
reqHistoricalData() (I'm using Java) only returns results if the symbol is first typed into the TWS platform.? I appear to have this issue only with OTC stocks.? For example, my software can call?reqHistoricalData() all it wants but the?historicalData() callback is never called until I go to TWS and manually type in the symbol the software is looking for.? The next call then produces the proper callback. Any ideas? Thanks! |
Re: Fix Pegged order type?
Thanks for your reply. Thats exactly what I'm seeing - when the trigger price for my adjustable stop order is reached, the Fix Pegged order type appears and the status displays as 'update'. Did you see this status change as well?
This seems to require some manual intervention to click the update button - if a similar order is placed by a script, I'm wondering if theres a way to get around this? |
Re: IB Gateway hardware requirements
Hi there, Machines differ, so you can basically do two things - reduce the memory and cores until you see degradation, or you can work it out from the allocated heap size, memory foot print and apparent loading of the vcpu. You could also monitor the loading to see whether you are running out of any particular resource... Just ideas. Best wishes, M On Fri, 21 Jan 2022 at 10:36, <beganovic.emir+groupsio@...> wrote: Hi, -- +44 (0) 7528 551604? Gulfstream Software - Winner Risk Management Awards 2010 This message is subject to : |
IB Gateway hardware requirements
Hi,
I've been experimenting for a few weeks with IB Gateway in the cloud using IBCAlpha inside Docker containers running on Kubernetes. I've been doing a dozen of trades a day using Python connected to IB Gateway.? I wonder what's the appropriate CPU core count for IB Gateway, and if adding more will benefit anything? It's been running on 2 cores and 4 GB memory allocated to it without a problem so far.? |
Re: Connectivity between IB and Trader Workstation has been lost
toggle quoted message
Show quoted text
On Jan 21, 2022, at 8:34 AM, morrone.marco4 via groups.io <morrone.marco4@...> wrote:
|
Re: Connectivity between IB and Trader Workstation has been lost
I had the same problem since when I started using TWS, but it was not a major problem because after the temporary disconection TWS reconnected automatically. However, in the last two days something has changend. After I get disconnected a pop up winodow shows up giving me two possible options: "Re-Login" or "Exit TWS". To make TWS reconnect and corrertly work with my API systems I have to click on Re-login.
Clearly, since this happen at 5 a.m I am not awake and I am left disconnected until I wake up. Why is this happening and how can i solve it? Thanks |