@tradejs/node 1.0.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/README.md +72 -0
- package/dist/ai-NNJ3RLLL.mjs +19 -0
- package/dist/backtest.d.mts +9 -0
- package/dist/backtest.d.ts +9 -0
- package/dist/backtest.js +6561 -0
- package/dist/backtest.mjs +487 -0
- package/dist/chunk-4ZPGZWO7.mjs +13 -0
- package/dist/chunk-5YNMSWL3.mjs +0 -0
- package/dist/chunk-6DZX6EAA.mjs +37 -0
- package/dist/chunk-CVTV6S2V.mjs +94 -0
- package/dist/chunk-DE7ADBIR.mjs +204 -0
- package/dist/chunk-E2QNOA5M.mjs +227 -0
- package/dist/chunk-GKDBAF3A.mjs +5500 -0
- package/dist/chunk-MHCXPD2B.mjs +201 -0
- package/dist/chunk-PXJJPAQT.mjs +49 -0
- package/dist/chunk-ZIMX3JX2.mjs +294 -0
- package/dist/cli.d.mts +12 -0
- package/dist/cli.d.ts +12 -0
- package/dist/cli.js +6385 -0
- package/dist/cli.mjs +548 -0
- package/dist/connectors.d.mts +20 -0
- package/dist/connectors.d.ts +20 -0
- package/dist/connectors.js +468 -0
- package/dist/connectors.mjs +28 -0
- package/dist/constants.d.mts +6 -0
- package/dist/constants.d.ts +6 -0
- package/dist/constants.js +40 -0
- package/dist/constants.mjs +13 -0
- package/dist/pine.d.mts +8 -0
- package/dist/pine.d.ts +8 -0
- package/dist/pine.js +128 -0
- package/dist/pine.mjs +11 -0
- package/dist/registry.d.mts +15 -0
- package/dist/registry.d.ts +15 -0
- package/dist/registry.js +439 -0
- package/dist/registry.mjs +29 -0
- package/dist/strategies.d.mts +71 -0
- package/dist/strategies.d.ts +71 -0
- package/dist/strategies.js +7210 -0
- package/dist/strategies.mjs +847 -0
- package/package.json +69 -0
package/README.md
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# @tradejs/node
|
|
2
|
+
|
|
3
|
+
Node-only TradeJS runtime package.
|
|
4
|
+
|
|
5
|
+
- Homepage: https://tradejs.dev
|
|
6
|
+
- Documentation: https://docs.tradejs.dev
|
|
7
|
+
- Quickstart: https://docs.tradejs.dev/getting-started/quickstart
|
|
8
|
+
|
|
9
|
+
## Where It Fits
|
|
10
|
+
|
|
11
|
+
`@tradejs/node` is the server/runtime half of TradeJS.
|
|
12
|
+
|
|
13
|
+
Use it together with:
|
|
14
|
+
|
|
15
|
+
- `@tradejs/core` for browser-safe/public authoring helpers
|
|
16
|
+
- `@tradejs/types` for shared contracts
|
|
17
|
+
- `@tradejs/cli` for operational commands
|
|
18
|
+
- `@tradejs/app` if you want the installable web UI
|
|
19
|
+
|
|
20
|
+
## Standard External Install Flow
|
|
21
|
+
|
|
22
|
+
In a normal external TradeJS project you usually install the full runtime set:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npm i @tradejs/app @tradejs/core @tradejs/node @tradejs/types @tradejs/base @tradejs/cli
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
And create `tradejs.config.ts` in project root:
|
|
29
|
+
|
|
30
|
+
```ts
|
|
31
|
+
import { defineConfig } from '@tradejs/core/config';
|
|
32
|
+
import { basePreset } from '@tradejs/base';
|
|
33
|
+
|
|
34
|
+
export default defineConfig(basePreset);
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## What It Provides
|
|
38
|
+
|
|
39
|
+
`@tradejs/node` contains server-only runtime helpers that do not belong in browser-safe `@tradejs/core`:
|
|
40
|
+
|
|
41
|
+
- strategy runtime execution
|
|
42
|
+
- connector/plugin registries
|
|
43
|
+
- backtest orchestration helpers
|
|
44
|
+
- Pine loading/runtime helpers
|
|
45
|
+
- runtime-side operational helpers used by CLI/app
|
|
46
|
+
|
|
47
|
+
## Public Surface
|
|
48
|
+
|
|
49
|
+
Import only explicit subpaths:
|
|
50
|
+
|
|
51
|
+
- `@tradejs/node/strategies`
|
|
52
|
+
- `@tradejs/node/backtest`
|
|
53
|
+
- `@tradejs/node/pine`
|
|
54
|
+
- `@tradejs/node/registry`
|
|
55
|
+
- `@tradejs/node/connectors`
|
|
56
|
+
- `@tradejs/node/cli`
|
|
57
|
+
- `@tradejs/node/constants`
|
|
58
|
+
|
|
59
|
+
There is no root `@tradejs/node` import surface.
|
|
60
|
+
|
|
61
|
+
## Minimal Example
|
|
62
|
+
|
|
63
|
+
```ts
|
|
64
|
+
import { createStrategyRuntime } from '@tradejs/node/strategies';
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Notes
|
|
68
|
+
|
|
69
|
+
- `@tradejs/node` is server-only.
|
|
70
|
+
- Do not import it into browser/client bundles.
|
|
71
|
+
- For plugin/config declaration and browser-safe helpers, use `@tradejs/core`.
|
|
72
|
+
- For shared contracts, use `@tradejs/types`.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
MAX_AI_SERIES_POINTS,
|
|
3
|
+
askAI,
|
|
4
|
+
buildAiHumanPrompt,
|
|
5
|
+
buildAiPayload,
|
|
6
|
+
buildAiSystemPrompt,
|
|
7
|
+
trimSeriesDeep
|
|
8
|
+
} from "./chunk-ZIMX3JX2.mjs";
|
|
9
|
+
import "./chunk-MHCXPD2B.mjs";
|
|
10
|
+
import "./chunk-DE7ADBIR.mjs";
|
|
11
|
+
import "./chunk-6DZX6EAA.mjs";
|
|
12
|
+
export {
|
|
13
|
+
MAX_AI_SERIES_POINTS,
|
|
14
|
+
askAI,
|
|
15
|
+
buildAiHumanPrompt,
|
|
16
|
+
buildAiPayload,
|
|
17
|
+
buildAiSystemPrompt,
|
|
18
|
+
trimSeriesDeep
|
|
19
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from '@tradejs/core/backtest';
|
|
2
|
+
import { TestingBox, TestConnectorCreator } from '@tradejs/types';
|
|
3
|
+
|
|
4
|
+
declare const resetTestingKlineCache: () => void;
|
|
5
|
+
declare const testing: TestingBox;
|
|
6
|
+
|
|
7
|
+
declare const createTestConnector: TestConnectorCreator;
|
|
8
|
+
|
|
9
|
+
export { createTestConnector, resetTestingKlineCache, testing };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from '@tradejs/core/backtest';
|
|
2
|
+
import { TestingBox, TestConnectorCreator } from '@tradejs/types';
|
|
3
|
+
|
|
4
|
+
declare const resetTestingKlineCache: () => void;
|
|
5
|
+
declare const testing: TestingBox;
|
|
6
|
+
|
|
7
|
+
declare const createTestConnector: TestConnectorCreator;
|
|
8
|
+
|
|
9
|
+
export { createTestConnector, resetTestingKlineCache, testing };
|