Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

EasyLanguage to NinjaScript

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

  • RobinT
    replied
    ok thank you

    Leave a comment:


  • NinjaTrader_PatrickH
    replied
    You would handle it much like any text file. We do not have any code available for this functionality (that being altering the Config.XML) as it is not recommended.

    Leave a comment:


  • RobinT
    replied
    Thanks, but I was hoping you knew how to navigate an xml file in c#.

    Leave a comment:


  • NinjaTrader_PatrickH
    replied
    Hello RobinT,

    I would recommend taking a look at our sample on reading and writing to an external file at the following link: http://ninjatrader.com/support/forum...ead.php?t=3477

    Leave a comment:


  • RobinT
    replied
    and it does.

    To save me having to learn xml in c#, can you help?

    I have:

    XmlDocument doc = new XmlDocument();
    doc.Load( NTpath + @"\Config.xml");
    XmlNode root = doc.DocumentElement["ConnectOptionsCollection"];

    but I want to select "ExternalOpions"
    and change false to true.

    I know how to save the file.

    Leave a comment:


  • NinjaTrader_PatrickH
    replied
    That would be it. The would enable the External Data Feed to connect on start up of the NinjaTrader Platform.

    Leave a comment:


  • RobinT
    replied
    OK what am I missing?
    I just changed
    <ConnectOptions xsi:type="ExternalOptions">
    <Backup />
    <ConnectOnStartup>false</ConnectOnStartup>
    to true

    and it all worked!

    Leave a comment:


  • NinjaTrader_PatrickH
    replied
    RobinT,

    The Config.xml file is located under Documents\NinjaTrader 7.

    Leave a comment:


  • RobinT
    replied
    Users config? where would I find that?

    Leave a comment:


  • NinjaTrader_PatrickH
    replied
    Hello Robin T,

    There is not a means in code to automatically connect. You could edit the user's Config but this would not be recommended.

    Leave a comment:


  • RobinT
    replied
    Is there anyway of connecting to external automatically on NT startup. I am trying to cutdown user intervention.

    Leave a comment:


  • RobinT
    replied
    I understand that the response from Last is if the post was successful, but Last does not seem to connect automatically.

    Leave a comment:


  • RobinT
    replied
    yes you are connected, I am looking at the control center. I will look at the response.

    Leave a comment:


  • NinjaTrader_PatrickH
    replied
    Originally posted by RobinT
    if (Last(sym, close, 100) == -1)
    This does not return 0 if successfully connected, it returns 0 if setting the last price was successful.
    Code:
    int Connected(int showMessage)
    This returns 0 if connected successfully.

    Originally posted by RobinT
    TearDown() returns 0, but does not disconnect.
    I am guessing but you are determining it is not successful by looking to the Control Center of NinjaTrader and seeing that the External Data Feed is connected, correct?
    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.

    Leave a comment:


  • RobinT
    replied
    I would be grateful if you could look at this as I cannot control the datastream without being able to connect and disconnect.

    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