Keyboard Shortcuts
Likes
- Twsapi
- Messages
Search
Re: using EWrapper::fundamentalData
Thanks J_G,
now I have studied the old posts in the group and found many references to other sites to get fundamental financial data.
Now I am in data hell. For example, I tried to compare fundamental data on EBIT and EBITDA of CRM (Salesforce) from a few different sites and could not find matching data. It is very frustrating. For EBIT, I found an acceptable match between SeekingAlpha and TWS (IBKR) and SimFin. However only SimFin has 15 years of historical data. ?
Does anyone have any suggestions on which data is more reliable among: - SeekingAlpha (historical data not old enough from what I see and not easily reachable via API) - macrotrends - SimFin - Zacks - hedginglabs - alphavantage - eodhd - financialmodel grep - polygon - ... |
Re: How do I find out the margin requirements for a US stock through the TWS API?
On Sun, Nov 24, 2024 at 8:25?AM J G via <windmill_1965=[email protected]> wrote:
yes, and all this information is available before entering the trade, and I should be able to deduct the result myself, without a 'what if' order. ideally for example based on values in accountSummary(), such as?AvailableFunds-S ? |
Re: How do I find out the margin requirements for a US stock through the TWS API?
I don't think that it is counter-intuitive. Whether an order would go through may depend on many parameters. For example what other positions are already in your portfolio, and how much free cash you have available. Besides the size of the intended order. The margin required is therefore depending on the situation and can only be analyzed by submitting a "what-if order". |
Re: Best practice for cancelmktdata
It used to be the case that you can send a maximum of 50 messages per second via the API. So you would need to include some waiting time if you need to send more messages. However, latest versions of the API have a pacing function built-in. So it would not help if you include any waiting time when you send your messages. In my case: even though the pacing function is there, I still include some waiting time in case I send a batch of messages that is longer than 50 messages. |
Re: How do I find out the margin requirements for a US stock through the TWS API?
Well, it sounds very anti-intuitive that one cannot determine if a trade will go through by using data available at the time of entering a trade - but has to 'reverse engineer' by issuing 'what if' trades and seeing their result. Is this really the case? On Sat, Nov 2, 2024 at 6:35?PM ´³¨¹°ù²µ±ð²Ô Reinold via <TwsApiOnGroupsIo=[email protected]> wrote:
|
Re: using EWrapper::fundamentalData
You use reqFundamentalData to request certain data. The requested data is then sent to you via fundamentalData. However, as you already mention, is the request reqFundamentalData deprecated. Meaning that if you can't request data, then implicitly no data can be sent to you.
If you search in this group you will find multiple topics, all related to the fact that fundamental data has been deprecated. |
Best practice for cancelmktdata
Hello I am currently have this in a foreach loop using
?
?
My question is should i add sleep between each canceltickerid, I am batching about 300 canceltickerids at once and the tick call backs for each canceltickerids keeps firing,? On the log for example I could call canclemktdata for a specific tickerid and for up to 2 minutes I may still get tick call backs for that partciular tickerid, Will adding sleep allow for faster processing or should i do smaller batches? |
Re: API call: Error validating request.-'bF' : cause - Please enter a stop price
The TWS documentation on orders is most useful when you want to determine, which order object fields need to be initialized. But that documentation does not give you any details on exactly what the different order types (or algos) do, what thez are intended for, or what their major limitations are. Richard gave you an overview of the STP, STLMT, and "IF TOCUHED" orders, but I recommended that, if you have not done so yet, you spend some time with this IBKR "" explorer. Here the . ´³¨¹°ù²µ±ð²Ô ? ?
On Fri, Nov 22, 2024 at 12:01 PM, Danny wrote:
.. |
Re: API call: Error validating request.-'bF' : cause - Please enter a stop price
¿ªÔÆÌåÓýFor a sell order, you only use stop or stoplimit when the market is above the trigger price (ie the AuxPrice). When the price drops to the trigger price, either a market or a limit order is then entered into the exchange. So you can use this to exit from a long position (this is typically a stop-loss, but it can alternatively be a profit taker if the position is currently in profit). ? You can use a buy stop or stoplimit to enter a new position, in which case market price must be below the trigger price. ? Be careful not to confuse a stop or stoplimit ?order with a ¡®stop-loss¡¯ order: stop and stoplimit orders are specific types of order, whereas a stop-loss order is really a mode of operating that protects a position against excessive loss, and can be of several different types. ? Note also that a market- or limit--if-touched order can also be used either to enter or exit a position, but you wouldn¡¯t use it as a stop-loss. I¡¯ll leave you to think about why that is. You need to make sure you have a clear understanding of these different order types. ? But here¡¯s an example: suppose the market is trading in a range, and you want to catch a breakout from that range in either direction: you could use a sell stop with trigger 1-tick below the bottom of the range, and a buy stop with trigger 1-tick above the high of the range. And you would put both orders in an OCA group so if one order fills, the other is cancelled. ? ? ? ? From: [email protected] <[email protected]> On Behalf Of Danny via groups.io
Sent: 22 November 2024 18:01 To: [email protected] Subject: Re: [TWS API] API call: Error validating request.-'bF' : cause - Please enter a stop price ? ? ? thanks ? Can I use a 'stop limit' for my 2 SELL calls? (one for a stop above the current market and another for below the current market, whichever reaches first) Here it says that a 'stop limit' can only be used for a stop at a price below?the current market, and to use 'Limit if Touched' for a SELL for a price above the current market ? ? Limit if TouchedA??is an order to buy (or sell) a contract at a specified price or better, below (or above) the market. This order is held in the system until the trigger price is touched. An LIT order is similar to a stop limit order, except that an LIT sell order is placed above the current market price, and a stop limit sell order is placed below.
¡¤?????????????????????? Order order = new Order(); order.Action = action; order.OrderType = "LIT"; order.TotalQuantity = quantity; order.LmtPrice = limitPrice; order.AuxPrice = triggerPrice; ? ? |
Re: API call: Error validating request.-'bF' : cause - Please enter a stop price
?
?
thanks
?
Can I use a 'stop limit' for my 2 SELL calls? (one for a stop above the current market and another for below the current market, whichever reaches first)
Here it says that a 'stop limit' can only be used for a stop at a price below?the current market, and to use 'Limit if Touched' for a SELL for a price above the current market
?
?
Limit if TouchedA??is an order to buy (or sell) a contract at a specified price or better, below (or above) the market. This order is held in the system until the trigger price is touched. An LIT order is similar to a stop limit order, except that an LIT sell order is placed above the current market price, and a stop limit sell order is placed below.
|
Re: API call: Error validating request.-'bF' : cause - Please enter a stop price
¿ªÔÆÌåÓýThat message means exactly what it says. ? The API log entries show that you have set the LmtPrice field to 34.71. But it¡¯s the AuxPrice field you need for the STOP price. ? |
API call: Error validating request.-'bF' : cause - Please enter a stop price
Hello all,
?
I am sending 2 STP API calls (to sell at a specific increase and decrease from the current price, whichever reaches first), but I am getting an error message regarding "enter a stop price".
What am I doing wrong? (and what is "bF"?)
Thanks
?
From the API log:
?
SMCI-STK--0.0---SMART-Nasdaq-USD-----SELL-120-STP-34.71
SMCI-STK--0.0---SMART-Nasdaq-USD-----SELL-120-STP-31.2
?
getting:
?
Error validating request.-'bF' : cause - Please enter a stop price
?
Error validating request.-'bF' : cause - Please enter a stop price |
Re: Documentation for OrderCancel? ...
In these situations, I always do the following:
1) I contact IB via support ticket. They will contact someone knowledgeable in the API team that will provide a detailed answer. 2) I read the relevant sections of the source code which is always the best and most updated documentation. Often, I will have managed to find by myself how to proceed before IB replies to my support ticket confirming my findings. Hope this helps. -- |
using EWrapper::fundamentalData
Hello everybody,
is there anyone that use the EWrapper::fundamentalData function instead of the EClient::reqFundamentalData.
The 2nd is deprecated and I should need more fundamental data, so I'd like to use the 1st but I can't find any documentation or example (in any programming language).? Thank you in advance |
Re: Documentation for OrderCancel? ...
Recently, this mailing list was already the venue for an investigation into this apparent breaking change. You can search for the respective tread. As far as I can rely on my memory, the second argument is inconsequential for retail investors and it's OK to use both null and a default new instance. §é§ä, 21 §ß§à§ñ§Ò. 2024 §Ô., 17:06 bdcoder via <bdaviduck=[email protected]>:
--
Best, DS |
Documentation for OrderCancel? ...
bdcoder
Using C# API Version 10.30.01.
?
Only a few weeks into using this API and have noticed the documentation is severely lacking in all areas (which seems to be the state of the programming world these days).? Regardless, I needed to use the cancelOrder method.
?
The shows an example of the cancelOrder method as:
client.cancelOrder(nextOrderId - 1, "");
?
The shows the same example as above.
?
However, the code (downloaded) from IB contains an EClient.cancelOrder method with the following arguments:
? ? ? ? public void cancelOrder(int orderId, OrderCancel orderCancel) ?
The code downloaded from IB shows the default constructor for an "OrderCancel" object as:
? ? ? ? public OrderCancel()
? ? ? ? { ? ? ? ? ? ? ManualOrderCancelTime = EMPTY_STR; ? ? ? ? ? ? ExtOperator = EMPTY_STR; ? ? ? ? ? ? ExternalUserId = EMPTY_STR; ? ? ? ? ? ? ManualOrderIndicator = int.MaxValue; ? ? ? ? } ?
I ended up calling the cancelOrder method as follows, which works ...
?
? ? ? ?cancelOrder( order_id, new IBApi.OrderCancel() );
?
But I am ASSUMING this is OK as I do not receive any errors.? If someone knows of a resource that fully describes the "OrderCancel" object, please post a link.
?
Also, any ideas as to how often the documentation is actually updated?
?
Thanks in advance.
?
?
?
?
?
|
C# code needed to download earnings date data in a CSV
AJ
Hi I'm new to IB API and my coding skills are quite limited. I need someone to help me with my request. I am willing to pay for it if needed. If you are looking for payment then please reply to me privately at below email address with your proposed fee: I need a complete C# code that will contact the IB server, get the data I need, and perform error handling to handle issues. All I need to do is run the code. The data I need is the following in a CSV format: 1. Symbol 2. Day of earning announcement (actual day not proposed or tentative) 3. Time of announcement of date from item 2? 4. Actual EPS 5. Forecasted EPS for the item 4 6. Next scheduled date for earning announcement Note: 1. Limit results to US listed securities only. 2. Include time zone if possible. 3. If IB provides item 2 and 3 as one field then just report that. I can parse the field to get the day and time. 4. One CSV file is produced for each symbol so if there are 5000 symbols then there are 5000 CSV files. 5. Add a variable that let's me indicate the folder where the CSV files are to be stored on my local machine. 6. Be extremely generous in your code comments so every detail is explained. 7. I will not download libraries, DLLs, third party software etc for security purposes so provide your code in plain text format so I can review the code before running it. It is ok to use IB libraries and any libraries that come with C#.?? 8. Retrieve all data for a given symbol. I'm not sure how far back IB data goes so go as far as back as possible. 9. If payment is involved, then payment is made after I have tested the code. I can wait a few weeks for the deliverable after scope and any other details have been finalized.? Any questions please ask. Thank you |
Re: timeout when connecting to TWS Gateway, but existing connection still works
That's a question for IBKR and it has been like this forever. There is a post in our group archive every few months such as this one from August: TWS not connecting throwing a timeout error as port is stuck in (CLOSE_WAIT) state . The workaround is to avoid TCP/IP connections that get closed without sending the "API\0" message and firestorms of several connection requests simultaneously. If you want to learn more about what happens (though you won't be able the change anything), enable verbose/debug logging in TWS, look at the logs, and follow how the port listener thread pool starts dedicated API threads for each connection. For some reason (race condition, missed socket-closed exception, singleton, ...) one of those threads can get locked up if it does not see the "API\0" message, or if the TCP/IP connection gets closed immediately after it has been established. Once that happens, TWS/IBGW can accept more (physical) TCP/IP connections, but it cannot start client conversations any longer until it restarts. ´³¨¹°ù²µ±ð²Ô ? On Tue, Nov 19, 2024 at 11:29 AM, ?kos Mar¨®y wrote:
|
Re: timeout when connecting to TWS Gateway, but existing connection still works
´³¨¹°ù²µ±ð²Ô, What would be the reason for no new TWS API client connections, assuming the client is valid and follows the protocol? What is the limitation here? ?kos On Tue 19 Nov 2024, 18:26 ´³¨¹°ù²µ±ð²Ô Reinold via , <TwsApiOnGroupsIo=[email protected]> wrote:
|