Gamestudio Links
Zorro Links
Newest Posts
Fun Arcade Car Physics (nfs style)
by Ezzett. 08/02/26 21:11
ZorroGPT
by TipmyPip. 07/31/26 22:56
Wolfram Mathematica with Zorro
by TipmyPip. 07/30/26 02:07
What are you working on?
by rayp. 07/24/26 22:58
Z9 getting Error 058
by madpower2000. 07/22/26 14:01
New Zorro version 3.11
by jcl. 07/21/26 13:42
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
1 registered members (TipmyPip), 1,491 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
riggi89, shuhari, KD1990, Ephraim, Student_64151
19223 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 4 1 2 3 4
Zorro not reconnecting to IB gateway after restart #488687
04/01/25 01:17
04/01/25 01:17
Joined: Dec 2023
Posts: 16
Paddington
O
opm Offline OP
Newbie
opm  Offline OP
Newbie
O

Joined: Dec 2023
Posts: 16
Paddington
Hi,

I'm having an issue where Zorro doesn't reconnect to the IBKR gateway after the daily restart. As you can see status is green, but no port is open or data sent/recieved. I've tested restart during market hours and outside.

Any help or advice would be much appreciated.

Thanks,
Adam

Attached Files 2025-03-31.png
Re: Zorro not reconnecting to IB gateway after restart [Re: opm] #488688
04/01/25 11:26
04/01/25 11:26
Joined: Jul 2000
Posts: 28,128
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,128
Frankfurt
I don't know a problem with a daily restart, but there is one with the automated weekly gateway shutdown. You must manually close and restart the gateway on any weekend. Zorro needs not be restarted, but the current gateway version won't recover properly from its automated shutdown.

Re: Zorro not reconnecting to IB gateway after restart [Re: opm] #488689
04/01/25 12:38
04/01/25 12:38
Joined: Dec 2023
Posts: 16
Paddington
O
opm Offline OP
Newbie
opm  Offline OP
Newbie
O

Joined: Dec 2023
Posts: 16
Paddington
Hi jcl,

thanks for your response. I'm finding that zorro doesn't reconnect to the gateway after the daily restart, weekly or manual restart. I have to manually stop/start zorro trading after every auto gateway restart.

I've tried multiple strategies and they are all the same. None of them reopen a port in the gateway.

Adam

Re: Zorro not reconnecting to IB gateway after restart [Re: opm] #488690
04/01/25 16:09
04/01/25 16:09
Joined: Feb 2017
Posts: 1,823
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

Joined: Feb 2017
Posts: 1,823
Chicago
Do you have any logs? Set Verbose = 7|DIAG.

Re: Zorro not reconnecting to IB gateway after restart [Re: opm] #488691
04/02/25 01:53
04/02/25 01:53
Joined: Dec 2023
Posts: 16
Paddington
O
opm Offline OP
Newbie
opm  Offline OP
Newbie
O

Joined: Dec 2023
Posts: 16
Paddington
Hi,

yes I've attached an extract of the log file.

Restart occurs at 01:34 UTC. Log either side of restart time below.

