Interface PortfolioStrategy

All Known Implementing Classes:
CrossSectionalMomentum

public interface PortfolioStrategy
A multi-asset, weight-based strategy for the PortfolioBacktester. All series must be index-aligned (same length, same bar times). Weights are fractions of current equity: positive = long, negative = short, missing symbol = flat; |weights| may sum above 1 for leverage.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    default void
    init(Map<String, BarSeries> signalData, Map<String, BarSeries> tradeData)
    Price-pair initialisation used by the survivorship-aware engine: signalData is split and dividend adjusted and is what signals must be computed on; tradeData is the unadjusted series the engine trades on, available for strategies that need actual prices (share-count limits, price filters).
     
    targetWeights(int index)
    Target weights by symbol decided at bar index's close; when they fill is the engine's fillPolicy (next open by default).
  • Method Details

    • name

      String name()
    • init

      void init(Map<String, BarSeries> data)
    • init

      default void init(Map<String, BarSeries> signalData, Map<String, BarSeries> tradeData)
      Price-pair initialisation used by the survivorship-aware engine: signalData is split and dividend adjusted and is what signals must be computed on; tradeData is the unadjusted series the engine trades on, available for strategies that need actual prices (share-count limits, price filters). The default ignores tradeData.
    • targetWeights

      Map<String,Double> targetWeights(int index)
      Target weights by symbol decided at bar index's close; when they fill is the engine's fillPolicy (next open by default).