@tradejs/app 2.0.18 → 2.0.20

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 (52) hide show
  1. package/package.json +14 -8
  2. package/src/app/actions/backtest.ts +2 -1
  3. package/src/app/actions/scanner.ts +2 -1
  4. package/src/app/api/backtest/files/route.ts +2 -1
  5. package/src/app/api/backtest/test/[strategy]/[name]/route.ts +1 -1
  6. package/src/app/api/derivatives/[symbol]/[interval]/route.ts +1 -1
  7. package/src/app/api/derivatives/summary/route.ts +1 -1
  8. package/src/app/api/signal/[symbol]/[signalId]/route.ts +2 -1
  9. package/src/app/api/spread/[symbol]/[interval]/route.ts +1 -1
  10. package/src/app/api/spread/summary/route.ts +1 -1
  11. package/src/app/api/strategies/runtime/route.ts +4 -674
  12. package/src/app/api/user/runtime-deployments/[deploymentId]/route.ts +1 -1
  13. package/src/app/api/user/runtime-deployments/route.ts +2 -2
  14. package/src/app/api/user/runtime-strategy-configs/route.ts +22 -212
  15. package/src/app/api/user/trading-accounts/[accountId]/route.ts +1 -1
  16. package/src/app/components/Backtest/TestList/index.tsx +1 -1
  17. package/src/app/components/Dashboard/KlineChart/figures/circle.ts +1 -1
  18. package/src/app/components/Dashboard/KlineChart/figures/diamond.ts +1 -1
  19. package/src/app/components/Dashboard/KlineChart/figures/label.ts +1 -1
  20. package/src/app/components/Dashboard/KlineChart/figures/rectangle.ts +1 -1
  21. package/src/app/components/Dashboard/KlineChart/figures/star.ts +1 -1
  22. package/src/app/components/Dashboard/KlineChart/index.tsx +2 -1
  23. package/src/app/components/Shared/Filters/Root/index.tsx +1 -1
  24. package/src/app/components/Shared/Filters/context.ts +1 -1
  25. package/src/app/components/Strategies/RuntimeStrategyCard.tsx +82 -861
  26. package/src/app/components/Strategies/RuntimeStrategyChart.tsx +115 -184
  27. package/src/app/components/Strategies/StrategyEvidencePopover.tsx +259 -0
  28. package/src/app/components/Strategies/StrategyPerformanceCharts.tsx +419 -0
  29. package/src/app/components/Strategies/StrategySnapshotCard.tsx +122 -937
  30. package/src/app/components/UI/Segment/index.tsx +1 -1
  31. package/src/app/components/UI/Select/index.tsx +1 -1
  32. package/src/app/components/UI/SelectWithSearch/index.tsx +1 -1
  33. package/src/app/lib/backtestJobContracts.ts +67 -0
  34. package/src/app/lib/backtestJobProgress.ts +28 -0
  35. package/src/app/lib/backtestJobRequest.ts +107 -0
  36. package/src/app/lib/backtestJobs.ts +25 -257
  37. package/src/app/lib/runtimeDashboard.ts +700 -0
  38. package/src/app/lib/runtimeStrategies.ts +22 -457
  39. package/src/app/lib/runtimeStrategyConfigService.ts +279 -0
  40. package/src/app/lib/runtimeStrategyLineage.ts +264 -0
  41. package/src/app/lib/runtimeTradeReconciliation.ts +113 -0
  42. package/src/app/lib/runtimeTradeSync.ts +1 -1
  43. package/src/app/lib/strategyEvidenceTimeline.ts +298 -0
  44. package/src/app/lib/strategyPerformance.ts +387 -0
  45. package/src/app/routes/dashboard/Dashboard.tsx +2 -6
  46. package/src/app/routes/derivatives/derivativesViewModel.ts +253 -0
  47. package/src/app/routes/derivatives/page.tsx +70 -262
  48. package/src/app/store/filters.ts +2 -1
  49. package/src/app/store/indicators.ts +2 -1
  50. package/src/app/store/tests.ts +1 -1
  51. package/src/app/store/tickers.ts +2 -1
  52. package/src/app/types/ui.ts +20 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tradejs/app",
3
- "version": "2.0.18",
3
+ "version": "2.0.20",
4
4
  "description": "Installable Next.js UI for the TradeJS TypeScript framework: dashboards, backtests, charts, and runtime data.",
5
5
  "keywords": [
6
6
  "tradejs",
@@ -51,12 +51,13 @@
51
51
  "@emotion/react": "^11.14.0",
52
52
  "@langchain/core": "^1.2.3",
53
53
  "@langchain/openai": "^1.5.5",
54
- "@tradejs/connectors": "^2.0.18",
55
- "@tradejs/core": "^2.0.18",
56
- "@tradejs/indicators": "^2.0.18",
57
- "@tradejs/infra": "^2.0.18",
58
- "@tradejs/node": "^2.0.18",
59
- "@tradejs/types": "^2.0.18",
54
+ "@tradejs/connectors": "^2.0.20",
55
+ "@tradejs/core": "^2.0.20",
56
+ "@tradejs/indicators": "^2.0.20",
57
+ "@tradejs/infra": "^2.0.20",
58
+ "@tradejs/node": "^2.0.20",
59
+ "@tradejs/strategies": "^2.0.20",
60
+ "@tradejs/types": "^2.0.20",
60
61
  "@types/bcryptjs": "2.4.6",
61
62
  "@types/lodash": "4.17.24",
62
63
  "@types/node": "24.13.3",
@@ -84,11 +85,16 @@
84
85
  "typescript": "5.9.3",
85
86
  "zustand": "5.0.14"
86
87
  },