Code
Intrabar 45749.06523 (04-02 01:33:56)
BrokerTime=> 2025-04-02 01:33:56 PC 01:33:56: 2 0.019400 ms
UpdatePrices 01:33:56
BrokerAsset EUR/USD 0 => 1  (1.0788 223.380900 ms)
No Quote
Server [2025-04-02 01:33:56   1.07879 *] 01:33:56
Messages 01:33:56
Loop 3879.6 ms
Intrabar 45749.06528 (04-02 01:34:00)
BrokerTime=> 2025-04-02 01:34:00 PC 01:34:00: 2 0.018100 ms
UpdatePrices 01:34:00
BrokerAsset EUR/USD 0 => 1  (1.0788 250.129800 ms)
No Quote
Server [2025-04-02 01:34:00   1.07879] 01:34:00
Messages 01:34:00
Loop 3891.6 ms
Intrabar 45749.06532 (04-02 01:34:04)
BrokerTime=> 2025-04-02 01:34:04 PC 01:34:04: 2 0.025400 ms
UpdatePrices 01:34:04
BrokerAsset EUR/USD 0 => 0  (0.0000 32672.776300 ms)
No Quote
Server [2025-04-02 01:34:04   1.07879] 01:34:37
Messages 01:34:37
Loop 3872.4 ms
Intrabar 45749.06575 (04-02 01:34:40)
BrokerTime=> 2025-04-02 01:34:40 PC 01:34:40: 2 0.018700 ms
UpdatePrices 01:34:40
BrokerAsset EUR/USD 0 => 0  (0.0000 28959.669300 ms)
No Quote
Server [2025-04-02 01:34:40   XXXXX] 01:35:09
Messages 01:35:09
Loop 3879.1 ms
Intrabar 45749.06613 (04-02 01:35:13)
BrokerTime=> 2025-04-02 01:35:13 PC 01:35:13: 2 0.018700 ms
UpdatePrices 01:35:13
BrokerAsset EUR/USD 0 => 0  (0.0000 28679.320700 ms)
No Quote
Server [2025-04-02 01:35:13   XXXXX] 01:35:41
Messages 01:35:41
Loop 3888.6 ms
Intrabar 45749.06650 (04-02 01:35:46)
BrokerTime=> 2025-04-02 01:35:46 PC 01:35:46: 2 0.108200 ms
UpdatePrices 01:35:46
BrokerAsset EUR/USD 0 => 0  (0.0000 28447.444100 ms)
No Quote
Server [2025-04-02 01:35:46   XXXXX] 01:36:14
Messages 01:36:14


Attached Files
TWS_Restart_Log.txt (174 downloads)
Last edited by opm; 04/02/25 08:50.
Re: Zorro not reconnecting to IB gateway after restart [Re: jcl] #488692
04/02/25 13:17
04/02/25 13:17
Joined: Feb 2017
Posts: 1,823
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

Joined: Feb 2017
Posts: 1,823
Chicago
Did you see this?
Originally Posted by jcl
the current gateway version won't recover properly from its automated shutdown.

Which gateway version are you running? Do you have any gateway logs?

Re: Zorro not reconnecting to IB gateway after restart [Re: opm] #488693
04/03/25 00:56
04/03/25 00:56
Joined: Dec 2023
Posts: 16
Paddington
O
opm Offline OP
Newbie
opm  Offline OP
Newbie
O

Joined: Dec 2023
Posts: 16
Paddington
I'm running the latest version and build.

Yeah, jcl references the weekly restart, so I thought daily might be different. Maybe the same issue. Its happening with both the gateway and TWS.

I've looked at the logs, but nothing there. A "client" tab isn't opened either. I'll turn on verbose logging and check it.

Re: Zorro not reconnecting to IB gateway after restart [Re: opm] #488694
04/03/25 10:43
04/03/25 10:43
Joined: Jul 2000
Posts: 28,128
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,128
Frankfurt
I was referring to the weekly shutdown, but if you have set it up for daily shutdown, it's the same. Shutdown requires manually closing and opening the gateway. Zorro can reconnect automatically, you can even set BarMode to let it explicitly disconnect and re-connect, but it won't help. After a shutdown, the gateway is in a state that it does not accept API connections. Only closing it solves that.

I hope that this behavior changes with a new gateway version, but so far, all versions behave this way.

Re: Zorro not reconnecting to IB gateway after restart [Re: opm] #488696
04/09/25 11:02
04/09/25 11:02
Joined: Dec 2023
Posts: 16
Paddington
O
opm Offline OP
Newbie
opm  Offline OP
Newbie
O

Joined: Dec 2023
Posts: 16
Paddington
Hi jcl,

the gateway restarts every day by default. All I can do is change the time. This is what I'm referring to. I know the weekly restart/shutdown is different.

Any thoughts on why it won't reconnect? I can add a video if that helps. The zorro log just shows it isn't restablishing a connection. ¯\_(?)_/¯

I'll try BarMode to force reconnection and set StartDate to NOW, so I don't keep missing trades.

Re: Zorro not reconnecting to IB gateway after restart [Re: opm] #488807
06/30/25 11:54
06/30/25 11:54
Joined: Jun 2025
Posts: 5
ledfoot Offline
Newbie
ledfoot  Offline
Newbie

Joined: Jun 2025
Posts: 5
Did you manage to solve this connection issue?

