@forgecharts/sdk 1.3.2 → 1.3.4
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/dist/api/TChart.d.ts +11 -2
- package/dist/api/TChart.d.ts.map +1 -1
- package/dist/index.js +187 -39
- package/dist/index.js.map +1 -1
- package/dist/internal.js +187 -39
- package/dist/internal.js.map +1 -1
- package/dist/licensing/ChartRuntimeResolver.d.ts +22 -0
- package/dist/licensing/ChartRuntimeResolver.d.ts.map +1 -1
- package/dist/licensing/__tests__/chartFeatureParity.test.d.ts +2 -0
- package/dist/licensing/__tests__/chartFeatureParity.test.d.ts.map +1 -0
- package/dist/licensing/licenseTypes.d.ts +9 -1
- package/dist/licensing/licenseTypes.d.ts.map +1 -1
- package/dist/react/canvas/ChartCanvas.d.ts.map +1 -1
- package/dist/react/canvas/toolbars/LeftToolbar.d.ts +3 -1
- package/dist/react/canvas/toolbars/LeftToolbar.d.ts.map +1 -1
- package/dist/react/index.d.ts +2 -0
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +1437 -117
- package/dist/react/index.js.map +1 -1
- package/dist/react/internal.js +6615 -6304
- package/dist/react/internal.js.map +1 -1
- package/dist/react/shell/OrderEntryPanel.d.ts +5 -1
- package/dist/react/shell/OrderEntryPanel.d.ts.map +1 -1
- package/dist/react/trading/OrderTicket.d.ts +38 -0
- package/dist/react/trading/OrderTicket.d.ts.map +1 -0
- package/dist/react/workspace/BottomTradingPanel.d.ts +14 -3
- package/dist/react/workspace/BottomTradingPanel.d.ts.map +1 -1
- package/dist/react/workspace/ChartWorkspace.d.ts +24 -1
- package/dist/react/workspace/ChartWorkspace.d.ts.map +1 -1
- package/dist/react/workspace/IndicatorsDialog.d.ts.map +1 -1
- package/dist/react/workspace/toolbars/BottomToolbar.d.ts +3 -1
- package/dist/react/workspace/toolbars/BottomToolbar.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/api/TChart.d.ts
CHANGED
|
@@ -235,9 +235,18 @@ export declare class TChart implements IPublicChart {
|
|
|
235
235
|
* Emits `drawingUpdated`.
|
|
236
236
|
*/
|
|
237
237
|
updateDrawing(id: string, patches: Partial<Pick<Drawing, 'points' | 'color' | 'text' | 'fontSize' | 'visible' | 'locked' | 'lineWidth' | 'fillColor' | 'fillOpacity' | 'deviationMultiplier' | 'riskRewardRatio' | 'accountSize' | 'lotSize' | 'risk' | 'riskUnit' | 'leverage'>>): void;
|
|
238
|
+
/**
|
|
239
|
+
* Drawing tools in the "extended" library — gated by the `extendedDrawings`
|
|
240
|
+
* plan feature. Basic tools (trend lines, rays, channels, h/v lines, text,
|
|
241
|
+
* shapes) are covered by `drawingTools` alone; the catalog's description of
|
|
242
|
+
* extendedDrawings is "Gann, Fibonacci, pitchforks, spirals, arcs" plus the
|
|
243
|
+
* forecasting/measurement tools.
|
|
244
|
+
*/
|
|
245
|
+
private static readonly EXTENDED_DRAWING_TOOLS;
|
|
238
246
|
/**
|
|
239
247
|
* Activates a drawing tool. Clicks will place anchors on the chart.
|
|
240
248
|
* The tool remains active after each commit (auto-repeat). Press Escape to cancel.
|
|
249
|
+
* Extended-library tools require the `extendedDrawings` plan feature.
|
|
241
250
|
*/
|
|
242
251
|
startDrawingTool(type: import('@forgecharts/types').DrawingType): void;
|
|
243
252
|
/** Cancels an active drawing tool and returns to cursor mode. */
|
|
@@ -386,9 +395,9 @@ export declare class TChart implements IPublicChart {
|
|
|
386
395
|
upsertOrder(order: ChartOrder): void;
|
|
387
396
|
/** Remove an order line by id. Silent no-op if not found. */
|
|
388
397
|
removeOrder(orderId: string): void;
|
|
389
|
-
/** Replace the entire position set on the chart overlay. */
|
|
398
|
+
/** Replace the entire position set on the chart overlay. Requires the `positionsOverlay` plan feature. */
|
|
390
399
|
setPositions(positions: ChartPosition[]): void;
|
|
391
|
-
/** Insert or update a single position (matched by `position.id`). */
|
|
400
|
+
/** Insert or update a single position (matched by `position.id`). Requires the `positionsOverlay` plan feature. */
|
|
392
401
|
upsertPosition(position: ChartPosition): void;
|
|
393
402
|
/** Remove a position marker by id. Silent no-op if not found. */
|
|
394
403
|
removePosition(positionId: string): void;
|
package/dist/api/TChart.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TChart.d.ts","sourceRoot":"","sources":["../../src/api/TChart.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,aAAa,EACb,UAAU,EACV,aAAa,EACb,WAAW,EACX,OAAO,EAEP,eAAe,EACf,iBAAiB,EACjB,OAAO,EACP,YAAY,EACZ,KAAK,EACL,cAAc,EACf,MAAM,oBAAoB,CAAC;AAG5B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAS3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"TChart.d.ts","sourceRoot":"","sources":["../../src/api/TChart.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,aAAa,EACb,UAAU,EACV,aAAa,EACb,WAAW,EACX,OAAO,EAEP,eAAe,EACf,iBAAiB,EACjB,OAAO,EACP,YAAY,EACZ,KAAK,EACL,cAAc,EACf,MAAM,oBAAoB,CAAC;AAG5B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAS3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AASrE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACrG,OAAO,EAAE,wBAAwB,EAAE,MAAM,6CAA6C,CAAC;AAIvF;;;;;;;;;;;;;;;;;;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AC/D,WAAW,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAMpC,6DAA6D;IAC7D,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAQlC,0GAA0G;IAC1G,YAAY,CAAC,SAAS,EAAE,aAAa,EAAE,GAAG,IAAI;IAU9C,mHAAmH;IACnH,cAAc,CAAC,QAAQ,EAAE,aAAa,GAAG,IAAI;IAU7C,iEAAiE;IACjE,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IAQxC,2EAA2E;IAC3E,aAAa,CAAC,IAAI,EAAE,aAAa,GAAG,IAAI;IAQxC;;;;;;;;;;;;;;;;;;;OAmBG;IACH,iBAAiB,IAAI,wBAAwB;IAQ7C,OAAO,CAAC,aAAa;IAKrB,OAAO,CAAC,YAAY;IAMpB;;;OAGG;IACH,OAAO,CAAC,aAAa;IAuBrB,OAAO,CAAC,eAAe;CAoBxB"}
|
package/dist/index.js
CHANGED
|
@@ -10668,7 +10668,9 @@ var TRADING_FEATURE_KEYS = /* @__PURE__ */ new Set([
|
|
|
10668
10668
|
"draggableOrders",
|
|
10669
10669
|
"bracketOrders",
|
|
10670
10670
|
"trailingStops",
|
|
10671
|
-
"positionsOverlay"
|
|
10671
|
+
"positionsOverlay",
|
|
10672
|
+
"depthOfMarket",
|
|
10673
|
+
"tradingPanel"
|
|
10672
10674
|
]);
|
|
10673
10675
|
|
|
10674
10676
|
// src/licensing/capabilityMatrix.ts
|
|
@@ -11021,6 +11023,14 @@ var ChartRuntimeResolver = class _ChartRuntimeResolver {
|
|
|
11021
11023
|
canUseDataExport() {
|
|
11022
11024
|
return this.#featureOrDefault("dataExport", true);
|
|
11023
11025
|
}
|
|
11026
|
+
/** Continuous futures roll rules + contract-switch handling. */
|
|
11027
|
+
canUseContinuousContracts() {
|
|
11028
|
+
return this.#featureOrDefault("continuousContracts", true);
|
|
11029
|
+
}
|
|
11030
|
+
/** Regular/Extended trading-hours session filtering. */
|
|
11031
|
+
canUseSessionHours() {
|
|
11032
|
+
return this.#featureOrDefault("sessionHours", true);
|
|
11033
|
+
}
|
|
11024
11034
|
// ── Trading capability queries (managed-only by default) ────────────────────
|
|
11025
11035
|
/**
|
|
11026
11036
|
* Built-in order entry UI hooks.
|
|
@@ -11097,6 +11107,23 @@ var ChartRuntimeResolver = class _ChartRuntimeResolver {
|
|
|
11097
11107
|
if (this.#isCoreTier()) return false;
|
|
11098
11108
|
return this.#featureOrDefault("positionsOverlay", true);
|
|
11099
11109
|
}
|
|
11110
|
+
/**
|
|
11111
|
+
* DOM price ladder. Managed deployments only — there is no unmanaged
|
|
11112
|
+
* depth-feed contract, so this is additionally vetoed off-managed.
|
|
11113
|
+
*/
|
|
11114
|
+
canUseDepthOfMarket() {
|
|
11115
|
+
if (!this.isManagedMode()) return false;
|
|
11116
|
+
if (this.#isCoreTier()) return false;
|
|
11117
|
+
return this.#featureOrDefault("depthOfMarket", true);
|
|
11118
|
+
}
|
|
11119
|
+
/**
|
|
11120
|
+
* Built-in positions/orders/history journal panel. Trading-tier feature,
|
|
11121
|
+
* gated on productTier (not deploymentMode).
|
|
11122
|
+
*/
|
|
11123
|
+
canUseTradingPanel() {
|
|
11124
|
+
if (this.#isCoreTier()) return false;
|
|
11125
|
+
return this.#featureOrDefault("tradingPanel", true);
|
|
11126
|
+
}
|
|
11100
11127
|
// ── Scripting capability queries ────────────────────────────────────────────
|
|
11101
11128
|
/** ForgeScript scripting engine. */
|
|
11102
11129
|
canUseForgeScript() {
|
|
@@ -11220,6 +11247,8 @@ var ChartRuntimeResolver = class _ChartRuntimeResolver {
|
|
|
11220
11247
|
realtimeData: this.canUseRealtimeData(),
|
|
11221
11248
|
multipleProviders: this.canUseMultipleProviders(),
|
|
11222
11249
|
dataExport: this.canUseDataExport(),
|
|
11250
|
+
continuousContracts: this.canUseContinuousContracts(),
|
|
11251
|
+
sessionHours: this.canUseSessionHours(),
|
|
11223
11252
|
// ── Trading features ────────────────────────────────────────────────
|
|
11224
11253
|
orderEntry: this.canUseOrderEntry(),
|
|
11225
11254
|
managedTrading: this.canUseManagedTrading(),
|
|
@@ -11227,6 +11256,8 @@ var ChartRuntimeResolver = class _ChartRuntimeResolver {
|
|
|
11227
11256
|
bracketOrders: this.canUseBracketOrders(),
|
|
11228
11257
|
trailingStops: this.canUseTrailingStops(),
|
|
11229
11258
|
positionsOverlay: this.canUsePositionsOverlay(),
|
|
11259
|
+
depthOfMarket: this.canUseDepthOfMarket(),
|
|
11260
|
+
tradingPanel: this.canUseTradingPanel(),
|
|
11230
11261
|
// ── Scripting features ──────────────────────────────────────────────
|
|
11231
11262
|
forgeScript: this.canUseForgeScript(),
|
|
11232
11263
|
customIndicators: this.canUseCustomIndicators(),
|
|
@@ -11992,7 +12023,16 @@ var TChart = class _TChart {
|
|
|
11992
12023
|
static OVERLAY_ONLY = /* @__PURE__ */ new Set(["bbands", "vwap", "sma", "ema", "wma"]);
|
|
11993
12024
|
addIndicator(config) {
|
|
11994
12025
|
this._assertAlive();
|
|
11995
|
-
|
|
12026
|
+
if (config.type === "script" && !canUseForgeScript()) {
|
|
12027
|
+
throw new Error(
|
|
12028
|
+
"[ForgeCharts] ForgeScript indicators are not enabled on the active license. Contact your license provider to enable the forgeScript feature."
|
|
12029
|
+
);
|
|
12030
|
+
}
|
|
12031
|
+
let finalConfig = _TChart.OVERLAY_ONLY.has(config.type) && config.overlay !== true ? { ...config, overlay: true } : config;
|
|
12032
|
+
if (finalConfig.overlay !== true && !canUseMultiPane()) {
|
|
12033
|
+
console.warn("[ForgeCharts] multiPane is not enabled on the active license \u2014 indicator added as a price-pane overlay instead.");
|
|
12034
|
+
finalConfig = { ...finalConfig, overlay: true };
|
|
12035
|
+
}
|
|
11996
12036
|
const id = this._indicators.add(finalConfig);
|
|
11997
12037
|
if (finalConfig.overlay !== true) {
|
|
11998
12038
|
const label = _indicatorTypeLabel(finalConfig.type);
|
|
@@ -12052,6 +12092,10 @@ var TChart = class _TChart {
|
|
|
12052
12092
|
*/
|
|
12053
12093
|
moveIndicatorToPane(id, targetPaneId) {
|
|
12054
12094
|
this._assertAlive();
|
|
12095
|
+
if (!canUseMultiPane()) {
|
|
12096
|
+
console.warn("[ForgeCharts] multiPane is not enabled on the active license \u2014 indicator stays on the price pane.");
|
|
12097
|
+
return;
|
|
12098
|
+
}
|
|
12055
12099
|
const inst = this._indicators.get(id);
|
|
12056
12100
|
if (!inst) return;
|
|
12057
12101
|
const oldPaneId = this._panes.getPanes().find((p) => p.indicatorIds.includes(id))?.id;
|
|
@@ -12123,12 +12167,49 @@ var TChart = class _TChart {
|
|
|
12123
12167
|
this._core.setDrawings(this._drawings.all());
|
|
12124
12168
|
this._core.markDirty();
|
|
12125
12169
|
}
|
|
12170
|
+
/**
|
|
12171
|
+
* Drawing tools in the "extended" library — gated by the `extendedDrawings`
|
|
12172
|
+
* plan feature. Basic tools (trend lines, rays, channels, h/v lines, text,
|
|
12173
|
+
* shapes) are covered by `drawingTools` alone; the catalog's description of
|
|
12174
|
+
* extendedDrawings is "Gann, Fibonacci, pitchforks, spirals, arcs" plus the
|
|
12175
|
+
* forecasting/measurement tools.
|
|
12176
|
+
*/
|
|
12177
|
+
static EXTENDED_DRAWING_TOOLS = /* @__PURE__ */ new Set([
|
|
12178
|
+
"fibRetracement",
|
|
12179
|
+
"trendBasedFibExtension",
|
|
12180
|
+
"fibChannel",
|
|
12181
|
+
"fibTimeZone",
|
|
12182
|
+
"fibSpeedResistanceFan",
|
|
12183
|
+
"trendBasedFibTime",
|
|
12184
|
+
"fibCircles",
|
|
12185
|
+
"fibSpiral",
|
|
12186
|
+
"fibSpeedResistanceArcs",
|
|
12187
|
+
"fibWedge",
|
|
12188
|
+
"pitchfan",
|
|
12189
|
+
"pitchfork",
|
|
12190
|
+
"schiffPitchfork",
|
|
12191
|
+
"modifiedSchiffPitchfork",
|
|
12192
|
+
"insidePitchfork",
|
|
12193
|
+
"gannBox",
|
|
12194
|
+
"gannSquareFixed",
|
|
12195
|
+
"gannSquare",
|
|
12196
|
+
"gannFan",
|
|
12197
|
+
"longPosition",
|
|
12198
|
+
"shortPosition",
|
|
12199
|
+
"priceRange",
|
|
12200
|
+
"dateRange"
|
|
12201
|
+
]);
|
|
12126
12202
|
/**
|
|
12127
12203
|
* Activates a drawing tool. Clicks will place anchors on the chart.
|
|
12128
12204
|
* The tool remains active after each commit (auto-repeat). Press Escape to cancel.
|
|
12205
|
+
* Extended-library tools require the `extendedDrawings` plan feature.
|
|
12129
12206
|
*/
|
|
12130
12207
|
startDrawingTool(type) {
|
|
12131
12208
|
this._assertAlive();
|
|
12209
|
+
if (_TChart.EXTENDED_DRAWING_TOOLS.has(type) && !canUseExtendedDrawings()) {
|
|
12210
|
+
console.warn(`[ForgeCharts] Drawing tool '${type}' requires the extendedDrawings feature, which is not enabled on the active license.`);
|
|
12211
|
+
return;
|
|
12212
|
+
}
|
|
12132
12213
|
this._core.startDrawingTool(type);
|
|
12133
12214
|
}
|
|
12134
12215
|
/** Cancels an active drawing tool and returns to cursor mode. */
|
|
@@ -12477,15 +12558,23 @@ var TChart = class _TChart {
|
|
|
12477
12558
|
this._core.markDirty();
|
|
12478
12559
|
}
|
|
12479
12560
|
// ─ Positions ──
|
|
12480
|
-
/** Replace the entire position set on the chart overlay. */
|
|
12561
|
+
/** Replace the entire position set on the chart overlay. Requires the `positionsOverlay` plan feature. */
|
|
12481
12562
|
setPositions(positions) {
|
|
12482
12563
|
this._assertAlive();
|
|
12564
|
+
if (!canUsePositionsOverlay()) {
|
|
12565
|
+
console.warn("[ForgeCharts] positionsOverlay is not enabled on the active license \u2014 positions not rendered.");
|
|
12566
|
+
return;
|
|
12567
|
+
}
|
|
12483
12568
|
this._overlayStore.setPositions(positions);
|
|
12484
12569
|
this._core.markDirty();
|
|
12485
12570
|
}
|
|
12486
|
-
/** Insert or update a single position (matched by `position.id`). */
|
|
12571
|
+
/** Insert or update a single position (matched by `position.id`). Requires the `positionsOverlay` plan feature. */
|
|
12487
12572
|
upsertPosition(position) {
|
|
12488
12573
|
this._assertAlive();
|
|
12574
|
+
if (!canUsePositionsOverlay()) {
|
|
12575
|
+
console.warn("[ForgeCharts] positionsOverlay is not enabled on the active license \u2014 position not rendered.");
|
|
12576
|
+
return;
|
|
12577
|
+
}
|
|
12489
12578
|
this._overlayStore.upsertPosition(position);
|
|
12490
12579
|
this._core.markDirty();
|
|
12491
12580
|
}
|
|
@@ -18109,6 +18198,19 @@ function lineStyleToDash(style) {
|
|
|
18109
18198
|
return [];
|
|
18110
18199
|
}
|
|
18111
18200
|
}
|
|
18201
|
+
function applyRuntimeConfig(caps, config) {
|
|
18202
|
+
return caps;
|
|
18203
|
+
}
|
|
18204
|
+
function useChartCapabilities(config) {
|
|
18205
|
+
const [licCaps, setLicCaps] = useState(() => getCapabilities());
|
|
18206
|
+
useEffect(() => {
|
|
18207
|
+
const unsub = LicenseManager.getInstance().subscribe(() => {
|
|
18208
|
+
setLicCaps(getCapabilities());
|
|
18209
|
+
});
|
|
18210
|
+
return unsub;
|
|
18211
|
+
}, []);
|
|
18212
|
+
return useMemo(() => applyRuntimeConfig(licCaps), [licCaps, config]);
|
|
18213
|
+
}
|
|
18112
18214
|
|
|
18113
18215
|
// src/react/assets/logo_dark.png
|
|
18114
18216
|
var logo_dark_default = "./logo_dark-B2KCSRPJ.png";
|
|
@@ -19182,7 +19284,7 @@ function nextRenewalDate(subscribedAt) {
|
|
|
19182
19284
|
const periods = Math.floor((now - start) / MS_30D);
|
|
19183
19285
|
return new Date(start + (periods + 1) * MS_30D);
|
|
19184
19286
|
}
|
|
19185
|
-
function LeftToolbar({ activeTool, onSelectTool, drawingFavorites, onDrawingFavoritesChange, onVisibilityAction, visibilityActiveAction, onVisibilityDeactivate, onLinkClick, onDeleteClick, onLogout, magnetMode, onMagnetModeChange, user, getAuthToken, apiUrl, containerRef, showDrawingTools }) {
|
|
19287
|
+
function LeftToolbar({ activeTool, onSelectTool, drawingFavorites, onDrawingFavoritesChange, onVisibilityAction, visibilityActiveAction, onVisibilityDeactivate, onLinkClick, onDeleteClick, onLogout, magnetMode, onMagnetModeChange, user, getAuthToken, apiUrl, containerRef, showDrawingTools, showExtendedDrawings }) {
|
|
19186
19288
|
const [favorites, setFavorites] = useState(drawingFavorites ?? []);
|
|
19187
19289
|
const [profileOpen, setProfileOpen] = useState(false);
|
|
19188
19290
|
const [profileTab, setProfileTab] = useState("profile");
|
|
@@ -19520,7 +19622,7 @@ function LeftToolbar({ activeTool, onSelectTool, drawingFavorites, onDrawingFavo
|
|
|
19520
19622
|
onFavoritesChange: handleFavoritesChange
|
|
19521
19623
|
}
|
|
19522
19624
|
),
|
|
19523
|
-
/* @__PURE__ */ jsx(
|
|
19625
|
+
showExtendedDrawings !== false && /* @__PURE__ */ jsx(
|
|
19524
19626
|
FibGannGroup,
|
|
19525
19627
|
{
|
|
19526
19628
|
activeTool,
|
|
@@ -19557,34 +19659,36 @@ function LeftToolbar({ activeTool, onSelectTool, drawingFavorites, onDrawingFavo
|
|
|
19557
19659
|
onFavoritesChange: handleFavoritesChange
|
|
19558
19660
|
}
|
|
19559
19661
|
),
|
|
19560
|
-
/* @__PURE__ */
|
|
19561
|
-
|
|
19562
|
-
|
|
19563
|
-
|
|
19564
|
-
|
|
19565
|
-
|
|
19566
|
-
|
|
19567
|
-
|
|
19568
|
-
|
|
19569
|
-
|
|
19570
|
-
|
|
19571
|
-
|
|
19572
|
-
|
|
19573
|
-
|
|
19574
|
-
|
|
19575
|
-
|
|
19576
|
-
|
|
19577
|
-
|
|
19578
|
-
|
|
19579
|
-
|
|
19580
|
-
|
|
19581
|
-
|
|
19582
|
-
|
|
19583
|
-
|
|
19584
|
-
|
|
19585
|
-
|
|
19586
|
-
|
|
19587
|
-
|
|
19662
|
+
showExtendedDrawings !== false && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
19663
|
+
/* @__PURE__ */ jsx(
|
|
19664
|
+
ToolFlyoutGroup,
|
|
19665
|
+
{
|
|
19666
|
+
items: FORECAST_ITEMS,
|
|
19667
|
+
toolSet: FORECAST_TOOLS,
|
|
19668
|
+
itemMap: FORECAST_ITEM_MAP,
|
|
19669
|
+
defaultTool: "longPosition",
|
|
19670
|
+
groupTitle: "Forecasting",
|
|
19671
|
+
activeTool,
|
|
19672
|
+
favorites,
|
|
19673
|
+
onSelectTool,
|
|
19674
|
+
onFavoritesChange: handleFavoritesChange
|
|
19675
|
+
}
|
|
19676
|
+
),
|
|
19677
|
+
/* @__PURE__ */ jsx(
|
|
19678
|
+
ToolFlyoutGroup,
|
|
19679
|
+
{
|
|
19680
|
+
items: MEASURER_ITEMS,
|
|
19681
|
+
toolSet: MEASURER_TOOLS,
|
|
19682
|
+
itemMap: MEASURER_ITEM_MAP,
|
|
19683
|
+
defaultTool: "priceRange",
|
|
19684
|
+
groupTitle: "Measurers",
|
|
19685
|
+
activeTool,
|
|
19686
|
+
favorites,
|
|
19687
|
+
onSelectTool,
|
|
19688
|
+
onFavoritesChange: handleFavoritesChange
|
|
19689
|
+
}
|
|
19690
|
+
)
|
|
19691
|
+
] }),
|
|
19588
19692
|
/* @__PURE__ */ jsx(
|
|
19589
19693
|
MagnetTool,
|
|
19590
19694
|
{
|
|
@@ -22613,6 +22717,7 @@ var ChartCanvas = forwardRef(
|
|
|
22613
22717
|
const [error, setError] = useState(null);
|
|
22614
22718
|
const [bars, setBars] = useState([]);
|
|
22615
22719
|
const [panes, setPanes] = useState([]);
|
|
22720
|
+
const capabilities = useChartCapabilities();
|
|
22616
22721
|
const [indicators, setIndicators] = useState([]);
|
|
22617
22722
|
const [totalHeight, setTotalHeight] = useState(600);
|
|
22618
22723
|
const [activeTool, setActiveTool] = useState(initialActiveTool ?? "cursor");
|
|
@@ -22669,6 +22774,10 @@ var ChartCanvas = forwardRef(
|
|
|
22669
22774
|
onOrderDragEndRef.current = onOrderDragEnd;
|
|
22670
22775
|
const onTpSlCreateRef = useRef(onTpSlCreate);
|
|
22671
22776
|
onTpSlCreateRef.current = onTpSlCreate;
|
|
22777
|
+
const tradingBridgeRef = useRef(tradingBridge);
|
|
22778
|
+
tradingBridgeRef.current = tradingBridge;
|
|
22779
|
+
const symbolRef = useRef(symbol);
|
|
22780
|
+
symbolRef.current = symbol;
|
|
22672
22781
|
const dagRef = useRef(null);
|
|
22673
22782
|
const [computedResults, setComputedResults] = useState(
|
|
22674
22783
|
() => /* @__PURE__ */ new Map()
|
|
@@ -22801,10 +22910,48 @@ var ChartCanvas = forwardRef(
|
|
|
22801
22910
|
onPositionClickRef.current?.(positionId);
|
|
22802
22911
|
});
|
|
22803
22912
|
chart.on("orderDragEnd", ({ orderId, newPrice }) => {
|
|
22804
|
-
onOrderDragEndRef.current
|
|
22913
|
+
if (onOrderDragEndRef.current) {
|
|
22914
|
+
onOrderDragEndRef.current(orderId, newPrice);
|
|
22915
|
+
return;
|
|
22916
|
+
}
|
|
22917
|
+
const bridge = tradingBridgeRef.current;
|
|
22918
|
+
if (!bridge) return;
|
|
22919
|
+
const order = chart.getTradingOverlayStore()?.getOrders().find((o) => o.id === orderId);
|
|
22920
|
+
const isBracketLeg = order?.role === "take_profit" || order?.role === "stop_loss";
|
|
22921
|
+
if (isBracketLeg) {
|
|
22922
|
+
if (!canUseBracketOrders()) return;
|
|
22923
|
+
void bridge.onBracketAdjustIntent?.({
|
|
22924
|
+
type: "bracket_adjust",
|
|
22925
|
+
entryOrderId: order?.groupId ?? orderId,
|
|
22926
|
+
symbol: symbolRef.current,
|
|
22927
|
+
...order?.role === "stop_loss" ? { stopLossPrice: newPrice } : { takeProfitPrice: newPrice },
|
|
22928
|
+
timestamp: Date.now()
|
|
22929
|
+
});
|
|
22930
|
+
} else {
|
|
22931
|
+
if (!canUseDraggableOrders()) return;
|
|
22932
|
+
void bridge.onModifyOrderIntent?.({
|
|
22933
|
+
type: "modify",
|
|
22934
|
+
orderId,
|
|
22935
|
+
symbol: symbolRef.current,
|
|
22936
|
+
limitPrice: newPrice,
|
|
22937
|
+
timestamp: Date.now()
|
|
22938
|
+
});
|
|
22939
|
+
}
|
|
22805
22940
|
});
|
|
22806
22941
|
chart.on("tpSlCreate", ({ entryOrderId, kind, price }) => {
|
|
22807
|
-
onTpSlCreateRef.current
|
|
22942
|
+
if (onTpSlCreateRef.current) {
|
|
22943
|
+
onTpSlCreateRef.current(entryOrderId, kind, price);
|
|
22944
|
+
return;
|
|
22945
|
+
}
|
|
22946
|
+
const bridge = tradingBridgeRef.current;
|
|
22947
|
+
if (!bridge || !canUseBracketOrders()) return;
|
|
22948
|
+
void bridge.onBracketAdjustIntent?.({
|
|
22949
|
+
type: "bracket_adjust",
|
|
22950
|
+
entryOrderId,
|
|
22951
|
+
symbol: symbolRef.current,
|
|
22952
|
+
...kind === "sl" ? { stopLossPrice: price } : { takeProfitPrice: price },
|
|
22953
|
+
timestamp: Date.now()
|
|
22954
|
+
});
|
|
22808
22955
|
});
|
|
22809
22956
|
if (layoutToRestore) {
|
|
22810
22957
|
try {
|
|
@@ -22927,7 +23074,7 @@ var ChartCanvas = forwardRef(
|
|
|
22927
23074
|
}, [initialCanvasSettings]);
|
|
22928
23075
|
useEffect(() => {
|
|
22929
23076
|
const chart = chartRef.current;
|
|
22930
|
-
if (!chart || !canvasSettings.showContractSwitches) {
|
|
23077
|
+
if (!chart || !canvasSettings.showContractSwitches || !capabilities.continuousContracts) {
|
|
22931
23078
|
chart?.setContractSwitches([]);
|
|
22932
23079
|
contractSwitchesRef.current = [];
|
|
22933
23080
|
return;
|
|
@@ -22964,7 +23111,7 @@ var ChartCanvas = forwardRef(
|
|
|
22964
23111
|
return () => {
|
|
22965
23112
|
cancelled = true;
|
|
22966
23113
|
};
|
|
22967
|
-
}, [symbol, apiUrl, canvasSettings.showContractSwitches, providerKey]);
|
|
23114
|
+
}, [symbol, apiUrl, canvasSettings.showContractSwitches, providerKey, capabilities.continuousContracts]);
|
|
22968
23115
|
useEffect(() => {
|
|
22969
23116
|
if (!dagRef.current) dagRef.current = new IndicatorDAG();
|
|
22970
23117
|
const dag = dagRef.current;
|
|
@@ -23703,7 +23850,8 @@ var ChartCanvas = forwardRef(
|
|
|
23703
23850
|
onDrawingFavoritesChange?.(favs);
|
|
23704
23851
|
},
|
|
23705
23852
|
containerRef: outerRef,
|
|
23706
|
-
showDrawingTools,
|
|
23853
|
+
showDrawingTools: showDrawingTools !== false && capabilities.drawingTools,
|
|
23854
|
+
showExtendedDrawings: capabilities.extendedDrawings,
|
|
23707
23855
|
...onLogout ? { onLogout } : {},
|
|
23708
23856
|
...user ? { user } : {},
|
|
23709
23857
|
...getAuthToken ? { getAuthToken } : {},
|