• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

change parameters of a strategy while its in motion

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

    change parameters of a strategy while its in motion

    is there a way to change parameters of a strategy while its in motion? for example the stop value ? or the number of periods of SMA without stopping the strategy?

    #2
    Hello,

    Thank you for the question.

    While the strategy is running the user interface properties you see in the strategies menu would be disabled and would be expected. Unfortunately there is no way from the Properties menu its self to edit these values while the strategy is enabled. Only the strategies code could change the variables from that point on.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      How Can I change or enter the new values in a variable through the code of the strategy?

      Can you give me an example of how to change the code and what could change on these values?

      Thanks

      Comment


        #4
        Hello,

        If you are using a script that has a Public property, lets just say your script has a "Period" property.

        Initially you set the Period to 10 from the user interface.

        In OnBarUpdate you have a condition:

        if(Close[0] > Close[1])
        Period = 33;

        In this case, when the Close is greater than the Open of the prior bar, the Public property Period was changed to 33, this is the same property from the user interface but changed via script.

        If you then re open the strategy menu it would likely reflect the new value but to be absolutely sure you could use a Print(Period) to print the value of the property in OnBarUpdate. This would show the change as it happened.

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Ok I understand, but in this case the new value was scheduler in the code.

          I can not to change manually, externally, the value of the Period?

          While the strategy is running is not possible to change the value of the Period manually?

          Thanks

          Comment


            #6
            Hello,

            Yes this is correct and expected, the user interface would be disabled while the strategy is running.

            There are no documented ways to do this but other users have used undocumented code to create custom buttons or other interface items to change values in the strategy which added the button as an example.

            These types of topics are not one we can assist with through support though because you are essentially just developing in C# at that point and doing modifications to the user interface which can be complicated or cause errors if not done correctly.

            The simple answer is no this is not possible, the more detailed and complicated answer would be its certainly possible but would require a fair knowledge of C# winform application design to accomplish this.

            I look forward to being of further assistance.
            JesseNinjaTrader Customer Service

            Comment


              #7
              I understood , thank you for the prompt response. Can you point me in the right direction on where I might find more information or even an example of this in practice ?
              Thanks in advance for all the support !

              Comment


                #8
                Hello,

                For NinjaTrader 7 there are not many items I could provide, there is a lot of information spread throughout the forum on more specific topics.

                One item you could look at is the Toolbar shortcut indicator, that creates a toolbar and assigns buttons to that toolbar in a chart. Its a good first step to understanding Controls in C# and how to modify the interface.

                http://ninjatrader.com/support/forum...d=6&linkid=530

                I look forward to being of further assistance.
                JesseNinjaTrader Customer Service

                Comment


                  #9
                  Thank you for your help. I will see this code.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by rouillard, Today, 03:34 PM
                  2 responses
                  18 views
                  0 likes
                  Last Post rouillard  
                  Started by mquinteroj, Today, 02:41 PM
                  1 response
                  10 views
                  0 likes
                  Last Post NinjaTrader_ChelseaB  
                  Started by JPPoulin, Today, 01:32 PM
                  4 responses
                  15 views
                  0 likes
                  Last Post JPPoulin  
                  Started by bltdavid, Today, 01:09 PM
                  1 response
                  10 views
                  0 likes
                  Last Post NinjaTrader_Kate  
                  Started by pstrusi, Today, 12:50 PM
                  2 responses
                  8 views
                  0 likes
                  Last Post pstrusi
                  by pstrusi
                   
                  Working...
                  X