Re: Zorro not reconnecting to IB gateway after restart [Re: opm] #488958
10/24/25 00:23
10/24/25 00:23
Joined: Dec 2023
Posts: 16
Paddington
O
opm Offline OP
Newbie
opm  Offline OP
Newbie
O

Joined: Dec 2023
Posts: 16
Paddington
Hi, no. Its on my list to investigate again

Re: Zorro not reconnecting to IB gateway after restart [Re: opm] #489020
12/17/25 15:18
12/17/25 15:18
Joined: Jan 2021
Posts: 8
Austin, TX, USA
J
Jack_Zodiac Offline
Newbie
Jack_Zodiac  Offline
Newbie
J

Joined: Jan 2021
Posts: 8
Austin, TX, USA
Hi, is this still the state of things? I am wondering about trying to programmatically issue the re-connect commands to Zorro.

I'm using TWS, and it accepts connection fine after its daily re-start -- but Zorro has to be given 'stop', 'don't close trades', 'do stop trading', and then 'trade' button clicks, load prices, run through the lookback, and then everything works.

Re: Zorro not reconnecting to IB gateway after restart [Re: opm] #489021
12/18/25 08:43
12/18/25 08:43
Joined: Jul 2000
Posts: 28,128
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,128
Frankfurt
We'll soon do a new IB plugin version and will attempt a workaround of the problem on that occasion, although I cannot promise a perfect solution.

Re: Zorro not reconnecting to IB gateway after restart [Re: opm] #489059
12/31/25 21:11
12/31/25 21:11
Joined: Jan 2021
Posts: 8
Austin, TX, USA
J
Jack_Zodiac Offline
Newbie
Jack_Zodiac  Offline
Newbie
J

Joined: Jan 2021
Posts: 8
Austin, TX, USA
I made a work-around for this that seems to be working reliably enough for me. (I consider it a convenience rather than mission-critical.)

It involves using the system() command to kick off another Zorro instance shortly after the TWS restart, and quit() to kill the original one.

My implementation is likely sub-optimal, so comments welcomed. (But, no need to lecture me about global variables.)

I am running 64-bit Zorro C++ scripts on a Windows 11 machine, with an S-level license.

The following code is pieced together from the various functions where it actually resides and hasn't been tested in this exact form, so consider it just a sketch of concept. The core commands are in the last few lines, the rest is infrastructure.

(Edit: oops, I left out showing where Last_Started_Day is written to the state file. In practice I update the state file every 15th minute based on a tod(0) check.)

-----------------------

// Globals
int Last_Started_Day, UTC_offset;
bool SOD_Business, SOD_Business Done, EOD_Business, EOD_Business_Done; // SOD = start of day, EOD = end of day
string State_File;

DLLFUNC void main()
{
// Delay to ensure previous Zorro instance has ended
if (is(TRADEMODE) && is(COMMAND))
{
printf("10 second delay for Zorro instance handoff...");
wait(10000);
}

State_File = "Data\\My_State_File.csv";

// other main() stuff....

}

DLLFUNC void run()
{
if (Bar == StartBar)
{
printf("\n");
printf("\nLoading State File...");

// Script-wide variables
Last_Started_Day = (int)(getvar(State_File, "Last_Started_Day"));
EOD_Business_Done = (bool)(getvar(State_File, "EOD_Business_Done"));

// other state stuff....
}

// TIME ZONE OFFSET
if (dst(EST,0)==1)
{
UTC_offset = -4;
}
else
{
UTC_offset = -5;
}

start_time = 0400 - UTC_offset*100;

// Daily business
SOD_Business_Done = day(0) == Last_Started_Day;
SOD_Business = tod(0) >= start_time && tod(0) < 2300 && !SOD_Business_Done;

if (SOD_Business)
{
Last_Started_Day = day(0);
SOD_Business_Done = true;
EOD_Business_Done = false;

// other start of day stuff ...
}

int EOD_time;
bool EOD_Window;
if (dst(EST,0)==1)
{
EOD_time = 2350;
EOD_Window = tod(0) >= EOD_time;
}
else
{
EOD_time = 50;
EOD_Window = tod(0) >= EOD_time && tod(0) < 200;
}

// TWS daily restart should be set for slightly before the EOD_time. E.g. currently I use 00:30 GMT

EOD_Business = EOD_Window && !EOD_Business_Done;

if (EOD_Business)
{
if (is(TRADEMODE) && Bar > StartBar && !EOD_Business_Done)
{
login(4);
EOD_Business_Done = true;
putvar(State_File, "EOD_Business_Done", (var)(EOD_Business_Done));
wait(10000);
system("Zorro64.exe -trade My_Script.cpp");
quit("!Restarting Zorro session to cope with IBKR lockout.");
}
}

}

