Chartsv26.10.18
Pro edition

Trading from the chart

The Pro trading surfaces - the order bracket with its risk and profit zones, the Sell / volume / Buy strip, the Order and DOM panel, the exits block with configurable confirmation thresholds, the position row and the execution toasts.

The trading layer keeps the platform contract: the library never talks to a brokerage API. The host implements the TradingAdapter over its BFF and owns every call, while the desk components render the state and route the intents. Orders use the six trading-ms types only - MARKET, LIMIT, STOP_LIMIT, TAKE_PROFIT, FOK and IOC - and the roles stay TRADER, OPERATOR, COMPLIANCE and PARTICIPANT.

Journal 0 · versions 0 · events 0
Spread 0.50
Buy10 × LIMIT866.74
Stop 863.71
Take 872.80
Risk 3.03Reward 6.062.00
60.6 ticks · 0.35%
121.2 ticks · 0.70%
Order ticket · AAPL
Notional 8667.40 USDLeverage 1:5
Risk 3.03 (0.35%)

The desk above works from the chart itself: press the Buy or Sell chip on the canvas and the order form opens right on the chart - pick one of the six platform types, the amount, the price and the protective levels, and submit. The plan then draws itself on the chart and one command writes exactly one journal record, one event and one toast, while the repeated key stays idempotent. Every screen docks on the chart: the Plan chip floats the bracket card and the exits block, the Panel chip docks the Order / DOM panel, the trade bar sits along the bottom edge and the position row along the top, while the toasts and the live counters stay wired to the same state. Once the plan is on, drag its entry, stop and take lines: they are chart price lines of the library, painted with their axis tags by the renderer, and the drag reads the live pixel and price scales of that chart - the pending price follows the pointer with the live risk numbers, the release writes exactly one journal version, the lock freezes a level and the exits block drives the same layer.

The bracket: one command, one story

BracketSeam carries the plan through a single path: the order goes to the adapter, the accepted result creates the markup object, the trading journal records it, one event leaves the seam and the host turns it into a toast. Role and mode gates plus validateOrderRequest run before the adapter, so a refused plan never touches the BFF and never creates an object. The stop and the take are optional; the distances are available in ticks of tickStep and in percents of the entry through bracketDistances.

BracketLayer paints the story on the chart. A drag opens a session and moves only the pending price - the live numbers follow computeRisk while the pointer moves - and releases exactly one version into the journal, no matter how many frames the drag lasted. The lock blocks a level from dragging, removing one level keeps the others, and the risk and profit zones use the fill patterns of the drawing registry.

The trade bar

TradeBar is the Sell / volume / Buy strip the host usually docks at the bottom of the chart. It is controlled: the spread comes from the bid and ask props, never from a timer. The quick volume set (1, 5, 10 by default) is configurable, readOnly blocks the buttons and explains the reason, mini hides the strip, and the keyboard follows a configurable mapping - Enter sends Buy and Shift+Enter sends Sell until the host flips enterSendsBuy.

The panel: Order and DOM

TradePanel carries two tabs over one source of truth. The Order tab wraps the ticket of the six platform types with the bid and ask quick prices, the notional in the account currency, the leverage and tick rows, the full-text call to action and the risk row. Validation problems render next to the fields, never as a toast. The DOM tab is the ladder with the volume field, the Flat, CXL All and Reverse actions, the Buy Mkt and Sell Mkt buttons and the position row; the refresh gate createDomRefreshGate keeps it under ten refreshes per second during a book storm, and every action has an accessible name and stays behind its host callback.

Exits and confirmations

The exits block carries the take-profit and stop-loss toggles, their prices, the distances in ticks and percents, the quick 1R and 2R targets built by targetFromRisk, the ATR hook and the drag entry. The confirmation policy lives in the core: confirmationDecision compares the order against the thresholds of the host - quantity, notional and the share of the deposit - names every trigger that fired, and OrderTicket.confirm refuses to touch the adapter while a fired threshold stays unconfirmed. The thresholds can be switched off explicitly by omitting them, and the exits block shows the reason of the fired threshold as a hint.

Position and toasts

PositionRow is the compact line of the open position: size, average, the unrealised P&L recomputed from the last tick with no internal state, and the close action. TradeToasts rides the shared toast stack with a five-second life and an idempotency key, so a repeated platform event never duplicates a toast. The trade pulse of a bar follows the motion policy of the kit - when the reduced motion is requested it is not rendered at all.

Hosting notes

  • orders are created by TRADER and PARTICIPANT; OPERATOR and COMPLIANCE watch and export, and the readOnly mode blocks everyone;
  • every send path goes through the host callbacks that own the adapter: the components never call the platform themselves;
  • the tickets, the seam and the layer are framework-free in the core, so the same logic serves React, the custom element and the terminal windows.

On this page