@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.
@@ -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[];