Last edited by Jack_Zodiac; 01/01/26 05:07.
Re: Zorro not reconnecting to IB gateway after restart [Re: jcl] #489194
02/18/26 20:51
02/18/26 20:51
Joined: Nov 2025
Posts: 19
C
clint000 Offline
Newbie
clint000  Offline
Newbie
C

Joined: Nov 2025
Posts: 19
Hi, are there any furthe news on this, or suggested workarounds?
I am facing the same issue with the IB Gateway and Zorro. I am using IBC to keep the Gateway logged in after the daily restart, but once the Gateway has been restarted once, Zorro seems to lose the connectivity to it, even if the Gateway is back on line.

Thanks

Re: Zorro not reconnecting to IB gateway after restart [Re: clint000] #489200
02/20/26 18:55
02/20/26 18:55
Joined: Feb 2017
Posts: 1,823
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

Joined: Feb 2017
Posts: 1,823
Chicago

Re: Zorro not reconnecting to IB gateway after restart [Re: AndrewAMD] #489201
02/20/26 23:12
02/20/26 23:12
Joined: Nov 2025
Posts: 19
C
clint000 Offline
Newbie
clint000  Offline
Newbie
C

Joined: Nov 2025
Posts: 19
great many thanks!

Re: Zorro not reconnecting to IB gateway after restart [Re: AndrewAMD] #489230
02/24/26 22:37
02/24/26 22:37
Joined: Nov 2025
Posts: 19
C
clint000 Offline
Newbie
clint000  Offline
Newbie
C

Joined: Nov 2025
Posts: 19
Hi,
I am sorry to say that the IB connection is still not working reliably with the IB Gateway after the upgrade to Zorro v3.01.
There are 2 systematic issues as far as I can gather:

- The first time I press on trade (demo), it connects to the Gateway but does nothing. Then I click on Stop, then on Trade again and it connects to the Gateway and this second time it starts downloading data, etc as normal. This behaviour did not happen with the previous versions of Zorro.

- Every time the Gateway restarts (every day), even if it re-opens and re-logins automatically, Zorro loses the connection to it permanently (red square in the connection status).

Any clue on how to resolve the above?


Thanks

Re: Zorro not reconnecting to IB gateway after restart [Re: opm] #489260
02/26/26 15:17
02/26/26 15:17
Joined: Jul 2000
Posts: 28,128
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,128
Frankfurt
Which Gateway version are you using? And does this happen onyl with the Gateway, or also with the TWS?

Re: Zorro not reconnecting to IB gateway after restart [Re: jcl] #489282
02/28/26 22:12
02/28/26 22:12
Joined: Nov 2025
Posts: 19
C
clint000 Offline
Newbie
clint000  Offline
Newbie
C

Joined: Nov 2025
Posts: 19
Gateway version 10.37, see details below (I have not tried with the TWS)

Build 10.37.1o, Jan 5, 2026 4:05:28 PM
Jolt Build 1.18.12, Sep 5, 2024 06:57:46 PM
Nia Build 2.25.8, Jan 3, 2025 05:52:02 PM
ModelNav Build 1.13.2, Jan 24, 2022 04:59:21 PM
Riskfeed Build 2.48.1, May 7, 2025 11:18:31 AM

Re: Zorro not reconnecting to IB gateway after restart [Re: opm] #489306
03/10/26 12:47
03/10/26 12:47
Joined: Jul 2000
Posts: 28,128
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,128
Frankfurt
We can confirm the Gateway issue. The automated Gateway restart leaves it in an unstable state. It does not accept an API connection in that state. But if you close and restart the Gateway manually, Zorro can connect.

