@christtrade/depth 0.15.0 → 0.16.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/depth.cjs +63 -63
- package/depth.css +1 -1
- package/depth.mjs +63 -63
- package/depth.nopreflight.css +1 -1
- package/package.json +1 -1
- package/script-runtime.cjs +2 -2
- package/script-runtime.mjs +2 -2
- package/types/components/multi-chart/GridDividers.d.ts +3 -2
- package/types/components/ui/animated-panel.d.ts +5 -1
- package/types/components/ui/scroll-strip.d.ts +6 -0
- package/types/core/RenderEngine.d.ts +4 -0
- package/types/lib/indicator-stdlib.d.ts +17 -0
|
@@ -224,6 +224,15 @@ export type DrawCommand = {
|
|
|
224
224
|
padding?: number;
|
|
225
225
|
radius?: number;
|
|
226
226
|
anchored?: boolean;
|
|
227
|
+
} | {
|
|
228
|
+
/** Round-trip trade - entry and exit markers joined by a connector */
|
|
229
|
+
type: 'trade';
|
|
230
|
+
side: 'long' | 'short';
|
|
231
|
+
entryTs: bigint;
|
|
232
|
+
entryPrice: number;
|
|
233
|
+
exitTs: bigint;
|
|
234
|
+
exitPrice: number;
|
|
235
|
+
pnl: number;
|
|
227
236
|
};
|
|
228
237
|
/**
|
|
229
238
|
* drawLine(pts, color, width, dash?, connect?)
|
|
@@ -382,6 +391,14 @@ export declare function drawBadge(t: bigint, price: number, text: string, textCo
|
|
|
382
391
|
radius?: number;
|
|
383
392
|
anchored?: boolean;
|
|
384
393
|
}): DrawCommand;
|
|
394
|
+
/**
|
|
395
|
+
* drawTrade(side, entryTs, entryPrice, exitTs, exitPrice, pnl)
|
|
396
|
+
*
|
|
397
|
+
* Draws a closed trade the way the default strategy view does: an entry arrow
|
|
398
|
+
* coloured by side, an exit arrow and dashed connector coloured by outcome, and
|
|
399
|
+
* a P&L tag once zoomed in far enough to read it.
|
|
400
|
+
*/
|
|
401
|
+
export declare function drawTrade(side: 'long' | 'short', entryTs: bigint, entryPrice: number, exitTs: bigint, exitPrice: number, pnl: number): DrawCommand;
|
|
385
402
|
export declare function executeDrawCommands(commands: DrawCommand[], renderCtx: RenderContext): void;
|
|
386
403
|
export declare function obv(bars: OhlcvBar[]): number[];
|
|
387
404
|
export declare function mfi(bars: OhlcvBar[], period?: number): number[];
|