Skip to content

PowerBridge 0.11.0

Choose a tag to compare

@hudsonwa hudsonwa released this 24 Oct 07:38
· 23 commits to main since this release
4235d5f

Highlights:

  • --max-bars-back defaults to auto, so a strategy's warm-up bars no longer trade where MultiCharts' would not, and the quickstart needs no flag (#237).
  • Bars CSVs are checked: the slash-date order is inferred (or the run asks for --date-format), and bars that go back in time stop the run (#229, #237).
  • EL run-time errors and a missing ; stop with one line naming the EL line, instead of a traceback or a silent run (#223, #235).
  • The run_el / run_oracle library lives in pl_transpiler.run and pl_transpiler.oracle, and pl_transpile --dialect names the output dialect (#217, #227).
  • Some runs give different results or now stop; see the behaviour changes under Changed.

Added

  • pl_transpile --dialect {runnable,mirror} selects the output dialect with the same names as transpile(src, dialect=...); --no-persist stays as an alias for --dialect mirror (#217).
  • InstrumentConfig.round_turn_cost ($ per contract, default 25.0) sets the cost the native audit packet subtracts from each closed trade, instead of a fixed $25. The built-in NQ and ES configs keep 25.0, so their packets are byte-identical; fills and digests do not depend on it (#233).

Changed

  • Behaviour change: --max-bars-back on pl_run and pl_oracle defaults to auto, and max_bars_back in run_el / run_oracle to None (auto), as MultiCharts auto-detects MaxBarsBack. When the lookback cannot be inferred, the default falls back to 0 with a stderr note (an explicit auto still stops with an error). The status line shows the number used (max-bars-back 21 (auto)). Pass --max-bars-back 0 (max_bars_back=0) for the old results; digests with an explicit value are unchanged on both engines (#237).
  • Behaviour change: without --date-format (date_format=None in load_bars_csv / load_bars), the slash-date order of a bars CSV is inferred from the whole file. When it cannot tell, or both orders occur, the run stops with one line asking for --date-format mdy or dmy (exit 2). Before, slash dates were read day-first, so a month-first file holding only days 1-12 was silently misread. EL integer dates load as before (#237).
  • Behaviour change: pl_run, pl_oracle, load_bars_csv and load_bars stop on bars that go back in time, naming the CSV line (bars out of order at line 4: 2024-01-02 09:29 comes after 2024-01-02 09:31), with exit 2 (ValueError in the library). Bars with the same date and time are still accepted (#229).
  • Behaviour change: a statement or declaration without its closing ; is a syntax error (missing ';' at the end of the statement, line, caret, exit 2). The documented omission before Else and attributes like [IntrabarOrderGeneration = False] still parse, and Close Data2-style forms once reported as unimplemented keywords now stop at the missing ;. Generated code is unchanged for every file that still parses (#235).
  • A run-time error in the EL program (array index out of range, division or Mod by zero, any other exception from the generated code) stops pl_run and pl_oracle with one line naming the EL line and exit 2, instead of a traceback and exit 1. The library raises the new ELRuntimeError (with .line), which is also an instance of the original exception type; PB_DEBUG=1 shows the traceback (#223).
  • The library code behind pl_run and pl_oracle moved to pl_transpiler.run and pl_transpiler.oracle; the CLI modules are thin argument parsers and the old import paths still work (#227).
  • The --help text of every command is in plain language, with maintainer options listed last under "advanced options"; option names and behaviour are unchanged (#225, #229).
  • pl_transpiler.engine no longer re-exports private helpers (_parse_el_date, NQ, ...); import them from engine_dates and runtime.instrument_config (#217).
  • The AUDIT_REF_3_* pinned-digest constants moved to tests/reference_pins.py, since only the tests use them (#233).
  • Internal: the native kernel has one Rust fill engine; the unused copy in accel/src/engine/ is gone. Fills and digests are identical (#231).
  • The dev tools are pinned in the dev extra and CI installs it, so pip install -e '.[dev]' gives the same lint, type-check and test results as CI (#221). The core modules are fully type-annotated and mypy runs with check_untyped_defs (#215).