nexustrade 1.4.0 → 1.5.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
CHANGED
|
@@ -23,6 +23,71 @@ npm install nexustrade
|
|
|
23
23
|
|
|
24
24
|
**Zero runtime dependencies.** ESM and CommonJS builds ship together, with types.
|
|
25
25
|
|
|
26
|
+
## MCP server
|
|
27
|
+
|
|
28
|
+
NexusTrade also exposes the platform as a hosted, remote Model Context Protocol
|
|
29
|
+
server. Modern MCP clients connect directly to the production Streamable HTTP
|
|
30
|
+
endpoint and discover NexusTrade OAuth automatically:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
claude mcp add --transport http nexustrade https://nexustrade.io/api/mcp
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Cursor and other remote-capable clients use:
|
|
37
|
+
|
|
38
|
+
```json
|
|
39
|
+
{
|
|
40
|
+
"mcpServers": {
|
|
41
|
+
"nexustrade": {
|
|
42
|
+
"url": "https://nexustrade.io/api/mcp"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
For Claude Desktop and other stdio-only clients, use the established
|
|
49
|
+
`mcp-remote` bridge—no clone or local NexusTrade server is required:
|
|
50
|
+
|
|
51
|
+
```json
|
|
52
|
+
{
|
|
53
|
+
"mcpServers": {
|
|
54
|
+
"nexustrade": {
|
|
55
|
+
"command": "npx",
|
|
56
|
+
"args": [
|
|
57
|
+
"-y",
|
|
58
|
+
"mcp-remote@latest",
|
|
59
|
+
"https://nexustrade.io/api/mcp",
|
|
60
|
+
"--transport",
|
|
61
|
+
"http-only"
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
The live server exposes more than 120 tools across market research, portfolio
|
|
69
|
+
construction, backtesting, optimization, walk-forward validation, managed
|
|
70
|
+
compute, Aurora agents, paper trading, and controlled brokerage operations.
|
|
71
|
+
Its creator-marketplace tools cover the full strategy adoption path:
|
|
72
|
+
|
|
73
|
+
- `search_creators` discovers public creators and their marketplace portfolios.
|
|
74
|
+
- `subscribe_portfolio` validates a monetized listing and returns a safe
|
|
75
|
+
checkout preview; the user completes payment in NexusTrade, never through the
|
|
76
|
+
MCP tool.
|
|
77
|
+
- `fork_shared_portfolio` creates a one-time editable copy of a marketplace
|
|
78
|
+
strategy in a new or existing portfolio.
|
|
79
|
+
- `copy_trade_shared` continuously mirrors an accessible strategy into a paper
|
|
80
|
+
or live portfolio at an explicit allocation.
|
|
81
|
+
|
|
82
|
+
See the [developer guide](https://nexustrade.io/developers), the
|
|
83
|
+
[utility tool reference](https://nexustrade.io/docs/api-reference/mcp-tools-utility),
|
|
84
|
+
and the [Aurora tool reference](https://nexustrade.io/docs/api-reference/mcp-tools-aurora).
|
|
85
|
+
|
|
86
|
+
Research and historical results are not investment advice and do not guarantee
|
|
87
|
+
future performance. Keep paper and live modes explicit. Tools that can affect
|
|
88
|
+
portfolios, schedules, or brokerage orders remain subject to the authenticated
|
|
89
|
+
account's NexusTrade permissions and approval controls.
|
|
90
|
+
|
|
26
91
|
## Quickstart
|
|
27
92
|
|
|
28
93
|
```ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.portfolio = exports.sessionFlatten = exports.strategy = exports.closeOption = exports.greeksTrigger = exports.daysHeldTrigger = exports.dteTrigger = exports.pnlTrigger = exports.rebalanceOption = exports.sleeve = exports.structureTemplate = exports.openOption = exports.againstParent = exports.optionsBuilder = exports.leg = exports.dynamicRebalance = exports.launchAgent = exports.alert = exports.sell = exports.buy = exports.selectPercentile = exports.selectTop = exports.filter = exports.RebalanceNetBenefit = exports.RebalanceExpectedBenefit = exports.RebalanceEstimatedCost = exports.RebalancePlannedTurnover = exports.RebalanceAllocationDrift = exports.volatilityTarget = exports.maximumDiversificationAllocation = exports.riskParityAllocation = exports.meanVarianceAllocation = exports.always = exports.multi = exports.exactly = exports.fewerThan = exports.atMost = exports.atLeast = exports.or = exports.and = exports.neq = exports.eq = exports.lte = exports.gte = exports.lt = exports.gt = exports.cryptoAsset = exports.stockAsset = exports.PORTFOLIO_WIDE = exports.CANDIDATE = void 0;
|
|
4
|
-
exports.geneUniversePipelineFilter = exports.geneSelectTopLimit = exports.geneDteBracket = exports.geneStrikeDistance = exports.geneOptionDelta = exports.geneExposurePolicy = exports.geneAllocationPolicy = exports.geneStructureKind = exports.geneTakeProfitPct = exports.geneRollTriggerDte = exports.geneDeploymentPct = exports.geneTotalBudgetPct = exports.geneAllocationPct = exports.geneBuyingPowerPct = exports.geneRankSignal = exports.geneEntryCooldownDays = exports.geneExitCondition = exports.geneEntryCondition = exports.geneSubject = exports.optimization = exports.walkForward = exports.backtest = exports.SMA = exports.RSI = exports.PriceStdDev = exports.EMA = exports.BBand = void 0;
|
|
4
|
+
exports.geneUniversePipelineFilter = exports.geneSelectTopLimit = exports.geneMaxSpreadPct = exports.geneDteBracket = exports.geneStrikeDistance = exports.geneOptionDelta = exports.geneExposurePolicy = exports.geneAllocationPolicy = exports.geneStructureKind = exports.geneStopLossPct = exports.geneTakeProfitPct = exports.geneRollTriggerDte = exports.geneDeploymentPct = exports.geneTotalBudgetPct = exports.geneAllocationPct = exports.geneBuyingPowerPct = exports.geneRankSignal = exports.geneEntryCooldownDays = exports.geneExitCondition = exports.geneEntryCondition = exports.geneSubject = exports.optimization = exports.walkForward = exports.backtest = exports.SMA = exports.RSI = exports.PriceStdDev = exports.EMA = exports.BBand = void 0;
|
|
5
5
|
exports.universe = universe;
|
|
6
6
|
exports.AbsoluteValue = AbsoluteValue;
|
|
7
7
|
exports.AverageTrueRange = AverageTrueRange;
|
|
@@ -1699,21 +1699,29 @@ const geneDeploymentPct = (strategyIndex, values) => ({
|
|
|
1699
1699
|
});
|
|
1700
1700
|
exports.geneDeploymentPct = geneDeploymentPct;
|
|
1701
1701
|
/** Sweep RollTriggerDte (Action scope) over a value set. */
|
|
1702
|
-
const geneRollTriggerDte = (
|
|
1702
|
+
const geneRollTriggerDte = (values, strategyIndex) => ({
|
|
1703
1703
|
field: "RollTriggerDte",
|
|
1704
1704
|
scope: "Action",
|
|
1705
|
-
target: { scope: "Action", field: "RollTriggerDte", strategyIndex },
|
|
1705
|
+
target: { scope: "Action", field: "RollTriggerDte", ...(strategyIndex === undefined ? {} : { strategyIndex }) },
|
|
1706
1706
|
values: values,
|
|
1707
1707
|
});
|
|
1708
1708
|
exports.geneRollTriggerDte = geneRollTriggerDte;
|
|
1709
1709
|
/** Sweep TakeProfitPct (Action scope) over a value set. */
|
|
1710
|
-
const geneTakeProfitPct = (
|
|
1710
|
+
const geneTakeProfitPct = (values, strategyIndex) => ({
|
|
1711
1711
|
field: "TakeProfitPct",
|
|
1712
1712
|
scope: "Action",
|
|
1713
|
-
target: { scope: "Action", field: "TakeProfitPct", strategyIndex },
|
|
1713
|
+
target: { scope: "Action", field: "TakeProfitPct", ...(strategyIndex === undefined ? {} : { strategyIndex }) },
|
|
1714
1714
|
values: values,
|
|
1715
1715
|
});
|
|
1716
1716
|
exports.geneTakeProfitPct = geneTakeProfitPct;
|
|
1717
|
+
/** Sweep StopLossPct (Action scope) over a value set. */
|
|
1718
|
+
const geneStopLossPct = (values, strategyIndex) => ({
|
|
1719
|
+
field: "StopLossPct",
|
|
1720
|
+
scope: "Action",
|
|
1721
|
+
target: { scope: "Action", field: "StopLossPct", ...(strategyIndex === undefined ? {} : { strategyIndex }) },
|
|
1722
|
+
values: values,
|
|
1723
|
+
});
|
|
1724
|
+
exports.geneStopLossPct = geneStopLossPct;
|
|
1717
1725
|
/** Sweep StructureKind (Action scope) over a value set. */
|
|
1718
1726
|
const geneStructureKind = (strategyIndex, values) => ({
|
|
1719
1727
|
field: "StructureKind",
|
|
@@ -1762,6 +1770,14 @@ const geneDteBracket = (strategyIndex, legIndex, values) => ({
|
|
|
1762
1770
|
values: values,
|
|
1763
1771
|
});
|
|
1764
1772
|
exports.geneDteBracket = geneDteBracket;
|
|
1773
|
+
/** Sweep MaxSpreadPct (OptionLeg scope) over a value set. */
|
|
1774
|
+
const geneMaxSpreadPct = (strategyIndex, legIndex, values) => ({
|
|
1775
|
+
field: "MaxSpreadPct",
|
|
1776
|
+
scope: "OptionLeg",
|
|
1777
|
+
target: { scope: "OptionLeg", field: "MaxSpreadPct", strategyIndex, legIndex },
|
|
1778
|
+
values: values,
|
|
1779
|
+
});
|
|
1780
|
+
exports.geneMaxSpreadPct = geneMaxSpreadPct;
|
|
1765
1781
|
/** Sweep SelectTopLimit (UniversePipeline scope) over a value set. */
|
|
1766
1782
|
const geneSelectTopLimit = (strategyIndex, stageIndex, values) => ({
|
|
1767
1783
|
field: "SelectTopLimit",
|
|
@@ -1408,9 +1408,11 @@ export declare const geneTotalBudgetPct: (strategyIndex: number, values: number[
|
|
|
1408
1408
|
/** Sweep DeploymentPct (Action scope) over a value set. */
|
|
1409
1409
|
export declare const geneDeploymentPct: (strategyIndex: number, values: number[]) => Gene;
|
|
1410
1410
|
/** Sweep RollTriggerDte (Action scope) over a value set. */
|
|
1411
|
-
export declare const geneRollTriggerDte: (
|
|
1411
|
+
export declare const geneRollTriggerDte: (values: number[], strategyIndex?: number) => Gene;
|
|
1412
1412
|
/** Sweep TakeProfitPct (Action scope) over a value set. */
|
|
1413
|
-
export declare const geneTakeProfitPct: (
|
|
1413
|
+
export declare const geneTakeProfitPct: (values: number[], strategyIndex?: number) => Gene;
|
|
1414
|
+
/** Sweep StopLossPct (Action scope) over a value set. */
|
|
1415
|
+
export declare const geneStopLossPct: (values: number[], strategyIndex?: number) => Gene;
|
|
1414
1416
|
/** Sweep StructureKind (Action scope) over a value set. */
|
|
1415
1417
|
export declare const geneStructureKind: (strategyIndex: number, values: string[]) => Gene;
|
|
1416
1418
|
/** Sweep AllocationPolicy (Action scope) over a value set. */
|
|
@@ -1432,6 +1434,8 @@ export declare const geneStrikeDistance: (strategyIndex: number, legIndex: numbe
|
|
|
1432
1434
|
}[]) => Gene;
|
|
1433
1435
|
/** Sweep DteBracket (OptionLeg scope) over a value set. */
|
|
1434
1436
|
export declare const geneDteBracket: (strategyIndex: number, legIndex: number, values: [number, number][]) => Gene;
|
|
1437
|
+
/** Sweep MaxSpreadPct (OptionLeg scope) over a value set. */
|
|
1438
|
+
export declare const geneMaxSpreadPct: (strategyIndex: number, legIndex: number, values: number[]) => Gene;
|
|
1435
1439
|
/** Sweep SelectTopLimit (UniversePipeline scope) over a value set. */
|
|
1436
1440
|
export declare const geneSelectTopLimit: (strategyIndex: number, stageIndex: number, values: number[]) => Gene;
|
|
1437
1441
|
/** Sweep UniversePipelineFilter (UniversePipeline scope) over a value set. */
|
|
@@ -1526,17 +1526,24 @@ export const geneDeploymentPct = (strategyIndex, values) => ({
|
|
|
1526
1526
|
values: values,
|
|
1527
1527
|
});
|
|
1528
1528
|
/** Sweep RollTriggerDte (Action scope) over a value set. */
|
|
1529
|
-
export const geneRollTriggerDte = (
|
|
1529
|
+
export const geneRollTriggerDte = (values, strategyIndex) => ({
|
|
1530
1530
|
field: "RollTriggerDte",
|
|
1531
1531
|
scope: "Action",
|
|
1532
|
-
target: { scope: "Action", field: "RollTriggerDte", strategyIndex },
|
|
1532
|
+
target: { scope: "Action", field: "RollTriggerDte", ...(strategyIndex === undefined ? {} : { strategyIndex }) },
|
|
1533
1533
|
values: values,
|
|
1534
1534
|
});
|
|
1535
1535
|
/** Sweep TakeProfitPct (Action scope) over a value set. */
|
|
1536
|
-
export const geneTakeProfitPct = (
|
|
1536
|
+
export const geneTakeProfitPct = (values, strategyIndex) => ({
|
|
1537
1537
|
field: "TakeProfitPct",
|
|
1538
1538
|
scope: "Action",
|
|
1539
|
-
target: { scope: "Action", field: "TakeProfitPct", strategyIndex },
|
|
1539
|
+
target: { scope: "Action", field: "TakeProfitPct", ...(strategyIndex === undefined ? {} : { strategyIndex }) },
|
|
1540
|
+
values: values,
|
|
1541
|
+
});
|
|
1542
|
+
/** Sweep StopLossPct (Action scope) over a value set. */
|
|
1543
|
+
export const geneStopLossPct = (values, strategyIndex) => ({
|
|
1544
|
+
field: "StopLossPct",
|
|
1545
|
+
scope: "Action",
|
|
1546
|
+
target: { scope: "Action", field: "StopLossPct", ...(strategyIndex === undefined ? {} : { strategyIndex }) },
|
|
1540
1547
|
values: values,
|
|
1541
1548
|
});
|
|
1542
1549
|
/** Sweep StructureKind (Action scope) over a value set. */
|
|
@@ -1581,6 +1588,13 @@ export const geneDteBracket = (strategyIndex, legIndex, values) => ({
|
|
|
1581
1588
|
target: { scope: "OptionLeg", field: "DteBracket", strategyIndex, legIndex },
|
|
1582
1589
|
values: values,
|
|
1583
1590
|
});
|
|
1591
|
+
/** Sweep MaxSpreadPct (OptionLeg scope) over a value set. */
|
|
1592
|
+
export const geneMaxSpreadPct = (strategyIndex, legIndex, values) => ({
|
|
1593
|
+
field: "MaxSpreadPct",
|
|
1594
|
+
scope: "OptionLeg",
|
|
1595
|
+
target: { scope: "OptionLeg", field: "MaxSpreadPct", strategyIndex, legIndex },
|
|
1596
|
+
values: values,
|
|
1597
|
+
});
|
|
1584
1598
|
/** Sweep SelectTopLimit (UniversePipeline scope) over a value set. */
|
|
1585
1599
|
export const geneSelectTopLimit = (strategyIndex, stageIndex, values) => ({
|
|
1586
1600
|
field: "SelectTopLimit",
|