Re: Zorro not reconnecting to IB gateway after restart [Re: opm] #489307
03/10/26 21:30
03/10/26 21:30
Joined: Nov 2025
Posts: 19
C
clint000 Offline
Newbie
clint000  Offline
Newbie
C

Joined: Nov 2025
Posts: 19
Ok, thanks for the confirmation. In order for Zorro S 3.01 to re-connect to the Gateway, does it need any user intervention?

At the moment, when the connection status shows red and I restart the gateway manually, the Zorro connection keeps on being red. It is only when I stop and restart trading in Zorro (Stop --> Trade) that it reconnects and shows as green. I can manage to restart the Gateway automatically every day with IBC and a scheduled task, but it would be great if there was a way for Zorro to re-connect automatically?


Thanks!

Re: Zorro not reconnecting to IB gateway after restart [Re: opm] #489309
03/11/26 13:30
03/11/26 13:30
Joined: Jul 2000
Posts: 28,128
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,128
Frankfurt
Yes, with the new broker command SET_RESTART.

Re: Zorro not reconnecting to IB gateway after restart [Re: opm] #489310
03/11/26 21:44
03/11/26 21:44
Joined: Nov 2025
Posts: 19
C
clint000 Offline
Newbie
clint000  Offline
Newbie
C

Joined: Nov 2025
Posts: 19
OK, very good, many thanks!

However when the connection is red, the first time I click on Trade it connects to the API but it doesn't receive any data (times out and Zorro shows errors 011, 046 and 047 as it doesn't receive any data from the API). Then I need to click Stop and Trade again and the second time it does connect to the API and is able to retrieve data normally.

DId you also experience this issue?

Thanks

Re: Zorro not reconnecting to IB gateway after restart [Re: opm] #489313
03/13/26 00:09
03/13/26 00:09
Joined: Nov 2025
Posts: 19
C
clint000 Offline
Newbie
clint000  Offline
Newbie
C

Joined: Nov 2025
Posts: 19
In case it helps, this is the Log from the Gateway the first time Zorro connects to it after a restart.


2026-03-12 22:43:01.971 [TC] INFO [JTS-SocketListener-55] - State: HEADER, IsAPI: UNKNOWN
2026-03-12 22:43:02.007 [TC] INFO [JTS-SocketListener-55] - State: STOP, IsAPI: YES
2026-03-12 22:43:02.522 [TC] INFO [JTS-SocketListener-55] - ArEServer: Adding 105670462 with id -
2026-03-12 22:43:02.599 [TC] INFO [JTS-SocketListener-55] - eServersChanged: 1
2026-03-12 22:43:02.828 [TC] INFO [JTS-EServerSocketNotifier-101] - Starting async queue thread
2026-03-12 22:43:02.864 [TC] INFO [JTS-EServerSocket-100] - [-:180:180:1:0:0:0:SYS] Starting new conversation with client on 127.0.0.1
2026-03-12 22:43:02.903 [TC] INFO [JTS-EServerSocket-100] - [-:180:180:1:0:0:0:SYS] Server version is 180
2026-03-12 22:43:02.903 [TC] INFO [JTS-EServerSocket-100] - [-:180:180:1:0:0:0:SYS] Client version is 180
2026-03-12 22:43:02.906 [TC] INFO [JTS-EServerSocket-100] - [-:180:180:1:0:0:0:SYS] is 3rdParty true
2026-03-12 22:43:06.839 [TC] INFO [JTS-EServerSocket-100] - Ignoring API request 'jextend.bk' since API is not accepted.
2026-03-12 22:43:06.846 [TC] INFO [JTS-EServerSocket-100] - ArEServer: Removing 105670462 with id -
2026-03-12 22:43:06.848 [TC] INFO [JTS-EServerSocket-100] - eServersChanged: 0
2026-03-12 22:43:06.897 [TC] INFO [JTS-EServerSocketNotifier-101] - Terminating async queue thread
2026-03-12 22:43:06.976 [TC] INFO [JTS-EServerSocket-100] - Cleaning up [serverId: -]...
2026-03-12 22:43:07.063 [TC] INFO [JTS-EServerSocket-100] - Cleaning up [serverId: -]...
2026-03-12 22:43:07.135 [TC] INFO [JTS-EServerSocket-100] - Cleaning up [serverId: -]...
2026-03-12 22:43:07.172 [TC] INFO [JTS-EServerSocket-100] - [ApiAccountAdditionMgr] Cleaning up [serverId=-]...
2026-03-12 22:43:07.226 [TC] INFO [JTS-EServerSocket-100] - ============ EServerSocket messages stats ============
2026-03-12 22:43:07.228 [TC] INFO [JTS-EServerSocket-100] - Number of socket messages pushed to updates queue: 0
2026-03-12 22:43:07.228 [TC] INFO [JTS-EServerSocket-100] - Number of socket messages sent directly: 0
2026-03-12 22:43:07.229 [TC] INFO [JTS-EServerSocket-100] - =======================================================
2026-03-12 22:43:07.235 [TC] INFO [JTS-EWriter1-102] - [-:180:180:1:0:0:0:SYS] Writer thread terminated for socket client{-}.
2026-03-12 22:43:07.269 [TC] INFO [JTS-EServerSocket-100] - There are no API orders being processed.
2026-03-12 22:43:07.269 [TC] INFO [JTS-EServerSocket-100] - SecDefRequestTimeOut: There are no timed out SecDef requests.
2026-03-12 22:43:07.278 [TC] INFO [JTS-EServerSocket-100] - UnhandledOrderPresetRequest: There are no unprocessed order preset requests.
2026-03-12 22:43:07.279 [TC] INFO [JTS-EServerSocket-100] - [-:180:180:1:0:0:0:SYS] Ending conversation with client{-} at 127.0.0.1



