Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Set default state parameters and walk-forward parameters in code

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

    Set default state parameters and walk-forward parameters in code

    I would like to set as many strategy analyzer parameters as possible in code so I don't have to manually set them everytime. For some parameters such as include commisions, slippage etc I have found the corresponding parameters in State.Defaults, but I am still missing a few (including set instrument, data series based on data from the last x minutes, start and end date, trading hours and so forth. Does anyone have a list (and preferably example) of the corresponding code variables to set in SetDefaults for these parameters? Also, how can I set default walk-forward optimization values for my NinjaScriptProperty variables? For example, how can I set 500;2000;500 for the following property:

    [NinjaScriptProperty]
    [Display(ResourceType = typeof(Custom.Resource), Name = "$ Stop")]
    public double stop
    {
    get; set;
    }​

    Strategy analyzer settings I want to set in code:

    Click image for larger version

Name:	image.png
Views:	131
Size:	20.3 KB
ID:	1266552

    #2
    Hello haakonflaar,

    Thank you for your post.

    Not all of those properties may be set programmatically within the script, though you may save a template of your desired Strategy Analyzer settings by configuring the test you'd like to save, then in the bottom-right corner above the 'Run' button select template > save. Give your template a name and save, then it will be available from the Strategy Analyzer the next time you'd like to run the test if you select template > load > select the template you saved. Otherwise, you may save as default and this will save those parameters as the default settings for that strategy in the Strategy Analyzer.

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

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    47 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    23 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    33 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    51 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    42 views
    0 likes
    Last Post CarlTrading  
    Working...
    X