What's the root cause of this failure of placing order

IBPlugin is further development of TWSLink.It is focused for the useage with MetaTrader. But as it is a DLL, you can use it everywhere on Windows which supports DLL, e.g. in Trade Station or C++ applications or make wrapper for Perl, Python etc.

Users who just registered, please write an email to
forum@trade-commander.de
with your username mentioned.
So we can distinguish you from bots.
Thank you
Post Reply
hkenrique
Posts: 28
Joined: Tue Jul 28, 2020 3:23 pm

What's the root cause of this failure of placing order

Post by hkenrique »

Hi,

My plugin has been working well, but today I encounter an issue when placing order:

The return code of order_send function is: -2147483646

-2147483646 is the return code (uid) of the order send function with the plugin:

uid= __ib.order_send(......)

So could someone tell me what this return value means ? Why am I not able to place order into IB account?

board_admin
Site Admin
Posts: 244
Joined: Mon Apr 24, 2017 3:24 pm

Re: What's the root cause of this failure of placing order

Post by board_admin »

the plugin installs a help file where you find all functions documented.
For send order function return values, go to this table please:
C:/Program%20Files/trade-commander.com/IBPlugin/documentation/tbl_general_error_codes.html

Error code
-2147483646
points to a license fault.

All accounts visible in your TWS/Gateway connection, if funded, used or not, need to be covered by license.
If you should not use one or more accounts in your TWS, you can get another login from IB, i believe without costs,
where you just manage accounts in use.

This way, you could avoid to extend license for accounts u do not use.

hkenrique
Posts: 28
Joined: Tue Jul 28, 2020 3:23 pm

Re: What's the root cause of this failure of placing order

Post by hkenrique »

Hi,
Please see the license log, my license won't expire until next year. Could you please confirm if the timeout is on your side and caused the order issue? The order issue occurs during the timeout period indicated in the log.
If so I will need to consider some monitoring on such issue that impacted my daily trading:

Code: Select all

Mon 2021-Nov-29 08:56:37.308711;C:\projekte\brLic\libtools_lic\src\comm\SocketManager.cpp;tcSock::send_message;457;189360;detail;OK
Mon 2021-Nov-29 08:56:37.308711;C:\projekte\brLic\libtools_lic\src\license\clientcomm.cpp;license_client_module::logon;879;189360;important;[OUT] logon request ..
Mon 2021-Nov-29 20:56:40.795892;C:\projekte\brLic\libtools_lic\src\license\clientcomm.cpp;license_client_module::has_server_timeout;422;189360;warning;server timeout minutes=720
Mon 2021-Nov-29 20:56:45.833639;C:\projekte\brLic\libtools_lic\src\license\clientcomm.cpp;license_client_module::has_server_timeout;422;189360;warning;server timeout minutes=720
Mon 2021-Nov-29 20:56:50.876267;C:\projekte\brLic\libtools_lic\src\license\clientcomm.cpp;license_client_module::has_server_timeout;422;189360;warning;server timeout minutes=720
Mon 2021-Nov-29 20:56:55.915969;C:\projekte\brLic\libtools_lic\src\license\clientcomm.cpp;license_client_module::has_server_timeout;422;189360;warning;server timeout minutes=720
.........................
.......................................
Tue 2021-Nov-30 02:59:59.145169;C:\projekte\brLic\libtools_lic\src\license\clientcomm.cpp;license_client_module::has_server_timeout;422;189360;warning;server timeout minutes=1083
Tue 2021-Nov-30 12:58:23.354505;C:\projekte\brLic\libtools_lic\src\license\clientcomm.cpp;license_client_module::license_client_module;64;192676;important;+++ license create:  ibplugin +++
Tue 2021-Nov-30 12:58:23.356506;C:\projekte\brLic\libtools_lic\src\license\lizenzAdmin.cpp;tclicSetup::Setup;1336;192676;important;appname=ibplugin show dialogs=0
Tue 2021-Nov-30 12:58:23.356506;C:\projekte\brLic\libtools_lic\src\license\lizenzAdmin.cpp;tclicSetup::licenseStatus;1675;192676;important;new status=0   unknown
Tue 2021-Nov-30 12:58:23.359509;C:\projekte\brLic\libtools_lic\src\license\lizenzAdmin.cpp;tclicSetup::fromXMLCore;2107;192676;important;feature str=1=1

board_admin
Site Admin
Posts: 244
Joined: Mon Apr 24, 2017 3:24 pm

Re: What's the root cause of this failure of placing order

Post by board_admin »

It is not about expiry, it is about # of IBKR accounts covered by license.
Such error is not in the license log.


Check the order log:

C:\trade-commander.com\ibplugin\configurations\<your_config>\log\api\connection_1\channel_order.log

<your_config> is the configuration used when init. Usually "default".

hkenrique
Posts: 28
Joined: Tue Jul 28, 2020 3:23 pm

Re: What's the root cause of this failure of placing order

Post by hkenrique »

Hi,
Below is the info of my license administration tool. I removed some private info:

more locks used than possible with license temporarily accepted
application = ibplugin
licenser = trade-commander.org
licensee = xxxxxxxxxxxxxx@gmail.com
type = commercial
subtype = online
expiry = 2022-01-04 00:00:00

features = 1=1
locktype = 1
# locks = 1
server = xxxxxxxxxxxxxx
file = c:\trade-commander.com\lizenzen\ibplugin.tclic
processid = 195148

As far as I know there weren't any new accounts created in the IB platform under the current TWS.
The account is actually belonging to my client but I checked in web portal as well as TWS I don't find any clue that multiple trading accounts exist.

Could you please let me know what I should do to confirm the root cause?

board_admin
Site Admin
Posts: 244
Joined: Mon Apr 24, 2017 3:24 pm

Re: What's the root cause of this failure of placing order

Post by board_admin »

Please have a look into your TWS account window.
How many accounts do you can see ?

hkenrique
Posts: 28
Joined: Tue Jul 28, 2020 3:23 pm

Re: What's the root cause of this failure of placing order

Post by hkenrique »

I cannot insert image here, but the account window is not showing anything else. just usual balance and stuff.
No clue of another account that exists.

board_admin
Site Admin
Posts: 244
Joined: Mon Apr 24, 2017 3:24 pm

Re: What's the root cause of this failure of placing order

Post by board_admin »

The error is related to license issue.
Do you have a 2n instance of IBPlugin running ?

What is the order log i pointed to telling ?

hkenrique
Posts: 28
Joined: Tue Jul 28, 2020 3:23 pm

Re: What's the root cause of this failure of placing order

Post by hkenrique »

I had a 2nd license running but now have only 1.
the issue was gone next day and I have been able to place order so far.
I'm convinced that there was some environmental issue.

user108
Posts: 5
Joined: Wed Jan 05, 2022 8:25 pm

Re: What's the root cause of this failure of placing order

Post by user108 »

@hkenrique,

Do you use the script simultaneously on more than one chart? I am havuing a tough time doing this (soory see my other post in this section)... and any help you can offer in terms of a sample script that utilizes a proper order logic and initialization would be great help

Thanx

Post Reply