You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pyramiding is judged at placement for stop and limit entries (#95). With pyramiding=1, two stop entries placed while flat now both fill when they trigger, on the same bar and on a later bar with the position already open, matching TradingView. Market entries keep their check at processing time. A strategy.entry call rejected by the pyramiding limit now also removes the resting order with the same id, as on TradingView.
timeframe.change on intraday timeframes is anchored to the session start (#93). Data that starts mid-session no longer shifts every period start by one bar, a session open inside a data gap re-anchors the grid, and requested timeframes that are not a multiple of the chart's are handled.
New built-in: updatetime. Historical bars return their opening time; realtime updates return the clock at the first read and keep it for the rest of that update (a replay's pinned clock takes precedence).
Library exports can read current per-bar scalars. An exported function may now read immutable scalar bindings from the library's main scope, including per-bar values, and keeps seeing their current value on later bars. Objects, inputs and reassigned bindings stay private.
Live Trading (Broker)
External intervention quarantine. When someone else changes a bot-owned order, SL/TP or the bot's position share (with on_unexpected_cancel = "stop"), the run latches an EXTERNAL_INTERVENTION quarantine: it writes nothing to the venue (no entry, exit, close, cancel, amend or protection re-arm) while event ingestion and fill booking continue. A separate position of another party on the account is not treated as an intervention.
The quarantine survives restarts. It is stored in the broker database and lifted only by the new pyne broker resume RUN_ID QUARANTINE_ID command. A running bot picks the request up within seconds and restarts itself in place to re-sync with the venue; a stopped bot resumes at its next start. After the resume the bot re-asserts its own SL/TP once.
Venue-trouble quarantines are unchanged in scope. Rejected protective exits, repeatedly rejected closes and spot-inventory problems still only block new entries; protection keeps working.
Protection level guard. Plugins record their own SL/TP writes, so a confirmed foreign change to a protection level is detected and reported once.
Missing stops are re-armed only when their absence is explained. The stop-coverage guard waits for the disappearance verdict instead of rebuilding a stop someone may have removed; without a verdict after 120 s it re-arms anyway and reports it as unverified.
Spot inventory drift is judged against the bot's own inventory; a conclusive shortfall latches the quarantine.
Reversals stop waiting once any fill of the opposite entry is booked, so venue lot rounding no longer holds a reversal for the full 600 s.
A protective level crossed before the venue attached it is handled as Pine's immediate exit: the position is closed at market and logged at INFO instead of being reported as a failed protection.
Rejected dispatches are closed and no longer defer the run's exits on that side.
Crash safety: the broker store now uses PRAGMA synchronous=FULL.
Native fail-safe: after a restart or a cancel recovery, a parent waits for a broker confirmation only when the plugin has a native fail-safe actuator and the parent has an active SL or trail leg. Before, such parents could escalate to DEGRADED and block every entry on the symbol.
Spot pre-clear: the venue's cancel echoes of swept exit legs are logged as the engine's own strategy cancels, not as external cancels.
Quarantine log records are stable single-line records carrying the quarantine id and the resume command.
Breaking Changes
The on_unexpected_cancel = "stop_and_cancel" policy has been removed. Valid values are stop, re_place, ignore and halt. stop now freezes all venue writes until an operator resume.
Broker plugin API: plugins gate their venue writes with BrokerPlugin.ensure_venue_writes_allowed(), the quarantine sink takes a kind argument, and DisappearanceTracker no longer takes cancel_siblings. See docs/development/broker-plugin-authoring.md.
Broker database: storage migrations 8 and 9 run automatically on the first start.
Documentation
New CLI page for pyne broker (resuming a quarantined bot).
Broker plugin authoring guide updated for the intervention and quarantine contract.