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

Strategy Optimizer

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

    Strategy Optimizer

    I created a strategy in Strategy Builder but when I try to optimize it in Strategy Analyzer, no Strategy Parameters will show up after I select Optimization.
    Is it possible to optimize a strategy that was created in Strategy Builder?
    Thanks for your help.

    #2
    Hello nrevell,

    You can optimize any strategy that has inputs for bool and int on the Inputs and Variables page of the Strategy Builder.

    If the script does not have any inputs to optimize over, the script cannot be optimized.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Chelsea, would it be possible for you to show me where there is an example, with code or with use of strategy builder, of a strategy that can be optimized for stop loss and profit target amounts?
      Thank-you!

      Comment


        #4
        Hello nrevell,

        You would just have to make User Inputs on the Inputs and Variables page of the Strategy Builder, and then you would use those User Inputs for your desired stop and target distance when you set up Stop and Targets on the Stops and Targets page.

        Our Strategy Builder 301 course walks through making a strategy in the Strategy Builder and how you can create User Inputs as well as using them in the Stops and Targets page.

        Strategy Builder 301 (publicly available resource) — https://www.youtube.com/watch?v=_KQF2Sv27oE

        Inputs and Variables - https://ninjatrader.com/support/help...ariablesScreen

        Stops and Targets - https://ninjatrader.com/support/help...dTargetsScreen
        JimNinjaTrader Customer Service

        Comment


          #5
          Hello Chelsea, hello Jim,

          I would like to optimize a few int and bool variables within the region Properties:

          Code:
          #region Properties
          
          [NinjaScriptProperty]
          [Range(0, 100)]
          [Display(Name="inputMinimumProfitRequired", Description="inputMinimumProfitRequired", Order=2, GroupName="Parameters")]
          public int inputMinimumProfitRequired
          { get; set; }
          
          [Range(0, 1000000)]
          [Display(Name="AccountSize", Description="AccountSize", Order=3, GroupName="Parameters")]
          public double InitialBalance
          { get; set; }
          
          
          [Display(Name = "Trailing", GroupName = "Parameters", Order = 5)]
          public bool ActivateTrailing
          { get; set; }
          
          #endregion
          Unfortunately when using the strategy optimizer, I cannot optimize over the boolean nor over the int variables.

          I am not using the strategy builder.

          Kind regards
          Gerik

          Comment


            #6
            Hello Gerik,

            For an input to be optimizable the NinjaScriptProperty attribute must be used.


            Notice this difference between the inputMinimumProfitRequired and other properties in your suggested code.

            When adding inputs with the Strategy Builder, the NinjaScriptProperty attribute will automatically be applied. Trying using the Strategy Builder to generate your inputs.
            Chelsea B.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Torontobluejays, Today, 08:43 AM
            0 responses
            1 view
            0 likes
            Last Post Torontobluejays  
            Started by sastrades, 01-31-2024, 10:19 PM
            12 responses
            186 views
            0 likes
            Last Post sastrades  
            Started by Jimmyk, 01-26-2018, 05:19 AM
            8 responses
            863 views
            0 likes
            Last Post emuns
            by emuns
             
            Started by giulyko00, 04-24-2024, 12:03 PM
            6 responses
            29 views
            0 likes
            Last Post giulyko00  
            Started by 00nevest, 04-27-2024, 02:27 PM
            3 responses
            27 views
            0 likes
            Last Post 00nevest  
            Working...
            X