01-12-2025, 08:49 AM
HI,
I started a paper trading account with IBKR and downloaded the IB Gateway 10.30.
I followed the settings detailed below with Port 4002 and Paper trading account number DUHXXXXXX.
After pressing the "Start" button, I received a prompt window that says Account DUHXXXXXX not licensed (token [117425]).
I also copy here the Account Log
========================================================================
[12/1/2025 9:40:06 pm][----] [ INFO] [ Start] Started by user
[12/1/2025 9:40:08 pm][----] [ ERROR] [ EW Exception] System.Net.Sockets.SocketException (0x80004005): No connection could be made because the target machine actively refused it 127.0.0.1:4002
at System.Net.Sockets.TcpClient..ctor(String hostname, Int32 port)
at IBApi.EClientSocket.createClientStream(String host, Int32 port)
at IBApi.EClientSocket.eConnect(String host, Int32 port, Int32 clientId, Boolean extraAuth)
[12/1/2025 9:40:08 pm][----] [CRITICAL-ERROR] [ Connect] Cannot connect to IB [127.0.0.1:4002:0]
[12/1/2025 9:40:08 pm][----] [ ERROR] [ BrokerConnect] Could not connect to 127.0.0.1:4002.
Please verify that IB Gateway or TWS is up and running.
Also verify that the IB settings are correct on both APM and the Gateway (i.e. port, IP, client ID)
[12/1/2025 9:40:08 pm][----] [ ERROR] [ EW CodeErr] -1:504:Not connected
[12/1/2025 9:40:08 pm][----] [ ERROR] [ EW CodeErr] -1:504:Not connected
[12/1/2025 9:42:56 pm][----] [ INFO] [ Start] Started by user
[12/1/2025 9:42:57 pm][----] [ ERROR] [ EW CodeErr] -1:2158:Sec-def data farm connection is OK
ecdefil
[12/1/2025 9:42:57 pm][----] [ INFO] [ BrokerStart] Found account list DUH253879
[12/1/2025 9:42:57 pm][----] [ INFO] [ AccountSummary] Acct Summary. ReqId: 9000, Acct: DUH253879, Tag: Currency, Value: BASE, Currency: BASE
[12/1/2025 9:42:57 pm][----] [ INFO] [ AccountSummary] Acct Summary. ReqId: 9000, Acct: DUH253879, Tag: RealCurrency, Value: SGD, Currency: BASE
[12/1/2025 9:42:57 pm][----] [ INFO] [ ContractDetails] Loading contract details for all positions. This might take a while...
[12/1/2025 9:43:07 pm][----] [ ERROR] [ License] Error downloading or writing license file
[12/1/2025 9:43:07 pm][----] [ ERROR] [ License] Bad Request
[12/1/2025 9:43:07 pm][----] [ ERROR] [ License] Could not find license file
[12/1/2025 9:43:07 pm][----] [ INFO] [ Broker] Connection closed
====================================================================================
Can anyone advice me what have I not done correctly please?
'
thank you.
I started a paper trading account with IBKR and downloaded the IB Gateway 10.30.
I followed the settings detailed below with Port 4002 and Paper trading account number DUHXXXXXX.
After pressing the "Start" button, I received a prompt window that says Account DUHXXXXXX not licensed (token [117425]).
I also copy here the Account Log
========================================================================
[12/1/2025 9:40:06 pm][----] [ INFO] [ Start] Started by user
[12/1/2025 9:40:08 pm][----] [ ERROR] [ EW Exception] System.Net.Sockets.SocketException (0x80004005): No connection could be made because the target machine actively refused it 127.0.0.1:4002
at System.Net.Sockets.TcpClient..ctor(String hostname, Int32 port)
at IBApi.EClientSocket.createClientStream(String host, Int32 port)
at IBApi.EClientSocket.eConnect(String host, Int32 port, Int32 clientId, Boolean extraAuth)
[12/1/2025 9:40:08 pm][----] [CRITICAL-ERROR] [ Connect] Cannot connect to IB [127.0.0.1:4002:0]
[12/1/2025 9:40:08 pm][----] [ ERROR] [ BrokerConnect] Could not connect to 127.0.0.1:4002.
Please verify that IB Gateway or TWS is up and running.
Also verify that the IB settings are correct on both APM and the Gateway (i.e. port, IP, client ID)
[12/1/2025 9:40:08 pm][----] [ ERROR] [ EW CodeErr] -1:504:Not connected
[12/1/2025 9:40:08 pm][----] [ ERROR] [ EW CodeErr] -1:504:Not connected
[12/1/2025 9:42:56 pm][----] [ INFO] [ Start] Started by user
[12/1/2025 9:42:57 pm][----] [ ERROR] [ EW CodeErr] -1:2158:Sec-def data farm connection is OK
ecdefil[12/1/2025 9:42:57 pm][----] [ INFO] [ BrokerStart] Found account list DUH253879
[12/1/2025 9:42:57 pm][----] [ INFO] [ AccountSummary] Acct Summary. ReqId: 9000, Acct: DUH253879, Tag: Currency, Value: BASE, Currency: BASE
[12/1/2025 9:42:57 pm][----] [ INFO] [ AccountSummary] Acct Summary. ReqId: 9000, Acct: DUH253879, Tag: RealCurrency, Value: SGD, Currency: BASE
[12/1/2025 9:42:57 pm][----] [ INFO] [ ContractDetails] Loading contract details for all positions. This might take a while...
[12/1/2025 9:43:07 pm][----] [ ERROR] [ License] Error downloading or writing license file
[12/1/2025 9:43:07 pm][----] [ ERROR] [ License] Bad Request
[12/1/2025 9:43:07 pm][----] [ ERROR] [ License] Could not find license file
[12/1/2025 9:43:07 pm][----] [ INFO] [ Broker] Connection closed
====================================================================================
Can anyone advice me what have I not done correctly please?
'
thank you.

