Skip to content

v6.4.1 — Bar Magnifier & calc_on_order_fills

Choose a tag to compare

@wallneradam wallneradam released this 05 Apr 15:34
· 9 commits to main since this release

Bar Magnifier

Strategy orders now use lower-timeframe (LTF) sub-bar data to determine the chronological order
of intrabar fills. When a bar's price path hits both a take-profit and a stop-loss, the magnifier
resolves which was hit first using actual 1-minute (or other LTF) candles instead of the
simplified OHLC assumption.

  • Bar magnifier is now enabled by default for all strategies (use_bar_magnifier=True)
  • CLI: --magnifier-tf flag to specify the sub-bar timeframe (default: auto-detected)
  • Verified against TradingView reference trades on real BINANCE:BTCUSDT data

calc_on_order_fills & IBPersistent (varip)

When calc_on_order_fills=True, the script re-executes after each order fill on a bar:

  • Persistent[T] (var) variables are rolled back to the previous bar's committed state
    before each re-execution
  • IBPersistent[T] (varip) variables accumulate across re-executions without rollback
  • New VarSnapshot mechanism handles snapshot/restore across main script and libraries
  • Zero overhead when calc_on_order_fills=False (the default)

Fixes

  • syminfo.tickerid now correctly populated (was empty in some contexts)
  • int() truncation restored in margin call cover_amount calculation
  • License link in README fixed to point to correct LICENSE file

Logging

  • Log output suppressed in request.security contexts to avoid noise
  • New PYNE_SECURITY_LOG environment variable for file-based security context logging

Documentation

Major reference documentation overhaul:

  • New: complete script format reference (script-format.md)
  • New: input functions reference (inputs.md) with all input.*() types
  • New: type system reference (types.md) — Series, Persistent, IBPersistent, collections,
    drawing types, @udt, StrEnum
  • New: bar magnifier guide (advanced/bar-magnifier.md)
  • New: 20+ library namespace reference pages (ta, math, strategy, array, matrix, map, str,
    color, label, line, box, table, polyline, syminfo, barstate, timeframe, session, request, log,
    runtime, and constants)
  • Removed Pine Script-centric language reference — all documentation now Python-centric
  • Fixed syminfo ticker/tickerid/root documentation semantics
  • All code examples include complete context (imports, @script decorators, main() function)

Other

  • Added LICENSE and NOTICE files for proper attribution
  • Added additional currency constants (HKD, SGD, SEK, NOK, etc.)