Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

optimization - private variables

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

    optimization - private variables

    Hi,
    In the strategy I have several private variables calculated.
    How can I test all possibilities to find out what set has the best results?
    For example do the long trade if int a = -1, int b = 0, int c = 1 and to exit long trade if a = 1.
    variables a, b, c I calculate base on indicators and correlation to the price.
    Beside the checking the results based on the variables, part of the conditions are as well price leve compared to some indicator f.e. close[0] < ema[0]. how can I check if results are better if there is a sign '>' and not '<'?

    #2
    Hello iskier,

    Thanks for your post.

    It is important to first understand the purpose of optimizations before optimizing a strategy. You can fine-tune the input parameters of a strategy through optimization. Optimization is the process of testing a range of values through iterative backtests to determine the optimal input values over the historical test period based on your optimization fitness.

    Only user-defined input parameters are able to be optimized when running an Optimization in the Strategy Analyzer.

    For example, the Fast user-defined input parameter and Slow user-defined input parameter in the SampleMACrossover script that comes default with NinjaTrader. You could view the Fast and Slow parameters in the SampleMACrossover code by opening a New > NinjaScript Editor window, opening the Strategies folder, and double-clicking on the SampleMACrossover file.

    There would be no optimization options available for optimizing the '>' or '<' comparison operators in a script.

    See this help guide page for more information about running optimizations: https://ninjatrader.com/support/help...a_strategy.htm

    See this help guide page for more information about creating user-defined input parameters: https://ninjatrader.com/support/help...d_input_pa.htm
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    93 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    138 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
    123 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    73 views
    0 likes
    Last Post PaulMohn  
    Working...
    X