|
Post by Come_on_Grandad on May 16, 2014 13:43:32 GMT
Yo*****re and Bu***ey have just drawn down. I had an AI mandate set up to buy a target of £1,000 from a holding of zero. From the log, I see that it attempted to buy to the value of £903.50, which is peculiar. It bought 9x£100 parts and also a tiddler, a loan part id 333254 to the value of 34pence, which is also peculiar! The log then shows that AI attempted a further purchase to the value of £3.160000000000025, which is (allowing for rounding) sticking to the strange target after a purchase of £900.34 So chris, can you explain the strange purchase and the 34p unit? Here is a clue: the available to invest figure in my account was, at the relevant time, £1403.50 ... perhaps AI was earmarking £500 of that for something else, and then spending what it thought was all I had left?
|
|
|
Post by chris on May 16, 2014 13:51:12 GMT
AI doesn't earmark funds at the moment, if there's any opportunity to immediately invest cash according the targets you have set then it is taken. The exception is pre-bids where the system deducts your total live pre-bids from your current cash balance when working out how much money you have available to invest.
The 34p loan unit is likely to have been the final few pence that made up the loan. With the ability to bid any amount you wish there is always likely an odd little bit left over at the end.
Parts of AI will operate using floating point arithmetic whereas all transactions happen using fixed precision (to 20 decimal places) so there can be odd discrepancy like the rounding error you highlight. I don't know if that is the cause but suspect it to be the case.
Don't know if that combines to explain what you saw, hopefully it does. Let me know if you still think there's some strange behaviour and I'll look into it properly. Having a bit of a week at the moment so under time pressure.
|
|