Well, as I said, I really don't understand why you're seeing something different from me. For me, it just works.
?
The only thing that does occur to me is that perhaps the condition is actually being accepted and the error occurs when parsing something else in the API message ¨C maybe you have some extraneous field set?
?
So can we make sure we're both doing exactly the same thing.
?
On the Conditional Orders worksheet, the only fields I set in the first order row are as follows ¨C all other fields are blank:
?
Symbol:???????????????????????????? IBM
Type:???????????????????????????????? Stock
Exchange:???????????????????????? SMART
Currency:????????????????????????? USD
Action:????????????????????????????? BUY
Quantity:????????????????????????? 100
Order Type:????????????????????? MKT
Filled:??????????????????????????????? 0
Remaining:??????? ????????????? 0
Avg Fill Price:??????????????????? 0
Last Fill Price:???? ????????????? 0
Parent Id:???????????????????????? 0
Conditions:????????????????????? last of bid/ask Price of 376589407(NYBOT) is >= 1.2111
?
Then I make sure the first order row (Row 7) is selected, and click 'Place / Modify Order': I find it's necessary to click it twice, as the first click just selects the button ¨C very annoying!).
?
The order is then sent to TWS and the Id and Status columns are updated more or less instantly. The order appears in TWS, and depending on whether the condition is satisfied it sits there waiting or is executed.
?
?
?
?
Hi Richard, thank you for your explanation. I did not explain myself right.
If I leave the decimal point "." on the price then I get the same error 320 and the order is not sent.?
If I just leave an integer amount (without decimal part) then the order is processed and sent to TWS.
So this is really weird because the only thing that produces the error is the decimal point "." on the price condition -> 1.15
What else should I check?
?
El dom., 6 feb. 2022 14:05, Richard L King <rlking@...> escribi¨®:
Joan
?
When the condition is parsed to extract the price value, it uses the following C# statement:
?
Price = double.Parse(value, NumberFormatInfo.InvariantInfo);
?
You'll find this at line 46 of PriceCondition.cs. The NumberFormatInfo.InvariantInfo parameter means that local culture is not taken into account, so commas in a number are taken to be thousands separators (and are ignored). Thus 1,15 is simply parsed as 115.
?
Note that the API uses the invariant culture everywhere when parsing numbers, because otherwise the API would work differently in different regions.
?
So you do need to use a period as the decimal point, not a comma. But if I understand you correctly, you seem to be saying that if you use 1.15 that also gets parsed as 115? I cannot understand that.
?
Also what changed that you are no longer getting the error?