Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
EasyLanguage to NinjaScript
Collapse
X
-
Originally posted by RobinT View Postwhen I have connected manually to external the Last is passed through to NT correctly.
when I am not connected the last is ignored and nothing happens. It does not connect automatically.
Comment
-
the guide says
int Connected(int showMessage)
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 cannot be established. A value of 1 = show message box, any other value = don't show message box.
"Calling any function in the DLL will automatically initiate a connection to the server"
if that does not work, how do I do it?
Comment
-
[DllImport("NTDirect.dll")]
public static extern int Last(string instrument, double price, int size);
sets up the dll,
if (Last(sym, close, 100) == -1)
{
System.Console.WriteLine("There was an error calling ninja - terminating execution");
FileOK = false;
}
sends the data.
if there is no connection, one is not established.
Comment
-
also,
[DllImport("NTDirect.dll")]
public static extern int TearDown();
if (TearDown() == 0)
{
if (File.Exists(localFilePath + fileName))
{
try { File.Delete(localFilePath + fileName); }
catch { Console.WriteLine("Cannot Delete " + fileName); }
}
}
doesn't work either, so I cant disconnect and reconnect the interface.
TearDown() returns 0, but does not disconnect.
Comment
-
Originally posted by RobinTif (Last(sym, close, 100) == -1)
Code:int Connected(int showMessage)
Originally posted by RobinTTearDown() returns 0, but does not disconnect.
If so, the External Data Feed will always show connected and in green. Even after you call TearDown(). TearDown() returns 0 when your application has successfully disconnected from NinjaTrader, not if the External Data Feed is disconnected in NinjaTrader.
Please let me know if you have any questions.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by foxtrott21, Today, 08:27 AM
|
0 responses
1 view
0 likes
|
Last Post
by foxtrott21
Today, 08:27 AM
|
||
Started by jaypelle3, Today, 08:26 AM
|
0 responses
1 view
0 likes
|
Last Post
by jaypelle3
Today, 08:26 AM
|
||
Started by linkcou, Today, 07:01 AM
|
2 responses
18 views
0 likes
|
Last Post
by bltdavid
Today, 08:25 AM
|
||
Started by jaypelle3, Today, 08:25 AM
|
0 responses
1 view
0 likes
|
Last Post
by jaypelle3
Today, 08:25 AM
|
||
Started by jaypelle3, Today, 08:22 AM
|
0 responses
2 views
0 likes
|
Last Post
by jaypelle3
Today, 08:22 AM
|
Comment