Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

EasyLanguage to NinjaScript

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • RobinT
    replied
    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.

    Leave a comment:


  • RobinT
    replied
    [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.

    Leave a comment:


  • NinjaTrader_PatrickH
    replied
    Hello RobinT,

    Thank you for your response.

    Please provide the full lines of code used to verify this on your end.

    Leave a comment:


  • RobinT
    replied
    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?

    Leave a comment:


  • NinjaTrader_PatrickH
    replied
    Originally posted by RobinT View Post
    when 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.
    Correct, it would not be expected to connect automatically based on a Command.

    Leave a comment:


  • RobinT
    replied
    when 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.

    Leave a comment:


  • NinjaTrader_PatrickH
    replied
    Originally posted by RobinT View Post
    Calling any function in the DLL will automatically initiate a connection to the server, but that doesn't seem to happen with Last.
    When you use the Command for the Last price, what is occurring?

    Leave a comment:


  • RobinT
    replied
    yes, and I am referring to the dll commands.

    Leave a comment:


  • NinjaTrader_PatrickH
    replied
    Hello RobinT,

    I am not sure I follow your inquiry. Are you connecting via the External Data Feed connection? - http://ninjatrader.com/support/helpG...connection.htm

    Leave a comment:


  • RobinT
    replied
    Do you know how to connect the external interface via program.
    teardown disconnects
    and connected shows the status.

    Calling any function in the DLL will automatically initiate a connection to the server, but that doesn't seem to happen with Last.

    Leave a comment:


  • NinjaTrader_PatrickH
    replied
    Hello RobinT,

    The NTM and NTD formats are not published.

    Leave a comment:


  • RobinT
    replied
    Project has gone well and all working.

    I am now trying to get data into the system automatically. As I cannot call the historical data manager, I am trying to create the .nta file myself. Is the format published?

    Leave a comment:


  • RobinT
    replied
    yes, I am using the

    [DllImport("NTDirect.dll")]
    public static extern int Last(string instrument, double price, int size);

    interface, and time is not passed to NT through this interface from TS or any other source.

    Leave a comment:


  • NinjaTrader_PatrickH
    replied
    Hello RobinT,

    Are you stating the data when received by NinjaTrader from TradeStation is not timestamped?

    Leave a comment:


  • RobinT
    replied
    Yes, and TS data is not timestamped. I was just trying to deal with the tiny discrepancies that occur at the end of a bar due to different clocks.

    Leave a comment:

Latest Posts

Collapse

Topics Statistics Last Post
Started by kinfxhk, 07-14-2026, 09:39 AM
0 responses
128 views
0 likes
Last Post kinfxhk
by kinfxhk
 
Started by kinfxhk, 07-13-2026, 10:18 AM
0 responses
105 views
0 likes
Last Post kinfxhk
by kinfxhk
 
Started by kinfxhk, 07-13-2026, 09:50 AM
0 responses
86 views
0 likes
Last Post kinfxhk
by kinfxhk
 
Started by kinfxhk, 07-13-2026, 07:21 AM
0 responses
105 views
0 likes
Last Post kinfxhk
by kinfxhk
 
Started by kinfxhk, 07-11-2026, 02:11 AM
0 responses
86 views
0 likes
Last Post kinfxhk
by kinfxhk
 
Working...
X