Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Parameter Constraints for Optimization

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

    Parameter Constraints for Optimization

    Hello,

    I was hoping to get some assistance regarding adding constraints to parameters when running optimization on a strategy.

    Specifically, I have a few parameters I am optimizing which could all theoretically be any value between .5 and 3. However, there are certain parameters which should always be less than others in order for the strategy to function properly. For instance if I have a variable RR, which represents the risk/reward of the trade structure, and another variable BE which represents the R multiple needed to move stop to breakeven, ideally BE should always be less than RR. If the optimizer tried something like a "2 RR" value with a "3 BE" value, that would essentially cancel the function out all together.

    Currently, in the actual strategy I am trying to optimize, I have 4 parameters which I'd like to have some sort of rules for:

    RR- double representing initial risk/reward structure of trade
    BE- double representing relative "RR" multiple needed to move stop to entry price
    PL - double representing relative "RR" multiple needed to move stop into profit
    ProfitLock - double representing relative "RR" amount of profit to lock in (controls how far into profit stop is moved)

    Since these are all relative to RR, I'd really like a way to constrain the optimizer to making sure that it does not make any of these parameters greater than RR while searching for parameter values. Preferably I'd also like BE to always be < PL, and Profitlock to always be < PL, and RR to always be the greatest value of the 4.

    A workaround would be hard coding a check inside the code that automatically changes the values if they are not structured correctly, but I'd prefer the optimizer handle this so it can be more efficient.

    Thanks,
    Curtis

    #2
    Hello skatefallen55,

    In this case the best solution would be adding conditions into your logic to ensure the values are correct for the given use. The optimizer its self would not have any way to control parameters based on other parameters values.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Got it, thanks Jesse

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by ThatMikey, Today, 08:15 AM
      1 response
      7 views
      0 likes
      Last Post NinjaTrader_ChristopherJ  
      Started by ThatMikey, 12-06-2024, 01:56 PM
      2 responses
      15 views
      0 likes
      Last Post ThatMikey  
      Started by dpolyakov, 03-29-2024, 11:30 AM
      15 responses
      2,469 views
      3 likes
      Last Post backtester831  
      Started by jpkulkarni, Yesterday, 09:27 PM
      1 response
      13 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by jpkulkarni, Yesterday, 10:12 PM
      1 response
      10 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Working...
      X