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:	138
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 Mindset, 04-21-2026, 06:46 AM
    0 responses
    88 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    134 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    68 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    119 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    69 views
    0 likes
    Last Post PaulMohn  
    Working...
    X