Record Class ParentOrder
java.lang.Object
java.lang.Record
com.quantfinlib.backtest.ParentOrder
public record ParentOrder(Side side, int signalIndex, double arrivalPrice, String reason, List<Execution> fills, int[] fillBarIndices)
extends Record
One parent order worked by the
ExecutionAwareBacktester: the signal
that created it, the arrival price (close at signal time — the TCA
benchmark), and the child fills with the bar index each filled on.
reason is "ENTRY" for entries, or the exit reason
(SIGNAL / STOP_LOSS / TAKE_PROFIT / END_OF_DATA).-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionParentOrder(Side side, int signalIndex, double arrivalPrice, String reason, List<Execution> fills, int[] fillBarIndices) Creates an instance of aParentOrderrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the value of thearrivalPricerecord component.doublefinal booleanIndicates whether some other object is "equal to" this one.int[]Returns the value of thefillBarIndicesrecord component.intBars from first to last fill (0 for unfilled or single-bar parents).longfills()Returns the value of thefillsrecord component.final inthashCode()Returns a hash code value for this object.reason()Returns the value of thereasonrecord component.side()Returns the value of thesiderecord component.intReturns the value of thesignalIndexrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
REASON_ENTRY
- See Also:
-
-
Constructor Details
-
ParentOrder
public ParentOrder(Side side, int signalIndex, double arrivalPrice, String reason, List<Execution> fills, int[] fillBarIndices) Creates an instance of aParentOrderrecord class.- Parameters:
side- the value for thesiderecord componentsignalIndex- the value for thesignalIndexrecord componentarrivalPrice- the value for thearrivalPricerecord componentreason- the value for thereasonrecord componentfills- the value for thefillsrecord componentfillBarIndices- the value for thefillBarIndicesrecord component
-
-
Method Details
-
filledQty
public long filledQty() -
avgFillPrice
public double avgFillPrice() -
fillDurationBars
public int fillDurationBars()Bars from first to last fill (0 for unfilled or single-bar parents). -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
side
Returns the value of thesiderecord component.- Returns:
- the value of the
siderecord component
-
signalIndex
public int signalIndex()Returns the value of thesignalIndexrecord component.- Returns:
- the value of the
signalIndexrecord component
-
arrivalPrice
public double arrivalPrice()Returns the value of thearrivalPricerecord component.- Returns:
- the value of the
arrivalPricerecord component
-
reason
Returns the value of thereasonrecord component.- Returns:
- the value of the
reasonrecord component
-
fills
-
fillBarIndices
public int[] fillBarIndices()Returns the value of thefillBarIndicesrecord component.- Returns:
- the value of the
fillBarIndicesrecord component
-