Hi,
I made an efs which automatically generates orders in Trader Work Station (TWS from Interactive brokers). This efs makes use of the dynaorder host software. For most of the futures i trade the efs works fine, but for futures which needs an price format xxx.xx such as the bund fe 113.01, I get the error message from TWS stating that the price format of the order is not correct.
Inspecting the problem further i found that the efs generates a price fe 113.00999 instead of 113.01. I use the following code:
function buylimit (limitprice){
rnd(limitprice,2);
limitprice.toFixed(2);
if (backtest ==0){
var OID = dots5.call ("BuyLimit", symbolName, symbolType, symbolExpiry, rightInfo, strikePrice, eXchange, cUrrency, 1,limitprice);
return (OID);
}
else if (backtest == 1){
btestcounter++
return (btestcounter);
}
}
I thought that the rnd function and .toFixed(2) would correct this problem, but apparently this is not the case.
Can please somebody help me with this problem??
Thanks
Ruurd H.
I made an efs which automatically generates orders in Trader Work Station (TWS from Interactive brokers). This efs makes use of the dynaorder host software. For most of the futures i trade the efs works fine, but for futures which needs an price format xxx.xx such as the bund fe 113.01, I get the error message from TWS stating that the price format of the order is not correct.
Inspecting the problem further i found that the efs generates a price fe 113.00999 instead of 113.01. I use the following code:
function buylimit (limitprice){
rnd(limitprice,2);
limitprice.toFixed(2);
if (backtest ==0){
var OID = dots5.call ("BuyLimit", symbolName, symbolType, symbolExpiry, rightInfo, strikePrice, eXchange, cUrrency, 1,limitprice);
return (OID);
}
else if (backtest == 1){
btestcounter++
return (btestcounter);
}
}
I thought that the rnd function and .toFixed(2) would correct this problem, but apparently this is not the case.
Can please somebody help me with this problem??
Thanks
Ruurd H.
Comment