wagheav darleena warrack

0 views
Skip to first unread message

Rell Jette

unread,
Aug 3, 2024, 1:04:39 AM8/3/24
to hiehenringders

There have been many changes between TWS API V9 and V10, but the one with the most impact is the transition of most "size" fields in classes and method signatures from "int/long" or "double" types to a "Decimal" data type. You need to look at the TWS API source code for the language you are using so see what that means exactly for you, since their approach was a little different for each language. Take a look, for example, at the totalQuantity or filledQuantity fields of the Order class in one of the more recent V10 versions.

"Decimal" math assures stability to the right of the decimal point/comma well beyond what floating point math can achieve. That became important with the introduction of fractional shares and crypto trading. You don't want to lose a small fortune just because trade quantities accumulate impressions every time you do a simple math operation.

"Decimal" types are generally more cumbersome to work with, though, since have to call methods even for simple arithmetic functions such as a.plus( b ).multiplyBy( c ). But details, as I said, are language specific.

Atop excellent answer from Jrgen
I may mention some caveats of Decimal from C/C++ perspectives (that may be source of inspiration for other language)

- On 64 bits machine (and I suspect regardless of the OS) the Decimal is hidden under a "long long" (it maybe language dependent although)
Default use can be seen signed as a __int64 for linking.
Warning, this allow some compilers to cast to/from double without any warning!! (can happen too with cast to/from __int64 or uint64_t)

Otherwise said it use 8 Bytes/ number (The official standard allow 32 bits as well as 128 bits encoding aside of 64 bits, I saw IB using it in 64 bits which is default and good enough)
"Decimal" should NOT be caste directly to a simple type as it use a very specific bits organization. (so different from a double or __int64 that it create huge errors that you will not missed on first run).
If you need type conversion, simplest way is go trough Decimal to String then String to double or int or whatever using regular ASCII to float/etc ...) generally fast enough if done only once.

- FYI: Decimal is not an invention from IB, it is standardized and there are various open source lib, like from Intel or IBM to help supporting it. (And IB does supply a Decimal lib with it's example)

- Once in "Decimal" you should stay in Decimal and use Decimal operators.

There are really no settings you can change. You would have to use a TWS API Version of at least "163" for any of the fractional size rules to work. rossh_yh mentioned that "163" is available in TWS API V10.10 and later. And it sounds like IBKR now requires fractional size support for AUD.USD real-time data.

Your client can also be aware of the maximum API version it understands and, after connection with TWS/IBGW, the highest common version. This is somewhat language dependent again, but in python, for example, these two lines below should be able to print the API version for you and it should print a number of 163 or higher for fractional siye support.

hymagik is correct about the somewhat messy C++ Decimal support and the fact that IBKR has selected a decimal size of 8 bytes (64 bits). To be more precise, IBKR decimal uses a "MathContext with a precision setting matching the IEEE 754R Decimal64 format, 16 digits, and a rounding mode of HALF_EVEN.". I also fully support when hymagik says 'Once in "Decimal" you should stay in Decimal'.

This is an out-of-cycle release which provides PHP 8.0 support to Mautic 4 users, and some other bug fixes. This should allow Mautic users to update their PHP versions before PHP 7 reaches end of l...

Why is it that Ubuntu only support a version for a limited time? Since I have been on this site I have seen many references to particular versions not being supported. What does it actually mean? After this time must a user just use the OS in the state it is in at the date that support ends? Does this mean no more package updates are available?

Or when this support date has elapsed, should the user then abandon the version and install a newer version instead? I am slightly confused with the difference between Ubuntu and Linux here (with Windows you use it until you buy the latest version) and would be grateful if someone could explain the Ubuntu 'lifecycle' (if that is a suitable word).Thanks in advance for your help.

I have to say this are all excellent question and I will go through your excellent questions one part at a time with the small knowledge I have about the Ubuntu ecosystem. I have divided your question into several smaller ones:

Before explaining the time limit for each version (9.10, 11.04, 12.10...) or type of version (Desktop, Server...) we need to first see some variables that are taken into consideration for this time limits. For example, some of them are:

Man Power / Geek Power / Amount of Developers - This is the amount of geeks, developers and in general people that work in the creation of Ubuntu. This is the amount of people that can put some of their time to work on the upcoming Ubuntu release, the current Ubuntu release and/or a previous version of Ubuntu. Right now, with the time periods for support pushed from Servers to 5 years and Desktop to 5 years in LTS and in normal versions to 2 years, this means that the Ubuntu devs have to work in around 9 versions of Ubuntu. As of this writing the versions of Ubuntu that have support are below (you can see a more current list here):

This does not include the work done in 12.10 which is the upcoming version (As of this writing). So in total, right now, there are 10 versions that are getting support. For what I have seen, the 2 versions that get more support are the 12.04 and 12.10 in a somewhat 70%-80% work for 12.10 and 30%-20% for 12.04. Of course if we take into account the other previous versions of Ubuntu that are getting support it would be something a percent bigger for the upcoming release, followed by the second biggest percent for the current release and then followed by several almost equal percents for each previous version supported. This means in plain english that devs focus more on upcoming and current releases but still do not abandon older, supported ones.

The point of all of this is to get a clear look into the amount of work that needs to be done for this 10 versions of Ubuntu to satisfy and to offer support for all the users of each version. With this in mind we jump to the second part.

With time comes new hardware, new software techniques and new innovative and smart ways to create new stuff and to make old stuff better. For example, when Ubuntu 5.10 came out, there was no USB 3.0, Sata 6G or NFC. This also applies to the hardware and software in that time frame. When a motherboard came out, around the time that specific version of Ubuntu came out there was no X hardware invented or developed. There was no GCC with better X properties and Y compiling times.

This means that for each new version that comes out, Ubuntu tries to absorb whatever new technology that comes out in the world. This helps the development a lot if the time frame between releases is short, since having a time frame between version of, let us say, 10 years, would mean that it would need to adopt all technologies in that time.. THAT IS A LOT!. Having it in one year also means that users might not get the updates they want or that special version of the program they use in time. A balanced time frame therefore is the release cycle of 6 months. That is why in this example the release cycle is a 6 month time period. So anything that happens in the next 6 months can be applied to the new version (To some degree of peace of mind for the developers I may add).

c01484d022
Reply all
Reply to author
Forward
0 new messages