After I click on Stop and then Trade again, it works. This is the log:


2026-03-12 22:45:44.196 [TC] INFO [JTS-SocketListener-55] - State: HEADER, IsAPI: UNKNOWN
2026-03-12 22:45:44.197 [TC] INFO [JTS-SocketListener-55] - State: STOP, IsAPI: YES
2026-03-12 22:45:44.205 [TC] INFO [JTS-SocketListener-55] - ArEServer: Adding 1513967017 with id -
2026-03-12 22:45:44.205 [TC] INFO [JTS-SocketListener-55] - eServersChanged: 1
2026-03-12 22:45:44.210 [TC] INFO [JTS-EServerSocket-105] - [-:180:180:1:0:0:0:SYS] Starting new conversation with client on 127.0.0.1
2026-03-12 22:45:44.210 [TC] INFO [JTS-EServerSocketNotifier-106] - Starting async queue thread
2026-03-12 22:45:44.210 [TC] INFO [JTS-EServerSocket-105] - [-:180:180:1:0:0:0:SYS] Server version is 180
2026-03-12 22:45:44.210 [TC] INFO [JTS-EServerSocket-105] - [-:180:180:1:0:0:0:SYS] Client version is 180
2026-03-12 22:45:44.211 [TC] INFO [JTS-EServerSocket-105] - [-:180:180:1:0:0:0:SYS] is 3rdParty true
2026-03-12 22:45:44.531 [TC] INFO [JTS-EServerSocket-105] - Start API message, ClientID=1
2026-03-12 22:45:48.732 [TC] INFO [JTS-EServerSocket-105] - FAController: set useBackEndAliases to false
2026-03-12 22:45:48.760 [TC] INFO [JTS-EMsgPacer-109] - Starting compressor
2026-03-12 22:45:48.767 [TC] INFO [JTS-EMsgPacer-109] - Shutting down compressor. FlatLen:0
2026-03-12 22:45:48.768 [TC] INFO [JTS-EMsgPacer-109] - CM setting requested API account spec to DUO493542.(API)
2026-03-12 22:45:48.783 [TC] INFO [JTS-EMsgPacer-109] - CM Sending current account image DUO493542 to API
2026-03-12 22:45:49.304 [TC] INFO [JTS-QuickMktDataWrapper-112] - Farm cashfarm/UNCONNECTED: Creating ServiceConnection for:cashfarm
2026-03-12 22:45:49.305 [TC] INFO [JTS-QuickMktDataWrapper-112] - Farm cashfarm/UNCONNECTED: Starting connection thread
2026-03-12 22:45:49.305 [TC] INFO [JTS-QuickMktDataWrapper-112] - Added message to queue [serviceName=cashfarm,state=STARTING,size=1]...
2026-03-12 22:45:49.374 [TC] INFO [JTS-cashfarmServiceConnector-114] - Farm cashfarm/STARTING: Connecting natively (cashfarm)...
2026-03-12 22:45:49.375 [TC] INFO [JTS-cashfarmServiceConnector-114] - InnerConnection.connectOrTransfer()[endPoint=ndc1.ibllc.com:4000,serviceType=MARKET_DATA,farmName=cashfarm,usesCcpConman=false]...
2026-03-12 22:45:49.386 [TC] INFO [JTS-cashfarmServiceConnector-114] - InnerConnection.updateEndPointIfNeeded()[endPoint=ndc1.ibllc.com:4000,serviceType=MARKET_DATA,farmName=cashfarm,mainConnUseSsl=true,useSslFarmList=].
2026-03-12 22:45:49.388 [TC] INFO [JTS-cashfarmServiceConnector-114] - Connecting ndc1.ibllc.com:4000 timeout=0...
2026-03-12 22:45:49.388 [TC] INFO [JTS-cashfarmServiceConnector-114] - CONN CALC: Last connection set as now:22:45:49:388
2026-03-12 22:45:49.489 [TC] INFO [JTS-cashfarmServiceConnector-114] - Connected to ndc1.ibllc.com:4000/64.190.197.40 remote-ip on local port 0 socket local addrs:port /38.141.14.52:60428
2026-03-12 22:45:49.490 [TC] INFO [JTS-cashfarmServiceConnector-114] - Updating machine info [connectionAddress=/38.141.14.52]...
2026-03-12 22:45:49.492 [TC] INFO [JTS-cashfarmServiceConnector-114] - Farm cashfarm/PRE_NATIVE: Connected, sending secure connect and/or auth
2026-03-12 22:45:49.492 [TC] INFO [JTS-cashfarmServiceConnector-114] - Added to valid hosts list: ndc1.ibllc.com
2026-03-12 22:45:49.495 [TC] INFO [JTS-cashfarmListenerS10-116] - Starting listener thread [sessionID=10]...
2026-03-12 22:45:49.511 [TC] INFO [JTS-cashfarmServiceConnector-114] - InnerConnection.onConnected() [sessionID=10,secureConnectEnabled=true,logonReplySigned=false].
2026-03-12 22:45:49.520 [TC] INFO [JTS-cashfarmListenerS10-116] - Initial listener buffer size is 131072.
2026-03-12 22:45:49.520 [TC] INFO [JTS-cashfarmListenerS10-116] - Capping listener buffer size at 65536.
2026-03-12 22:45:49.531 [TC] INFO [JTS-cashfarmListenerS10-116] - Listener thread [sessionID=10] is ready to process messages.
2026-03-12 22:45:49.532 [TC] INFO [JTS-cashfarmDispatcherS10-117S10-118] - Starting dispatcher thread [sessionID=10]...

