Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
    JimNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by judysamnt7, 03-13-2023, 09:11 AM
    4 responses
    57 views
    0 likes
    Last Post DynamicTest  
    Started by ScottWalsh, Today, 06:52 PM
    4 responses
    36 views
    0 likes
    Last Post ScottWalsh  
    Started by olisav57, Today, 07:39 PM
    0 responses
    7 views
    0 likes
    Last Post olisav57  
    Started by trilliantrader, Today, 03:01 PM
    2 responses
    20 views
    0 likes
    Last Post helpwanted  
    Started by cre8able, Today, 07:24 PM
    0 responses
    9 views
    0 likes
    Last Post cre8able  
    Working...
    X