Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 elirion, Today, 09:32 PM
          0 responses
          2 views
          0 likes
          Last Post elirion
          by elirion
           
          Started by cre8able, Today, 09:15 PM
          1 response
          5 views
          0 likes
          Last Post bltdavid  
          Started by cummish, Today, 08:43 PM
          0 responses
          12 views
          0 likes
          Last Post cummish
          by cummish
           
          Started by Option Whisperer, Today, 07:58 PM
          4 responses
          21 views
          0 likes
          Last Post Option Whisperer  
          Started by ETFVoyageur, 05-07-2024, 07:05 PM
          13 responses
          87 views
          0 likes
          Last Post ETFVoyageur  
          Working...
          X