Class AlphaBacktester.Traced

java.lang.Object
com.quantfinlib.alpha.AlphaBacktester.Traced
Enclosing class:
AlphaBacktester

public static final class AlphaBacktester.Traced extends Object
A run with its per-bar trace: the book held over each close-to-close bar, each name's P&L, the cost and the financing, all as fractions of equity at the start of the bar. Per bar, Σ_i namePnl + cost + financing equals the net return exactly (cost and financing are signed P&L, so normally negative).
  • Method Details

    • result

      public AlphaBacktester.Result result()
    • startIndex

      public int startIndex()
      Context bar index of trace step 0; step s covers close(start + s) → close(start + s + 1).
    • steps

      public int steps()
      Number of traced bars.
    • held

      public double held(int s, int i)
      Weight of name i held over step s, after any fill at the step's opening close.
    • heldCopy

      public double[] heldCopy(int s)
    • namePnl

      public double namePnl(int s, int i)
      P&L of name i over step s, fraction of equity at the step start.
    • namePnlCopy

      public double[] namePnlCopy(int s)
    • cost

      public double cost(int s)
      Trading cost P&L of step s (≤ 0).
    • financing

      public double financing(int s)
      Financing P&L of step s.
    • netReturn

      public double netReturn(int s)
      Net return of step s from the equity curve.