AlgoQuant, an integrated trading strategy research and backtesting system
com.numericalmethod.algoquant.model.util.frequency

## Class CustomFrequency

• java.lang.Object
• com.numericalmethod.algoquant.model.util.frequency.CustomFrequency
• All Implemented Interfaces:
Frequency

public class CustomFrequency
extends Object
implements Frequency
Allows defining a frequency where consecutive periods are offset by a fixed period and the first period starts at a particular time.
• ### Constructor Summary

Constructors
Constructor and Description
CustomFrequency(org.joda.time.DateTime startDate, org.joda.time.Period duration)
Constructs a new instance, where the first period starts at startDate and consecutive periods are offset by period length.
• ### Method Summary

All Methods
Modifier and Type Method and Description
org.joda.time.DateTime periodBegin(org.joda.time.DateTime time)
Gets the begin time of the period that the time belongs to.
org.joda.time.DateTime periodEnd(org.joda.time.DateTime time)
Gets the end time of the period that the time belongs to.
• ### Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
• ### Constructor Detail

• #### CustomFrequency

public CustomFrequency(org.joda.time.DateTime startDate,
org.joda.time.Period duration)
Constructs a new instance, where the first period starts at startDate and consecutive periods are offset by period length.
Parameters:
startDate - the start of the first period
duration - the duration or length of one period
• ### Method Detail

• #### periodBegin

public org.joda.time.DateTime periodBegin(org.joda.time.DateTime time)
Description copied from interface: Frequency
Gets the begin time of the period that the time belongs to. The time returned must be less than or equal to the argument.
Specified by:
periodBegin in interface Frequency
Parameters:
time - a time
Returns:
the period begin time
• #### periodEnd

public org.joda.time.DateTime periodEnd(org.joda.time.DateTime time)
Description copied from interface: Frequency
Gets the end time of the period that the time belongs to. The time must be greater than the argument.
Specified by:
periodEnd in interface Frequency
Parameters:
time - a time
Returns:
the period end time