Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Input to Strategy from text file in real-time

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

    Input to Strategy from text file in real-time

    For years now I have wanted to input/change parameter settings in a custom strategy without having to open the strategy dialog and change a parameter ...which then re-enables/initializes the strategy from ground zero....thereby losing all collected data/calcs and plots.

    I note from ninja 8 pre-release webinars that 8 will not allow this either. Unfortunate since an 'interactive' strategy would be very useful to everyone? ANYONE ELSE?...PLEASE EXPRESS YOUR INTEREST OR IT WILL NEVER HAPPEN.

    Also I note that the work-around is to read from a file using StreamReader per this thread/example by Josh:


    This works fine for initial input. I want however to be able to change the text file in real time and this is not allowed using just the sample code since the text file is being used by ninja.

    So, how do I have the code only read the text file at intervals, such as FirstTickOfBar, and release it in between so I can make a change to the text file ready for next reading?

    Also, please explain how to work around multi-threading file issues if any in such an application of this method.

    Thanks.
    Last edited by ATI user; 03-02-2013, 11:37 AM.

    #2
    Originally posted by ATI user View Post
    For years now I have wanted to input/change parameter settings in a custom strategy without having to open the strategy dialog and change a parameter ...which then re-enables/initializes the strategy from ground zero....thereby losing all collected data/calcs and plots.

    I note from ninja 8 pre-release webinars that 8 will not allow this either. Unfortunate since an 'interactive' strategy would be very useful to everyone? ANYONE ELSE?...PLEASE EXPRESS YOUR INTEREST OR IT WILL NEVER HAPPEN.

    Also I note that the work-around is to read from a file using StreamReader per this thread/example by Josh:


    This works fine for initial input. I want however to be able to change the text file in real time and this is not allowed using just the sample code since the text file is being used by ninja.

    So, how do I have the code only read the text file at intervals, such as FirstTickOfBar, and release it in between so I can make a change to the text file ready for next reading?

    Also, please explain how to work around multi-threading file issues if any in such an application of this method.

    Thanks.
    How interactive is it?

    Have you looked into adding buttons to the chart to change your inputs with callbacks to the indicator?

    There are samples here about how to add buttons.

    Comment


      #3
      not that interactive... I just want to change a parameter without the chart refreshing the strategy

      are you referring to these samples?


      very cool

      that gives me real-time access to the strategy without disturbing its operation....thanks
      Last edited by ATI user; 03-02-2013, 04:06 PM.

      Comment


        #4
        Originally posted by ATI user View Post
        not that interactive... I just want to change a parameter without the chart refreshing the strategy

        are you referring to these samples?


        very cool

        that gives me real-time access to the strategy without disturbing its operation....thanks
        Just got back, looks like you found one.

        Comment


          #5
          yes..thanks for the tip...working perfectly....scrapped the StreamReader text file and using the buttons instead ...better and quicker than modifying a text file anyway

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          649 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          370 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          109 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          574 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          576 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X