Re: Zorro not reconnecting to IB gateway after restart [Re: opm] #489317
03/15/26 07:48
03/15/26 07:48
Joined: Jul 2000
Posts: 28,128
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,128
Frankfurt
You must really manually restart the Gateway. Clicking Stop and Trade is not enough.

Re: Zorro not reconnecting to IB gateway after restart [Re: opm] #489318
03/16/26 07:45
03/16/26 07:45
Joined: Nov 2025
Posts: 19
C
clint000 Offline
Newbie
clint000  Offline
Newbie
C

Joined: Nov 2025
Posts: 19
Then there is no way for Zorro to operate uninterrupted with Interactive Brokers?

Re: Zorro not reconnecting to IB gateway after restart [Re: opm] #489320
03/16/26 11:32
03/16/26 11:32
Joined: Jul 2000
Posts: 28,128
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,128
Frankfurt
Until IB fixes the Gateway, either use the TWS, or restart the Gateway externally.

Note that all these are workarounds and against IB's policy. The real solution would be when IB would permit to trade uninterrupted.

Re: Zorro not reconnecting to IB gateway after restart [Re: opm] #489324
03/19/26 07:35
03/19/26 07:35
Joined: Nov 2025
Posts: 19
C
clint000 Offline
Newbie
clint000  Offline
Newbie
C

