Package-level declarations

Types

Link copied to clipboard

The single translation boundary between continuous futures streams (VENUE:ROOT@front) and the contracts they follow. Each stream in symbols gets its own ContractVenue from venueFactory, on a private bus and a private contract price view; orders are translated onto the contract the roll schedule names at submit time, with limit and stop levels snapped so they never fill early, and the venue's events are republished on bus in continuous space. The engine never sees a contract symbol for a continuous stream. Each venue is handed the stream's contract positions, as its account holds them, to judge what an order reduces. At each roll every position and resting order is carried to the next contract and the roll is recorded in ledger with its cost booked (RollExecutor); every engine fill is recorded in fills with the contract and price it executed at. A live session's lanes keep their state in store across restarts; a backtest passes none.

Link copied to clipboard
data class ContractFill(val atMs: Long, val strategyId: String, val stream: String, val orderId: String, val contract: String, val side: Side, val quantity: BigDecimal, val contractPrice: BigDecimal, val streamPrice: BigDecimal)

One engine fill on a continuous stream, as it executed: on contract at contractPrice, seen by the engine at streamPrice in the adjusted series.

Link copied to clipboard

Every engine fill a run's continuous streams executed, in order; the source of contracts.csv.

Link copied to clipboard
class ContractVenue(val broker: Broker, val onTick: (Tick) -> Unit = {})

The contract-level venue a continuous stream executes on: its broker, and onTick, which hands it each contract tick the stream derives (a simulated exchange matches on them; a live venue has its own feed and ignores them).

Link copied to clipboard
class LaneStateStore(persistence: StreamLanePersistence, ownerId: String)

Where a live session's continuous stream lanes keep their state across restarts: persistence, under the session's state owner ownerId. A backtest has none, and its lanes save nothing.

Link copied to clipboard
data class RollEntry(val atMs: Long, val stream: String, val strategyId: String, val from: String, val to: String, val quantity: BigDecimal, val multiplier: BigDecimal, val fromFill: BigDecimal, val toFill: BigDecimal, val fromReference: BigDecimal, val toReference: BigDecimal, val fees: BigDecimal)

One strategy's position carried across one futures roll: closed on from at fromFill and reopened on to at toFill. quantity is the carried position, positive long and negative short; fromReference and toReference are the roll's reference prices, the ones the continuous series was adjusted by; fees are both legs' fees in the contract's currency.

Link copied to clipboard

Every roll a run carried, in order; the source of the roll report.