Table of Contents

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

trainStart DateTime
trainEnd DateTime
testStart DateTime
testEnd DateTime

Properties

InSampleResults

Gets the in-sample trade stats.

[ProtoMember(5)]
public TradeStats InSampleResults { get; }

Property Value

TradeStats

OutOfSampleResults

Gets the out-of-sample trade stats.

[ProtoMember(6)]
public TradeStats OutOfSampleResults { get; }

Property Value

TradeStats

TestEnd

Gets the out-of-sample end date.

[ProtoMember(4)]
public DateTime TestEnd { get; }

Property Value

DateTime

TestStart

Gets the out-of-sample start date.

[ProtoMember(3)]
public DateTime TestStart { get; }

Property Value

DateTime

TrainEnd

Gets the in-sample end date.

[ProtoMember(2)]
public DateTime TrainEnd { get; }

Property Value

DateTime

TrainStart

Gets the in-sample start date.

[ProtoMember(1)]
public DateTime TrainStart { get; }

Property Value

DateTime

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 DateTime
endDate DateTime
trainYears int
testYears int
isAnchored bool
snapToYearEnd bool

When true the first training period end date will be aligned to the closest year end.

Returns

IEnumerable<WalkForwardSlice>

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

startDate DateTime
endDate DateTime
trainWindow TimeSpan
testWindow TimeSpan
isAnchored bool

Returns

IEnumerable<WalkForwardSlice>

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 DateTime
endDate DateTime
trainWindow TimeSpan
testWindow TimeSpan
separation TimeSpan
isAnchored bool

Returns

IEnumerable<WalkForwardSlice>

ToString()

Returns a string representation of this object.

public override string ToString()

Returns

string