[ts-gen] limits in risk.rb

Nils Gebhardt mail at ngebhardt.de
Mon Sep 1 16:24:27 EDT 2008


Hi,

when going through the example in exs/risk.rb, I noticed that there is a
problem getting the decimals in limit orders right. I.e. if I say 

src3 = "create item 145  #{take_pos} LMT 3 114.51 0.0;

then, along the lines of risk.rb,  I get a resulting order, however the
limit is turned into 114.00 instead of 114.51. Same with selling orders.
Any hints? 

Another thing: with a plain call ./shim --data I get some problem
reports, probably harmless, for example 

Problem: 414 mysql query evaluation failed
Error 1452 (23000): Cannot add or update a child row: a foreign key
constraint fails (`testing/OrderResult`, CONSTRAINT `OrderResult_ibfk_1`
FOREIGN KEY (`ibc`) REFERENCES `Product` (`ibc`))
insert ignore
  into OrderResult(
acc, type, curr, name, expiry, rite, strike, position, price, value,
avg_cost, un_pnl, real_pnl, ibc)
values
('DU33186', 'FUT', 'EUR', 'GBL', '20080908', '0', 0.00, 71, 114.00,
8138729.00, 114818.00, 0.00, 0.00, null);

----------------------%-------%------------------------

and similar lines. 



Thanks,

Nils 




More information about the ts-general mailing list