Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Reading text file by multiple instances of indicator

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

    Reading text file by multiple instances of indicator

    Hello,

    I need to be able to read values from a text file into multiple instances of the same indicator on separate charts. For example pivot lines or support/ resistance lines.

    I know it is possible to read into an indicator and I have seen the StreamrReader examples, so my question really is about the multiple reads. Is it possible to do this or would the StreamReader not be able to open the file from the multiple instances? I am considering the case of when ninja starts up and the indicators go to access the file.

    If it needs to be linear access is there a way to do that?

    Thanks

    #2
    Hello Tasker-182,

    I have found a few stackoverflow threads that may help you to accomplish your goal.

    http://stackoverflow.com/questions/1...etween-threads

    http://stackoverflow.com/questions/1...ent-file-write

    I think it may be possible to save the values to static variables. I'm currently trying to test that theory. I will update you if I am successful.


    Please let me know if I can be of further assistance.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by Tasker-182 View Post
      Hello,

      I need to be able to read values from a text file into multiple instances of the same indicator on separate charts. For example pivot lines or support/ resistance lines.

      I know it is possible to read into an indicator and I have seen the StreamrReader examples, so my question really is about the multiple reads. Is it possible to do this or would the StreamReader not be able to open the file from the multiple instances? I am considering the case of when ninja starts up and the indicators go to access the file.

      If it needs to be linear access is there a way to do that?

      Thanks
      You just have to open the file for multiple read (ie., asynchronous) access.

      ref: http://msdn.microsoft.com/en-us/library/db5x7c0d.aspx

      Comment


        #4
        Thanks for the help.

        On a slightly related subject. How can I retain a user input filename and path (input via the indicator panel) so that it stays in the indicator after shutdown and is there on restart.

        Comment


          #5
          Originally posted by Tasker-182 View Post
          Thanks for the help.

          On a slightly related subject. How can I retain a user input filename and path (input via the indicator panel) so that it stays in the indicator after shutdown and is there on restart.
          That will be a string, so it is properly serialized by NT on its own. You should need to do nothing other than expose the Property as a public string.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          597 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
          555 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X