Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Non-optimizable Inputs

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

    Non-optimizable Inputs

    Hello,

    Is it possible to create Inputs in Ninjascript and mark them somehow so they are not optimizable?

    I have inputs for PeriodType and Period Value which I want to use in StrategyAnalyzer for Backtesting. This works fine now, but when I switch to Optimization I get an error stating that I am trying to optimize using Dynamic bar definitions.

    For instance, I am using the following to define the parameters:
    Code:
    [Range(0, 6)]
    [NinjaScriptProperty]
    [Display(Name = "SI_LTPeriodType", Description = "Input System Discovery: Long Term Chart Type", Order = 1, GroupName = "StratDiscConst")]
    public int SI_LTCPeriodType
    { get; set; }
    
     [Range(0, int.MaxValue)]
     [NinjaScriptProperty]
     [Display(Name = "SI_LTPeriodValue", Description = "Input System Discovery: Long Term Chart Period Value", Order = 2, GroupName = "StratDiscConst")]
     public int SI_LTCPeriodValue    
     { get; set; }
    And using these parameters in the AddDataSeries()

    Code:
    switch (SI_STCPeriodType) 
    {
            case 0: // Tick 
                     AddDataSeries(BarsPeriodType.Tick, SI_STCPeriodValue);
                     Print("Adding STC Tick Bars: " + SI_STCPeriodValue);
                     break;
    }
    Thanks,
    Last edited by tornadoatc; 01-10-2020, 01:10 PM.

    #2
    Hello tornadoatc,

    Thanks for your post.

    Dynamically adding data series is not fully supported (please notes in AddDataSeries documentation.) If you experience an issue that would require our support, the data series should be hard coded when testing to rule out adding the data series dynamically.

    AddDataSeries - https://ninjatrader.com/support/help...dataseries.htm

    If you would like to prevent a parameter from being optimized, you can remove the [NinjaScriptProperty] attribute from the property.

    NinjaScriptProperty Attribute - https://ninjatrader.com/support/help...yattribute.htm

    Please let us know if we can be of further assistance.

    Comment

    Latest Posts

    Collapse

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