@stocksharp/trading-controls 1.3.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +113 -5
- package/dist/esm/chart-engine.js +15 -0
- package/dist/esm/chart-engine.js.map +1 -0
- package/dist/esm/control-types.js +4 -0
- package/dist/esm/control-types.js.map +1 -1
- package/dist/esm/equity-widget.js +261 -0
- package/dist/esm/equity-widget.js.map +1 -0
- package/dist/esm/heatmap-grid.js +271 -0
- package/dist/esm/heatmap-grid.js.map +1 -0
- package/dist/esm/index.js +19 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/log-monitor-widget.js +29 -8
- package/dist/esm/log-monitor-widget.js.map +1 -1
- package/dist/esm/optimization-heatmap-widget.js +303 -0
- package/dist/esm/optimization-heatmap-widget.js.map +1 -0
- package/dist/esm/option-smile-widget.js +252 -0
- package/dist/esm/option-smile-widget.js.map +1 -0
- package/dist/esm/pnl-curve.js +5 -1
- package/dist/esm/pnl-curve.js.map +1 -1
- package/dist/esm/surface-grid.js +282 -0
- package/dist/esm/surface-grid.js.map +1 -0
- package/dist/esm/surface-widget.js +379 -0
- package/dist/esm/surface-widget.js.map +1 -0
- package/dist/sstradingcontrols.js +1622 -176
- package/dist/sstradingcontrols.js.map +4 -4
- package/dist/types/chart-engine.d.ts +3 -0
- package/dist/types/chart-engine.d.ts.map +1 -0
- package/dist/types/control-types.d.ts +4 -0
- package/dist/types/control-types.d.ts.map +1 -1
- package/dist/types/equity-widget.d.ts +34 -0
- package/dist/types/equity-widget.d.ts.map +1 -0
- package/dist/types/heatmap-grid.d.ts +88 -0
- package/dist/types/heatmap-grid.d.ts.map +1 -0
- package/dist/types/index.d.ts +15 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/log-monitor-widget.d.ts +5 -1
- package/dist/types/log-monitor-widget.d.ts.map +1 -1
- package/dist/types/optimization-heatmap-widget.d.ts +45 -0
- package/dist/types/optimization-heatmap-widget.d.ts.map +1 -0
- package/dist/types/option-smile-widget.d.ts +39 -0
- package/dist/types/option-smile-widget.d.ts.map +1 -0
- package/dist/types/pnl-curve.d.ts +3 -0
- package/dist/types/pnl-curve.d.ts.map +1 -1
- package/dist/types/surface-grid.d.ts +64 -0
- package/dist/types/surface-grid.d.ts.map +1 -0
- package/dist/types/surface-widget.d.ts +64 -0
- package/dist/types/surface-widget.d.ts.map +1 -0
- package/package.json +28 -2
- package/screenshots/equity.png +0 -0
- package/screenshots/optimization-surface.png +0 -0
- package/screenshots/optimization.png +0 -0
- package/screenshots/option-smile.png +0 -0
- package/screenshots/panels.jpg +0 -0
- package/src/chart-engine.global.ts +64 -0
- package/src/chart-engine.ts +29 -0
- package/src/control-types.ts +4 -0
- package/src/equity-widget.ts +289 -0
- package/src/heatmap-grid.ts +405 -0
- package/src/index.ts +46 -0
- package/src/log-monitor-widget.ts +38 -6
- package/src/optimization-heatmap-widget.ts +347 -0
- package/src/option-smile-widget.ts +281 -0
- package/src/pnl-curve.ts +13 -1
- package/src/surface-grid.ts +410 -0
- package/src/surface-widget.ts +457 -0
- package/styles/trading-controls.css +287 -0
- package/translation-keys.json +14 -1
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
// Optimisation heatmap - multi-instance.
|
|
2
|
+
//
|
|
3
|
+
// One metric over two parameters: an axis of discrete values across, another up, a cell per pair
|
|
4
|
+
// of them, coloured by what that pair measured. The panel does not know what an optimisation is -
|
|
5
|
+
// a heatmap of a metric over two parameters is the same object whatever produced it - so the
|
|
6
|
+
// pairs are handed in and the two axis names come with them.
|
|
7
|
+
//
|
|
8
|
+
// The map is a <canvas>, the one surface a class name cannot reach: its geometry comes out of
|
|
9
|
+
// `heatmap-grid.ts` as numbers and its colours out of the host's `canvasPalette()`, so nothing
|
|
10
|
+
// here is painted from a palette this package chose. The tooltip is DOM, because it is text.
|
|
11
|
+
//
|
|
12
|
+
// Two things are drawn rather than tabulated and are worth stating. A cell carries no printed
|
|
13
|
+
// number: at the size a forty by forty sweep leaves a cell, digits are unreadable, and reading
|
|
14
|
+
// colour at that size is the entire reason to draw the map. And a pair nobody ran is struck
|
|
15
|
+
// through rather than left blank, because an unrun pair and a pair that measured zero are
|
|
16
|
+
// different facts that a scale with zero at its neutral point would otherwise paint the same.
|
|
17
|
+
import { formatStatistic } from './statistics-widget.js';
|
|
18
|
+
import { makeElement, makeIconButton, makePanelId, makePanelRoot } from './dom.js';
|
|
19
|
+
import { ControlTypes } from './control-types.js';
|
|
20
|
+
import { assertHost } from './trading-host.js';
|
|
21
|
+
import { hitHeatmap, layoutHeatmap } from './heatmap-grid.js';
|
|
22
|
+
// Opacity, not colour. Every hue below is the host's `canvasPalette`; how solid a thing is drawn
|
|
23
|
+
// is the map's own business, and keeping the two apart is what lets one palette serve a light
|
|
24
|
+
// theme and a dark one without the package knowing which it is in.
|
|
25
|
+
//
|
|
26
|
+
// The ground is drawn under every measured cell so that a cell sitting exactly on the anchor -
|
|
27
|
+
// which takes no tint at all - is still visibly a cell. That is also what lets the tint itself
|
|
28
|
+
// go all the way down to nothing without a floor: neutral reads as the ground, and a pair that
|
|
29
|
+
// was never run has no ground under it.
|
|
30
|
+
const GROUND_ALPHA = 0.1;
|
|
31
|
+
const GAP_ALPHA = 0.25;
|
|
32
|
+
const LABEL_ALPHA = 0.65;
|
|
33
|
+
const BEST_WIDTH = 2;
|
|
34
|
+
// Gap between the cursor and the tooltip, and between the tooltip and the edge it is clamped
|
|
35
|
+
// against.
|
|
36
|
+
const TOOLTIP_OFFSET = 12;
|
|
37
|
+
const TOOLTIP_MARGIN = 4;
|
|
38
|
+
export class OptimizationHeatmapWidget {
|
|
39
|
+
static create(hostEl, state, deps) {
|
|
40
|
+
// Assert before building: the markup below is localized through the host, so a missing
|
|
41
|
+
// host has to fail here rather than render a panel captioned with raw English keys.
|
|
42
|
+
const host = assertHost(deps?.host, 'OptimizationHeatmapWidget');
|
|
43
|
+
const root = OptimizationHeatmapWidget._buildRoot(host);
|
|
44
|
+
root.id = makePanelId(OptimizationHeatmapWidget.TYPE);
|
|
45
|
+
hostEl.appendChild(root);
|
|
46
|
+
return new OptimizationHeatmapWidget(root, state || {}, deps);
|
|
47
|
+
}
|
|
48
|
+
// The panel's markup. The metric's name sits in the header rather than on the canvas: it is
|
|
49
|
+
// the caption the drawn legend is read against, and putting it in the chrome costs the map
|
|
50
|
+
// no pixels and leaves the text selectable and sized by the stylesheet.
|
|
51
|
+
static _buildRoot(host) {
|
|
52
|
+
const title = host.t('OptimizationHeatmap');
|
|
53
|
+
return makePanelRoot('optimization-heatmap-panel', title, [
|
|
54
|
+
makeElement('div', 'panel-header', {}, [
|
|
55
|
+
makeElement('span', '', {}, [title]),
|
|
56
|
+
makeElement('span', 'heatmap-metric', {}, []),
|
|
57
|
+
makeIconButton('bt-icon-btn bt-icon-cancel panel-close-btn', host.t('ClosePanel'), 'bi-x', { type: 'button' }),
|
|
58
|
+
]),
|
|
59
|
+
makeElement('div', 'panel-body', {}, [
|
|
60
|
+
makeElement('canvas', 'heatmap-canvas', { role: 'img', 'aria-label': host.t('OptimizationHeatmapChart') }, []),
|
|
61
|
+
makeElement('div', 'heatmap-empty', { hidden: '' }, [host.t('NoOptimizationResults')]),
|
|
62
|
+
makeElement('div', 'heatmap-tooltip', { role: 'tooltip', hidden: '' }, []),
|
|
63
|
+
]),
|
|
64
|
+
]);
|
|
65
|
+
}
|
|
66
|
+
constructor(rootEl, _state, deps) {
|
|
67
|
+
this._host = assertHost(deps?.host, 'OptimizationHeatmapWidget');
|
|
68
|
+
this.rootEl = rootEl;
|
|
69
|
+
this.canvasEl = this.rootEl.querySelector('.heatmap-canvas');
|
|
70
|
+
this._metricEl = this.rootEl.querySelector('.heatmap-metric');
|
|
71
|
+
this._emptyEl = this.rootEl.querySelector('.heatmap-empty');
|
|
72
|
+
this._tooltipEl = this.rootEl.querySelector('.heatmap-tooltip');
|
|
73
|
+
this._closeBtn = this.rootEl.querySelector('.panel-close-btn');
|
|
74
|
+
this._ctx = this.canvasEl?.getContext('2d') ?? null;
|
|
75
|
+
this._data = null;
|
|
76
|
+
this._layout = null;
|
|
77
|
+
this._size = null;
|
|
78
|
+
this._resizeObserver = null;
|
|
79
|
+
this._closeBtn?.addEventListener('click', (e) => { e.preventDefault(); this._host.close(); });
|
|
80
|
+
this._bindHover();
|
|
81
|
+
this._setEmpty(true);
|
|
82
|
+
if (this.canvasEl && typeof ResizeObserver === 'function') {
|
|
83
|
+
this._resizeObserver = new ResizeObserver(() => this._render());
|
|
84
|
+
this._resizeObserver.observe(this.canvasEl);
|
|
85
|
+
}
|
|
86
|
+
this._host.register(this);
|
|
87
|
+
}
|
|
88
|
+
dispose() {
|
|
89
|
+
try {
|
|
90
|
+
this._resizeObserver?.disconnect();
|
|
91
|
+
}
|
|
92
|
+
catch { /* already torn down */ }
|
|
93
|
+
this._host.unregister(this);
|
|
94
|
+
try {
|
|
95
|
+
this.rootEl.remove();
|
|
96
|
+
}
|
|
97
|
+
catch { /* already detached */ }
|
|
98
|
+
}
|
|
99
|
+
/// Show this map. The whole of it at once: a pair that has dropped out of the set has stopped
|
|
100
|
+
/// existing, and leaving its cell behind would report a run that is no longer in the report.
|
|
101
|
+
update(data) {
|
|
102
|
+
this._data = data;
|
|
103
|
+
if (this._metricEl !== null)
|
|
104
|
+
this._metricEl.textContent = data.metricLabel;
|
|
105
|
+
this._hideTooltip();
|
|
106
|
+
this._render();
|
|
107
|
+
}
|
|
108
|
+
// The canvas in CSS pixels, and its backing store in device pixels. Without the second the
|
|
109
|
+
// map is drawn at a third of the resolution the screen has, and a lattice of hairlines is
|
|
110
|
+
// exactly the drawing that shows it.
|
|
111
|
+
_sizeCanvas() {
|
|
112
|
+
const canvas = this.canvasEl;
|
|
113
|
+
if (!canvas)
|
|
114
|
+
return;
|
|
115
|
+
const rect = canvas.getBoundingClientRect();
|
|
116
|
+
const ratio = typeof devicePixelRatio === 'number' && devicePixelRatio > 0 ? devicePixelRatio : 1;
|
|
117
|
+
const width = Math.max(1, Math.floor(rect.width));
|
|
118
|
+
const height = Math.max(1, Math.floor(rect.height));
|
|
119
|
+
if (canvas.width !== width * ratio || canvas.height !== height * ratio) {
|
|
120
|
+
canvas.width = width * ratio;
|
|
121
|
+
canvas.height = height * ratio;
|
|
122
|
+
// Everything below draws in CSS pixels, which is also the space a mouse event
|
|
123
|
+
// arrives in - so the hit test needs no conversion of its own.
|
|
124
|
+
this._ctx?.setTransform(ratio, 0, 0, ratio, 0, 0);
|
|
125
|
+
}
|
|
126
|
+
this._size = { width, height };
|
|
127
|
+
}
|
|
128
|
+
_render() {
|
|
129
|
+
const ctx = this._ctx;
|
|
130
|
+
if (ctx === null)
|
|
131
|
+
return;
|
|
132
|
+
this._sizeCanvas();
|
|
133
|
+
const size = this._size;
|
|
134
|
+
if (size === null)
|
|
135
|
+
return;
|
|
136
|
+
ctx.clearRect(0, 0, size.width, size.height);
|
|
137
|
+
this._layout = null;
|
|
138
|
+
const data = this._data;
|
|
139
|
+
if (data === null) {
|
|
140
|
+
this._setEmpty(true);
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
const layout = layoutHeatmap({
|
|
144
|
+
width: size.width,
|
|
145
|
+
height: size.height,
|
|
146
|
+
cells: data.cells,
|
|
147
|
+
betterWhen: data.betterWhen,
|
|
148
|
+
xLabel: data.xLabel,
|
|
149
|
+
yLabel: data.yLabel,
|
|
150
|
+
});
|
|
151
|
+
this._setEmpty(layout === null);
|
|
152
|
+
if (layout === null)
|
|
153
|
+
return;
|
|
154
|
+
this._layout = layout;
|
|
155
|
+
const palette = this._host.presentation.canvasPalette();
|
|
156
|
+
ctx.font = palette.font;
|
|
157
|
+
ctx.lineWidth = 1;
|
|
158
|
+
for (const shape of layout.cells)
|
|
159
|
+
this._paintTint(ctx, shape.rect, shape.tint, palette.grid, palette.up, palette.down);
|
|
160
|
+
// A pair nobody ran, struck through. One diagonal rather than a fill of any kind: no
|
|
161
|
+
// amount of colour can say "not measured" on a map whose colours are all measurements.
|
|
162
|
+
ctx.globalAlpha = GAP_ALPHA;
|
|
163
|
+
ctx.strokeStyle = palette.grid;
|
|
164
|
+
for (const gap of layout.gaps) {
|
|
165
|
+
ctx.beginPath();
|
|
166
|
+
ctx.moveTo(gap.rect.x, gap.rect.y + gap.rect.height);
|
|
167
|
+
ctx.lineTo(gap.rect.x + gap.rect.width, gap.rect.y);
|
|
168
|
+
ctx.stroke();
|
|
169
|
+
}
|
|
170
|
+
// Last, so it sits over its own fill. In the grid colour because that is the only
|
|
171
|
+
// non-directional colour the palette carries, and an outline in either direction colour
|
|
172
|
+
// would vanish on half the cells it might land on.
|
|
173
|
+
const best = layout.cells.find(shape => shape.best);
|
|
174
|
+
if (best !== undefined) {
|
|
175
|
+
ctx.globalAlpha = 1;
|
|
176
|
+
ctx.strokeStyle = palette.grid;
|
|
177
|
+
ctx.lineWidth = BEST_WIDTH;
|
|
178
|
+
OptimizationHeatmapWidget._outline(ctx, best.rect, BEST_WIDTH / 2);
|
|
179
|
+
ctx.lineWidth = 1;
|
|
180
|
+
}
|
|
181
|
+
// The key, drawn out of the same two colours the map is: a legend in CSS would read the
|
|
182
|
+
// page's own tokens, and a host whose canvas palette comes from anywhere else would then
|
|
183
|
+
// explain its map in colours the map does not use.
|
|
184
|
+
for (const step of layout.legend.steps)
|
|
185
|
+
this._paintTint(ctx, step.rect, step.tint, palette.grid, palette.up, palette.down);
|
|
186
|
+
ctx.globalAlpha = LABEL_ALPHA;
|
|
187
|
+
ctx.fillStyle = palette.grid;
|
|
188
|
+
ctx.textBaseline = 'top';
|
|
189
|
+
ctx.textAlign = 'center';
|
|
190
|
+
for (const tick of layout.xTicks)
|
|
191
|
+
ctx.fillText(tick.text, tick.x, tick.y);
|
|
192
|
+
ctx.fillText(layout.xTitle.text, layout.xTitle.x, layout.xTitle.y);
|
|
193
|
+
ctx.fillText(formatStatistic(layout.legend.anchor.value), layout.legend.anchor.x, layout.legend.anchor.y);
|
|
194
|
+
ctx.textAlign = 'left';
|
|
195
|
+
ctx.fillText(layout.yTitle.text, layout.yTitle.x, layout.yTitle.y);
|
|
196
|
+
ctx.fillText(formatStatistic(layout.legend.low.value), layout.legend.low.x, layout.legend.low.y);
|
|
197
|
+
ctx.textAlign = 'right';
|
|
198
|
+
ctx.fillText(formatStatistic(layout.legend.high.value), layout.legend.high.x, layout.legend.high.y);
|
|
199
|
+
ctx.textBaseline = 'middle';
|
|
200
|
+
for (const tick of layout.yTicks)
|
|
201
|
+
ctx.fillText(tick.text, tick.x, tick.y);
|
|
202
|
+
ctx.globalAlpha = 1;
|
|
203
|
+
}
|
|
204
|
+
// The ground, then as much of the direction colour as the cell earned. Two fills rather than
|
|
205
|
+
// one blended colour: blending would need a background this control is not allowed to know.
|
|
206
|
+
_paintTint(ctx, rect, tint, ground, up, down) {
|
|
207
|
+
ctx.globalAlpha = GROUND_ALPHA;
|
|
208
|
+
ctx.fillStyle = ground;
|
|
209
|
+
ctx.fillRect(rect.x, rect.y, rect.width, rect.height);
|
|
210
|
+
if (tint === 0)
|
|
211
|
+
return;
|
|
212
|
+
ctx.globalAlpha = Math.abs(tint);
|
|
213
|
+
ctx.fillStyle = tint > 0 ? up : down;
|
|
214
|
+
ctx.fillRect(rect.x, rect.y, rect.width, rect.height);
|
|
215
|
+
}
|
|
216
|
+
static _outline(ctx, rect, inset) {
|
|
217
|
+
const left = rect.x + inset;
|
|
218
|
+
const top = rect.y + inset;
|
|
219
|
+
const right = rect.x + rect.width - inset;
|
|
220
|
+
const bottom = rect.y + rect.height - inset;
|
|
221
|
+
ctx.beginPath();
|
|
222
|
+
ctx.moveTo(left, top);
|
|
223
|
+
ctx.lineTo(right, top);
|
|
224
|
+
ctx.lineTo(right, bottom);
|
|
225
|
+
ctx.lineTo(left, bottom);
|
|
226
|
+
ctx.closePath();
|
|
227
|
+
ctx.stroke();
|
|
228
|
+
}
|
|
229
|
+
_setEmpty(empty) {
|
|
230
|
+
if (this._emptyEl === null)
|
|
231
|
+
return;
|
|
232
|
+
if (empty)
|
|
233
|
+
this._emptyEl.removeAttribute('hidden');
|
|
234
|
+
else
|
|
235
|
+
this._emptyEl.setAttribute('hidden', '');
|
|
236
|
+
}
|
|
237
|
+
_bindHover() {
|
|
238
|
+
const canvas = this.canvasEl;
|
|
239
|
+
if (!canvas)
|
|
240
|
+
return;
|
|
241
|
+
canvas.addEventListener('mousemove', (e) => {
|
|
242
|
+
const layout = this._layout;
|
|
243
|
+
if (layout === null) {
|
|
244
|
+
this._hideTooltip();
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
const rect = canvas.getBoundingClientRect();
|
|
248
|
+
const x = e.clientX - rect.left;
|
|
249
|
+
const y = e.clientY - rect.top;
|
|
250
|
+
const hit = hitHeatmap(layout, x, y);
|
|
251
|
+
// A pair nobody ran says nothing, so it says nothing: a tooltip reading "no data"
|
|
252
|
+
// over a cell that is visibly struck through is the same statement twice.
|
|
253
|
+
if (hit !== null)
|
|
254
|
+
this._showTooltip(hit, x, y);
|
|
255
|
+
else
|
|
256
|
+
this._hideTooltip();
|
|
257
|
+
});
|
|
258
|
+
canvas.addEventListener('mouseleave', () => this._hideTooltip());
|
|
259
|
+
}
|
|
260
|
+
_showTooltip(shape, x, y) {
|
|
261
|
+
const tooltip = this._tooltipEl;
|
|
262
|
+
const canvas = this.canvasEl;
|
|
263
|
+
const data = this._data;
|
|
264
|
+
if (!tooltip || !canvas || data === null)
|
|
265
|
+
return;
|
|
266
|
+
const lines = [
|
|
267
|
+
this._tooltipLine(data.xLabel, shape.bucket.x),
|
|
268
|
+
this._tooltipLine(data.yLabel, shape.bucket.y),
|
|
269
|
+
this._tooltipLine(data.metricLabel, formatStatistic(shape.bucket.value)),
|
|
270
|
+
];
|
|
271
|
+
// How many runs the figure is the mean of, and only when it is a mean of more than one.
|
|
272
|
+
// A count of 1 on every cell is a column of noise; a count of 5 on one of them is the
|
|
273
|
+
// difference between a result and a coincidence.
|
|
274
|
+
if (shape.bucket.count > 1)
|
|
275
|
+
lines.push(this._tooltipLine(this._host.t('Runs'), String(shape.bucket.count)));
|
|
276
|
+
if (shape.best)
|
|
277
|
+
lines.push(makeElement('div', 'heatmap-tt-row heatmap-tt-best', {}, [this._host.t('Best')]));
|
|
278
|
+
tooltip.replaceChildren(...lines);
|
|
279
|
+
// Measured, then placed: the size is only known once it is showing, and it is clamped
|
|
280
|
+
// inside the canvas so a cell near the right or bottom edge does not push its own
|
|
281
|
+
// tooltip out of view.
|
|
282
|
+
tooltip.removeAttribute('hidden');
|
|
283
|
+
const canvasRect = canvas.getBoundingClientRect();
|
|
284
|
+
const parentRect = tooltip.offsetParent?.getBoundingClientRect() ?? canvasRect;
|
|
285
|
+
const originX = canvasRect.left - parentRect.left;
|
|
286
|
+
const originY = canvasRect.top - parentRect.top;
|
|
287
|
+
const maxX = originX + canvasRect.width - tooltip.offsetWidth - TOOLTIP_MARGIN;
|
|
288
|
+
const maxY = originY + canvasRect.height - tooltip.offsetHeight - TOOLTIP_MARGIN;
|
|
289
|
+
tooltip.style.left = `${Math.max(0, Math.min(originX + x + TOOLTIP_OFFSET, maxX))}px`;
|
|
290
|
+
tooltip.style.top = `${Math.max(0, Math.min(originY + y + TOOLTIP_OFFSET, maxY))}px`;
|
|
291
|
+
}
|
|
292
|
+
_tooltipLine(label, value) {
|
|
293
|
+
return makeElement('div', 'heatmap-tt-row', {}, [
|
|
294
|
+
makeElement('span', 'heatmap-tt-label', {}, [label]),
|
|
295
|
+
makeElement('span', 'heatmap-tt-value', {}, [value]),
|
|
296
|
+
]);
|
|
297
|
+
}
|
|
298
|
+
_hideTooltip() {
|
|
299
|
+
this._tooltipEl?.setAttribute('hidden', '');
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
OptimizationHeatmapWidget.TYPE = ControlTypes.OptimizationHeatmap;
|
|
303
|
+
//# sourceMappingURL=optimization-heatmap-widget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"optimization-heatmap-widget.js","sourceRoot":"","sources":["../../src/optimization-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IAED,YAAY;QACR,IAAI,CAAC,UAAU,EAAE,YAAY,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IAChD,CAAC;;AA7RM,8BAAI,GAAG,YAAY,CAAC,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
// Option smile — multi-instance.
|
|
2
|
+
//
|
|
3
|
+
// One expiry's implied volatility against strike, call side and put side as two curves on one
|
|
4
|
+
// scale, drawn by @stocksharp/chart.
|
|
5
|
+
//
|
|
6
|
+
// The engine is a time-series engine and this axis is a ladder of strikes, which looked at first
|
|
7
|
+
// like a reason to draw the chart by hand. It is not: the axis carries numbers, and what turns
|
|
8
|
+
// them into dates is `timeScale.formatter` - one function shared by the tick labels and the
|
|
9
|
+
// crosshair label. Given a formatter that words a number as a strike, the axis is a strike axis,
|
|
10
|
+
// and the crosshair, the legend readout, the zoom and the pan come with it rather than being
|
|
11
|
+
// written again here.
|
|
12
|
+
//
|
|
13
|
+
// `mode: 'ordinal'` on top of that, because a listed chain is evenly spaced by listing rather
|
|
14
|
+
// than by the gaps between its numbers: a venue that lists 67000, 67250 and then 68000 means
|
|
15
|
+
// three rungs, not a hole.
|
|
16
|
+
import { formatPrice } from './formatters.js';
|
|
17
|
+
import { makeElement, makeIconButton, makePanelId, makePanelRoot } from './dom.js';
|
|
18
|
+
import { ControlTypes } from './control-types.js';
|
|
19
|
+
import { assertHost } from './trading-host.js';
|
|
20
|
+
import { CrosshairMode, LineSeries, createChart, } from './chart-engine.js';
|
|
21
|
+
const LINE_WIDTH = 2;
|
|
22
|
+
/// The volatility a side is drawn at: what it last traded at, or the middle of its quote when it
|
|
23
|
+
/// has not traded. Null when neither is known - a strike nobody has quoted is a gap in the curve,
|
|
24
|
+
/// and a line drawn through it invents a quote nobody made.
|
|
25
|
+
export function sideVolatility(side) {
|
|
26
|
+
if (side === undefined || side === null)
|
|
27
|
+
return null;
|
|
28
|
+
const last = side.ivLast;
|
|
29
|
+
if (typeof last === 'number' && isFinite(last) && last > 0)
|
|
30
|
+
return last;
|
|
31
|
+
const bid = side.ivBid;
|
|
32
|
+
const ask = side.ivAsk;
|
|
33
|
+
const quoted = [bid, ask].filter((v) => typeof v === 'number' && isFinite(v) && v > 0);
|
|
34
|
+
if (quoted.length === 0)
|
|
35
|
+
return null;
|
|
36
|
+
return quoted.reduce((sum, v) => sum + v, 0) / quoted.length;
|
|
37
|
+
}
|
|
38
|
+
/// The chain in the order it is drawn: by strike, lowest first, whatever order it arrived in.
|
|
39
|
+
export function sortedChain(strikes) {
|
|
40
|
+
return [...strikes]
|
|
41
|
+
.filter(row => row !== null && row !== undefined && isFinite(row.strike))
|
|
42
|
+
.sort((a, b) => a.strike - b.strike);
|
|
43
|
+
}
|
|
44
|
+
/// One side as a series, and the strikes it was drawn at.
|
|
45
|
+
///
|
|
46
|
+
/// The x value is the strike itself rather than an index: the axis words it back through the
|
|
47
|
+
/// formatter, so the number on the wire and the number on the label are the same one and no
|
|
48
|
+
/// lookup can put them out of step.
|
|
49
|
+
export function toSmileSeries(chain, put) {
|
|
50
|
+
const out = [];
|
|
51
|
+
for (const row of chain) {
|
|
52
|
+
const volatility = sideVolatility(put ? row.put : row.call);
|
|
53
|
+
// Whitespace rather than a point: the engine keeps the rung on the axis and leaves the
|
|
54
|
+
// line broken across it, which is what a strike quoted on one side only looks like.
|
|
55
|
+
if (volatility === null)
|
|
56
|
+
out.push({ time: row.strike });
|
|
57
|
+
else
|
|
58
|
+
out.push({ time: row.strike, value: volatility * 100 });
|
|
59
|
+
}
|
|
60
|
+
return out;
|
|
61
|
+
}
|
|
62
|
+
export class OptionSmileWidget {
|
|
63
|
+
static create(hostEl, state, deps) {
|
|
64
|
+
const host = assertHost(deps?.host, 'OptionSmileWidget');
|
|
65
|
+
const root = OptionSmileWidget._buildRoot(host);
|
|
66
|
+
root.id = makePanelId(OptionSmileWidget.TYPE);
|
|
67
|
+
hostEl.appendChild(root);
|
|
68
|
+
return new OptionSmileWidget(root, state || {}, deps);
|
|
69
|
+
}
|
|
70
|
+
static _buildRoot(host) {
|
|
71
|
+
const title = host.t('OptionSmile');
|
|
72
|
+
return makePanelRoot('option-smile-panel', title, [
|
|
73
|
+
makeElement('div', 'panel-header', {}, [
|
|
74
|
+
makeElement('span', '', {}, [title]),
|
|
75
|
+
makeIconButton('bt-icon-btn option-smile-reset-btn', host.t('ResetView'), 'bi-arrow-clockwise', { type: 'button' }),
|
|
76
|
+
makeIconButton('bt-icon-btn bt-icon-cancel panel-close-btn', host.t('ClosePanel'), 'bi-x', { type: 'button' }),
|
|
77
|
+
]),
|
|
78
|
+
makeElement('div', 'panel-body', {}, [
|
|
79
|
+
makeElement('div', 'option-smile-legend', {}, [
|
|
80
|
+
makeElement('span', 'option-smile-axis', {}, [host.t('ImpliedVolatility')]),
|
|
81
|
+
makeElement('span', 'option-smile-key', {}, [
|
|
82
|
+
makeElement('span', 'option-smile-dot option-smile-dot-call', {}, []),
|
|
83
|
+
host.t('Call'),
|
|
84
|
+
]),
|
|
85
|
+
makeElement('span', 'option-smile-key', {}, [
|
|
86
|
+
makeElement('span', 'option-smile-dot option-smile-dot-put', {}, []),
|
|
87
|
+
host.t('Put'),
|
|
88
|
+
]),
|
|
89
|
+
makeElement('span', 'option-smile-spot', {}, []),
|
|
90
|
+
]),
|
|
91
|
+
makeElement('div', 'option-smile-chart', { role: 'img', 'aria-label': host.t('OptionChain') }, [
|
|
92
|
+
// Over the chart, not in the panel header: a reading about the point under the
|
|
93
|
+
// pointer belongs beside that point, and a host that lifts panel headers into a
|
|
94
|
+
// tab strip would otherwise write it into a tab title.
|
|
95
|
+
makeElement('div', 'option-smile-hover', {}, []),
|
|
96
|
+
makeElement('div', 'option-smile-empty', {}, [host.t('NoOptions')]),
|
|
97
|
+
]),
|
|
98
|
+
]),
|
|
99
|
+
]);
|
|
100
|
+
}
|
|
101
|
+
constructor(rootEl, _state, deps) {
|
|
102
|
+
this._host = assertHost(deps?.host, 'OptionSmileWidget');
|
|
103
|
+
this.rootEl = rootEl;
|
|
104
|
+
this._closeBtn = this.rootEl.querySelector('.panel-close-btn');
|
|
105
|
+
this._resetBtn = this.rootEl.querySelector('.option-smile-reset-btn');
|
|
106
|
+
this._emptyEl = this.rootEl.querySelector('.option-smile-empty');
|
|
107
|
+
this._chartEl = this.rootEl.querySelector('.option-smile-chart');
|
|
108
|
+
this._spotEl = this.rootEl.querySelector('.option-smile-spot');
|
|
109
|
+
this._hoverEl = this.rootEl.querySelector('.option-smile-hover');
|
|
110
|
+
this._chart = null;
|
|
111
|
+
this._call = null;
|
|
112
|
+
this._put = null;
|
|
113
|
+
this._strikes = [];
|
|
114
|
+
this._context = {};
|
|
115
|
+
this._resizeObserver = null;
|
|
116
|
+
this._closeBtn?.addEventListener('click', (e) => { e.preventDefault(); this._host.close(); });
|
|
117
|
+
this._resetBtn?.addEventListener('click', (e) => { e.preventDefault(); this.resetZoom(); });
|
|
118
|
+
if (this._chartEl !== null && typeof ResizeObserver !== 'undefined') {
|
|
119
|
+
this._resizeObserver = new ResizeObserver(() => this._fit());
|
|
120
|
+
this._resizeObserver.observe(this._chartEl);
|
|
121
|
+
}
|
|
122
|
+
this._render();
|
|
123
|
+
this._host.register(this);
|
|
124
|
+
}
|
|
125
|
+
dispose() {
|
|
126
|
+
try {
|
|
127
|
+
this._resizeObserver?.disconnect();
|
|
128
|
+
}
|
|
129
|
+
catch { /* already torn down */ }
|
|
130
|
+
this._resizeObserver = null;
|
|
131
|
+
try {
|
|
132
|
+
this._chart?.remove();
|
|
133
|
+
}
|
|
134
|
+
catch { /* already gone */ }
|
|
135
|
+
this._chart = null;
|
|
136
|
+
this._call = null;
|
|
137
|
+
this._put = null;
|
|
138
|
+
this._host.unregister(this);
|
|
139
|
+
try {
|
|
140
|
+
this.rootEl.remove();
|
|
141
|
+
}
|
|
142
|
+
catch { /* already detached */ }
|
|
143
|
+
}
|
|
144
|
+
/// Show this chain, priced against this context.
|
|
145
|
+
///
|
|
146
|
+
/// The desk's two arguments unchanged, and for the same reason it takes them together: they
|
|
147
|
+
/// are one observation. A smile marked with a spot the curves never saw is two moments.
|
|
148
|
+
update(strikes, context = {}) {
|
|
149
|
+
this._strikes = strikes || [];
|
|
150
|
+
this._context = context || {};
|
|
151
|
+
this._render();
|
|
152
|
+
}
|
|
153
|
+
/// Show the whole chain again, after a zoom.
|
|
154
|
+
resetZoom() {
|
|
155
|
+
try {
|
|
156
|
+
this._chart?.timeScale().fitContent();
|
|
157
|
+
}
|
|
158
|
+
catch { /* no chart yet */ }
|
|
159
|
+
}
|
|
160
|
+
/// The engine, for a host that wants to add to this chart - a second expiry, a marker.
|
|
161
|
+
chart() {
|
|
162
|
+
return this._chart;
|
|
163
|
+
}
|
|
164
|
+
_ensureChart() {
|
|
165
|
+
if (this._chart !== null)
|
|
166
|
+
return true;
|
|
167
|
+
if (this._chartEl === null)
|
|
168
|
+
return false;
|
|
169
|
+
const palette = this._host.presentation.canvasPalette();
|
|
170
|
+
this._chart = createChart(this._chartEl, {
|
|
171
|
+
layout: {
|
|
172
|
+
background: { type: 'solid', color: 'transparent' },
|
|
173
|
+
textColor: palette.grid,
|
|
174
|
+
fontFamily: palette.font,
|
|
175
|
+
fontSize: 11,
|
|
176
|
+
attributionLogo: false,
|
|
177
|
+
},
|
|
178
|
+
grid: { vertLines: { color: palette.grid }, horzLines: { color: palette.grid } },
|
|
179
|
+
crosshair: { mode: CrosshairMode.Normal },
|
|
180
|
+
rightPriceScale: { borderColor: palette.grid },
|
|
181
|
+
timeScale: {
|
|
182
|
+
borderColor: palette.grid,
|
|
183
|
+
// Evenly spaced by listing, and worded as strikes: the axis carries the strike
|
|
184
|
+
// itself, so the label and the value can never drift apart.
|
|
185
|
+
mode: 'ordinal',
|
|
186
|
+
formatter: (value) => formatPrice(Number(value)),
|
|
187
|
+
},
|
|
188
|
+
});
|
|
189
|
+
this._call = this._chart.addSeries(LineSeries, { lineWidth: LINE_WIDTH, color: palette.up });
|
|
190
|
+
this._put = this._chart.addSeries(LineSeries, { lineWidth: LINE_WIDTH, color: palette.down });
|
|
191
|
+
this._chart.subscribeCrosshairMove((param) => this._renderHover(param));
|
|
192
|
+
return true;
|
|
193
|
+
}
|
|
194
|
+
_render() {
|
|
195
|
+
const chain = sortedChain(this._strikes);
|
|
196
|
+
const quoted = chain.some(row => sideVolatility(row.call) !== null || sideVolatility(row.put) !== null);
|
|
197
|
+
if (this._emptyEl !== null)
|
|
198
|
+
this._emptyEl.hidden = quoted;
|
|
199
|
+
this._renderSpot();
|
|
200
|
+
if (!quoted)
|
|
201
|
+
return;
|
|
202
|
+
if (!this._ensureChart() || this._call === null || this._put === null)
|
|
203
|
+
return;
|
|
204
|
+
this._call.setData(toSmileSeries(chain, false));
|
|
205
|
+
this._put.setData(toSmileSeries(chain, true));
|
|
206
|
+
this._fit();
|
|
207
|
+
}
|
|
208
|
+
_fit() {
|
|
209
|
+
if (this._chart === null || this._chartEl === null)
|
|
210
|
+
return;
|
|
211
|
+
const rect = this._chartEl.getBoundingClientRect();
|
|
212
|
+
if (rect.width <= 0 || rect.height <= 0)
|
|
213
|
+
return;
|
|
214
|
+
try {
|
|
215
|
+
this._chart.resize(rect.width, rect.height);
|
|
216
|
+
}
|
|
217
|
+
catch { /* the engine is between frames */ }
|
|
218
|
+
}
|
|
219
|
+
// Where the money is. Not a line on the chart: an ordinal axis has a rung per listed strike
|
|
220
|
+
// and the spot is between two of them, so it is stated rather than drawn at a place the
|
|
221
|
+
// ladder does not have.
|
|
222
|
+
_renderSpot() {
|
|
223
|
+
const el = this._spotEl;
|
|
224
|
+
if (el === null)
|
|
225
|
+
return;
|
|
226
|
+
const spot = this._context.assetPrice;
|
|
227
|
+
if (typeof spot !== 'number' || !isFinite(spot)) {
|
|
228
|
+
el.textContent = '';
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
el.textContent = `${this._host.t('Underlying')} ${formatPrice(spot)}`;
|
|
232
|
+
}
|
|
233
|
+
// What the pointer is over: the strike and both sides at it. Both, because a smile is read by
|
|
234
|
+
// the distance between the two curves - a readout naming one of them answers half of it.
|
|
235
|
+
_renderHover(param) {
|
|
236
|
+
const el = this._hoverEl;
|
|
237
|
+
if (el === null)
|
|
238
|
+
return;
|
|
239
|
+
if (param.time === null) {
|
|
240
|
+
el.textContent = '';
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
const at = (series) => {
|
|
244
|
+
const point = series === null ? undefined : param.seriesData.get(series);
|
|
245
|
+
const value = point?.value;
|
|
246
|
+
return typeof value === 'number' && isFinite(value) ? `${value.toFixed(2)}%` : '--';
|
|
247
|
+
};
|
|
248
|
+
el.textContent = `${formatPrice(Number(param.time))} ${at(this._call)} / ${at(this._put)}`;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
OptionSmileWidget.TYPE = ControlTypes.OptionSmile;
|
|
252
|
+
//# sourceMappingURL=option-smile-widget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"option-smile-widget.js","sourceRoot":"","sources":["../../src/option-smile-widget.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,EAAE;AACF,8FAA8F;AAC9F,qCAAqC;AACrC,EAAE;AACF,iGAAiG;AACjG,+FAA+F;AAC/F,4FAA4F;AAC5F,iGAAiG;AACjG,6FAA6F;AAC7F,sBAAsB;AACtB,EAAE;AACF,8FAA8F;AAC9F,6FAA6F;AAC7F,2BAA2B;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACnF,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAe,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,EACH,aAAa,EAAE,UAAU,EAAE,WAAW,GAEzC,MAAM,mBAAmB,CAAC;AAO3B,MAAM,UAAU,GAAG,CAAC,CAAC;AAErB,iGAAiG;A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,CAAC,WAAW,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC;IAC1E,CAAC;IAED,8FAA8F;IAC9F,yFAAyF;IACzF,YAAY,CAAC,KAAqB;QAC9B,MAAM,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC;QACzB,IAAI,EAAE,KAAK,IAAI;YAAE,OAAO;QAExB,IAAI,KAAK,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC;YACtB,EAAE,CAAC,WAAW,GAAG,EAAE,CAAC;YACpB,OAAO;QACX,CAAC;QAED,MAAM,EAAE,GAAG,CAAC,MAAmC,EAAU,EAAE;YACvD,MAAM,KAAK,GAAG,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;YACzE,MAAM,KAAK,GAAI,KAAwC,EAAE,KAAK,CAAC;YAC/D,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;QACxF,CAAC,CAAC;QAEF,EAAE,CAAC,WAAW,GAAG,GAAG,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;IAChG,CAAC;;AA9MM,sBAAI,GAAG,YAAY,CAAC,WAAW,CAAC"}
|
package/dist/esm/pnl-curve.js
CHANGED
|
@@ -86,6 +86,7 @@ export function pnlCurve(points, box) {
|
|
|
86
86
|
const y = (value) => (valueSpan === 0 ? top : bottom - ((value - min) / valueSpan) * (bottom - top));
|
|
87
87
|
const curve = shown.map(p => [x(p.time), y(p.value)]);
|
|
88
88
|
const zeroY = y(0);
|
|
89
|
+
const last = shown[shown.length - 1].value;
|
|
89
90
|
return {
|
|
90
91
|
points: curve,
|
|
91
92
|
// Closed along the baseline rather than along the foot of the box: a run entirely above
|
|
@@ -94,7 +95,10 @@ export function pnlCurve(points, box) {
|
|
|
94
95
|
zeroY,
|
|
95
96
|
min,
|
|
96
97
|
max,
|
|
97
|
-
|
|
98
|
+
from: firstTime,
|
|
99
|
+
to: lastTime,
|
|
100
|
+
last,
|
|
101
|
+
positive: last >= 0,
|
|
98
102
|
};
|
|
99
103
|
}
|
|
100
104
|
/// Paint a laid-out curve: the baseline, the filled area under it, then the line itself.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pnl-curve.js","sourceRoot":"","sources":["../../src/pnl-curve.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,EAAE;AACF,+FAA+F;AAC/F,8FAA8F;AAC9F,6FAA6F;AAC7F,6FAA6F;AAC7F,4FAA4F;
|
|
1
|
+
{"version":3,"file":"pnl-curve.js","sourceRoot":"","sources":["../../src/pnl-curve.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,EAAE;AACF,+FAA+F;AAC/F,8FAA8F;AAC9F,6FAA6F;AAC7F,6FAA6F;AAC7F,4FAA4F;AAyC5F,gFAAgF;AAChF,GAAG;AACH,iGAAiG;AACjG,8FAA8F;AAC9F,iGAAiG;AACjG,0FAA0F;AAC1F,eAAe;AACf,GAAG;AACH,8FAA8F;AAC9F,+FAA+F;AAC/F,8FAA8F;AAC9F,8FAA8F;AAC9F,wCAAwC;AACxC,MAAM,UAAU,WAAW,CAAC,MAA2B,EAAE,KAAa;IAClE,IAAI,MAAM,CAAC,MAAM,IAAI,KAAK,IAAI,KAAK,GAAG,CAAC;QAAE,OAAO,MAAM,CAAC,KAAK,EAAE,CAAC;IAE/D,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IACxB,MAAM,IAAI,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