88
+ "devDependencies": {
89
+ "@testing-library/dom": "^10.4.1",
90
+ "@testing-library/react": "^16.3.2"
91
+ },
87
92
  "scripts": {
88
93
  "dev": "node ./bin/tradejs-app.mjs dev",
89
94
  "build": "NODE_ENV=production node ./bin/tradejs-app.mjs build",
90
95
  "start": "node ./bin/tradejs-app.mjs start",
91
- "lint": "ESLINT_USE_FLAT_CONFIG=true yarn run -T eslint src"
96
+ "lint": "ESLINT_USE_FLAT_CONFIG=true yarn run -T eslint src",
97
+ "typecheck": "tsc -p ./tsconfig.json --noEmit"
92
98
  },
93
99
  "license": "BUSL-1.1",
94
100
  "author": "aleksnick (https://github.com/aleksnick)"
@@ -1,5 +1,6 @@
1
1
  import { API } from '@tradejs/core/api';
2
- import { Item, OrderLogData, TestResult } from '@tradejs/types';
2
+ import { OrderLogData, TestResult } from '@tradejs/types';
3
+ import type { Item } from '#app/types/ui';
3
4
  import type {
4
5
  BacktestConfigSummary,
5
6
  BacktestJobRecord,
@@ -1,5 +1,6 @@
1
1
  import { API } from '@tradejs/core/api';
2
- import { Items, MarketUniverse } from '@tradejs/types';
2
+ import { MarketUniverse } from '@tradejs/types';
3
+ import type { Items } from '#app/types/ui';
3
4
 
4
5
  const API_PATH = '/api/scanner';
5
6
 
@@ -1,5 +1,6 @@
1
1
  import { NextResponse } from 'next/server';
2
- import { Item, TestStat } from '@tradejs/types';
2
+ import { TestStat } from '@tradejs/types';
3
+ import type { Item } from '#app/types/ui';
3
4
  import { parseTestName } from '@tradejs/core/backtest';
4
5
  import { TTL_1M } from '@tradejs/core/constants';
5
6
  import { getData, getKeys, redisKeys, setData } from '@tradejs/infra/redis';
@@ -7,7 +7,7 @@ import {
7
7
  } from '@tradejs/infra/backtestArtifacts';
8
8
  import { TTL_1M } from '@tradejs/core/constants';
9
9
  import { delKey, getData, redisKeys, setData } from '@tradejs/infra/redis';
10
- import { Item } from '@tradejs/types';
10
+ import type { Item } from '#app/types/ui';
11
11
  import { logger } from '@tradejs/infra/logger';
12
12
  import { auth } from '#app/auth';
13
13
 
@@ -1,5 +1,5 @@
1
1
  import { NextRequest, NextResponse } from 'next/server';
2
- import { getDerivativesRangeForSymbols } from '@tradejs/infra/timescale';
2
+ import { getDerivativesRangeForSymbols } from '@tradejs/infra/timescale/derivatives';
3
3
  import { logger } from '@tradejs/infra/logger';
4
4
  import type { DerivativesInterval } from '@tradejs/types';
5
5
 
@@ -1,6 +1,6 @@
1
1
  import { NextRequest, NextResponse } from 'next/server';
2
2
  import { logger } from '@tradejs/infra/logger';
3
- import { getDerivativesSummary } from '@tradejs/infra/timescale';
3
+ import { getDerivativesSummary } from '@tradejs/infra/timescale/derivatives';
4
4
 
5
5
  export const dynamic = 'force-dynamic';
6
6
 
@@ -30,8 +30,9 @@ export const GET = async (
30
30
  );
31
31
  }
32
32
 
33
- const signal: Signal = await getData(
33
+ const signal: Signal | null = await getData(
34
34
  redisKeys.storeSignal(symbol, signalId),
35
+ null,
35
36
  );
36
37
 
37
38
  return NextResponse.json({ signal });
@@ -1,5 +1,5 @@
1
1
  import { NextRequest, NextResponse } from 'next/server';
2
- import { getSpreadRangeForSymbols } from '@tradejs/infra/timescale';
2
+ import { getSpreadRangeForSymbols } from '@tradejs/infra/timescale/spread';
3
3
  import { logger } from '@tradejs/infra/logger';
4
4
  import type { DerivativesInterval } from '@tradejs/types';
5
5
 
@@ -1,6 +1,6 @@
1
1
  import { NextRequest, NextResponse } from 'next/server';
2
2
  import { logger } from '@tradejs/infra/logger';
3
- import { getSpreadSummary } from '@tradejs/infra/timescale';
3
+ import { getSpreadSummary } from '@tradejs/infra/timescale/spread';
4
4
 
5
5
  export const dynamic = 'force-dynamic';
6
6