¿ªÔÆÌåÓý

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

Re: IBDividends feed

 

Works perfectly, thanks!

Andrew


Re: Anyway to load symbols and dates into IB charts using code (not manually) from Excel?

 

Analyzing dates is more for strategy optimization, not replacing backtesting. ?For example, when analyzing a sample, you want to look or all the times the algorithm lost money. You then compare it to the ones it made money, and then try optimize your factors (doing it graphically). A backtest would only tell you if the algorithm is net positive/negative.?

Just wondering if IB charts save the date and symbol you saved it as. (i.e.: if you save a chart with the ticker "C" and date "12/21/2015, would it be able to load both if you open up the chart?) Learning code right now, so haven't had the chance to pay for IB data fees. . ?



Re: FAPercentage and order size

 

Josh and all,

Thanks a lot for your help. Yes I tried the code for both demo and real accounts. It gives the same message about zero. I also tried to specify 0 in the TotalQuantity and tried not to set the TotalQuantity at all. The former seems to have no effect on the result as I see that the Order constructor by default initializes that field to 0 anyway.

I think for now I'll give up on this allocation method as I'm not yet sure if I'm going to use it anyway in the foreseen future - just attempted to make sure my code supports all options. If one day I'll get back to this method I'll contact IB API support.



On Wed, Jun 8, 2016 at 4:38 AM, jb201448@... [TWSAPI] <TWSAPI@...> wrote:
?

Hi Ed,


Are you testing this in an FA paper account? If you try to place this order in an individual account (account number starting with 'U' or 'DU') you will receive the error message:

Error 100000 321 Error validating request:-'a8' : cause - The size value cannot be zero:


Otherwise in an FA account (starting with 'F' or 'DF') the following code from the sample will execute correctly:


? ? Order faOrderGroupPC = new Order();

? ? faOrderGroupPC.action("BUY");

? ? faOrderGroupPC.orderType("MKT");

? ? // You should not specify any order quantity for PctChange allocation method

? ? faOrderGroupPC.faGroup("All");

? ? faOrderGroupPC.faMethod("PctChange");

? ? faOrderGroupPC.faPercentage("100");

? ??m_s.placeOrder(NextValidId++, contract, faOrderGroupPC);


-Josh




Re: FAPercentage and order size

 

Hi Ed,

Are you testing this in an FA paper account? If you try to place this order in an individual account (account number starting with 'U' or 'DU') you will receive the error message:

Error 100000 321 Error validating request:-'a8' : cause - The size value cannot be zero:


Otherwise in an FA account (starting with 'F' or 'DF') the following code from the sample will execute correctly:


? ? Order faOrderGroupPC = new Order();

? ? faOrderGroupPC.action("BUY");

? ? faOrderGroupPC.orderType("MKT");

? ? // You should not specify any order quantity for PctChange allocation method

? ? faOrderGroupPC.faGroup("All");

? ? faOrderGroupPC.faMethod("PctChange");

? ? faOrderGroupPC.faPercentage("100");

? ??m_s.placeOrder(NextValidId++, contract, faOrderGroupPC);


-Josh



Re: Anyway to load symbols and dates into IB charts using code (not manually) from Excel?

 

I think more typically a backtesting engine would simply extract data from the Tws API and not using its charting capabilities, since there would is no way to plot arbitrary graphs in Tws- for instance showing the performance of a customized strategies over time. However with the IB API however because of the historical data limitations more commonly the data would have to be stored externally anyway, in a database or some other structure.

Its possible to save charts and chart templates in Tws but there isn't a generalized way to automate this.?

Josh


Re: IBDividends feed

 

Hi Andrew,

Try to smart-route rather than direct-route the request, i.e.

Contract contract = new Contract();

contract.symbol("RIO");

contract.secType("STK");

contract.currency("GBP");

contract.exchange("SMART");

contract.primaryExch("LSE");


m_s.reqMktData(101, contract, "456", false, null);


Then the dividend information will be returned.



Josh


Re: Higher Price Resolution on U.S. Equities?

rholowczak
 

In the US we have SEC Rule 612. Here is a decent FAQ about what the rule covers:

?


So clearly market makers can not post quotes (or brokers post limit orders) on Reg NMS securities below a penny increment when the price quote is over $1.00. However it is perfectly legal for a dark pool?to cross orders?or a broker / dealer to internalize two orders at sub-penny increments. You can easily observe this by looking at last trade prices as they come over the tape. You will see many sub-penny prints.

Various US Equity exchanges have been fighting this rule for some time since internalization and dark pool take revenue away from them. so far none have been successful in making a compelling case to the SEC. Although Nasdaq has some price improvement mechanism whereby certain participants (RMO's) can submit orders eligible for price improvement at sub-penny increment ?(http://nasdaq.cchwallstreet.com/NASDAQ/pdf/nasdaq-filings/2012/SR-NASDAQ-2012-129_Approval.pdf)


Re: Higher Price Resolution on U.S. Equities?

 

¿ªÔÆÌåÓý

It is possible for market makers etc to quote improved prices in fractions of a cent on some venues but they're not shown in the NBBO AFAIK. For retail traders luck us, as Nick said, I don't think there is any way to access those quotes reliably.

On 07/06/16 18:24, Nick news1000@... [TWSAPI] wrote:
Tick size means the smallest amount the price can change, as defined by the exchange. There is no point in a higher resolution as the extra digits will always be zero.

I don't trade stocks but I believe sub-penny pricing is not available to retail traders. You should verify the tick size of all instruments you trade.

On 6/7/2016 1:14 PM, keithjmiklas@... [TWSAPI] wrote:
?

Thanks, Stew.


So, are these tick sizes set in stone, or is there some way--in TWS, the API, or otherwise--to lower the tick size?


-- 
Stewart Douglas
sdouglas@...


Re: Higher Price Resolution on U.S. Equities?

Nick
 

¿ªÔÆÌåÓý

Tick size means the smallest amount the price can change, as defined by the exchange. There is no point in a higher resolution as the extra digits will always be zero.

I don't trade stocks but I believe sub-penny pricing is not available to retail traders. You should verify the tick size of all instruments you trade.

On 6/7/2016 1:14 PM, keithjmiklas@... [TWSAPI] wrote:

?

Thanks, Stew.


So, are these tick sizes set in stone, or is there some way--in TWS, the API, or otherwise--to lower the tick size?


Re: Higher Price Resolution on U.S. Equities?

 

¿ªÔÆÌåÓý

It is my understanding that tic resolution is set by the regulators, but that only applies to regular trading hours (RTH) and the lit market.? Dark pools and after-hours venues have their own rules.? I think IB follows the primary rule, penny pricing.

[rwk]



On 6/7/2016 11:14 AM, keithjmiklas@... [TWSAPI] wrote:

So, are these tick sizes set in stone, or is there some way--in TWS, the API, or otherwise--to lower the tick size?



Re: Higher Price Resolution on U.S. Equities?

 

Thanks, Stew.

So, are these tick sizes set in stone, or is there some way--in TWS, the API, or otherwise--to lower the tick size?


Re: Higher Price Resolution on U.S. Equities?

 

¿ªÔÆÌåÓý

Hi Keith

I may be a little out of date, but last time I looked the tick size for most US stocks is 0.01, stocks trading below 1$ have a tick size of 0.001 and stocks above 100,000 (aka Berkshire Hathaway) have a tick size of 0.1

Hope this helps

Stew

On 07/06/16 17:44, keithjmiklas@... [TWSAPI] wrote:
I'm receiving quotes at the penny (USD$0.01) level, while with Forex, I get quotes out to six decimal places.

Is there any way to get more granular quotes for U.S. Equities?



-- 
Stewart Douglas
sdouglas@...


Higher Price Resolution on U.S. Equities?

 

Hey All,


Is there any way to get higher price resolution on U.S. Equities?


I'm receiving quotes at the penny (USD$0.01) level, while with Forex, I get quotes out to six decimal places.


Is there any way to get more granular quotes for U.S. Equities?


Thank you for your help.

Sincerely,

Keith



How to get Uptick Status through API

 

In TWS, some stock contracts have a little red circle next to their contract name.? Hovering the mouse over it says something to the effect of "The SEC Rule 201 ("The Up-Tick Rule") has been triggered ...", and indicates that the up-tick rule in in effect, limiting the prices at which you can sell that stock.

How do I determine whether a contract is in the up-tick state through the API?? There is a shortability tick type that comes through tickString(), but I don't ever get anything in that field, even for stocks with the up-tick rule in place.

Any help/ideas appreciated!



Re: FAPercentage and order size

 

Unfortunately the newest beta 9.72 API gives the same error?10068 - Percent Change orders must have size or percent change but not both...

Seems like it does not work as expected.
Thanks anyway.

On Mon, Jun 6, 2016 at 8:38 PM, Ed Gonen <ed.gonen@...> wrote:
Correction - found it. I'm wondering how this beta is mature. I need to use this in production environment so I'm very careful not to use any pre-release versions. Any opinion on it?

On Mon, Jun 6, 2016 at 8:33 PM, Ed Gonen <ed.gonen@...> wrote:
Thanks for this info. I'm using the latest API_Version=9.71 available at Github. I'll try to look for 9.72. Maybe it was fixed.

BTW - I didn't find where I can download this 9.72 from...

Thanks
E

On Sun, Jun 5, 2016 at 11:32 PM, jb201448@... [TWSAPI] <TWSAPI@...> wrote:
?

Hi Edward,


Do you receive this error when following the example with the sample code in 9.72? - Also at:



Josh





Re: FAPercentage and order size

 

Correction - found it. I'm wondering how this beta is mature. I need to use this in production environment so I'm very careful not to use any pre-release versions. Any opinion on it?

On Mon, Jun 6, 2016 at 8:33 PM, Ed Gonen <ed.gonen@...> wrote:
Thanks for this info. I'm using the latest API_Version=9.71 available at Github. I'll try to look for 9.72. Maybe it was fixed.

BTW - I didn't find where I can download this 9.72 from...

Thanks
E

On Sun, Jun 5, 2016 at 11:32 PM, jb201448@... [TWSAPI] <TWSAPI@...> wrote:
?

Hi Edward,


Do you receive this error when following the example with the sample code in 9.72? - Also at:



Josh




Re: FAPercentage and order size

 

Thanks for this info. I'm using the latest API_Version=9.71 available at Github. I'll try to look for 9.72. Maybe it was fixed.

BTW - I didn't find where I can download this 9.72 from...

Thanks
E

On Sun, Jun 5, 2016 at 11:32 PM, jb201448@... [TWSAPI] <TWSAPI@...> wrote:
?

Hi Edward,


Do you receive this error when following the example with the sample code in 9.72? - Also at:



Josh



Re: Anyway to load symbols and dates into IB charts using code (not manually) from Excel?

 

I'm pretty surprised.. Do you know anyway to auto-load symbols/dates onto the TWS charts? It would seem like a task everyone with a backtester would need to do without having to mindlessly type in symbols to view specific dates/symbols (task can be quite tedious with a large enough sample size).?


Re: FAPercentage and order size

 

Hi Edward,

Do you receive this error when following the example with the sample code in 9.72? - Also at:



Josh


Re: earnings/upgrades/estimates etc...

 

Hi Anatoly,

Through the API the only sources of historical fundamental data would be from the Reuters Fundamentals or News services. The Reuters Fundamentals give information about historical earnings and dividends through reqFundamentals.?



Josh