Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/binance-strategy27-events-development.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ V10 live projection. The VPS remains the only market-data and event-analysis
authority. The userscript opens no Binance market-data WebSocket, uses no
Binance API key, and does not recalculate the four force groups.

Version 0.6.4 retains this installation's private gateway configuration and
Version 0.6.5 retains this installation's private gateway configuration and
provides a shared read-only transport. Strategy29 owns its own summary panel,
lifecycle and panel position. The existing `strategy27GatewayOrigin` and
`strategy27GatewayAuthSecret` storage keys remain the single credential source;
Expand Down Expand Up @@ -165,11 +165,11 @@ ADR 032 in CorsairQuant owns the server-side rule and transport contract. The
browser does not reconstruct candidates from ordinary events or recalculate
market evidence. The client, lifecycle, panel, native chart layer and optional-job
controller are wired into the entrypoint and tested together. The source and
generated install artifact are version 0.6.4 with identical metadata headers.
generated install artifact are version 0.6.5 with identical metadata headers.
The generated artifact passes syntax, release-contract and isolated execution
checks, including candidate delivery, paired entities, clear and context stop.
Binance operator-page validation remains outstanding. Server/gateway rollout
must precede browser publication; release status is tracked in
must precede browser publication. Initial compound publication history is recorded in
[CorsairQuant PR 324](https://github.com/jackhai9/CorsairQuant/pull/324) and
[userscripts PR 267](https://github.com/jackhai9/userscripts/pull/267).
Do not treat source unit tests or the panel fixture as deployment evidence.
Expand Down
57 changes: 42 additions & 15 deletions docs/binance-strategy29-bollinger-development.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ already-loaded native chart candles. The summary reads the authenticated
unified loopback gateway; it does not call Binance market-data or account APIs,
submit orders, rotate hidden charts, or add remote events as chart drawings.

Install Strategy29 0.5.4 with orderbook 2.7.199 or later, or use it alone.
Install CorsairQuant signal client 0.6.1 for the remote summary.
Install Strategy29 0.5.5 with orderbook 2.7.199 or later, or use it alone.
Install CorsairQuant signal client 0.6.5 for the remote summary.
Do not combine it with the embedded observer in orderbook 2.7.198.
After updating/disabling the old script, reload the page. An embedded observer
is an explicit conflict: Strategy29 stops and displays an upgrade/reload notice.
Expand Down Expand Up @@ -99,7 +99,21 @@ Server status freshness and signal times remain separate from local chart state.
Panel timestamps explicitly use `UTC+08` rather than inheriting the browser's
ambient timezone.

Observer API compatibility is `29_2_spec_v3`; durable event records retain
The main view shows the current symbol, connection, monitoring selection,
configured intervals, event-check time and recent signals. Each configured
interval retains up to three signals, then all retained rows share the same
descending close-time and sequence ordering. With six configured intervals the
maximum is 18 rows. An interval with no retained events is named separately;
the panel never fills its quota with another interval or synthetic signals.
The default-collapsed Diagnostics section contains specification compatibility,
the local detector fingerprint, selection details, stored processing progress
and global delivery totals. Processing rows sort by interval duration, from
minutes through days and weeks. Actionable connection, compatibility, selection
and processing failures remain visible in the main view; raw processing reasons
remain in Diagnostics. Delivery totals describe the server-wide notification
outbox and do not establish whether notifications are enabled.

Observer API compatibility is `29_2_spec_v4`; durable event records retain
`29_2_spec_v2` and are validated independently; the chart detector retains the frozen
V1 reference and unchanged hash. The server independently ranks an activity-score
universe and applies its configured intervals. Each status poll replaces current
Expand Down Expand Up @@ -157,21 +171,34 @@ off, `gateway_unavailable` when an enabled fixed backend cannot be reached, and
these separately. Installing the unified client does not activate server monitoring.

The browser polls status first and then consumes at most two event pages per
scheduled poll. A new route requests `mode=latest&limit=20` for its canonical
symbol: the server selects the most recent signal close times and a global increment
cursor from one SQLite snapshot. It does not scan retained global history to
fill the panel. Subsequent increments can contain no matching events while still
advancing that cursor. `cursor_expired` clears only remote rows and requests a new
latest snapshot. Rows are displayed and bounded by descending signal close time,
with descending durable sequence breaking ties. The snapshot response remains
sequence-ascending so the global increment contract is unchanged. Historical
backfills cannot evict newer signal times merely by being inserted later.
scheduled poll. A new route requests `mode=latest_per_timeframe&limit=3` for its
canonical symbol. The server reads its configured intervals, the three newest
retained events for each interval, and a global increment cursor from one SQLite
snapshot. Current market membership does not filter retained event history.
Subsequent increments can contain no matching events while still advancing that
cursor. `cursor_expired` clears only remote rows and requests another per-interval
snapshot. Rows are retained independently for each interval by descending signal
close time, with descending durable sequence breaking ties, and then displayed
in that same combined order. The snapshot response remains sequence-ascending so
the global increment contract is unchanged. Historical backfills cannot evict
newer signal times merely by being inserted later.

The client remembers the last nonempty set of configured intervals. A change to
that set clears remote rows and resets the cursor before requesting a new
snapshot; order-only changes and selection generations do not reset it. An empty
configuration during unavailable selection preserves the last known set and
history. If initialization consumed events before any configuration was known,
the first nonempty set also resynchronizes. A failed resynchronization leaves the
cursor unset. Status and events are separate requests that can straddle a server
restart, so snapshot validation uses the protocol's 13 supported intervals and a
39-row maximum, not the preceding status response's interval count. Each interval
is still capped at three and the snapshot must have `has_more: false`.
An empty increment advances the event-check timestamp without sorting retained
records or replacing their DOM rows. Nonempty increments sort once for retention
and rendering; locale changes still rebuild the translated rows.
This requires the server's explicit latest
This requires the server's explicit per-interval snapshot
query contract; a server rejecting it stops the remote context visibly.
Publish the V3 observer API contract before the client, then verify installed
Publish the V4 observer API contract before the client, then verify installed
source identity and reload before remote acceptance. Publication of either
component does not enable the observer, gateway, or notifications.

Expand All @@ -195,7 +222,7 @@ The status validator first checks the shared schema/spec/time identity envelope.
A different spec exposes only those three fields; no incompatible unit, selection
or delivery payload is interpreted. The panel clears current health rows, displays
the mismatch and preserves retained events; event consumption is blocked. Matching
V3 API responses still require every exact field and a coherent refresh state/reason
V4 API responses require every exact field and a coherent refresh state/reason
combination. An unknown schema envelope remains a contract error. The local reference hash is displayed and exposed
for audit, but the current server status schema does not carry a hash, so the UI
does not claim hash-level remote parity.
Expand Down
4 changes: 2 additions & 2 deletions scripts/binance-strategy27-events.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// @namespace binance.strategy27.events
// @icon data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2064%2064%22%3E%3Crect%20width%3D%2264%22%20height%3D%2264%22%20rx%3D%2214%22%20fill%3D%22%23f0b90b%22%2F%3E%3Ctext%20x%3D%2232%22%20y%3D%2249%22%20text-anchor%3D%22middle%22%20font-family%3D%22Arial%2C%20sans-serif%22%20font-size%3D%2242%22%20font-weight%3D%22800%22%20fill%3D%22%23111827%22%3EJ%3C%2Ftext%3E%3C%2Fsvg%3E
// @icon64 data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2064%2064%22%3E%3Crect%20width%3D%2264%22%20height%3D%2264%22%20rx%3D%2214%22%20fill%3D%22%23f0b90b%22%2F%3E%3Ctext%20x%3D%2232%22%20y%3D%2249%22%20text-anchor%3D%22middle%22%20font-family%3D%22Arial%2C%20sans-serif%22%20font-size%3D%2242%22%20font-weight%3D%22800%22%20fill%3D%22%23111827%22%3EJ%3C%2Ftext%3E%3C%2Fsvg%3E
// @version 0.6.4
// @version 0.6.5
// @author jackhai9
// @description Display Strategy 27 events and provide the shared private CorsairQuant gateway connection
// @match https://www.binance.com/*/futures/*
Expand Down Expand Up @@ -3061,7 +3061,7 @@ ${t("候选", "Candidate")} ${annotation.candidateId}`,
throw new TypeError("Signal gateway route or symbol is invalid");
}
const cursor = query.get("cursor");
const latest = keys2.length === 3 && keys2.every((key) => ["symbol", "mode", "limit"].includes(key)) && query.get("mode") === "latest" && query.get("limit") === "20";
const latest = keys2.length === 3 && keys2.every((key) => ["symbol", "mode", "limit"].includes(key)) && (query.get("mode") === "latest" && query.get("limit") === "20" || query.get("mode") === "latest_per_timeframe" && query.get("limit") === "3");
const increment = keys2.length === 2 && keys2.includes("cursor") && /^(0|[1-9]\d*)$/.test(cursor) && Number.isSafeInteger(Number(cursor));
if (!latest && !increment) throw new TypeError("Signal gateway event query is invalid");
return path;
Expand Down
Loading
Loading