Enum Class FillPolicy
- All Implemented Interfaces:
Serializable, Comparable<FillPolicy>, Constable
When an order decided on bar
t is filled. Shared by every bar
engine (Backtester, backtest.portfolio.PortfolioBacktester,
alpha.AlphaBacktester).
Signals in this library are computed from bars up to and including
close(t). A fill at that same close assumes the order went in
before the closing print using a price that did not exist yet, which is
not attainable. NEXT_OPEN is the default everywhere: decide on
the close, trade at the next bar's open. The gap between a CLOSE
run and a NEXT_OPEN run measures how much of a strategy's edge
lives inside one bar of latency; fast mean-reversion signals often lose
most of it.
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionFill atclose(t), the decision bar's own close.Fill atclose(t + 1): a market-on-close order submitted one bar after the decision, the usual convention in daily cross-sectional research.Fill atopen(t + 1). -
Method Summary
Modifier and TypeMethodDescriptionintlagBars()Bars between the decision bar and the fill bar (0 or 1).static FillPolicyReturns the enum constant of this class with the specified name.static FillPolicy[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
CLOSE
Fill atclose(t), the decision bar's own close. Optimistic: use it to measure the zero-latency upper bound, not to report results. -
NEXT_OPEN
Fill atopen(t + 1). The default. -
NEXT_CLOSE
Fill atclose(t + 1): a market-on-close order submitted one bar after the decision, the usual convention in daily cross-sectional research.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
lagBars
public int lagBars()Bars between the decision bar and the fill bar (0 or 1).
-