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:	129
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 NullPointStrategies, Yesterday, 05:17 AM
    0 responses
    56 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    133 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    73 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    45 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    49 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X