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
The widget's order ticket opens in the dock, beside the chart (@tradecanvas/chart): it was a dialog over the
chart. ticketPlace: 'dialog' keeps the dialog; a phone, and a widget with the dock off, have it as before. 'orderTicket' is one more WidgetPanel, which a page of your own cannot take as its id.
A confirmed bracket goes to the execution adapter (@tradecanvas/chart): with an adapter connected, brackets is now 'place' when left out, where it was 'event' with a warning in the console. An app that places the bracketPlace event's bracket itself connects with { brackets: 'event' }. The docs' Moving to 3.0 page has each case.
The paper account fills a stop-limit within its limit (@tradecanvas/core): PaperExecutionAdapter made a stopLimit order a position at its stop. It now becomes a limit order at its price once the stop is reached, and fills only within it.
A price set by hand is on the market's grid (@tradecanvas/core, @tradecanvas/chart): orderModify, positionModify, bracketPlace, the orderPlace of a draft order or of the right-click menu, priceAxisAdd, chartContextMenu and an alert dragged carried the price under the pointer as a pixel gives it (62549.71592675613). They carry it on the market's price step, else to the decimals the price axis shows (chart.roundPrice). Code that rounded them itself can stop. On a market with a ceiling and a floor for the day, an order's own price is also kept inside them: dragged past one, it is reported at it.
An order from the ticket waits for the adapter's answer (@tradecanvas/chart): with an execution adapter connected, the order ticket stays open until the adapter's placeOrder resolves or rejects, where it shut as it placed. An adapter whose placeOrder never settles leaves it waiting: resolve with the order, or reject with the reason. With it: every orderPlace payload carries a clientOrderId; a market order from the ticket carries the ask or the bid as its price where the feed gives both; an order from the right-click menu or the depth ladder is for the market's lot, not for 1.
Orders, positions and fills are drawn on their own symbol (@tradecanvas/commons, @tradecanvas/core, @tradecanvas/chart): one that names its symbol is drawn only while the chart shows that symbol, and the chart names the symbol it shows on every orderPlace payload, which PaperExecutionAdapter keeps on the order, on its position and on their fills: a position opened on one symbol is no longer drawn on the next. Every fill told has a symbol once the chart shows one, ChartWidget no longer forgets the fills when its symbol changes, and setMarkPrice takes the symbol as a third argument, which the chart gives in a replay. What names no symbol is drawn on every symbol, as before. The docs' Moving to 3.0 page has each case.
A press held on the chart shows the price popup (@tradecanvas/chart): in ChartWidget a mouse press held still on the plot for half a second shows the floating OHLCV tooltip until the button is let go, so a press held that long is no longer a click or the start of a pan (click and barClick are not sent for it). The widget's crosshairTooltip feature is 'hold' where it was false; chartOptions: { features: { crosshairTooltip: false } } has no popup, as before. Chart is not changed.
One-press orders wait for a live price (@tradecanvas/chart): with a feed of its own, ChartWidget no longer sends an order asked for in one press (the right-click menu, the depth ladder), nor a bracket or a draft order confirmed, while that feed is not connected; and the ticket sends no market order while it is not connected or has told nothing for a minute (feedQuietAfter).
One-press trades are confirmed, and a bid on the ladder is bought at (@tradecanvas/chart): ChartWidget asks before a position is closed or reversed and before an order from the right-click menu or the depth ladder is placed, where they went out in one press; confirmOrders: false keeps one press. On the depth ladder a press on a bid places a buy limit at that price and a press on an ask a sell limit, where a bid was sold into and an ask bought: orderPlace carries the other side from the same cell.
The widget's default look is Graphite. A ChartWidget with no ui is drawn in neutral grounds with 3 px
corners and a 40 px toolbar, and what is picked shows on a lighter ground, not on amber; the chart's colours
change with it unless theme is an object. ui: 'modern' keeps the look before it. The order ticket's button
names the order ("Buy 100 HPG") and a position's Reverse and Close buttons come right after its P&L: a test that
read the button's text or a column by its place needs the new one.
Vietnamese shares are worth their price in dong.MARKET_HOSE, MARKET_HOSE_ETF, MARKET_HNX and MARKET_UPCOM have a contractMultiplier of 1,000, their prices being in thousands: an order's value, a
position's profit and the amounts on the chart's tags read a thousand times what they did (100 shares at 26.40
are 2,640,000). scaleMarketPrices divides the multiplier by its factor. Stop multiplying by 1,000 yourself.
Money is counted by the market's multiplier wherever the chart counts it, as the account panel and the
ticket did: the amounts on the chart's tags (a VN30F position's tag reads in money, not in points), the
quantity a Long or Short Position drawing's risk buys, a bracket sized by risk, and a PaperExecutionAdapter
given no multiplier of its own, which takes the market's from the chart (ExecutionAdapter.setMultiplier,
optional). positionLevels(drawing, multiplier) takes the market's as its second argument. A position
keeps the multiplier it opened with (TradingPosition.multiplier): a chart shown another market or another
symbol revalues nothing that is open. An adapter is handed the multiplier of the chart an order comes from beside
the order (placeOrder(intent, context), OrderContext); the order itself has nothing added.
TimeInForce has three more members (@tradecanvas/commons): 'gtd', 'ioc' and 'fok'. Code that handles every member needs them.
FillReason and ExecutionEventType have one more member each (@tradecanvas/commons): 'liquidation' and 'marginCall'. Code that handles every member needs them.
Chart
The day lines start where the trading day does (@tradecanvas/core, @tradecanvas/chart): on a symbol whose session runs past midnight, the chart's dashed day lines fell at midnight while Session VWAP, the session volume profile and the prior-day lines started again at the session's open (17:00 for CME's). While the chart shows the exchange's time (setTimeZone('exchange'), or the exchange's zone by name) they now fall at the open too, a week's line on Sunday evening's; on another clock they stay at its midnight. SessionBreaks.setDayStart sets it.
A switch is no number in an indicator's name (@tradecanvas/chart): the legend, the chips, the Objects panel and the CSV columns named an indicator by its short name and its numbers, an on/off input among them as a bare 0 or 1 ("OB 5 0 5", "FVG 0 0", "Vol Δ 1"). An input that is a whole number from 0 to 1 is now left out at its default and named away from it, on ("OB 5 5 Broken", "Vol Δ Cumulative") or off ("Patterns 10 Reversal off"), so two instances still read apart. The widget writes these words in its 30 languages (indicatorSwitch.* messages). indicatorChipLabel takes the indicator's inputs as a fifth argument for it, and the words as a sixth (English unless given); without the inputs it reads as before. Volume Delta's mode is labelled Cumulative.
One value area everywhere (@tradecanvas/core, @tradecanvas/chart): the chart's market profile (setMarketProfileVisible, its TPO counts) and the range volume profile drawing (volumeProfileRange) grew their value area a row at a time toward the heavier neighbour; they now grow it two rows at a time toward the heavier pair, as Market Profile counts it and as the session volume profile (svp) does. On some ranges the value area's edges move, and it can hold a little more than its share.
A trading day that starts in the evening (@tradecanvas/commons, @tradecanvas/core, @tradecanvas/chart): a symbol whose session runs past midnight (SymbolInfo.sessions with { start: '17:00', end: '16:00' }, CME's in Chicago) starts its trading day at the session's open. The indicators that start again each day, week or month (Session VWAP, VWAP's and Volume Delta's anchor, the session volume profile, the MTF moving average's days), the prior-day lines and the market profile's days ran from midnight and cut such a session in two; they now run from 17:00 to 17:00, each day named by the date it ends on. Sessions inside a day keep midnight, as before. Indicators read it as config.sessionStart (minutes after the exchange's midnight), set by the chart; tradingDayStart(sessions) gives it, and sessionVolumeProfiles takes it as sessionStart. Daily bars, and the days built from trades, keep the zone's midnight.
Order blocks (@tradecanvas/core, @tradecanvas/chart): addIndicator('orderblocks') draws a box over the bar the market last turned from before a close broke a swing: the lowest bar between a swing high and the close over it (bullish), or the highest between a swing low and the close under it (bearish), from its high to its low. A swing is a bar higher (lower) than the length bars before it and no lower (no higher) than the length after (5), so it is known length bars late, and it makes one block. A box runs to the right edge while its block stands; a close through it breaks it and takes it off, unless showBroken: 1 keeps it, fainter, to the bar that broke it. Only the latest count standing blocks of each side are drawn (5; 0 for all). The boxes look like fair value gaps', and the two share their drawing. detectOrderBlocks(bars, { length }) gives them all with no chart. A live bar finds again only what it can change. The 138th built-in.
A volume profile a day (@tradecanvas/core, @tradecanvas/chart): addIndicator('svp') draws each trading day's volume by price, as rows growing right from the day's first bar, with the day's point of control and value area as lines across it. A day's range is split into rows (24); each bar's volume is shared by the rows its range covers; the value area holds valueArea percent of the day's volume (70), grown from the busiest row two rows at a time toward the heavier pair, as Market Profile counts it. A day starts at midnight on the exchange's clock, as Session VWAP's does. Each bar's poc, vah and val are its whole day's, the bars after it included, so they are for reading a day and not for signals or a backtest at that bar; on the day still trading they move as it trades. A live bar works out again only the day it is in. sessionVolumeProfiles(bars, options) gives the days' rows with no chart. The 137th built-in.
Divergences (@tradecanvas/core, @tradecanvas/chart): addIndicator('rsidiv') is the RSI with its divergences from the price: a line between the RSI's two turns where the price made a lower low and the RSI a higher one (bullish), or the price a higher high and the RSI a lower one (bearish), and a mark at the second turn; hidden: 1 adds the hidden ones, dashed. A turn stands out from left bars before it and right after, so a divergence is known right bars late and does not change once the bar that confirms it has closed (while that bar is forming it can come and go); minBars and maxBars say how far apart the two turns may be. detectDivergences(bars, line, options) reads any line with one value a bar (a MACD histogram, an indicator of your own) with no chart. A live bar looks again only at the turns it can still decide. It reads the close, and has no source input as rsi has: its turns are read against the bars' own lows and highs. The 136th built-in.
The tape writes its sizes to the decimals the rows listed need (@tradecanvas/chart): it took them from every trade it kept, so one fine print older than the rows on screen, or under the least size, wrote every whole size as "16.00". The decimals are now those of the rows listed, of both sides.
Fair value gaps (@tradecanvas/core, @tradecanvas/chart): addIndicator('fvg') draws a box over the prices three bars left traded by the middle one alone (the third bar's low over the first bar's high, or its high under the first bar's low), from the middle bar to the right edge while the gap is open, teal going up and pink going down (the candlestick patterns' colours, apart from the candles' own). A gap is filled by the first later bar that trades through all of it and is then taken off the chart; showFilled: 1 keeps it, fainter, to the bar that filled it, and minPercent leaves out the small ones. detectFairValueGaps(bars, { minPercent }) gives them all with no chart: index, formed, direction, top, bottom and filledAt. A live bar costs what it changes: the gaps it forms and fills, not the series again. It is in the indicators dialog under the patterns, the 135th built-in.
A chart of values too near each other to scale no longer takes the page with it (@tradecanvas/core, @tradecanvas/chart): an EquityCurveChart whose curve and benchmark were flat at nearly the same value (a run with no trade beside a market that never moved, the benchmark rescaled to the curve's start, so 100,000 beside 100,000.00000000001) threw "RangeError: Invalid array length" while it drew, after holding the page's thread. The step of its value axis was smaller than such values can be told apart by, and the loop that makes the ticks never ended. A range that narrow is now drawn as one value, with room above and below, in every finance chart that scales its values (niceScale).
In Graphite the accent fills no button and marks nothing picked, and the last price is the one block on the price
axis. The button that sends in a dialog or a panel (OK, Go to, Add alert, Save), a tick box, a radio, a slider's
thumb and a replay's play button are the text's colour with the ground's for their ink, where they were the
accent's fill; what is on (a menu's row, a tool, a tab of the account panel, a layout, a command) is the text's
colour on the picked ground, with no line of the accent under a tab; the keyboard's ring is the text's colour
(off its fill by the ground's width on a filled button and a slider's thumb), and a field in focus has its
line in the muted text's. A look set to underline what is on (ui.active: 'underline') keeps its line, and an
alert that fired keeps the accent's tint on its row. The accent is left to what is the
user's own on the chart and to a link. On the price axis an order's and a position's tags are outlined where a
theme outlines the values on its axis (valueTagsOutlined, the Graphite themes), as an indicator's value and a
quote are; filled, in every look, they are a shade deeper where no ink would read on their colour. The other looks'
chrome is as it was.
Graphite's picked ground lets a muted figure read on it, and two more picked things lose the accent. The dark
theme's picked ground is #2a2c32, where it was #2b2d33: the watchlist's picked row had its muted and
falling figures at 4.48:1, and has them at 4.54:1. The day picked in the calendar is a block in the text's colour,
where it was a block of the accent, and today is told by its line and its weight, not by the accent; the alerts panel's
button for a new alert, its form open, is on the picked ground too.
Graphite's smallest type is its small size: nothing to read is 10 px anywhere in the widget. The look's
smallest type token (--tcw-font-size-xs) is 12 px, where it was 10: the status bar, the watchlist's columns and
changes, the tape's and the ladder's heads, the account table's heads, the hotkey sheet, the command palette's
headings, hints and notes. A look that sets its small size writes nothing to read under it, and so does a ui.font.smallSize of
your own in any look (the smallest type is then that size too, where it was two steps under the body); the
other presets are as they were. A character inside a set shape (the letter in a symbol's badge) has a token of its own, --tcw-font-size-glyph, two steps under the body in every
look. In the watchlist the symbol on the chart is a picked row: the picked ground and its name in the strong
weight, the other names plain, with no bar of the accent down its left.
Graphite's chart dialogs are drawn by the design file. Every dialog's title is 15 px, where it was 21, and its
Cancel a neutral button with no border. In Indicators, Symbol search, Chart Settings and an indicator's or a
drawing's settings: nothing is 10 px (a group's name, an
indicator's short name and kind, a symbol's type and exchange, a day's change, a hint, a field's error, a colour's code are 12); a heading of a
group or a column is not strong; how many of an indicator are on the chart, in the dialog and beside the
toolbar's Indicators button, is a plain number, where it was a badge in the accent; the symbol on the chart is
marked by a tick in the text's colour, its name no longer in the accent; Template and the button that gives a
colour back to its part have no outline; on a phone the dialogs' tabs are not outlined; a colour's code is in the
figures' face. The other looks are as they were.
A limit's price is written once where the last price sits on it in its colour. With lastPrice.limitColors on
and the last price at a limit, the limit's own tag on the price axis gives way to the last price's: they were two
blocks of one colour with one figure, three with the countdown. The limit's line and its name stay, and so does
its tag where the price has gone through the limit far enough for the two to stand apart.
A day's limit tags are tags as the axis's others are, and the last price can take a limit's colour. A limit's
tag on the price axis is 16 px tall with its figure in the theme's small size, where it was 14 px with a figure a
size under, and is filled a shade deeper where no ink would read on a colour a host gave (the rule the last
price's, a quote's and an indicator's value's tags have); the theme's own ink is kept wherever it reads. A new
style key, lastPrice.limitColors, off unless you set it, with a switch in Chart Settings: the last price's line
and tag are the ceiling's colour at or over the ceiling, the floor's at or under the floor and the reference's at
the reference price, for a market whose boards colour prices so. The chart writes nothing under 10 px (a limit's
name, a signal's word and a trade zone's label were 9 px where the theme's small size is 11), the market
profile's rows grow with their type, and the time zone at the time axis's corner is the theme's quieter text at
full strength, where it was faded to under 4:1.
The last price, a quote and an indicator's value read on their tags, the quotes are outlined in Graphite, and the
chart's small type follows the theme. A tag's fill is deepened, its hue kept, where the ink it takes would not read on it at 4.5:1: a
light chart's last price was white on its candle's green at 4.06:1 (the candle keeps its colour, the tag and the
countdown under it are a shade deeper), and the same goes for the bid's and ask's tags and an indicator's filled
value. A look's own lastPrice.labelBackground is left as it is. Where a theme outlines the values on its axis
(valueTagsOutlined, the Graphite themes; axis.price.valueTagsOutlined), the bid's, the ask's, the high's and
the low's tags are outlined too, so the last price is the one block of colour among them. The type the chart had
at 11, 10 and 9 px in every theme (the day's limit tags and their names, a pane's title, alert, signal and
trade-zone labels, period levels, pivots, the market profile's figures, the measure tool) is the theme's small
size and one and two steps under it: unchanged in a theme whose small size is 11, a size up in Graphite, and
grown with a widget on a wide screen as far as its box holds it (a tag 14 px tall keeps 11 px type). A rise's and a fall's figures on the card beside the crosshair and on a
pinned bar's card are taken toward the chart's text until they read at 4.5:1 on its ground; the pinned card's
move is at full strength, and the card takes a new look's colours when the look changes while it is pinned.
Fixed: the crosshair's percentage (crosshair.labelChange) was still written with the last price switched off
by lastPrice.visible.
The crosshair says how far its price is from the last, and the chart's cards are set as the chart is. Under
the price the crosshair names on the price axis, Graphite writes that price's distance from the last one in
percent (+1.25%, in the chart's locale): the crosshair.labelChange style key, with its switch in Chart
Settings, on in the Graphite themes (a theme's own crosshairChange) and off in the others. None is written
with no last price, with the last price hidden, or on a percent or indexed scale; the tag stays on the plot by
its top and bottom, and the price axis is given room for a change of two figures (a wider one is cut at the tag). The card
beside the crosshair and a pinned bar's card are in the theme's small size and face throughout: the first had
five sizes from 10 to 11.5 px in every theme, the second a system face of its own at 11 and 9 px, its
"pinned" in small capitals and its rule in the move's colour (now "Pinned", and the chart's own line). In Graphite
both are a menu's: the raised ground, the one corner and shadow, nothing seen through, the change a plain
figure in its colour. A widget's look sets these through --tcw-chart-card-*; a chart with no widget keeps
the theme's.
A price reads on its own tag, and the last price is the one block of colour on Graphite's axis. The
ink on a filled tag (the last price, the countdown, an indicator's value, a mark) is now the dark or the light
one by which has the more contrast on the fill, in every theme: white on a candle's green was 2.3:1 and on its
red 3.1:1, and is now dark ink at 8.2:1 and 6:1; a deep fill keeps white. In Graphite an indicator's value
tags on the price axis are outlined, not filled (a theme's own valueTagsOutlined, which the axis.price.valueTagsOutlined style key and its switch in Chart Settings are over; a theme object of yours
that sets none keeps them filled), so the last price is not
one of five blocks; a value's figure is its line's colour, deepened toward the chart's text where it would
not read at 4.5:1 on the ground (it was written in the scale's grey, or left pale). Graphite's chart is set in the chrome's small size: its axes, tags and the prices in the
legend are 12 px, where they were 11 beside 12 px rows of indicators (GRAPHITE_DARK_THEME and GRAPHITE_LIGHT_THEME have font.sizeSmall: 12; the legend takes the look's font.smallSize). The other
themes keep their sizes and their filled tags.
Graphite by a design file.DESIGN.md at the repository's root says how the default look is drawn and
why, in the DESIGN.md format: its tokens, its components and
what not to do. Brought to it in this change: a field in focus says so on its own line, with no ring or glow
around it (number and text fields, selects, the stepper); the account panel's totals are a muted name and its
figure with no colon between, the open profit first and strong; a tab's count is a plain number; New order is
a neutral button with no border; the ticket's line over the order's value is solid; the day's limits stand by
the price they set; and a time in force or an order type with one choice reads as text. In every look a
total is now three parts for CSS of your own (tcw-account-total-name, -sep, -figure), reading as before,
and the open profit carries tcw-account-open. The other looks are drawn as they were.
A position is counted at the adapter's own price for it. Where an adapter gives a position its markPrice, the account panel's row (its Price and its P&L) and the chart's tag on the position count at it,
for a position of the chart's own symbol too: a row was counted at the chart's last price under a total the
broker had counted at its mark, and the two disagreed (+120.00 in the row, +300.00 as Open P&L). An adapter
that gave a position of the chart's symbol a markPrice and did not keep it current now shows that price:
say the positions again as the mark moves, or leave it out. With none, as before, the chart's latest price.
The band from a position's entry still reaches the chart's price, in the colour of the profit as the tag
counts it, and a positionLabel of your own is given the mark as its price. A markPrice of 0 is taken for
none; one under zero is a price. positionMark(position) (@tradecanvas/commons) is the price read that way.
Graphite's chrome in two type sizes and fewer rules. Figures in the account panel's table, a field's
name, a segment, the quote buttons and the bars under the chart are 12 px, where they were 11 and 10; a look's
small size is its own now (ui.font.smallSize, 10 to 20; left out, the step under size as before, so the other
looks are unchanged). The strong weight is kept for what is read first and what is picked: a column's
heading, a side in a row, the quote buttons' names, the range buttons and the ticket's side that is not
picked are in the plain weight. The order ticket has no rules between its rows, its day's limits are
figures to press with no box around each, and its button that sends is as wide as the ticket leaves it. The
toolbar draws a rule only between its groups (three, where there were six), the drawing tools stand at one
pitch with no divider between their sections, and a tool group's corner mark shows under the pointer, on focus
and while its menu is open (always where there is a touch screen). A theme of yours that sets font.size
over Graphite keeps the small size on the scale under it, as before. The other looks are as they were; their dividers inside
a group carry tcw-toolbar-sep--minor and tcw-sidebar-divider--section for CSS of your own.
Graphite's ticket and account panel, on its sizes and with fills of their own. The ticket's title is the
size of the order's value, its sides and fields are 36 px, its segments 28 and its buttons 40; it opens with
the quantity focused. Buy and Sell are deeper fills with white type (4.5:1 or more) and no border, as are the
quotes on the chart under the pointer. A position's row reads Entry, Price, SL, TP, then P&L with its buttons
after it; rows are 28 px and the panel is as tall as its rows, up to its height before.
The Graphite look (ui: 'graphite', the default): a trading desk's chrome with no hue of its own, dark and
light, on few tokens: controls 20, 24, 28, 36 or 40 px tall, one corner of 3 px, one shadow for what floats.
Chart themes to match are exported (GRAPHITE_DARK_THEME, GRAPHITE_LIGHT_THEME). In it switches are boxes
that are ticked and the account table's columns are as wide as their figures. In every look the order ticket
writes the order's value last and largest, over a button that names the order.
The broker's order rules (@tradecanvas/commons, @tradecanvas/core, @tradecanvas/chart): the widget's order ticket offered Market, Limit, Stop and Stop-limit, good till cancelled, on every market; an exchange takes kinds of its own (HOSE: LO, ATO, ATC, MP, for the day), and what a broker takes changes with the board and the session. orderRules, and widget.setOrderRules as the symbol or the session changes, give the kinds of order by the exchange's names, each with the kind the chart knows it as, the times in force taken (a kind may have its own) and the lot, which stand over the market's preset; an open ticket takes them at once and stays on its kind where it is still taken. The exchange's name goes with the order as exchangeType on the orderPlace payload, which PaperExecutionAdapter keeps on the order; it trades it as its type, and simulates no auction. An order from the right-click menu or the depth ladder goes out as the broker's kind of its type, or not at all where it has none; a bracket, a draft order and a close or a reverse are not named by the rules.
Colours of their own for the market profile and the liquidity heatmap, and the profile's figures clear of the legend (@tradecanvas/core, @tradecanvas/chart): both layers drew in the theme's rising and falling candles, so a chart that hid its candles to draw bars of its own lost the heatmap and the profile's value area with them. setDepthHeatmapConfig({ bidColor, askColor }) and setMarketProfileConfig({ valueAreaColor, color }) give them colours of their own; null, or none given, is the theme's as before, and getDepthHeatmapConfig and getMarketProfileConfig say what is set. The profile's POC, VAH and VAL were written in the plot's top corner, over the legend's lines: they are now written under the legend, and under the rows the widget stacks beneath it.
The day's limits as the broker gives them, and in the ticket (@tradecanvas/commons, @tradecanvas/chart): the ceiling and the floor were always the market's percentage of a reference price, which a special band or a stock's first session on another exchange is not. chart.setPriceLimits({ ceiling, floor, reference }) takes the three as they are for the symbol; a number is still the reference alone, with the percentages. The lines, the prices an order's line stops at and the ticket's checks follow what is given. The widget's order ticket, which knew the limits and showed neither until a price was refused for being past them, now shows the ceiling, the reference and the floor over its price: a press on one sets the price, and priceLimitOrder puts them in the order of a broker's board.
A trade is confirmed before it is made in one press (@tradecanvas/chart): Close and Reverse in the account panel, the same buttons on a position's line, a right-click "Buy limit" and a cell of the depth ladder each traded at once, with nothing asked. ChartWidget now asks first, in a dialog that says the trade in full (the side, the quantity, the price, the symbol): Enter does it, Escape and a press outside leave it undone, and an order is not sent if the feed went down while it asked. confirmOrders: false is one-click trading. chart.setPositionGuard is what holds a press on a position's button until it is confirmed, for a guard of your own on a headless chart. On the depth ladder a press on a bid now places a buy limit at that price, joining the bids there, and a press on an ask a sell limit (a bid was sold into, which only the cell's hidden label said); each cell says what a press places, with the quantity, before it is pressed.
A price that is no longer live (@tradecanvas/chart): the status bar said "Live" over a stream that had stalled two minutes before, and with the feed failed an order still went out at the price left standing. The widget now knows the price is live only while its feed is connected and telling: chart.getFeedTime() is when the stream last told anything, and a feed quiet for longer than feedQuietAfter (seconds, 60; 0 never) or not connected leaves it not live. The status bar then says "No price updates" in place of "Live", with a still dot; and the ticket sends no market order and warns on a limit or a stop, whose price is the trader's own. While the feed is not connected, an order asked for in one press, from the right-click menu or the depth ladder, and a bracket or a draft order confirmed on the chart are held back too, with a note that says why (chart.setOrderGate asks before those two are sent). Closing a position and cancelling an order are not held back. A market that is shut is not judged, nor are a replay or bars set by hand.
An account of more than one symbol (@tradecanvas/commons, @tradecanvas/core, @tradecanvas/chart): a long opened on BTCUSDT stayed on the chart when the symbol became ETHUSDT, its profit counted from ETH's price, and the paper account filled, stopped and valued it at that price. TradingOrder, TradingPosition, FillEvent and OrderPlaceIntent now have a symbol. The chart draws the orders, positions and fills of the symbol it shows (chart.getSymbol(); chart.setSymbol(symbol) says it for bars set by hand) and keeps the others, which getOrders(), getPositions() and getFills() still give and which are drawn again when their symbol is shown; what names no symbol is drawn on every symbol, the chart never guessing whose it is. A symbol is the same in any case of letters, and by its ticker where one name alone has a venue (BTCUSDT is BINANCE:BTCUSDT; sameSymbol in @tradecanvas/commons). An order the chart asks for names the symbol shown, a confirmed bracket's too, and a position is reversed on its own. PaperExecutionAdapter.setMarkPrice(price, time, symbol) works only that symbol's orders and stops and values each position at its own symbol's price, closing, reversing and stopping it out there; a net account keeps one position a symbol. The widget's account panel names each row's symbol once one is of another, and gives a position of another symbol the adapter's own price (markPrice on the position) or none; the depth ladder marks the orders of its own symbol; and the fill history and the realised profit stay when the symbol changes.
The price popup on a press held (@tradecanvas/commons, @tradecanvas/core, @tradecanvas/chart): features.crosshairTooltip takes 'hold' beside true and false. The floating OHLCV tooltip then shows only while a mouse press is held still on the plot: after half a second, the wait of a finger's long press, it shows for the bar under the pointer, follows the pointer from bar to bar, and goes when the button is let go. The chart does not pan meanwhile, the press is no click, and a pointer that only hovers shows no popup. A press that moves before the wait is over pans as before, and one that an order's line, a drawing, an axis or the "+" took is theirs. ChartWidget starts on 'hold' (it had no popup under the mouse, only the Alt-click pin); Chart keeps true, the popup under a pointer that hovers.
An order is valued at the price it trades at, sent once, and answered for (@tradecanvas/commons, @tradecanvas/core, @tradecanvas/chart): the order ticket valued, checked and sent a market Buy at the last price while its button showed the ask. Where the feed gives a bid and an ask it now trades a Buy at the ask and a Sell at the bid, in its sums, its checks (a limit against a stop, a stop-loss against the entry) and the price it sends; else at the last price, as before. Every order asked for goes out with a clientOrderId (its own, else one the chart gives it: from the ticket, a draft, the menus, a confirmed bracket, a reverse), placeOrderIntent returns the order as sent, the new orderPlaced event says an execution adapter took it, and an executionError of an orderPlace names it by clientOrderId; the paper account takes one order for an id, however often it is sent. With an adapter connected the ticket waits for the answer: it stays open with "Sending…" and nothing to change, so a second press sends nothing; it shuts once the order is taken, and when it is refused it keeps what was typed and says why (it shut as it placed, and the refusal was a note gone in three seconds). After ten seconds with no answer it says so, and waits on; what became of the order is told even when the adapter is taken away before it answers. A quote with its bid over its ask is taken for none. "Order sent" is said once the broker took the order. A press outside the ticket no longer shuts it. An order asked for in one press, from the right-click menu or the depth ladder, is for the market's lot where it has one (it was for 1 on a market that trades in hundreds, and the ladder's had no quantity). A note of something that went wrong stays 8 s, not 3.5. The paper account still fills a market order at its mark, the last price: it knows no spread. See Moving to 3.0.
The toolbar of a selected drawing keeps to one line, under what opens (@tradecanvas/chart): the toolbar over a selected drawing was a layer above the top bar's, so a menu opened from the bar (intervals, chart type) lay under it and the rows it covered took no press; on a phone it covered the drawing tools' button and the open tools, and with buttons of a finger's size it was wider than the chart. It is now under everything that opens (menus, a tool's menu, the panels, a phone's tools; the pinned tools' bar with it), and its own choices still open over all. On a chart too narrow for its buttons it stays on one line and gives up buttons, first to last: those the drawing's menu holds too (the alert, the lock, the words, the settings, each only while the host leaves its entry in the menu), then the figure beside the line width, then the text's and the fill's colours, which the settings hold. The line's colour, width and style, an order, the menu and delete stay. On a phone it waits at the foot of the plot beside the drawing tools' button, level with it. The audit's scene menuOverSelection holds it.
Controls take a finger's press, and a pointer's (@tradecanvas/chart): on a device whose main pointer is coarse (a phone, a tablet at any width) no control of the widget is smaller than 32 px each way, in every look and density. The sizes controls are made at (a control, a small one, a menu's row) are raised to it for everything inside the widget, so buttons, fields, tabs, menu rows, a panel's head and the bar over a selected drawing follow; each row of the indicator legend is 32 px tall, its name's press as tall and 32 px wide at least, and a row a finger opened shows its buttons at 32 px (they were 32 by 28); a pane's buttons take 32 by 32 px of a press (30 by 32) and a pane's legend name 32 px down from its row, their drawing as it was; a row a finger opened takes the room its four buttons need until it is shut, where a long name ("Ichimoku 9 26 52 26", "MACD 12 26 9") left Remove cut off on a phone: over the plot the plot's width, in a pane the pane's, over the pane's buttons; the Sell and Buy buttons, the replay's position, a switch, a colour, the calendar's buttons and a stepper follow by name; the drawing tools and the dock's rail are 32 px at least, in a column wide enough for them, and on a short screen the tools give way no further than that before their column scrolls; and on a narrow widget the bar over a selected drawing, wider than the chart at that size, keeps to one line by giving up buttons (the entry above). Under a mouse nothing is drawn larger, and a control takes 20 px of a press at least: the legend row's buttons (drawn 18 px tall), the button that folds the rows (14), a pane's buttons (18 by 16, now 2 px apart) and a pane's legend names (16; the rows of several indicators in one pane now stand 20 px apart, 17 before, and in a pane too short for them they stand evenly closer where the last ones lay on one line). One control stays smaller, the corner of a drawing tool that opens its menu: larger, it takes the press of the tool itself. pnpm audit:scenes now measures what a press takes of every control it shows, point by point, on a phone, on a tablet under a finger and under a pointer, and fails on one under the least. See Moving to 3.0.
Orders set by hand keep inside the day's limits (@tradecanvas/core, @tradecanvas/chart): on a market with a ceiling and a floor for the day (setMarket with priceLimits, and setPriceLimits), the order ticket refused a price past them, and the chart let a line be dragged there. An order's line, and a stop-limit's stop, now stops at the ceiling or the floor when dragged past it (a stop-limit dragged with its stop stops where the nearer of the two reaches the limit, the room between them kept); a bracket's entry and a draft order start and stay inside them, and one in hand when the limits come is put inside as it is confirmed; the engine's right-click menu opens for no order past them (the click is still the chart's: an app's own menu may take it, and the browser's does not stand in), and the widget's offers none there (an alert and a line still, and the ticket, which says why); a quick order from the widget's menu or its depth ladder past them is not placed, and the widget says what today's prices are. Limits that are no prices of the market's grid (a per cent of a reference, on a market that gave no price step) hold an order on the grid inside them. A position's stop, target and levels are not held: they are no orders of today's. The widget's menu also tells a limit from a stop against the market on the grid, as the price at the click is. TradingManager.setOrderPriceBounds is how a chart of your own parts tells its tools.
Prices set by hand keep to the market's grid (@tradecanvas/core, @tradecanvas/chart): an order, a stop, a target, a take-profit level or a stop-limit's stop dragged on the chart stands on the market's price step as it goes, and is reported there; a bracket and a draft order start on it and are dragged on it; a stop added from its button starts on it; an alert dragged lands on it; the right-click menu places at a price of it, and priceAxisAdd and chartContextMenu give one. The step is the market's (setMarket: HOSE's three bands, a futures contract's tick) or the symbol's minTick; with neither, the decimals the price axis shows. Until now each of these was the pointer's price to a pixel's sum, which the axis wrote rounded and a broker with a tick would refuse. The crosshair writes the price under the pointer on the same grid (its line stays under the pointer), so what it reads is what the “+” beside it places at. What the grid could have broken, it does not: a bracket's stop and target keep a step off its entry, where they start and wherever they are dragged (a bracket with no risk has no size); a stop added from its button stays beyond the entry and the price now; a draft order or a bracket started at the market is still a limit there, though the grid rounds it a step over the price to the digit; and a line let go on the step it was on asks the broker for nothing. TradingManager.setPriceRounding is how a chart of your own parts tells its tools.
A stop-limit order, seen, moved and placed (@tradecanvas/commons, @tradecanvas/core, @tradecanvas/chart): a stopLimit order showed one line, its limit, and nothing told where it begins to work. Its stop now has a line of its own in the order's colour, in dashes and dots, tagged STOP, with its price on the axis. Dragging the order's line moves both, the room between them kept; dragging the stop's line, or its tag, moves the stop alone. orderModify carries the stop's new price for either (newStopPrice, new and optional on the event and on OrderModifyIntent): an adapter of your own could not know the stop was to move; PaperExecutionAdapter puts it where it is told, and still takes it with the order when not told. The widget's order ticket takes a stop-limit, with a stop price and a limit price (its stop on the side of the market a stop waits on, both on the market's step and inside the day's limits; its stop-loss beyond its stop and its take-profit beyond its limit, since it may fill anywhere between the two), the account panel names it and writes both prices, the stop first, where it called it a stop, and the activity log says it was moved when its stop alone went elsewhere. Four new strings, in the 30 languages.
An order that is gone while its line is dragged (@tradecanvas/core): filled or cancelled by the broker during the drag, it was still asked to move when the line was let go (orderModify for an order no longer there). The drag is now called off, as a stop's is when its position goes.
An order good till a date, from the ticket (@tradecanvas/chart): the widget's order ticket offers GTD for a limit and a stop order. It asks when the order ends, a date and a time on the chart's own clock, a day from now to start with, and sends it as expireTime. It places no order that would end in the past or at no time, and says why. "Now" is the moment the account trades at: on a replay a paper account trades on, the replay's, which the new chart.getTradingTime() gives. A limit that fills at once or not at all (IOC, FOK) may be priced through the market, which the ticket refused as it does for a limit that waits; its value, its risk, its stop's side and its targets are counted from the market it fills at. One new string, in the 30 languages.
What became of an order (@tradecanvas/commons, @tradecanvas/core, @tradecanvas/chart): a fill that drops the rest of its order says how much in a new dropped (an immediate-or-cancel order filled in part; PaperExecutionAdapter sets it), the activity log writes that rest as cancelled, and the widget says how much filled. The widget also says when the adapter refused an order, in the adapter's words: until now it said the order was sent and nothing more. A toast now takes the place of the one showing, where two lay one over the other, and a long one goes on a second line where it was cut short (an error lost its reason on a phone). Two new strings, in the 30 languages.
No second price beside a line being dragged (@tradecanvas/core, @tradecanvas/chart): while an order's line, a stop, a target, a bracket's line or a draft order is dragged to a price, the crosshair draws no horizontal line and no price on the axis. The line keeps its distance from the pointer, so the two stood a few pixels apart, each with a price. The vertical line and the time stay.
What a footprint's bar adds up to (@tradecanvas/commons, @tradecanvas/core, @tradecanvas/chart): under each bar of a footprint chart, what its rows add up to: bought less sold in the colour of its sign, and both together under that. They are written where a bar is wide enough for a number, also under bars too narrow for their rows' numbers, and the price scale leaves them room under the lowest bar. chartTypeOptions.footprint.totals: false writes none; in the widget it is a switch in Chart Settings. A chart drawn with no page (renderPriceChart) has them too. One new string, in the 30 languages.
A tape that sorts (@tradecanvas/chart): the tape's header has a menu. It lists one side's trades alone (bought, or sold; the bar over the list still says how the two sides shared them), and makes one row of the trades made together: those of one moment, one price and one side, their sizes added, so a market order that took several resting orders reads as the one trade it was, measured against the least size, and for being large, by what it adds up to. tape: { side: 'buy', group: true } starts it so. What a reader chooses in the panel is kept in the browser (tcw:tape): the side and the grouping, and the least size for the symbol it was typed on, so another symbol starts with its own. Only what was chosen is kept, and it is used over the option it started from; what the reader never chose is still the host's to set. A least size is kept with its symbol's name, for up to a hundred symbols: tape: { persist: false } keeps nothing. Four new strings, in the 30 languages.
A logo in a heatmap's cell (@tradecanvas/commons, @tradecanvas/core, @tradecanvas/chart): a HeatmapCell may carry a logo, drawn over its name on a white plate where the cell has room; as cells get small the logo goes before the name and the value do. It takes the addresses a symbol's logo does (an https: address, a path on your site, a blob: or a data:image/… URL), is loaded once, and a cell whose logo fails is drawn as one with none (it is asked for again a minute later, when next drawn). A logo from another site is asked for as a picture the page may read (CORS), so the chart can still be saved as a picture; one whose site does not allow it is left out, as is any picture that would leave the canvas unreadable. When the data changes, the logos no cell has are let go. showLogos: false draws none. A heatmap drawn with no page (renderFinanceChart) has no logos. In core: ImageStore, imageAddress(), and renderHeatmap takes the cells' pictures as its last argument.
The charts' picture from the grid's bar (@tradecanvas/commons, @tradecanvas/core, @tradecanvas/chart): ChartWidgetGrid has a camera button on its bar. Its menu saves the charts together as an image, copies it, prints it or saves it as a PDF, each named after the symbols shown (charts for more than three). grid.copyScreenshot() is new, beside screenshot(), print() and toPdf(). picture: false leaves the button out; it is hidden as well while a chart's screenshot switch is off (the picture shows every chart), and has no copy entry while copyImage is. A narrow grid, which shows one chart at a time, pictures that chart and names the file after it. Five new strings, in the 30 languages; three new icons (download, printer, file). Fixed with it: in a language written right to left (or with widget.dir: 'rtl'), a grid's bar and its menus are written right to left as its charts are; the bar stayed left to right. A file named after a symbol keeps the symbol's own letters, in a grid's files and in a chart's PDF (삼성전자-5m.pdf, where it was _-5m.pdf): fileNamePart() in core. A menu under a button gives the keyboard back to that button when it shuts, in Safari too, which focuses no pressed button.
A tape, and the trades themselves (@tradecanvas/commons, @tradecanvas/core, @tradecanvas/chart): chart.followTrades() follows the trades of the chart's symbol until the function it returns is called: the feed's recent trades, then its live ones, as trades events ({ trades, recent }). The feed is asked once for any number of followers, a footprint chart follows them by itself, and trades given with chart.addTrades() are told the same way. None of the feed's recent trades is told again: not on another timeframe of the symbol, nor after a reconnect, when the ones missed are told though later ones came first; chart.getTrades() gives the trades told lately (up to 2,000) to a listener that comes after them. In the widget, tape: true adds the tape (time and sales) to the dock: the trades newest on top, each with its time, its price and its size, the price in the colour of who took it; a bar over the list says how the rows split between buyers and sellers, a trade ten times the usual size stands out, and trades under a least size can be left out (tape: { minSize }, or typed in the panel). The widget follows the feed's trades only while the tape is open. It opens from its rail button, the command palette or widget.openPanel('tape'); its switches are tape and dock.tape; five new strings, in the 30 languages. MockAdapter tells its bars' trades in whole sizes, and still tells them once it streams: asked for after the stream had started (a tape opened, a footprint chosen later) it gave trades of a price of their own.
A footprint chart (@tradecanvas/commons, @tradecanvas/core, @tradecanvas/chart): chartType: 'footprint' draws, by each bar, what traded at every price inside it: what the sellers took at the bid on the left, what the buyers took at the ask on the right (chartTypeOptions.footprint.cells: 'bidAsk', or 'delta' for bought less sold, or 'volume' for both together). A row where one side outdid the other, a row apart, is marked (imbalance: 3 times by default, 0 for none), the row most traded at is outlined, and a slim candle stands by each bar. A chart connected to a feed with trades (fetchTrades and subscribeTrades) asks for them itself while it shows a footprint: its recent trades, then its live ones. A host gives its own with chart.addTrades(trades), or whole rows with chart.setFootprint(bars) (footprintOf(trades, timeframe, rowSize) makes them from trades), reads them with chart.getFootprint(time?) and forgets them with chart.clearFootprint(); footprintStats(levels) adds a bar's rows up and footprintImbalances says where one side outdid the other. Rows are rowSize tall in price ('auto': about a ten-thousandth of the price) and are drawn several to one where they would be too thin to read. Choosing the footprint zooms in to where its numbers read, and its bars may get much wider than candles do; zoomed out, the numbers give way to a bar for each side, then to candles. A trade that does not say its side is told by the trade before it. In the widget it is Footprint in the chart type menu, with its settings in Chart Settings, in the 30 languages. renderPriceChart draws it from footprint. Four style keys colour it: series.footprint.upColor, downColor, wickUpColor and wickDownColor. MockAdapter's trades are now its bars' own (inside each bar, adding up to its volume and its buyVolume), and its live bar counts buyVolume from its ticks.
Who took the trades: a true volume delta (@tradecanvas/commons, @tradecanvas/core, @tradecanvas/chart): a bar may carry buyVolume, the part of its volume the buyers took, and a trade its side ('buy' when the buyer crossed the spread). barDelta(bar) is bought less sold, or null where the bar does not say. The Volume Delta indicator (voldelta) draws that true delta, and its running sum in mode: 1, from bars that say, and its old estimate from the close for those that do not; a new anchor input ('session', 'week', 'month'; 'all' by default) starts the running sum again with each period. BinanceAdapter fills both in, from the taker buy volume of its bars and from its aggregate trades, and MockAdapter makes them up. The chart carries buyVolume wherever it carries the volume: resampled bars and built timeframes add it up, tick bars and bars aggregated from ticks count it from trades that say their side, a replayed bar has it in step with its volume, and the CSV and JSON exports write it in a column of its own (Buy Volume), which the import reads back. A bar with a part that does not say has none. chart.updateLastBarFromTick takes the trade's side, and a bar whose buyVolume cannot be (more than its volume, or no number) is kept without it.
Orders that fill in parts (@tradecanvas/commons, @tradecanvas/core, @tradecanvas/chart): new PaperExecutionAdapter({ fillSize }) fills no more than that of a limit order at one price: a larger one fills a part at each price that reaches its limit and works on for the rest. TradingOrder.filledQuantity says how far an order has got and FillEvent.remaining what a part left working; the parts of one order build one position at the average of their prices, which has the order's stops and levels from its first part (a later part brings them no second time, so a stop moved since stays). Of an 'ioc' order what fills at once fills and the rest is dropped, a 'fok' order larger than the size is refused, and a market order and a stop fill whole. The chart writes what has filled on the order's tag (2/5) and the widget's account panel in its row; an adapter of your own reports parts the same way. quantityText and orderQuantityText (@tradecanvas/commons, and from @tradecanvas/chart) write a quantity as the tags do. On a net account, a fill that adds to the position and brings no levels now keeps of the position's levels only those still a profit from its new average entry.
A take-profit level dragged on the chart, and a paper account that calls margin and stops out (@tradecanvas/commons, @tradecanvas/core, @tradecanvas/chart): a position's take-profit level is dragged by its line or its tag, as its stop is: the line follows the pointer with where it was left faint behind it, and letting go raises positionModify with all the position's takeProfits, the nearest first. One let go at the entry or past it the losing way goes back. PaperExecutionAdapter takes marginCallLevel and stopOutLevel, as the equity's part of the margin held: under the first it warns once (the adapter's marginCall event, the chart's marginCall, a warning in the widget); under the second it closes positions at the price, the one losing most first, until it is back over the level (fills with reason: 'liquidation'). AccountSummary has marginLevel while positions hold margin, which the widget's account panel writes in its totals.
A position's value before expiry, clicks on a box plot and a radar, and 3D charts turned from the keyboard (@tradecanvas/chart, @tradecanvas/commons, @tradecanvas/core): PayoffChart takes a model ({ daysToExpiry, volatility, rate?, dividendYield? }) and draws a second, dashed line: what the legs make or lose with that many days to go, each option priced as a European one by Black-Scholes; a leg's own volatility and daysToExpiry stand in for the model's, the two lines are named over the plot, each beside a stretch of its own line (expiryLabel, model.label), and the pointer reads both. positionValue(legs, price, model, multiplier) and optionPrice(type, spot, strike, terms) are the sums. BoxPlotChart has onBoxClick(group, stats) and RadarChartonAxisClick({ axis, index, values }). SurfaceChart and Bar3DChart are reached with Tab: the arrows turn and tilt them (further with Shift) and Home goes back to their view; a chart that turns is role="application" to a screen reader, which is told the keys and, after each, where the chart is seen from (describeView for your words). One with rotate: false is the picture it was.
A picture at a size of its own, and of a whole grid (@tradecanvas/chart, @tradecanvas/commons, @tradecanvas/core): width and height on chart.toCanvas, screenshot, screenshotDataURL, screenshotBlob, copyScreenshot, print and toPdf lay the price chart out again at that size, the bars it has on view on view there (as wide as the size makes them, within what a bar can be), and put the page's layout back: nothing on the page is resized or told. A picture at a size of its own has nothing that follows the pointer on it, nor a canvas a host laid over the chart. (They were a finance chart's only; the price chart kept the size it had.) ChartWidgetGrid has toCanvas, screenshot, screenshotDataURL, screenshotBlob, print and toPdf: the grid's charts as one picture, each in its cell. Viewport.snapshot() and restore() put a viewport back as it was, and ChartLegend.keepSize() a legend's size. A picture held to the most pixels a canvas has could pass it by a few through rounding: it no longer does.
The price chart drawn with no page (@tradecanvas/chart, @tradecanvas/commons, @tradecanvas/core, @tradecanvas/mcp): renderPriceChart(ctx, options, size) draws the price chart on a 2D context of your own, where there is no page: a canvas made in Node (@napi-rs/canvas, skia-canvas) for a picture in an email, a report or a message from a bot, or an OffscreenCanvas in a worker. It is one frame, put together as Chart puts its own together: at the same size it is the picture a chart on a page gives of the same bars after fitContent() (or setVisibleRange(), with visibleRange), with the chart type, volume, both axes, the legend, the last price, a watermark, indicators on the price pane, in panes of their own, in one another's and on the left scale, drawings (on a pane too), and buy and sell marks. options are Chart's where they say how the chart looks (chartType, theme, font, overrides, density, logScale, numberLocale, priceFormat, watermark, features), with data, symbol, timeframe, indicators (as chart.getIndicatorSetup() gives them), drawings (as getDrawings() gives them or addDrawing() takes one), markers, visibleRange, pricePrecision, timeZone, symbolSeries (other symbols' bars, for 'compareSymbol' and the like) and plugins. Node has no Path2D: give your canvas library's as path2D. An option that is wrong throws before anything is drawn, by its name. It has no crosshair, orders, positions, alerts or compare lines. ChartLegend.measure() works out the legend's size without drawing it. The MCP server's list_options and validate_options take renderPriceChart as a target.
A chart beside a left price scale keeps its fit when its container reports its size (@tradecanvas/chart): with bars fitted closer than a slot usually gets (fitContent() on a narrow chart, a long series), a size report from the page widened the slots as if the left scale were not there, and the oldest bars went off view for good. The viewport is now given the plot the layout leaves.
Pictures at any size, print, PDF, and finance charts with no page (@tradecanvas/chart, @tradecanvas/commons, @tradecanvas/core): chart.screenshot, screenshotDataURL, screenshotBlob and copyScreenshot take options: type ('png', 'jpeg', 'webp') with quality, and pixelRatio or theme, for which the frame is drawn again for the picture and the chart on the page is left as it is; chart.toCanvas gives the canvas. chart.print() opens the print dialog for the chart alone, and chart.toPdf() gives a PDF of one page with the picture kept without loss, both in the light theme and at twice the pixels unless told otherwise. Every finance chart has the same methods, and takes a width and a height for a picture of another size. chartsToPdf makes one PDF of several charts, a page each. renderFinanceChart(ctx, kind, options, size) draws a finance chart on a context of your own with no page: a canvas made in Node, an OffscreenCanvas in a worker. The widget's command palette has Print chart and Save chart as PDF (widget.printChart(), widget.saveChartPdf()).
Charts in three dimensions (@tradecanvas/chart, @tradecanvas/commons, @tradecanvas/core, @tradecanvas/mcp), twenty-two finance charts in all: SurfaceChart draws values over two axes as a sheet in a box (implied volatility by strike and expiry, a profit by price and day), as a shaded surface, a wireframe, or with style: 'slices' a filled line for each y; Bar3DChart stands a column on each value in rows a series deep. A drag turns them (a mouse turns and tilts, a finger turns only, so a page still scrolls), a double click goes back to the view given, and getView, setView, onViewChange and rotate are there for it. depthSurface turns a run of order books into a surface: depth over time. Values are coloured by colorRamp, one hue from near the chart's ground to its strongest by default. Both read out under the pointer, take a click, and are in the MCP server's list_finance_charts.
Six more finance charts (@tradecanvas/chart, @tradecanvas/commons, @tradecanvas/core, @tradecanvas/mcp), twenty in all, for options and portfolios: PayoffChart (what an options position makes or loses at expiry, with its breakevens and the price now; payoffStats and optionPayoff give the numbers), CurveChart (values against a strike or a tenor: a volatility smile, a term structure, a yield curve), BoxPlotChart (quartiles, whiskers and outliers for each group; boxPlotStats), RadarChart (several measures on spokes, a shape a series), SunburstChart (parts inside parts, a ring a level, with a click) and StackedAreaChart (series one on another, or as shares with normalized). Each reads out under the pointer, takes theme, font, locale and ariaLabel, and is in the MCP server's list_finance_charts.
Six more chart types (@tradecanvas/chart, @tradecanvas/commons, @tradecanvas/core), 24 in all: columns (a column up to each close), hlcBars (high, low and close, with no open), stepArea (the step line, filled), spline (a smooth curve through the closes that never goes past a high or low close), dots (a dot at each close) and smoothedHeikinAshi (Heikin-Ashi of prices averaged over chartTypeOptions.smoothedHeikinAshi.period bars first, 10). The widget lists them and sets the length in its settings, in 30 languages.
Trading
The order ticket says what the account has free, and in what currency (@tradecanvas/chart): over the order's value the ticket's receipt has a line, Available, with the account's free margin (AccountSummary.freeMargin), read again each time the order or the account changes, and followed by the account's currency where the execution adapter names one (the order's value is in the market's money, and has none). An account that counts no free margin, and a chart with no account, show neither. In the 30 languages. In the dock, the day's ceiling, reference and floor share their row in three equal parts, a name over its price: side by side they wrapped at the dock's width, the floor alone on a second line.
The order ticket beside the chart. The widget's ticket is a page of the dock (ticketPlace: 'dock', the
default; openPanel('orderTicket'), its button on the rail): it hides no price, traps no key, is not lost to a
press on the chart, and stays for the next order once one is sent, on the same side, kind, quantity and
price (a market order's is the market's again), without the last one's stop-loss and take-profit. Shut by its
own Cancel, cross or Escape, its page shuts; another panel in its place, it goes with its page and what was
typed in it. An order on its way, and an order half typed when the widget is made too narrow for a dock, go on
as the dialog. Under 641 px, or with no dock, it is the dialog it was.
Profit taken in parts (@tradecanvas/commons, @tradecanvas/core, @tradecanvas/chart): takeProfits on an order's intent, an order and a position is a list of levels, each a price and the quantity that closes there; modifyPositionIntent({ positionId, takeProfits }) sets them and null takes them off. The paper account closes a level's part when the price reaches it (a fill each) and takeProfit closes what they leave. The chart draws a line and a tag for each level, the account panel writes the nearest and how many more, and the widget's order ticket reaches a take-profit in one, two or three targets.
A log of what happened to the orders (@tradecanvas/chart): chart.getActivityLog() gives each order placed, moved, cancelled or filled, and what was refused with its reason, the latest 200, read from the orders, fills and errors the chart is told. The widget's account panel shows it in a Log tab, in 30 languages. chart.clearActivityLog() empties it.
Sell and Buy on the chart (@tradecanvas/chart, @tradecanvas/commons): while an execution adapter is connected, the widget shows Sell and Buy under the chart's legend, each with its price (the bid and the ask with their spread, else the last price); a press opens the order ticket on that side. The tradeButtons switch turns them off. Two new events: executionChange says when an adapter is connected or taken away, and bidAskChange when the bid and the ask marked on the chart change.
A paper account with money (@tradecanvas/commons, @tradecanvas/core, @tradecanvas/chart): new PaperExecutionAdapter({ balance, leverage, multiplier, commission }) keeps a balance, holds margin for open positions, charges each fill (commission on the fill), and refuses an order its free margin cannot carry; a waiting order whose money has gone when its price comes is cancelled. chart.getAccount() and the accountChange event give its AccountSummary, and the widget's account panel heads its totals with the balance, the equity and the free margin. An adapter of your own gives its account with getAccount() and an account event.
Orders of which one cancels the others (@tradecanvas/commons, @tradecanvas/core, @tradecanvas/chart): an order's ocoGroup names the group it is one of. The paper account cancels the rest of a group when one of it fills, and the orders' tags read OCO.
How long an order works (@tradecanvas/commons, @tradecanvas/core, @tradecanvas/chart): timeInForce takes 'gtd' with an expireTime, 'ioc' and 'fok'. The paper account takes a 'gtd' order off at its date (by the time given with setMarkPrice, by the clock with none), and fills an 'ioc' or 'fok' limit at once, at the price there is, or refuses it. The widget's account panel names them.
The widget's ticket and account panel know the new orders (@tradecanvas/chart): the order ticket offers IOC and FOK for a limit order, and the account panel writes OCO beside an order of a group and a good-till-date order's date.
A stop order's stop moves with its line on the paper account (@tradecanvas/core): modifyOrder moved only a stop order's price, so it still waited at the old stopPrice. A stop-limit's stop and limit move by as much.
One net position on the paper account (@tradecanvas/core): new PaperExecutionAdapter({ positions: 'net' }) keeps one position, as a futures account does: fills the same way average in, fills the other way take from it and realise that part, and a larger one turns it round.
A bracket has a size (@tradecanvas/chart, @tradecanvas/core): chart.startBracket(side, entry, size) takes { quantity }, or { risk, quantityStep, multiplier } for the quantity that loses risk at the stop, which follows the lines as they are dragged. The quantity is written on the entry's tag and sent with bracketPlace, so the bracket reaches a connected adapter as an order; one with no quantity is not confirmed then, and stays to be given one (executionError, reason: 'noQuantity'). chart.setBracketSize(size) sizes it anew while it is placed, chart.getBracket() reads it, and bracketQuantity(bracket, size) is the sum on its own.
The widget's bracket bar has a quantity field (@tradecanvas/chart): it starts at the quantity last typed, else at the market's lot, steps by the lot, and Place is off while it holds no quantity. widget.startBracket(side, size) takes a size; a bracket sized by its risk has no field.