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 ageeholdings, Today, 07:43 AM
    0 responses
    7 views
    0 likes
    Last Post ageeholdings  
    Started by pibrew, Today, 06:37 AM
    0 responses
    4 views
    0 likes
    Last Post pibrew
    by pibrew
     
    Started by rbeckmann05, Yesterday, 06:48 PM
    1 response
    14 views
    0 likes
    Last Post bltdavid  
    Started by llanqui, Today, 03:53 AM
    0 responses
    6 views
    0 likes
    Last Post llanqui
    by llanqui
     
    Started by burtoninlondon, Today, 12:38 AM
    0 responses
    12 views
    0 likes
    Last Post burtoninlondon  
    Working...
    X