TestPeriod

<< Click to Display Table of Contents >>

Navigation:  NinjaScript > Language Reference > Strategy >

TestPeriod

Previous page Return to chapter overview Next page

Definition

Reserved for Walk-Forward Optimization, this property determines the number of days used for the "out of sample" backtest period for a given strategy.  See also OptimizationPeriod.

 

Note:  This property should ONLY be called from the OnStateChange() method during State.SetDefaults

 

Property Value

An int value representing the number of "out of sample" days used for walk-forward optimization; Default value is set to 28

 

Syntax

TestPeriod

 

 

Examples

ns


protected override void OnStateChange()
{
    if (State == State.SetDefaults)
    {        
        //set the default TestPeriod to 31 days for WFOs
        TestPeriod = 31;
    }
}