@tradejs/base 3.0.0 → 3.1.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 +15 -7
- package/dist/index.cjs +65 -0
- package/dist/index.js +28 -32
- package/package.json +54 -18
- package/dist/index.mjs +0 -19
- /package/dist/{index.d.mts → index.d.cts} +0 -0
package/README.md
CHANGED
|
@@ -16,12 +16,16 @@ Earlier releases remain MIT-licensed. See the
|
|
|
16
16
|
|
|
17
17
|
## What It Provides
|
|
18
18
|
|
|
19
|
-
`basePreset` wires the
|
|
19
|
+
`basePreset` installs and wires the public TradeJS packages:
|
|
20
20
|
|
|
21
|
-
-
|
|
21
|
+
- all 20 public strategy packages
|
|
22
22
|
- `@tradejs/indicators`
|
|
23
23
|
- `@tradejs/connectors`
|
|
24
24
|
|
|
25
|
+
`TrendLine` and `ReverseTrendLine` are intentionally delivered together by
|
|
26
|
+
`@tradejs/strategy-trend-line`; all other strategy packages map one-to-one to
|
|
27
|
+
their repositories.
|
|
28
|
+
|
|
25
29
|
Use it as the starting point for external projects, then append your own plugin packages.
|
|
26
30
|
|
|
27
31
|
## Install
|
|
@@ -33,14 +37,18 @@ npm i @tradejs/base @tradejs/core
|
|
|
33
37
|
## Usage
|
|
34
38
|
|
|
35
39
|
```ts
|
|
36
|
-
import { defineConfig } from
|
|
37
|
-
import { basePreset } from
|
|
40
|
+
import { defineConfig } from "@tradejs/core/config";
|
|
41
|
+
import { basePreset } from "@tradejs/base";
|
|
38
42
|
|
|
39
43
|
export default defineConfig(basePreset, {
|
|
40
|
-
strategies: [
|
|
41
|
-
indicators: [
|
|
42
|
-
connectors: [
|
|
44
|
+
strategies: ["@your-scope/private-strategy"],
|
|
45
|
+
indicators: ["@your-scope/tradejs-indicators"],
|
|
46
|
+
connectors: ["@your-scope/tradejs-connectors"],
|
|
43
47
|
});
|
|
44
48
|
```
|
|
45
49
|
|
|
46
50
|
If you only need the built-in catalog, `defineConfig(basePreset)` is enough.
|
|
51
|
+
|
|
52
|
+
The source of truth for the preset is this repository. Strategy implementation
|
|
53
|
+
changes belong to their individual repositories and do not require a TradeJS
|
|
54
|
+
engine commit.
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
basePreset: () => basePreset,
|
|
24
|
+
default: () => index_default
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(index_exports);
|
|
27
|
+
var import_strategies = require("@tradejs/node/strategies");
|
|
28
|
+
var basePreset = {
|
|
29
|
+
strategies: [
|
|
30
|
+
"@tradejs/strategy-breakout",
|
|
31
|
+
"@tradejs/strategy-trend-line",
|
|
32
|
+
"@tradejs/strategy-market-flush-reversal",
|
|
33
|
+
"@tradejs/strategy-volatility-compression-breakout",
|
|
34
|
+
"@tradejs/strategy-relative-rotation",
|
|
35
|
+
"@tradejs/strategy-trend-shift",
|
|
36
|
+
"@tradejs/strategy-double-tap",
|
|
37
|
+
"@tradejs/strategy-head-and-shoulders",
|
|
38
|
+
"@tradejs/strategy-cup-and-handle",
|
|
39
|
+
"@tradejs/strategy-grid",
|
|
40
|
+
"@tradejs/strategy-grid-classic",
|
|
41
|
+
"@tradejs/strategy-hyperliquid-consensus",
|
|
42
|
+
"@tradejs/strategy-liquidity-tails",
|
|
43
|
+
"@tradejs/strategy-liquidity-zones",
|
|
44
|
+
"@tradejs/strategy-trend-follow",
|
|
45
|
+
"@tradejs/strategy-structure-zones",
|
|
46
|
+
"@tradejs/strategy-ma-strategy",
|
|
47
|
+
"@tradejs/strategy-adaptive-momentum-ribbon",
|
|
48
|
+
"@tradejs/strategy-adaptive-trend-channel",
|
|
49
|
+
"@tradejs/strategy-volume-divergence"
|
|
50
|
+
],
|
|
51
|
+
indicators: ["@tradejs/indicators"],
|
|
52
|
+
connectors: ["@tradejs/connectors"],
|
|
53
|
+
hooks: {
|
|
54
|
+
beforePlaceOrder: (0, import_strategies.createCloseOppositeBeforePlaceOrderHook)({
|
|
55
|
+
isEnabled: (config) => Boolean(
|
|
56
|
+
config.CLOSE_OPPOSITE_POSITIONS
|
|
57
|
+
)
|
|
58
|
+
})
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
var index_default = basePreset;
|
|
62
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
63
|
+
0 && (module.exports = {
|
|
64
|
+
basePreset
|
|
65
|
+
});
|
package/dist/index.js
CHANGED
|
@@ -1,36 +1,32 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
1
|
// src/index.ts
|
|
21
|
-
|
|
22
|
-
__export(index_exports, {
|
|
23
|
-
basePreset: () => basePreset,
|
|
24
|
-
default: () => index_default
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(index_exports);
|
|
27
|
-
var import_strategies = require("@tradejs/node/strategies");
|
|
2
|
+
import { createCloseOppositeBeforePlaceOrderHook } from "@tradejs/node/strategies";
|
|
28
3
|
var basePreset = {
|
|
29
|
-
strategies: [
|
|
4
|
+
strategies: [
|
|
5
|
+
"@tradejs/strategy-breakout",
|
|
6
|
+
"@tradejs/strategy-trend-line",
|
|
7
|
+
"@tradejs/strategy-market-flush-reversal",
|
|
8
|
+
"@tradejs/strategy-volatility-compression-breakout",
|
|
9
|
+
"@tradejs/strategy-relative-rotation",
|
|
10
|
+
"@tradejs/strategy-trend-shift",
|
|
11
|
+
"@tradejs/strategy-double-tap",
|
|
12
|
+
"@tradejs/strategy-head-and-shoulders",
|
|
13
|
+
"@tradejs/strategy-cup-and-handle",
|
|
14
|
+
"@tradejs/strategy-grid",
|
|
15
|
+
"@tradejs/strategy-grid-classic",
|
|
16
|
+
"@tradejs/strategy-hyperliquid-consensus",
|
|
17
|
+
"@tradejs/strategy-liquidity-tails",
|
|
18
|
+
"@tradejs/strategy-liquidity-zones",
|
|
19
|
+
"@tradejs/strategy-trend-follow",
|
|
20
|
+
"@tradejs/strategy-structure-zones",
|
|
21
|
+
"@tradejs/strategy-ma-strategy",
|
|
22
|
+
"@tradejs/strategy-adaptive-momentum-ribbon",
|
|
23
|
+
"@tradejs/strategy-adaptive-trend-channel",
|
|
24
|
+
"@tradejs/strategy-volume-divergence"
|
|
25
|
+
],
|
|
30
26
|
indicators: ["@tradejs/indicators"],
|
|
31
27
|
connectors: ["@tradejs/connectors"],
|
|
32
28
|
hooks: {
|
|
33
|
-
beforePlaceOrder:
|
|
29
|
+
beforePlaceOrder: createCloseOppositeBeforePlaceOrderHook({
|
|
34
30
|
isEnabled: (config) => Boolean(
|
|
35
31
|
config.CLOSE_OPPOSITE_POSITIONS
|
|
36
32
|
)
|
|
@@ -38,7 +34,7 @@ var basePreset = {
|
|
|
38
34
|
}
|
|
39
35
|
};
|
|
40
36
|
var index_default = basePreset;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
37
|
+
export {
|
|
38
|
+
basePreset,
|
|
39
|
+
index_default as default
|
|
40
|
+
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tradejs/base",
|
|
3
|
-
"version": "3.
|
|
4
|
-
"description": "Default
|
|
3
|
+
"version": "3.1.0",
|
|
4
|
+
"description": "Default TradeJS preset wiring the public strategy, indicator, connector, and runtime packages.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"packageManager": "yarn@4.13.0",
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": "24.x"
|
|
9
|
+
},
|
|
5
10
|
"keywords": [
|
|
6
11
|
"tradejs",
|
|
7
12
|
"trading",
|
|
@@ -10,42 +15,73 @@
|
|
|
10
15
|
"starter",
|
|
11
16
|
"plugins"
|
|
12
17
|
],
|
|
18
|
+
"homepage": "https://tradejs.dev",
|
|
13
19
|
"repository": {
|
|
14
20
|
"type": "git",
|
|
15
|
-
"url": "https://github.com/TradeJS-Dev/TradeJS"
|
|
16
|
-
"directory": "packages/base"
|
|
21
|
+
"url": "https://github.com/TradeJS-Dev/TradeJS-Base"
|
|
17
22
|
},
|
|
18
23
|
"bugs": {
|
|
19
|
-
"url": "https://github.com/
|
|
24
|
+
"url": "https://github.com/TradeJS-Dev/TradeJS-Base/issues"
|
|
20
25
|
},
|
|
21
|
-
"main": "dist/index.
|
|
22
|
-
"module": "dist/index.
|
|
23
|
-
"types": "dist/index.d.ts",
|
|
26
|
+
"main": "./dist/index.cjs",
|
|
27
|
+
"module": "./dist/index.js",
|
|
28
|
+
"types": "./dist/index.d.ts",
|
|
24
29
|
"files": [
|
|
25
30
|
"dist"
|
|
26
31
|
],
|
|
27
32
|
"exports": {
|
|
28
33
|
".": {
|
|
29
34
|
"types": "./dist/index.d.ts",
|
|
30
|
-
"import": "./dist/index.
|
|
31
|
-
"require": "./dist/index.
|
|
35
|
+
"import": "./dist/index.js",
|
|
36
|
+
"require": "./dist/index.cjs"
|
|
32
37
|
}
|
|
33
38
|
},
|
|
39
|
+
"sideEffects": false,
|
|
34
40
|
"dependencies": {
|
|
35
|
-
"@tradejs/connectors": "^3.0.
|
|
36
|
-
"@tradejs/core": "^3.0.
|
|
37
|
-
"@tradejs/indicators": "^3.0.
|
|
38
|
-
"@tradejs/node": "^3.0.
|
|
39
|
-
"@tradejs/
|
|
41
|
+
"@tradejs/connectors": "^3.0.1",
|
|
42
|
+
"@tradejs/core": "^3.0.1",
|
|
43
|
+
"@tradejs/indicators": "^3.0.1",
|
|
44
|
+
"@tradejs/node": "^3.0.1",
|
|
45
|
+
"@tradejs/strategy-adaptive-momentum-ribbon": "^3.0.0",
|
|
46
|
+
"@tradejs/strategy-adaptive-trend-channel": "^3.0.0",
|
|
47
|
+
"@tradejs/strategy-breakout": "^3.0.0",
|
|
48
|
+
"@tradejs/strategy-cup-and-handle": "^3.0.0",
|
|
49
|
+
"@tradejs/strategy-double-tap": "^3.0.0",
|
|
50
|
+
"@tradejs/strategy-grid": "^3.0.0",
|
|
51
|
+
"@tradejs/strategy-grid-classic": "^3.0.0",
|
|
52
|
+
"@tradejs/strategy-head-and-shoulders": "^3.0.0",
|
|
53
|
+
"@tradejs/strategy-hyperliquid-consensus": "^3.0.0",
|
|
54
|
+
"@tradejs/strategy-liquidity-tails": "^3.0.0",
|
|
55
|
+
"@tradejs/strategy-liquidity-zones": "^3.0.0",
|
|
56
|
+
"@tradejs/strategy-ma-strategy": "^3.0.0",
|
|
57
|
+
"@tradejs/strategy-market-flush-reversal": "^3.0.0",
|
|
58
|
+
"@tradejs/strategy-relative-rotation": "^3.0.0",
|
|
59
|
+
"@tradejs/strategy-structure-zones": "^3.0.0",
|
|
60
|
+
"@tradejs/strategy-trend-follow": "^3.0.0",
|
|
61
|
+
"@tradejs/strategy-trend-line": "^3.0.0",
|
|
62
|
+
"@tradejs/strategy-trend-shift": "^3.0.0",
|
|
63
|
+
"@tradejs/strategy-volatility-compression-breakout": "^3.0.0",
|
|
64
|
+
"@tradejs/strategy-volume-divergence": "^3.0.0"
|
|
40
65
|
},
|
|
41
66
|
"devDependencies": {
|
|
67
|
+
"@types/jest": "^29.5.14",
|
|
68
|
+
"jest": "^29.7.0",
|
|
69
|
+
"prettier": "^3.6.2",
|
|
70
|
+
"ts-jest": "^29.2.5",
|
|
42
71
|
"tsup": "^8.5.1",
|
|
43
|
-
"typescript": "^5.9"
|
|
72
|
+
"typescript": "^5.9.2"
|
|
44
73
|
},
|
|
45
74
|
"scripts": {
|
|
46
75
|
"build": "tsup",
|
|
47
|
-
"
|
|
76
|
+
"format:check": "prettier --check .",
|
|
77
|
+
"test": "jest --runInBand",
|
|
78
|
+
"typecheck": "tsc -p ./tsconfig.json --noEmit",
|
|
79
|
+
"checks": "yarn format:check && yarn typecheck && yarn test && yarn build"
|
|
80
|
+
},
|
|
81
|
+
"publishConfig": {
|
|
82
|
+
"access": "public",
|
|
83
|
+
"provenance": true
|
|
48
84
|
},
|
|
49
85
|
"license": "BUSL-1.1",
|
|
50
86
|
"author": "aleksnick (https://github.com/aleksnick)"
|
|
51
|
-
}
|
|
87
|
+
}
|
package/dist/index.mjs
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
// src/index.ts
|
|
2
|
-
import { createCloseOppositeBeforePlaceOrderHook } from "@tradejs/node/strategies";
|
|
3
|
-
var basePreset = {
|
|
4
|
-
strategies: ["@tradejs/strategies"],
|
|
5
|
-
indicators: ["@tradejs/indicators"],
|
|
6
|
-
connectors: ["@tradejs/connectors"],
|
|
7
|
-
hooks: {
|
|
8
|
-
beforePlaceOrder: createCloseOppositeBeforePlaceOrderHook({
|
|
9
|
-
isEnabled: (config) => Boolean(
|
|
10
|
-
config.CLOSE_OPPOSITE_POSITIONS
|
|
11
|
-
)
|
|
12
|
-
})
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
var index_default = basePreset;
|
|
16
|
-
export {
|
|
17
|
-
basePreset,
|
|
18
|
-
index_default as default
|
|
19
|
-
};
|
|
File without changes
|