PyneCore v6.8.7 released — commissions are now booked once per order the way TradingView…

Fixes

  • Commission is booked per order, not per fill leg: a reversal’s closing and opening legs share one pooled fee, rounded once and split in quantity proportion — applies to strategy.commission.percent, cash_per_order and cash_per_contract
  • Realized gross P&L now lands in strategy.netprofit before the exit commission
  • A reversal’s remaining size is re-derived with the tolerant lot floor instead of by subtraction, which floored later percentage-based closes one lot low
  • In a process running several scripts, a non-converting run could book its percent commission at another script’s conversion rate
  • Broker: a fanned close settles only once every dispatched leg has reported, so a sibling rejected after the first leg filled still escalates
  • Broker: the stop-and-reverse fold’s surplus corrective close is now restart-durable — a correction in flight across a restart is re-armed and proven against the venue snapshot instead of being silently dropped

Performance

  • The account-currency memo is skipped entirely for runs that never convert — every strategy that does not declare strategy(currency=...) (#77)
  • Run invariants hoisted out of the per-bar loop, and seven simulator sites no longer walk containers that are empty while a position is merely held
  • Measured over 200000 bars: 1.1181 -> 0.9571 s holding one position, 1.4035 -> 1.2487 s trading actively — both now below v6.5.7, with identical trades and netprofit

Features

  • CloseFanResult.dispatched_qty reports a fanned close in Pine units, comparable with OrderEvent.fill_qty (the existing legs volumes are broker-grid integers)
  • JOURNAL_EXPOSURE_RETIRED_EXTRA_KEY is the documented OrderRow.extras key for entry exposure already closed back on the venue

Full release notes: https://github.com/PyneSys/pynecore/releases/tag/v6.8.7