Joined: Nov 2025
Posts: 19
Ok, thanks. However I find the TWS shows a similar behaviour. I have tried it over the last couple of days and when the TWS restarts, Zorro loses the connection and will not reconnect despite using the broker command SET_RESTART at a specified time (I assume the broker command is to be placed inside the run() function, correct?).

I am really at a loss here, ran out of ideas to try out. Is there really a solution that works reliably for Interactive Brokers?

Re: Zorro not reconnecting to IB gateway after restart [Re: opm] #489325
03/19/26 07:42
03/19/26 07:42
Joined: Nov 2025
Posts: 19
C
clint000 Offline
Newbie
clint000  Offline
Newbie
C

Joined: Nov 2025
Posts: 19
I also found that sometimes Zorro after pressing "Trade" it connects to the API but will not receive price data, therefore it stops the strategy (error 047). Then without doing anything to the TWS, if I close Zorro and re-open it again, when I click on "Trade" it will connect to the API and retrieve the price data OK.
Based on the above, I believe that there could be some issues on Zorro side.

Re: Zorro not reconnecting to IB gateway after restart [Re: opm] #489326
03/19/26 09:18
03/19/26 09:18
Joined: Jul 2000
Posts: 28,128
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,128
Frankfurt
Pressing Stop is equivalent to closing and restarting Zorro, but not equivalent to SET_RESTART. SET_RESTART releases the TWS API, while Stop only resets the connection on the Zorro side. Both does not 100% guarantee to reconnect, since the TWS or Gateway can stay blocked despite their API reset. For reconnecting with 100% certainty they must be externally closed and restarted. From our experience, external restart is necessary with the Gateway, but not with the TWS. However this can of course change with any new version.

Re: Zorro not reconnecting to IB gateway after restart [Re: jcl] #489359
04/08/26 21:56
04/08/26 21:56
Joined: Nov 2025
Posts: 19
C
clint000 Offline
Newbie
clint000  Offline
Newbie
C

Joined: Nov 2025
Posts: 19
ok thanks. Is there a way to tell Zorro to Stop and then Trade at a particular time, by script?
I have managed to keep the Gateway stable by logging out every day and restarting it through IBC, however when Zorro is connected to the gateway and this logout+new start process happens on the gateway, it will not reconnect again unless I press Stop and Trade.
Tried the SET_RESTART but it will not reconnect to the gateway after a restart...


Thanks

Re: Zorro not reconnecting to IB gateway after restart [Re: opm] #489361
04/13/26 09:34
04/13/26 09:34
Joined: Jul 2000
Posts: 28,128
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,128
Frankfurt
You can stop trading at a particular time, but not restart it since when Zorro is stopped, no script is running. But you can stop and start a trading Zorro process at a particular time. The procedure is described under https://zorro-project.com/manual/en/engine.htm.

Re: Zorro not reconnecting to IB gateway after restart [Re: opm] #489368
04/25/26 14:06
04/25/26 14:06
Joined: Dec 2023
Posts: 16
Paddington
O
opm Offline OP
Newbie
opm  Offline OP
Newbie
O

Joined: Dec 2023
Posts: 16
Paddington
I've built a plugin based on the web api, I'll let you know how it goes

Re: Zorro not reconnecting to IB gateway after restart [Re: opm] #489386
05/06/26 22:03
05/06/26 22:03
Joined: Nov 2025
Posts: 19
C
clint000 Offline
Newbie
clint000  Offline
Newbie
C

Joined: Nov 2025
Posts: 19
For info in case it helps, I have finally been able to get around the IB gateway daily restart issues by using IBC to manage the gateway restart business, and within Zorro use the tock() function right after the gateway restarts in order to do an API reset and log back in. Seems to be working okay as a workaround...


void tock()
{
if(hour(NOW) == 21 && minute(NOW)>= 50)
{
printf("\n[%s] Daily IB restart. Reconnecting1...", strdate("%y-%m-%d %H:%M:%S.",NOW));
login(4);
login(1);
}
}

Re: Zorro not reconnecting to IB gateway after restart [Re: opm] #489388
05/07/26 13:33
05/07/26 13:33
Joined: Jul 2000
Posts: 28,128
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,128
Frankfurt
Thank you for the info!

Page 1 of 4 1 2 3 4

Moderated by  Petra 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1