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:	140
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, 05-11-2026, 05:56 AM
    0 responses
    56 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    34 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    195 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    359 views
    0 likes
    Last Post CaptainJack  
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    281 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X