¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

the fields commission, max/min Commission in openOrder state are broken


 

hello friends,

i'm placing whatif orders to get the commission. it's twsapi ver 981.01 for python.?
the state received in openOrder is broken in respect to the commission fields,?
in the following way:

the paper account gives:
? > SELL 90 IWM @ LMT 230.34 [+2.00% : SELL 100.00%]
? ? profit:406.49, commission:1.7976931348623157e+308, profitable:False
? ? minCommission:0.1786933, maxCommission:0.7546933

while the live account gives:
? > BUY 11 IWM @ LMT 219.24 [+0.00% : BUY 12.50%]
? ? profit:None, commission:2.0, profitable:True
? ? minCommission:1.7976931348623157e+308, maxCommission:1.7976931348623157e+308

both accounts are at hk.

sys.float_info.max == 1.7976931348623157e+308

what do you think i'm doing wrong?

thanks in advance,
alex


 

why do you think its wrong? In the first case it lists commissions in the range [0.17, 0.75], in the second case it shows commissions as 2.0. Have you tried the Preview Order button in TWS? It should show the same thing. If two accounts are configured differently they can different commissions for the same or similar orders.


 

hello josh,?

thank you for considering my question.
there are 3 fields related to commissions: minCommission, maxCommission, and commission.
sys.float_info.max is not a reasonable number.
and it appears on different fields on different (types of)? accounts.

acct1 (paper): commission:(sys.float_info.max), minCommission:0.1786933, maxCommission:0.7546933
acct2(live): commission:2.0, minCommission:(sys.float_info.max), maxCommission:(sys.float_info.max)

for my tests i took the max value that is not (sys.float_info.max), but wondered whether it's a real problem.

thanks again,
alex


 

the max_int, min_int, max_float, min_float values mean ¡°no value¡± in the API, similar to NaN in numpy. If an exact commission is returned, you wouldn¡¯t expect to also receive a commission range, so those fields are used as placeholders.?