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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    79 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    40 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    63 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    63 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    54 views
    0 likes
    Last Post CarlTrading  
    Working...
    X