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 NullPointStrategies, Yesterday, 05:17 AM
            0 responses
            62 views
            0 likes
            Last Post NullPointStrategies  
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            134 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            75 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            45 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            50 views
            0 likes
            Last Post TheRealMorford  
            Working...
            X