@tradecanvas/core 1.21.0 → 1.23.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.
Files changed (61) hide show
  1. package/README.md +1 -1
  2. package/dist/finance/CounterClockRenderer.d.ts +45 -0
  3. package/dist/finance/CounterClockRenderer.d.ts.map +1 -0
  4. package/dist/finance/index.d.ts +2 -0
  5. package/dist/finance/index.d.ts.map +1 -1
  6. package/dist/index.cjs +5 -5
  7. package/dist/index.cjs.map +1 -1
  8. package/dist/index.js +3463 -2283
  9. package/dist/index.js.map +1 -1
  10. package/dist/indicators/candles/candleShape.d.ts +69 -0
  11. package/dist/indicators/candles/candleShape.d.ts.map +1 -0
  12. package/dist/indicators/candles/detect.d.ts +22 -0
  13. package/dist/indicators/candles/detect.d.ts.map +1 -0
  14. package/dist/indicators/candles/multiPatterns.d.ts +6 -0
  15. package/dist/indicators/candles/multiPatterns.d.ts.map +1 -0
  16. package/dist/indicators/candles/patternDef.d.ts +11 -0
  17. package/dist/indicators/candles/patternDef.d.ts.map +1 -0
  18. package/dist/indicators/candles/singlePatterns.d.ts +6 -0
  19. package/dist/indicators/candles/singlePatterns.d.ts.map +1 -0
  20. package/dist/indicators/index.d.ts +1 -0
  21. package/dist/indicators/index.d.ts.map +1 -1
  22. package/dist/indicators/overlay/CandlePatterns.d.ts +22 -0
  23. package/dist/indicators/overlay/CandlePatterns.d.ts.map +1 -0
  24. package/dist/indicators/overlay/DeMarkRange.d.ts +14 -0
  25. package/dist/indicators/overlay/DeMarkRange.d.ts.map +1 -0
  26. package/dist/indicators/overlay/MARainbow.d.ts +16 -0
  27. package/dist/indicators/overlay/MARainbow.d.ts.map +1 -0
  28. package/dist/indicators/overlay/PriceAverages.d.ts +5 -0
  29. package/dist/indicators/overlay/PriceAverages.d.ts.map +1 -1
  30. package/dist/indicators/overlay/TimeSeriesForecast.d.ts +12 -0
  31. package/dist/indicators/overlay/TimeSeriesForecast.d.ts.map +1 -0
  32. package/dist/indicators/panel/ABRatio.d.ts +16 -0
  33. package/dist/indicators/panel/ABRatio.d.ts.map +1 -0
  34. package/dist/indicators/panel/BinaryWave.d.ts +17 -0
  35. package/dist/indicators/panel/BinaryWave.d.ts.map +1 -0
  36. package/dist/indicators/panel/IntradayIntensity.d.ts +16 -0
  37. package/dist/indicators/panel/IntradayIntensity.d.ts.map +1 -0
  38. package/dist/indicators/panel/PsychologicalLine.d.ts +24 -0
  39. package/dist/indicators/panel/PsychologicalLine.d.ts.map +1 -0
  40. package/dist/indicators/panel/RSquared.d.ts +13 -0
  41. package/dist/indicators/panel/RSquared.d.ts.map +1 -0
  42. package/dist/indicators/panel/RandomWalkIndex.d.ts +15 -0
  43. package/dist/indicators/panel/RandomWalkIndex.d.ts.map +1 -0
  44. package/dist/indicators/panel/Sigma.d.ts +13 -0
  45. package/dist/indicators/panel/Sigma.d.ts.map +1 -0
  46. package/dist/indicators/panel/SmoothedROC.d.ts +12 -0
  47. package/dist/indicators/panel/SmoothedROC.d.ts.map +1 -0
  48. package/dist/indicators/panel/Sonar.d.ts +13 -0
  49. package/dist/indicators/panel/Sonar.d.ts.map +1 -0
  50. package/dist/indicators/panel/TrueRange.d.ts +9 -0
  51. package/dist/indicators/panel/TrueRange.d.ts.map +1 -0
  52. package/dist/indicators/panel/VerticalHorizontalFilter.d.ts +13 -0
  53. package/dist/indicators/panel/VerticalHorizontalFilter.d.ts.map +1 -0
  54. package/dist/indicators/panel/VolumeComparisons.d.ts +25 -0
  55. package/dist/indicators/panel/VolumeComparisons.d.ts.map +1 -0
  56. package/dist/indicators/panel/VolumeIndexes.d.ts +26 -0
  57. package/dist/indicators/panel/VolumeIndexes.d.ts.map +1 -0
  58. package/dist/indicators/panel/VolumeRatio.d.ts +14 -0
  59. package/dist/indicators/panel/VolumeRatio.d.ts.map +1 -0
  60. package/dist/indicators/registry.d.ts.map +1 -1
  61. package/package.json +2 -2
package/README.md CHANGED
@@ -34,7 +34,7 @@ Two stacked canvases — a hover repaints only the thin top one:
34
34
 
35
35
  Data transforms: `toHeikinAshi`, `toRenko`, `toLineBreak`, `toKagi`, `toPointAndFigure`, `toRangeBars`
36
36
 
37
- ### Indicators (111 built-in)
37
+ ### Indicators (134 built-in)
38
38
 
