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