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
    Modifier and Type
    Field
    Description
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    ParentOrder(Side side, int signalIndex, double arrivalPrice, String reason, List<Execution> fills, int[] fillBarIndices)
    Creates an instance of a ParentOrder record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Returns the value of the arrivalPrice record component.
    double
     
    final boolean
    Indicates whether some other object is "equal to" this one.
    int[]
    Returns the value of the fillBarIndices record component.
    int
    Bars from first to last fill (0 for unfilled or single-bar parents).
    long
     
    Returns the value of the fills record component.
    final int
    Returns a hash code value for this object.
    Returns the value of the reason record component.
    Returns the value of the side record component.
    int
    Returns the value of the signalIndex record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • ParentOrder

      public ParentOrder(Side side, int signalIndex, double arrivalPrice, String reason, List<Execution> fills, int[] fillBarIndices)
      Creates an instance of a ParentOrder record class.
      Parameters:
      side - the value for the side record component
      signalIndex - the value for the signalIndex record component
      arrivalPrice - the value for the arrivalPrice record component
      reason - the value for the reason record component
      fills - the value for the fills record component
      fillBarIndices - the value for the fillBarIndices record 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

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • side

      public Side side()
      Returns the value of the side record component.
      Returns:
      the value of the side record component
    • signalIndex

      public int signalIndex()
      Returns the value of the signalIndex record component.
      Returns:
      the value of the signalIndex record component
    • arrivalPrice

      public double arrivalPrice()
      Returns the value of the arrivalPrice record component.
      Returns:
      the value of the arrivalPrice record component
    • reason

      public String reason()
      Returns the value of the reason record component.
      Returns:
      the value of the reason record component
    • fills

      public List<Execution> fills()
      Returns the value of the fills record component.
      Returns:
      the value of the fills record component
    • fillBarIndices

      public int[] fillBarIndices()
      Returns the value of the fillBarIndices record component.
      Returns:
      the value of the fillBarIndices record component