nexustrade 1.20.0 → 1.21.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.
|
@@ -4,6 +4,7 @@ exports.currentLimit = exports.limitOrder = exports.closeOption = exports.greeks
|
|
|
4
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.geneConditionThreshold = exports.geneConditionWindowLength = exports.geneEntryCooldownDays = exports.geneReplaceExitCondition = exports.geneExitCondition = exports.geneReplaceEntryCondition = exports.geneEntryCondition = exports.geneSubject = exports.optimization = exports.walkForward = exports.backtest = exports.SMA = exports.RSI = exports.PriceStdDev = exports.EMA = exports.BBand = exports.portfolio = exports.sessionFlatten = exports.strategy = exports.goodForMinutes = exports.goodForDay = exports.minimumNetCredit = exports.maximumNetDebit = exports.unitPriceLimit = void 0;
|
|
5
5
|
exports.universe = universe;
|
|
6
6
|
exports.AbsoluteValue = AbsoluteValue;
|
|
7
|
+
exports.AverageDirectionalIndex = AverageDirectionalIndex;
|
|
7
8
|
exports.AverageTrueRange = AverageTrueRange;
|
|
8
9
|
exports.BearishFairValueGap = BearishFairValueGap;
|
|
9
10
|
exports.BollingerBand = BollingerBand;
|
|
@@ -74,6 +75,7 @@ exports.MinutesSinceOptionOrder = MinutesSinceOptionOrder;
|
|
|
74
75
|
exports.MinutesSinceOrder = MinutesSinceOrder;
|
|
75
76
|
exports.MinutesUntilClose = MinutesUntilClose;
|
|
76
77
|
exports.Month = Month;
|
|
78
|
+
exports.MovingAverageConvergenceDivergence = MovingAverageConvergenceDivergence;
|
|
77
79
|
exports.Multiply = Multiply;
|
|
78
80
|
exports.Negative = Negative;
|
|
79
81
|
exports.OpeningPrice = OpeningPrice;
|
|
@@ -105,6 +107,7 @@ exports.PriceRateOfChange = PriceRateOfChange;
|
|
|
105
107
|
exports.PriceStandardDeviation = PriceStandardDeviation;
|
|
106
108
|
exports.RebalanceDecisionMetric = RebalanceDecisionMetric;
|
|
107
109
|
exports.RelativeStrengthIndex = RelativeStrengthIndex;
|
|
110
|
+
exports.RelativeVolume = RelativeVolume;
|
|
108
111
|
exports.SimpleMovingAverage = SimpleMovingAverage;
|
|
109
112
|
exports.SquareRoot = SquareRoot;
|
|
110
113
|
exports.StockReport = StockReport;
|
|
@@ -497,6 +500,20 @@ function AbsoluteValue(operand) {
|
|
|
497
500
|
d.indicators = [operand];
|
|
498
501
|
return d;
|
|
499
502
|
}
|
|
503
|
+
/**
|
|
504
|
+
* AverageDirectionalIndex indicator.
|
|
505
|
+
* @param asset Ticker name (ex. SPY, BTC)
|
|
506
|
+
* @param length Length of time
|
|
507
|
+
* @param interval Unit of time
|
|
508
|
+
* @param line Which ADX-system line to evaluate
|
|
509
|
+
*/
|
|
510
|
+
function AverageDirectionalIndex(asset, length = 14, interval = "Day", line = "adx") {
|
|
511
|
+
const d = { type: "AverageDirectionalIndex" };
|
|
512
|
+
setAsset(d, "targetAsset", asset);
|
|
513
|
+
d["line"] = line;
|
|
514
|
+
d.window = { length: length, interval: interval };
|
|
515
|
+
return d;
|
|
516
|
+
}
|
|
500
517
|
/**
|
|
501
518
|
* AverageTrueRange indicator.
|
|
502
519
|
* @param asset Ticker name (ex. SPY, BTC)
|
|
@@ -1218,6 +1235,25 @@ function Month() {
|
|
|
1218
1235
|
const d = { type: "Month" };
|
|
1219
1236
|
return d;
|
|
1220
1237
|
}
|
|
1238
|
+
/**
|
|
1239
|
+
* MovingAverageConvergenceDivergence indicator.
|
|
1240
|
+
* @param asset Ticker name (ex. SPY, BTC)
|
|
1241
|
+
* @param fastLength Period of the fast EMA
|
|
1242
|
+
* @param slowLength Period of the slow EMA (must exceed the fast length)
|
|
1243
|
+
* @param signalLength Period of the EMA applied to the MACD line
|
|
1244
|
+
* @param interval Bar interval the MACD is computed on
|
|
1245
|
+
* @param line Which MACD line to evaluate
|
|
1246
|
+
*/
|
|
1247
|
+
function MovingAverageConvergenceDivergence(asset, fastLength = 12, slowLength = 26, signalLength = 9, interval = "Day", line = "macd") {
|
|
1248
|
+
const d = { type: "MovingAverageConvergenceDivergence" };
|
|
1249
|
+
setAsset(d, "targetAsset", asset);
|
|
1250
|
+
d["fastLength"] = fastLength;
|
|
1251
|
+
d["slowLength"] = slowLength;
|
|
1252
|
+
d["signalLength"] = signalLength;
|
|
1253
|
+
d["interval"] = interval;
|
|
1254
|
+
d["line"] = line;
|
|
1255
|
+
return d;
|
|
1256
|
+
}
|
|
1221
1257
|
/**
|
|
1222
1258
|
* Multiply indicator.
|
|
1223
1259
|
*/
|
|
@@ -1592,6 +1628,18 @@ function RelativeStrengthIndex(asset, length = 30, interval = "Day") {
|
|
|
1592
1628
|
return d;
|
|
1593
1629
|
}
|
|
1594
1630
|
exports.RSI = RelativeStrengthIndex;
|
|
1631
|
+
/**
|
|
1632
|
+
* RelativeVolume indicator.
|
|
1633
|
+
* @param asset Ticker name (ex. SPY, BTC)
|
|
1634
|
+
* @param length Length of time
|
|
1635
|
+
* @param interval Unit of time
|
|
1636
|
+
*/
|
|
1637
|
+
function RelativeVolume(asset, length = 14, interval = "Day") {
|
|
1638
|
+
const d = { type: "RelativeVolume" };
|
|
1639
|
+
setAsset(d, "targetAsset", asset);
|
|
1640
|
+
d.window = { length: length, interval: interval };
|
|
1641
|
+
return d;
|
|
1642
|
+
}
|
|
1595
1643
|
/**
|
|
1596
1644
|
* SimpleMovingAverage indicator.
|
|
1597
1645
|
* @param asset Ticker name (ex. SPY, BTC)
|
|
@@ -678,6 +678,14 @@ export declare const portfolio: (name: string, strategies: Strategy[], options?:
|
|
|
678
678
|
* AbsoluteValue indicator.
|
|
679
679
|
*/
|
|
680
680
|
export declare function AbsoluteValue(operand: Indicator): Indicator;
|
|
681
|
+
/**
|
|
682
|
+
* AverageDirectionalIndex indicator.
|
|
683
|
+
* @param asset Ticker name (ex. SPY, BTC)
|
|
684
|
+
* @param length Length of time
|
|
685
|
+
* @param interval Unit of time
|
|
686
|
+
* @param line Which ADX-system line to evaluate
|
|
687
|
+
*/
|
|
688
|
+
export declare function AverageDirectionalIndex(asset: AssetArg, length?: number, interval?: Interval, line?: "adx" | "plusDi" | "minusDi"): Indicator;
|
|
681
689
|
/**
|
|
682
690
|
* AverageTrueRange indicator.
|
|
683
691
|
* @param asset Ticker name (ex. SPY, BTC)
|
|
@@ -1074,6 +1082,16 @@ export declare function MinutesUntilClose(): Indicator;
|
|
|
1074
1082
|
* Month indicator.
|
|
1075
1083
|
*/
|
|
1076
1084
|
export declare function Month(): Indicator;
|
|
1085
|
+
/**
|
|
1086
|
+
* MovingAverageConvergenceDivergence indicator.
|
|
1087
|
+
* @param asset Ticker name (ex. SPY, BTC)
|
|
1088
|
+
* @param fastLength Period of the fast EMA
|
|
1089
|
+
* @param slowLength Period of the slow EMA (must exceed the fast length)
|
|
1090
|
+
* @param signalLength Period of the EMA applied to the MACD line
|
|
1091
|
+
* @param interval Bar interval the MACD is computed on
|
|
1092
|
+
* @param line Which MACD line to evaluate
|
|
1093
|
+
*/
|
|
1094
|
+
export declare function MovingAverageConvergenceDivergence(asset: AssetArg, fastLength?: number, slowLength?: number, signalLength?: number, interval?: Interval, line?: "macd" | "signal" | "histogram"): Indicator;
|
|
1077
1095
|
/**
|
|
1078
1096
|
* Multiply indicator.
|
|
1079
1097
|
*/
|
|
@@ -1277,6 +1295,13 @@ export declare function RebalanceDecisionMetric(metric?: "allocationDrift" | "pl
|
|
|
1277
1295
|
*/
|
|
1278
1296
|
export declare function RelativeStrengthIndex(asset: AssetArg, length?: number, interval?: Interval): Indicator;
|
|
1279
1297
|
export declare const RSI: typeof RelativeStrengthIndex;
|
|
1298
|
+
/**
|
|
1299
|
+
* RelativeVolume indicator.
|
|
1300
|
+
* @param asset Ticker name (ex. SPY, BTC)
|
|
1301
|
+
* @param length Length of time
|
|
1302
|
+
* @param interval Unit of time
|
|
1303
|
+
*/
|
|
1304
|
+
export declare function RelativeVolume(asset: AssetArg, length?: number, interval?: Interval): Indicator;
|
|
1280
1305
|
/**
|
|
1281
1306
|
* SimpleMovingAverage indicator.
|
|
1282
1307
|
* @param asset Ticker name (ex. SPY, BTC)
|
|
@@ -322,6 +322,20 @@ export function AbsoluteValue(operand) {
|
|
|
322
322
|
d.indicators = [operand];
|
|
323
323
|
return d;
|
|
324
324
|
}
|
|
325
|
+
/**
|
|
326
|
+
* AverageDirectionalIndex indicator.
|
|
327
|
+
* @param asset Ticker name (ex. SPY, BTC)
|
|
328
|
+
* @param length Length of time
|
|
329
|
+
* @param interval Unit of time
|
|
330
|
+
* @param line Which ADX-system line to evaluate
|
|
331
|
+
*/
|
|
332
|
+
export function AverageDirectionalIndex(asset, length = 14, interval = "Day", line = "adx") {
|
|
333
|
+
const d = { type: "AverageDirectionalIndex" };
|
|
334
|
+
setAsset(d, "targetAsset", asset);
|
|
335
|
+
d["line"] = line;
|
|
336
|
+
d.window = { length: length, interval: interval };
|
|
337
|
+
return d;
|
|
338
|
+
}
|
|
325
339
|
/**
|
|
326
340
|
* AverageTrueRange indicator.
|
|
327
341
|
* @param asset Ticker name (ex. SPY, BTC)
|
|
@@ -1043,6 +1057,25 @@ export function Month() {
|
|
|
1043
1057
|
const d = { type: "Month" };
|
|
1044
1058
|
return d;
|
|
1045
1059
|
}
|
|
1060
|
+
/**
|
|
1061
|
+
* MovingAverageConvergenceDivergence indicator.
|
|
1062
|
+
* @param asset Ticker name (ex. SPY, BTC)
|
|
1063
|
+
* @param fastLength Period of the fast EMA
|
|
1064
|
+
* @param slowLength Period of the slow EMA (must exceed the fast length)
|
|
1065
|
+
* @param signalLength Period of the EMA applied to the MACD line
|
|
1066
|
+
* @param interval Bar interval the MACD is computed on
|
|
1067
|
+
* @param line Which MACD line to evaluate
|
|
1068
|
+
*/
|
|
1069
|
+
export function MovingAverageConvergenceDivergence(asset, fastLength = 12, slowLength = 26, signalLength = 9, interval = "Day", line = "macd") {
|
|
1070
|
+
const d = { type: "MovingAverageConvergenceDivergence" };
|
|
1071
|
+
setAsset(d, "targetAsset", asset);
|
|
1072
|
+
d["fastLength"] = fastLength;
|
|
1073
|
+
d["slowLength"] = slowLength;
|
|
1074
|
+
d["signalLength"] = signalLength;
|
|
1075
|
+
d["interval"] = interval;
|
|
1076
|
+
d["line"] = line;
|
|
1077
|
+
return d;
|
|
1078
|
+
}
|
|
1046
1079
|
/**
|
|
1047
1080
|
* Multiply indicator.
|
|
1048
1081
|
*/
|
|
@@ -1417,6 +1450,18 @@ export function RelativeStrengthIndex(asset, length = 30, interval = "Day") {
|
|
|
1417
1450
|
return d;
|
|
1418
1451
|
}
|
|
1419
1452
|
export const RSI = RelativeStrengthIndex;
|
|
1453
|
+
/**
|
|
1454
|
+
* RelativeVolume indicator.
|
|
1455
|
+
* @param asset Ticker name (ex. SPY, BTC)
|
|
1456
|
+
* @param length Length of time
|
|
1457
|
+
* @param interval Unit of time
|
|
1458
|
+
*/
|
|
1459
|
+
export function RelativeVolume(asset, length = 14, interval = "Day") {
|
|
1460
|
+
const d = { type: "RelativeVolume" };
|
|
1461
|
+
setAsset(d, "targetAsset", asset);
|
|
1462
|
+
d.window = { length: length, interval: interval };
|
|
1463
|
+
return d;
|
|
1464
|
+
}
|
|
1420
1465
|
/**
|
|
1421
1466
|
* SimpleMovingAverage indicator.
|
|
1422
1467
|
* @param asset Ticker name (ex. SPY, BTC)
|