Announcement

Collapse
No announcement yet.

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

        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 Mindset, 04-21-2026, 06:46 AM
            0 responses
            90 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by M4ndoo, 04-20-2026, 05:21 PM
            0 responses
            137 views
            0 likes
            Last Post M4ndoo
            by M4ndoo
             
            Started by M4ndoo, 04-19-2026, 05:54 PM
            0 responses
            68 views
            0 likes
            Last Post M4ndoo
            by M4ndoo
             
            Started by cmoran13, 04-16-2026, 01:02 PM
            0 responses
            120 views
            0 likes
            Last Post cmoran13  
            Started by PaulMohn, 04-10-2026, 11:11 AM
            0 responses
            69 views
            0 likes
            Last Post PaulMohn  
            Working...
            X