39
39
  Moving averages, bands and channels, trend and stops, VWAPs and profiles on the price pane; oscillators, volume and volatility indicators in panes of their own. Every id with its inputs, lines and levels is in the [indicator catalog](https://bonguynvan.github.io/tradecanvas/docs/indicators). Four more read a second symbol's bars (`compareSymbol`, `spread`, `correlation`, `correlationlog`); `@tradecanvas/chart`'s `Chart` registers them with its symbol store.
40
40
 
@@ -0,0 +1,45 @@
1
+ import { CounterClockOptions, CounterClockPoint, OHLCBar, Theme } from '@tradecanvas/commons';
2
+ import { Measure, NiceScale, Rect } from './chartKit.js';
3
+ /** Points drawn at most. */
4
+ export declare const MAX_CLOCK_POINTS = 2000;
5
+ /**
6
+ * Average volume and average close over each run of `period` bars, one point
7
+ * per bar from the first full run: the path a counter-clock chart draws.
8
+ * `last` keeps only the newest points. Each run is summed afresh, so equal
9
+ * closes give equal averages, with no rounding drift between them.
10
+ */
11
+ export declare function counterClockPoints(data: readonly OHLCBar[], period: number, last?: number): CounterClockPoint[];
12
+ /**
13
+ * The direction of the last move, as one of eight phases counter-clockwise
14
+ * from volume rising at a steady price: 1 volume up, 2 both up, 3 price up,
15
+ * 4 price up on falling volume, 5 volume down, 6 both down, 7 price down,
16
+ * 8 price down on rising volume. Moves are read against the points' ranges,
17
+ * so a phase doesn't depend on the units. Null without a move.
18
+ */
19
+ export declare function counterClockPhase(points: readonly CounterClockPoint[]): number | null;
20
+ export interface PlacedClockPoint {
21
+ px: number;
22
+ py: number;
23
+ alpha: number;
24
+ point: CounterClockPoint;
25
+ }
26
+ export interface CounterClockLayout {
27
+ plot: Rect;
28
+ xScale: NiceScale;
29
+ yScale: NiceScale;
30
+ points: PlacedClockPoint[];
31
+ /** The newest move's phase, 1–8, or null. */
32
+ phase: number | null;
33
+ color: string;
34
+ }
35
+ /** The plot and the newest points' places, for a chart `width` × `height`. */
36
+ export declare function computeCounterClockLayout(options: CounterClockOptions, width: number, height: number, _theme: Theme, measure: Measure): CounterClockLayout;
37
+ /** How many of the newest points a chart shows: `points`, 2 to MAX_CLOCK_POINTS. */
38
+ export declare function shownCount(options: Pick<CounterClockOptions, 'points'>): number;
39
+ /** The point nearest the pointer, within reach; the newest wins a tie. */
40
+ export declare function nearestCounterClockPoint(layout: CounterClockLayout, x: number, y: number): PlacedClockPoint | null;
41
+ export declare function renderCounterClock(ctx: CanvasRenderingContext2D, width: number, height: number, options: CounterClockOptions, theme: Theme, pointer: {
42
+ x: number;
43
+ y: number;
44
+ } | null, layout?: CounterClockLayout): CounterClockLayout;
45
+ //# sourceMappingURL=CounterClockRenderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CounterClockRenderer.d.ts","sourceRoot":"","sources":["../../src/finance/CounterClockRenderer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAEnG,OAAO,EAUL,KAAK,OAAO,EACZ,KAAK,SAAS,EACd,KAAK,IAAI,EACV,MAAM,eAAe,CAAC;AASvB,4BAA4B;AAC5B,eAAO,MAAM,gBAAgB,OAAO,CAAC;AAIrC;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,SAAS,OAAO,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,SAAW,GAAG,iBAAiB,EAAE,CAcjH;AAKD;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,iBAAiB,EAAE,GAAG,MAAM,GAAG,IAAI,CAmBrF;AAED,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,iBAAiB,CAAC;CAC1B;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,IAAI,CAAC;IACX,MAAM,EAAE,SAAS,CAAC;IAClB,MAAM,EAAE,SAAS,CAAC;IAClB,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,6CAA6C;IAC7C,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,8EAA8E;AAC9E,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,mBAAmB,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,GAAG,kBAAkB,CAiC1J;AAED,oFAAoF;AACpF,wBAAgB,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,mBAAmB,EAAE,QAAQ,CAAC,GAAG,MAAM,CAG/E;AAED,0EAA0E;AAC1E,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,kBAAkB,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI,CAYlH;AAID,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,wBAAwB,EAC7B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,mBAAmB,EAC5B,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,EACxC,MAAM,GAAE,kBAAwG,GAC/G,kBAAkB,CAuDpB"}
@@ -25,4 +25,6 @@ export { renderCalendar, computeCalendarLayout, hitDay, parseDay, dayToIso } fro
25
25
  export type { CalendarLayout, CalendarCell } from './CalendarRenderer.js';
26
26
  export { renderMatrix, computeMatrixLayout, hitMatrixCell, correlationMatrix } from './MatrixRenderer.js';
27
27
  export type { MatrixLayout, MatrixCellRect } from './MatrixRenderer.js';
28
+ export { renderCounterClock, computeCounterClockLayout, nearestCounterClockPoint, counterClockPoints, counterClockPhase, shownCount } from './CounterClockRenderer.js';
29
+ export type { CounterClockLayout, PlacedClockPoint } from './CounterClockRenderer.js';
28
30
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/finance/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACpH,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,YAAY,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAClG,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAC9F,YAAY,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,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