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

Creating User Defined Input Parameters, setting Min from another Param input

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

    Creating User Defined Input Parameters, setting Min from another Param input

    In reference to this http://www.ninjatrader.com/support/f...ead.php?t=5782

    If I want to set the Math.Min to another variable being optimized, so that it can never be bigger then such value, do I want to reference the private int I declared in variables or the get/set method value...

    So Math.Min(Period....

    or Math.Min(period...

    The variables must be allowed the full range by the optimizer, I can not simply just make one of them go from 1-10, and the other from 10-20... they must both be allowed 1-20 during optimization.

    Thank you
    Last edited by waynewright33; 08-27-2013, 01:51 PM.

    #2
    Hello waynewright33,

    Using Math.Min() should work inside the set method of the parameters section, but I believe this may effect how your results are going to be displayed for the optimization.

    It may be best that you check for the variables inside of OnBarUpdate() and use the "return;" line to make sure that your Strategy is not processed when this happens and maybe display some text on the chart notifying this.

    Kind of like the current bar check in the following reference.
    JCNinjaTrader Customer Service

    Comment


      #3
      So I have it working right now using the Capital "P" Period rather then the little p period, therefore referencing the Set method value, not the private int. I made sure to put the Parameters with this attribute at the end of the list of parameters so that parameters inside the Math.Min 's will have been calculated. Not sure if that was necessary or not.

      Can you explain how this might effect the way my results will be displayed for the optimization?

      With it set up like this, I forced a higher value in the optimizer then Math.Min should allow, and when I clicked on the settings tab in the results it seemed to have successfully cut the parameter back to the Min.

      Thanks,

      Comment


        #4
        Hello waynewright33,

        Sure, so what I mean by this is that changing the variable as such may have duplicate Parameters inside of the Strategy Analyzer window depending on what the variables are set to.

        Let me clarify that it will not effect how the Summary is reported but you may get some redundancy is basically all.

        Please let me know if you have any other questions.
        JCNinjaTrader Customer Service

        Comment


          #5
          Funny, I have noticed multiple results in around the same performance score, never really honing in on the better ones. The things I changed that require this condition we're discussing should only have made the strategy more profitable, though I fear I have so many parameters it's like trying to find a grain of pepper on a beach.

          If I already have a ton of optimization possibilities ( 90x10^18 ) that aren't all getting tested anyways due to the optimizer limits, I can't afford any redundancy.

          Do you think removing the Math.Min from the Parameters, and placing the check condition inside the OnBarUpdate() with a return command would totally fix this? I was kind of afraid that doing that would stop certain combinations from being tested with the GO.

          So let's say I have value A that isn't allowed to go above value B. The GO loads one combination where A is above B, my code kicks it out, but A is allowed to be that high, just not with B so low, so is a A with that high value never going to be tried again?

          Thanks for your help with this,

          Comment


            #6
            Hello waynewright33,

            Doing a check inside of OnBarUpdate() will not make make the code prevent it from being loaded, but what it will do is make NinjaTrader not calculate anything after the return statement so you get two major benefits.

            1. Saves processing time since NinjaTrader is not loading any calculations besides checking the two variables values.

            2. Will not produce any performance results so duplicates will not fill up you results screen making it easier to see the differences in your results.

            Happy to be of further assistance.
            JCNinjaTrader Customer Service

            Comment


              #7
              Ok that sounds good, thanks.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Max238, Today, 01:28 AM
              2 responses
              26 views
              0 likes
              Last Post NinjaTrader_ChristopherJ  
              Started by Shansen, 08-30-2019, 10:18 PM
              25 responses
              949 views
              0 likes
              Last Post NinjaTrader_BrandonH  
              Started by JonesJoker, 04-22-2024, 12:23 PM
              8 responses
              41 views
              0 likes
              Last Post JonesJoker  
              Started by timko, Today, 06:45 AM
              0 responses
              3 views
              0 likes
              Last Post timko
              by timko
               
              Started by Waxavi, 04-19-2024, 02:10 AM
              2 responses
              39 views
              0 likes
              Last Post poeds
              by poeds
               
              Working...
              X