Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Reconnect from TS to NT
Collapse
X
-
Calling any function automatically forces a reconnect.
Returns a value of zero if the DLL has established a connection to the NinjaTrader server (application) and if the ATI is currently enabled or, -1 if it is disconnected. Calling any function in the DLL will automatically initiate a connection to the server. The parameter showMessage indicates if a message box is displayed in case the connection can not be established. A value of 1 = show message box, any other value = don't show message box.
Leave a comment:
-
Reconnect from TS to NT
The following is a code snipit I use to connect TS to NT (potentially on another computer):
once begin
SetUp(iHost, iPort); // iHost & iPort are inputs to strategy
if NTConnected(1) then print("connected to ", iHost)
else print("NOT connected to ", iHost);
end;
It runs once at the begining of the startegy, and works well.
The issue I have is that it assumes that NT is already up and then TS comes up. If it is not, then I need to restart the strategy every day if I take NT down at the end of the day.
The question then is how do I force a reconnect from TS? There is no Connect() method that I am aware of that would force a reconnect. Can the above code be called again if NTConnected() returned a disconnected status? Or does calling NTConnected trigger a connection attempt?
Ideally, I would like to have my strategy reconnect if not connected.Tags: None
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by CaptainJack, 04-24-2026, 11:07 PM
|
0 responses
38 views
0 likes
|
Last Post
by CaptainJack
04-24-2026, 11:07 PM
|
||
|
Started by Mindset, 04-21-2026, 06:46 AM
|
0 responses
132 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|
||
|
Started by M4ndoo, 04-20-2026, 05:21 PM
|
0 responses
185 views
0 likes
|
Last Post
by M4ndoo
04-20-2026, 05:21 PM
|
||
|
Started by M4ndoo, 04-19-2026, 05:54 PM
|
0 responses
97 views
0 likes
|
Last Post
by M4ndoo
04-19-2026, 05:54 PM
|
||
|
Started by cmoran13, 04-16-2026, 01:02 PM
|
0 responses
139 views
0 likes
|
Last Post
by cmoran13
04-16-2026, 01:02 PM
|

Leave a comment: