Expand description
Services a host supplies, each through a small trait. Charts consume Marks, Signals and
Posts and keep their drawings in Storage, symbol choosers consume SymbolSearch, the
alerts panel Alerts, the watchlist Quotes, the notifications panel Notifications and the
chats panel Chats. SettingsStore and the layout menu keep settings and layouts in Storage;
other contracts define the host side of the assembled terminal. PaperAccount is a
ready-made Broker that simulates an account, and AlertEngine, with the alert-engine
feature, an Alerts service that evaluates alerts on the bars the host feeds it.
OrderFlowDetectors, with the detectors feature, is a Signals service that finds
order-flow events in the trades and depth the host feeds it.
Like Datafeed, every service is held as an Arc<dyn Trait> and
called on the UI thread. Its methods return at once and answer later through a
Reply, or push updates through an Events stream, from any thread,
runtime or browser task.
Structs§
- Absorption
Rule - An inside-price episode closes after one second without an execution there. It qualifies when aggressive volume reaches both the threshold and opening displayed size, no trade printed beyond it, and half the displayed size remains or order-level depth received adds.
- Alert
Data - Loaded live bars a host can lend to alerts with the same feed view. Supply only current, unpaused data, never replay bars or incomplete history.
- Alert
Engine - An
Alertsservice that keeps alerts in memory and evaluates them on the bars the host feeds it withupdate, asPaperAccountfills orders on the prices it is fed. It needs no egui, so a server can run the same code. A host that evaluates alerts on its own server implementsAlertsitself instead. Withstudies,AlertEvaluatorreads the saved source definitions from a datafeed and supplies these evaluations without constructing a chart. - Alert
Evaluator - History, subscriptions and independent study state for the alert service. Both interactive hosts and headless hosts poll this evaluator with the same saved definitions. Chart navigation and replay never replace its saved study definitions. Dropping it releases all subscriptions.
- Alert
Feed - Historical and streaming inputs for an alert without a rendered chart. Uses the same
validation, trade aggregation and history/live merge rules as a chart. Dropping it stops
its subscription and discards late replies. Available with
alert-engine. - BigTrade
Rule - What makes a trade large, and which of the zones of large trades are kept.
- Chat
Capabilities - The optional operations of a
Chatshost. - Chat
Message - One message of a room.
- Chat
User - A user, as the host identifies and names them.
- Count
Alert - Fires once when its window reaches
minimum, rearming only below it. - Detection
Alert - A live detection or count alert for a panel to show and the host to sound.
- Detection
Counts - Running detections, including loaded history and excluding updates of an existing signal.
- Detector
- The settings of one detector, disabled by default with alerts and sounds off.
- Detector
Settings - The settings of every detector, disabled by default, applied by
OrderFlowDetectors::set_settings. - Events
- Updates a service pushes to the terminal, from any thread, runtime or browser task. Cheap to clone; clones push into the same stream. The first push after a frame wakes the UI, and the pushes are applied in order on the next frame.
- Follow
Operation - A request to follow or unfollow, and how it stands.
- History
Page - One page of older history.
- History
Request - A request for one page of older history.
- Iceberg
Rule - Order-level refills at one price and side. An exact refill follows depletion within 100 ms, or replenishes an executed order within 100 ms without preserving priority. Aggregate depth estimates refills from executed volume divided by the opening displayed size, minus one.
- Liquidity
Rule - Follows levels within ten ticks of their side’s inside, and size added within five ticks. Automatic thresholds are four times the median positive displayed size within ten ticks on both sides at the current book update. An even count uses the mean of the middle pair.
- Market
Heatmap Selection - What the market heatmap shows, by the identifiers the host gave its universes and metrics.
Noneis the panel’s default. An identifier the host no longer offers stays chosen, so the choice returns when the host offers it again. - Marks
Page - One complete answer for a visible range. Empty vectors clear the source’s marks.
- Marks
Request - The chart view for which a host supplies annotations and events.
- NewChat
Room - A room the user asks the host to create.
- Notification
- One entry of the log.
- Order
Flow Detectors - A
Signalsservice that finds order-flow events in the executions and depth a host already streams, asPaperAccountis a ready-madeBroker. It needs no egui, so a server can run the same code. - Paper
Account - A paper account: a
Brokerthat fills orders against the prices the host feeds it, so the order ticket, the chart’s order and position lines and the account panel work as they do with a real account. - Profile
- What the host knows about a user the signed-in user can follow.
- Profile
Directory - The profiles the host pushed and the follow requests the user made, for one account. Call
pollevery frame; showprofilewith itsoperation, which says whether a request is pending or failed. - Profile
Id - The host’s identifier of a profile.
- Revision
- The host’s revision of a stored document, such as a version counter, an entity tag or a content hash. The library compares revisions for equality only and hands them back unchanged.
- Settings
Store - Keeps
UserSettingsin the host’sStorage: reads them once, then writes them a second after they last changed. A failed write keeps the settings in memory and is reported once bytake_error; a later poll or explicit flush retries it. Settings that could not be read are never written over. If the host keeps revisions of documents (seeStorage), a change by another client is read once nothing is unsaved and returned like the first read, and a write over a newer version is refused:conflictthen asks for the user’s choice andresolve_conflictapplies it. - Share
Link - A view-only link to a shared document and what its recipient may do with it.
- Share
Offer - The sharing operations a
Sharingservice offers for oneShareKind. - Stop
RunRule - A burst of at least five same-side fills, at most 20 ms apart, travelling at least three ticks without reversing. If any fill identifies its aggressor, at least three distinct aggressors are required. Unknown-side fills are excluded.
- Stop
Sweep Rule - A closed bar with directional delta of at least 25%, three diagonal imbalances at 3:1, a body at least 60% of its range, and volume at least 1.5 times the previous ten traded bars. Unknown-side fills never count. The latest subscribed time interval supplies the bars. The first retained bar is left out because its opening executions may be missing.
- Symbol
Expression - An arithmetic expression over symbols, such as
AAPL-MSFTor(BTCUSD+ETHUSD)/2, charted as one synthetic series. - Symbol
Query - What the user typed into the symbol search dialog, and the filters chosen there.
- User
Settings - What the library keeps of the user between sessions, in the
StoreKind::SettingsdocumentsettingsthatSettingsStorereads and writes. - Versioned
- A stored document with the revision it was read at.
Enums§
- Account
Event - A change to the account a
Brokerreports. - Alert
Event - A change to the host’s alerts, pushed through the stream
Alerts::watchreceived. - Chat
Event - A change to the user’s rooms, pushed through the stream
Chats::watchreceived. - Conflict
Choice - How the user settles a refused save. Until one is chosen the unsaved document stays in memory and nothing is written.
- Count
Window - The feed-time window of a count alert.
- Detection
Kind - The detections the service makes, each drawn in its own signal category.
- Expression
Error - Why text is not a
SymbolExpression, or why one cannot be charted. - Follow
Status - Where a follow or unfollow request stands.
- History
Kind - Which finished history
Broker::historyis asked for. - NewChat
Room Kind - Who may join a room the user creates.
- Notification
Target - What a social notification opens.
- Profile
Event - A change to the host’s profiles, pushed through the stream
Profiles::watchreceived. - Save
Outcome - The host’s answer to
Storage::save_versioned. - Share
Kind - What a
Sharingservice shares. - Signal
Event - A change to the signals of one subscription.
- Store
Kind - What a stored document holds. Each kind is its own namespace of names.
- Threshold
- The size or count from which a detector detects.
Traits§
- Alerts
- The host’s alerts. The host stores and evaluates them, on its own prices or on a server; the
library shows what the host pushes and sends every change the user makes through
saveandremove. With thealert-enginefeature,services::AlertEngineis a ready-made implementation that evaluates the alerts on the bars the host feeds it; without it the library evaluates nothing. - Broker
- One trading account at the host’s broker, real or simulated. The library holds no balances or positions: it shows what the broker pushes and places the orders the user confirms. Paper trading is an implementation of this trait. One value is one account; several accounts are several values.
- Chats
- The host’s chat rooms, for the chats panel. The host keeps the account, the rooms and their
messages, and moderates; the panel shows what the service pushes and sends what the user
writes through
send. - Marks
- Host source of marks. Attach with
Chart::set_mark_source. - Notifications
- Events the host tells the user about, such as alert triggers, filled orders or a lost connection, for the notifications panel. The host keeps the log; the panel shows what the service pushes, newest first.
- Posts
- Host service that resolves the link of a post or idea drawing into its content. Attach with
Chart::set_post_source. - Profiles
- The host’s profiles and follow relations. The host keeps the account, decides who may follow
whom and what a profile shows; the library shows what the host pushes and sends the user’s
follow and unfollow requests through
follow. It never changesProfile::followeditself. - Quotes
- The host’s quote stream. The watchlist subscribes to the symbols of its active list and the chart’s symbol, and hands the chart symbol’s quote to the symbol details panel, the symbol header and the order ticket.
- Sharing
- Sharing a layout or watchlist, supplied by a host that has accounts and somewhere to keep shared documents. The library owns neither: it shows the controls the host offers and reports the host’s answers. Without a service the layout menu and the watchlist panel offer no sharing.
- Signals
- The host’s analytics as markers, levels and zones. The library computes nothing: the terminal
draws what the service pushes, lets the user hide signals by category, and reports clicks.
Connect it through
Chart::set_signal_source(with thewidgetfeature). - Storage
- Where the library keeps settings and drawings between sessions: files, browser storage or a server, as the host chooses. The library reads and writes nothing on its own.
- Symbol
Search - Finds instruments for the symbol search dialog, from a source that need not be the feed’s.