Class WalkForwardSlice
- Namespace
- Balsam.Optimization
- Assembly
- Balsam.Backtester.dll
Encapsulates a slice of a walk forward optimization test.
[ProtoContract]
public class WalkForwardSlice
- Inheritance
-
WalkForwardSlice
- Inherited Members
- Extension Methods
Constructors
WalkForwardSlice(DateTime, DateTime, DateTime, DateTime)
Instantiates a new WalkForwardSlice using the specified dates.
public WalkForwardSlice(DateTime trainStart, DateTime trainEnd, DateTime testStart, DateTime testEnd)
Parameters
Properties
InSampleResults
Gets the in-sample trade stats.
[ProtoMember(5)]
public TradeStats InSampleResults { get; }
Property Value
OutOfSampleResults
Gets the out-of-sample trade stats.
[ProtoMember(6)]
public TradeStats OutOfSampleResults { get; }
Property Value
TestEnd
Gets the out-of-sample end date.
[ProtoMember(4)]
public DateTime TestEnd { get; }
Property Value
TestStart
Gets the out-of-sample start date.
[ProtoMember(3)]
public DateTime TestStart { get; }
Property Value
TrainEnd
Gets the in-sample end date.
[ProtoMember(2)]
public DateTime TrainEnd { get; }
Property Value
TrainStart
Gets the in-sample start date.
[ProtoMember(1)]
public DateTime TrainStart { get; }
Property Value
Methods
GetSlices(DateTime, DateTime, int, int, bool, bool)
Gets an enumerable of walk forward slices using the specified parameters.
public static IEnumerable<WalkForwardSlice> GetSlices(DateTime startDate, DateTime endDate, int trainYears, int testYears, bool isAnchored = false, bool snapToYearEnd = false)
Parameters
startDate
DateTimeendDate
DateTimetrainYears
inttestYears
intisAnchored
boolsnapToYearEnd
boolWhen true the first training period end date will be aligned to the closest year end.
Returns
GetSlices(DateTime, DateTime, TimeSpan, TimeSpan, bool)
Gets an enumerable of walk forward slices using the specified parameters.
public static IEnumerable<WalkForwardSlice> GetSlices(DateTime startDate, DateTime endDate, TimeSpan trainWindow, TimeSpan testWindow, bool isAnchored = false)
Parameters
Returns
GetSlices(DateTime, DateTime, TimeSpan, TimeSpan, TimeSpan, bool)
Gets an enumerable of walk forward slices using the specified parameters.
public static IEnumerable<WalkForwardSlice> GetSlices(DateTime startDate, DateTime endDate, TimeSpan trainWindow, TimeSpan testWindow, TimeSpan separation, bool isAnchored = false)
Parameters
startDate
DateTimeendDate
DateTimetrainWindow
TimeSpantestWindow
TimeSpanseparation
TimeSpanisAnchored
bool
Returns
ToString()
Returns a string representation of this object.
public override string ToString()