Out now on npm

TradeCanvas 3.0: a trading desk, not just a chart

The 3.0 widget looks like a trading desk. The new Graphite look uses neutral greys, so your prices carry the colour. It gives traders the tools of a broker’s terminal: a docked order ticket, a footprint chart and a tape, and the HOSE rules Vietnamese brokers trade by.

npm i @tradecanvas/chart

3.0.0 is latest on npm, with the React, Vue and Svelte wrappers at 2.0.33. Coming from 2.x? Read Moving to 3.0 first: what can change is trading behaviour.

chart types
25
indicators
138
finance charts
22
languages
30
The new default

Graphite

A ChartWidget with no ui now uses Graphite: neutral greys, 3 px corners, and controls at five fixed heights. Selected items get a lighter background instead of an accent colour, so the only coloured block on the price axis is the last price.

Every demo on this page is Graphite. ui: 'modern' keeps the 2.x look.

Trading desk

An order ticket that sits beside the chart

The ticket is now a page of the dock. It hides no price, a click on the chart does not close it, and it stays open for the next order on the same side, kind and quantity.

Its button names the order (Buy 1 BTCUSDT) and the order’s value is the last line above it. A market Buy is valued at the ask, a Sell at the bid.

  • The ticket waits for your broker’s answer. A second press sends nothing, and a refusal keeps what was typed.
  • Close, Reverse and one-press orders ask first. Set confirmOrders: false to trade in one press.
  • While the feed is down or silent, market orders are held back and the status bar says “No price updates”.
  • The paper account keeps a balance and margin, fills in parts, and supports OCO, GTD, IOC and FOK orders.
new ChartWidget(el, {
  symbol: 'BTCUSDT',
  trading: true,  // the ticket in the dock
  // ticketPlace: 'dialog' keeps the 2.x dialog
});
const paper = new PaperExecutionAdapter({
  balance: 100_000, leverage: 5,
});
chart.connectExecution(paper);
Trading overlay docs →
Order flow

Footprint charts and a tape that reads the trades

chartType: ‘footprint’ shows, for each bar, what traded at every price inside it: the bid on the left and the ask on the right. Imbalances are marked and the point of control is outlined.

The tape lists time and sales in the dock. Large prints stand out, and a menu filters it to one side or merges a sweep into one row.

  • The chart fetches the trades itself from any feed with fetchTrades and subscribeTrades.
  • Each bar shows its delta and total underneath. Cells switch between bid × ask, delta and volume.
  • Bars can carry buyVolume, so Volume Delta draws the true delta, not an estimate.
new ChartWidget(el, {
  adapter,                  // a feed with trades
  tape: true,
  chartOptions: { chartType: 'footprint' },
});
Chart types docs →
Vietnam

HOSE rules, from the broker

The ticket shows the day’s ceiling, reference and floor above the price; click one to use it. Drag an order line past a limit and it stops there.

orderRules gives the ticket the exchange’s order kinds (LO, ATO, ATC, MP), its time in force and its lot. The exchange’s name is sent with the order.

  • setPriceLimits({ ceiling, floor, reference }) takes the prices as your broker gives them, including special bands.
  • Order prices stay on HOSE’s price steps. One-press orders use the lot of 100, not 1.
  • Shares are valued in dong. 100 shares at 26.40 read 2,640,000.
widget.setOrderRules({
  orderKinds: [
    { code: 'LO', type: 'limit' },
    { code: 'ATO', type: 'market' },
    { code: 'ATC', type: 'market' },
    { code: 'MP', type: 'market' },
  ],
  timesInForce: ['day'],
  lot: 100,
});
chart.setMarket(MARKET_HOSE);
chart.setPriceLimits({
  ceiling: 28.25, floor: 24.55, reference: 26.4,
});
Trading overlay docs →
3D and finance charts

Surfaces you can turn, and payoffs before expiry

SurfaceChart draws values over two axes as a sheet in a box, such as implied volatility by strike and expiry, or an order book’s depth over time. Drag to rotate it; arrow keys turn it once it has focus.

PayoffChart shows what an options position makes at expiry and, with a model, what it is worth with days still to go, priced by Black-Scholes.

  • There are now 22 finance charts, including Bar3DChart, CurveChart, BoxPlotChart, RadarChart, SunburstChart and StackedAreaChart.
  • renderFinanceChart and renderPriceChart draw without a page: in Node, or in a worker.
  • Every chart can be saved as a picture, printed or saved as a PDF, at any size.
new SurfaceChart(el, {
  x: strikes, y: daysToExpiry, values: iv,   // values[y][x]
  xLabel: 'Strike', yLabel: 'Days', valueLabel: 'IV',
});
Finance charts docs →

More to try

Four new indicators, each with a function that finds the same zones or lines without a chart, and an options payoff.

Order blocks addIndicator(‘orderblocks’) boxes the bar the market last turned from before a close broke a swing, until a close goes through it. The latest five on each side are drawn.
Fair value gaps addIndicator(‘fvg’) boxes each three-bar gap until a later bar fills it. A live bar only updates the gaps it touches.
Session volume profile addIndicator(‘svp’) draws each day’s volume by price from its first bar, with the day’s point of control and value area. The lines use the whole day, so they are for reading a day, not for backtests.
RSI divergence addIndicator(‘rsidiv’) draws a line between two RSI turns where the price made a new low or high and the RSI did not. A divergence shows five bars after its second turn.
An options payoff An iron condor at expiry, and in 21 days by Black-Scholes. Move the pointer to read both lines.
  • Six more chart typesColumns, HLC bars, step area, spline, dots and smoothed Heikin-Ashi.
  • Profit taken in partsUp to three take-profit levels, each closing its own quantity, each draggable.
  • Several symbols, one accountOrders and positions stay on their own symbol. Switching charts no longer revalues them.
  • Prices on the gridDrags, brackets and the context menu use the market’s price step, not the pixel’s price.
  • A log of every orderThe account panel’s Log tab lists each order placed, moved, cancelled, filled or refused.
  • Made for fingersOn a touch screen, no control is smaller than 32 px, at any size or density.

● The demos run on a simulated market. Prices, volumes and trades are made up.

Upgrading from 2.x

Your data, saved layouts, indicators, drawings, themes and style keys load as before. What can break is trading behaviour. Brackets go to your execution adapter, the ticket waits for the adapter’s answer, orders carry their symbol, and Vietnamese prices are counted in dong. Moving to 3.0 lists each change and the option that keeps the 2.x behaviour.