Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Editing Data in Running NT Scripts

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

    Editing Data in Running NT Scripts

    Looking for ideas that I can further develop to change data in a running script (without reloading).

    The simplest way appears to be for the user to edit values in a text file and then have the running script read this file and use the data?

    but I'd like to explore more sophisticated solutions. Before I start learning more about "Creating Your Own AddOn Window" and "Creating Chart WPF"

    do you think they will also offer any opportunities?

    #2
    Hello fingers,

    While there is not any support for modifying the price series (such as Close, Open, Time, Volume, etc), you can read data from a file with a C# StreamReader and use this in your conditions.

    Below is a link to the SampleStreamReader reference sample in the help guide which provides sample code.


    The reference sample is an indicator, however a C# StreamReader could also be used in a custom addon window if this is what you are wanting.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      ok thanks. if the file contents change will I need to create another instance of StreamReader?

      Comment


        #4
        Hello fingers,

        The file would need to be re-read. The easiest way would be to create a new instance of the StreamReader.

        sr = new System.IO.StreamReader(path);

        From a google search I've found setting the Position and clearing the buffer may have the same result.
        I'm reading a file in line-by-line and I want to be able to restart the read by calling a method Rewind(). How can I manipulate my System.IO.StreamReader and/or its underlying System.IO.FileStream...
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        591 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        343 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        103 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        556 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        553 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X