nexustrade 1.21.0 → 1.22.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,12 +4,15 @@ 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.AccumulationDistribution = AccumulationDistribution;
7
8
  exports.AverageDirectionalIndex = AverageDirectionalIndex;
8
9
  exports.AverageTrueRange = AverageTrueRange;
9
10
  exports.BearishFairValueGap = BearishFairValueGap;
10
11
  exports.BollingerBand = BollingerBand;
11
12
  exports.BullishFairValueGap = BullishFairValueGap;
12
13
  exports.BuyingPower = BuyingPower;
14
+ exports.ChaikinMoneyFlow = ChaikinMoneyFlow;
15
+ exports.CommodityChannelIndex = CommodityChannelIndex;
13
16
  exports.CompoundAnnualGrowthRate = CompoundAnnualGrowthRate;
14
17
  exports.ConsecutiveTrue = ConsecutiveTrue;
15
18
  exports.CountTrue = CountTrue;
@@ -31,6 +34,7 @@ exports.DaysSinceStrategyFired = DaysSinceStrategyFired;
31
34
  exports.DaysSinceTransaction = DaysSinceTransaction;
32
35
  exports.DaysUntilEarnings = DaysUntilEarnings;
33
36
  exports.Divide = Divide;
37
+ exports.DonchianChannel = DonchianChannel;
34
38
  exports.Economic = Economic;
35
39
  exports.ExponentialMovingAverage = ExponentialMovingAverage;
36
40
  exports.Exponentiation = Exponentiation;
@@ -38,6 +42,7 @@ exports.Fundamental = Fundamental;
38
42
  exports.GapPercentage = GapPercentage;
39
43
  exports.GapSize = GapSize;
40
44
  exports.HighOfDay = HighOfDay;
45
+ exports.IchimokuCloud = IchimokuCloud;
41
46
  exports.ImpliedVolatility = ImpliedVolatility;
42
47
  exports.Index = Index;
43
48
  exports.IndicatorAtEntry = IndicatorAtEntry;
@@ -58,6 +63,7 @@ exports.IsNotAsset = IsNotAsset;
58
63
  exports.IVHVRatio = IVHVRatio;
59
64
  exports.IVPercentile = IVPercentile;
60
65
  exports.IVRank = IVRank;
66
+ exports.KeltnerChannel = KeltnerChannel;
61
67
  exports.LastOrderPrice = LastOrderPrice;
62
68
  exports.Log = Log;
63
69
  exports.LowOfDay = LowOfDay;
@@ -74,10 +80,12 @@ exports.MinutesSinceAlert = MinutesSinceAlert;
74
80
  exports.MinutesSinceOptionOrder = MinutesSinceOptionOrder;
75
81
  exports.MinutesSinceOrder = MinutesSinceOrder;
76
82
  exports.MinutesUntilClose = MinutesUntilClose;
83
+ exports.MoneyFlowIndex = MoneyFlowIndex;
77
84
  exports.Month = Month;
78
85
  exports.MovingAverageConvergenceDivergence = MovingAverageConvergenceDivergence;
79
86
  exports.Multiply = Multiply;
80
87
  exports.Negative = Negative;
88
+ exports.OnBalanceVolume = OnBalanceVolume;
81
89
  exports.OpeningPrice = OpeningPrice;
82
90
  exports.OptionCollateral = OptionCollateral;
83
91
  exports.OptionDaysHeld = OptionDaysHeld;
@@ -92,6 +100,7 @@ exports.OptionRealizedPremium = OptionRealizedPremium;
92
100
  exports.OptionSpreadCount = OptionSpreadCount;
93
101
  exports.OptionSpreadEntryPrice = OptionSpreadEntryPrice;
94
102
  exports.OptionUnrealizedPnL = OptionUnrealizedPnL;
103
+ exports.ParabolicSar = ParabolicSar;
95
104
  exports.Plus = Plus;
96
105
  exports.PoliticalTrades = PoliticalTrades;
97
106
  exports.PortfolioValue = PortfolioValue;
@@ -110,15 +119,18 @@ exports.RelativeStrengthIndex = RelativeStrengthIndex;
110
119
  exports.RelativeVolume = RelativeVolume;
111
120
  exports.SimpleMovingAverage = SimpleMovingAverage;
112
121
  exports.SquareRoot = SquareRoot;
122
+ exports.Stochastic = Stochastic;
113
123
  exports.StockReport = StockReport;
114
124
  exports.SumOrderAmount = SumOrderAmount;
115
125
  exports.SumOrderQuantity = SumOrderQuantity;
126
+ exports.Supertrend = Supertrend;
116
127
  exports.TrailingSum = TrailingSum;
117
128
  exports.TrueRange = TrueRange;
118
129
  exports.UnderlyingMaxDrawdown = UnderlyingMaxDrawdown;
119
130
  exports.Value = Value;
120
131
  exports.Volume = Volume;
121
132
  exports.VWAP = VWAP;
133
+ exports.WilliamsR = WilliamsR;
122
134
  exports.Year = Year;
123
135
  const portfolio_ts_1 = require("../portfolio.js");
124
136
  exports.CANDIDATE = { __candidate: true };
@@ -500,6 +512,17 @@ function AbsoluteValue(operand) {
500
512
  d.indicators = [operand];
501
513
  return d;
502
514
  }
515
+ /**
516
+ * AccumulationDistribution indicator.
517
+ * @param asset Ticker name (ex. SPY, BTC)
518
+ * @param interval Bar interval the line is accumulated on
519
+ */
520
+ function AccumulationDistribution(asset, interval = "Day") {
521
+ const d = { type: "AccumulationDistribution" };
522
+ setAsset(d, "targetAsset", asset);
523
+ d["interval"] = interval;
524
+ return d;
525
+ }
503
526
  /**
504
527
  * AverageDirectionalIndex indicator.
505
528
  * @param asset Ticker name (ex. SPY, BTC)
@@ -566,6 +589,32 @@ function BuyingPower() {
566
589
  const d = { type: "BuyingPower" };
567
590
  return d;
568
591
  }
592
+ /**
593
+ * ChaikinMoneyFlow indicator.
594
+ * @param asset Ticker name (ex. SPY, BTC)
595
+ * @param length Length of time
596
+ * @param interval Unit of time
597
+ */
598
+ function ChaikinMoneyFlow(asset, length = 20, interval = "Day") {
599
+ const d = { type: "ChaikinMoneyFlow" };
600
+ setAsset(d, "targetAsset", asset);
601
+ d.window = { length: length, interval: interval };
602
+ return d;
603
+ }
604
+ /**
605
+ * CommodityChannelIndex indicator.
606
+ * @param asset Ticker name (ex. SPY, BTC)
607
+ * @param length Length of time
608
+ * @param interval Unit of time
609
+ * @param constant Divisor scaling the mean deviation
610
+ */
611
+ function CommodityChannelIndex(asset, length = 20, interval = "Day", constant = 0.015) {
612
+ const d = { type: "CommodityChannelIndex" };
613
+ setAsset(d, "targetAsset", asset);
614
+ d["constant"] = constant;
615
+ d.window = { length: length, interval: interval };
616
+ return d;
617
+ }
569
618
  /**
570
619
  * CompoundAnnualGrowthRate indicator.
571
620
  * @param asset Ticker name (ex. SPY, BTC)
@@ -767,6 +816,20 @@ function Divide(left, right) {
767
816
  d.indicators = [left, right];
768
817
  return d;
769
818
  }
819
+ /**
820
+ * DonchianChannel indicator.
821
+ * @param asset Ticker name (ex. SPY, BTC)
822
+ * @param length Length of time
823
+ * @param interval Unit of time
824
+ * @param line Which Donchian line to evaluate
825
+ */
826
+ function DonchianChannel(asset, length = 20, interval = "Day", line = "upper") {
827
+ const d = { type: "DonchianChannel" };
828
+ setAsset(d, "targetAsset", asset);
829
+ d["line"] = line;
830
+ d.window = { length: length, interval: interval };
831
+ return d;
832
+ }
770
833
  /**
771
834
  * Economic indicator.
772
835
  * @param metric The economic indicator to use
@@ -837,6 +900,22 @@ function HighOfDay(asset) {
837
900
  setAsset(d, "targetAsset", asset);
838
901
  return d;
839
902
  }
903
+ /**
904
+ * IchimokuCloud indicator.
905
+ * @param asset Ticker name (ex. SPY, BTC)
906
+ * @param length Length of time
907
+ * @param interval Unit of time
908
+ * @param spanLength Senkou B lookback in bars (Kijun scales from conversion)
909
+ * @param line Which Ichimoku line to evaluate (unshifted)
910
+ */
911
+ function IchimokuCloud(asset, length = 9, interval = "Day", spanLength = 52, line = "tenkan") {
912
+ const d = { type: "IchimokuCloud" };
913
+ setAsset(d, "targetAsset", asset);
914
+ d["spanLength"] = spanLength;
915
+ d["line"] = line;
916
+ d.window = { length: length, interval: interval };
917
+ return d;
918
+ }
840
919
  /**
841
920
  * ImpliedVolatility indicator.
842
921
  * @param asset Ticker name (ex. SPY, BTC)
@@ -1059,6 +1138,22 @@ function IVRank(asset, length = 252, interval = "Day") {
1059
1138
  d.window = { length: length, interval: interval };
1060
1139
  return d;
1061
1140
  }
1141
+ /**
1142
+ * KeltnerChannel indicator.
1143
+ * @param asset Ticker name (ex. SPY, BTC)
1144
+ * @param length Length of time
1145
+ * @param interval Unit of time
1146
+ * @param multiplier How many ATRs from the EMA midline
1147
+ * @param line Which Keltner line to evaluate
1148
+ */
1149
+ function KeltnerChannel(asset, length = 20, interval = "Day", multiplier = 2, line = "middle") {
1150
+ const d = { type: "KeltnerChannel" };
1151
+ setAsset(d, "targetAsset", asset);
1152
+ d["multiplier"] = multiplier;
1153
+ d["line"] = line;
1154
+ d.window = { length: length, interval: interval };
1155
+ return d;
1156
+ }
1062
1157
  /**
1063
1158
  * LastOrderPrice indicator.
1064
1159
  * @param asset Ticker name (ex. SPY, BTC)
@@ -1228,6 +1323,18 @@ function MinutesUntilClose() {
1228
1323
  const d = { type: "MinutesUntilClose" };
1229
1324
  return d;
1230
1325
  }
1326
+ /**
1327
+ * MoneyFlowIndex indicator.
1328
+ * @param asset Ticker name (ex. SPY, BTC)
1329
+ * @param length Length of time
1330
+ * @param interval Unit of time
1331
+ */
1332
+ function MoneyFlowIndex(asset, length = 14, interval = "Day") {
1333
+ const d = { type: "MoneyFlowIndex" };
1334
+ setAsset(d, "targetAsset", asset);
1335
+ d.window = { length: length, interval: interval };
1336
+ return d;
1337
+ }
1231
1338
  /**
1232
1339
  * Month indicator.
1233
1340
  */
@@ -1270,6 +1377,17 @@ function Negative(operand) {
1270
1377
  d.indicators = [operand];
1271
1378
  return d;
1272
1379
  }
1380
+ /**
1381
+ * OnBalanceVolume indicator.
1382
+ * @param asset Ticker name (ex. SPY, BTC)
1383
+ * @param interval Bar interval the volume is accumulated on
1384
+ */
1385
+ function OnBalanceVolume(asset, interval = "Day") {
1386
+ const d = { type: "OnBalanceVolume" };
1387
+ setAsset(d, "targetAsset", asset);
1388
+ d["interval"] = interval;
1389
+ return d;
1390
+ }
1273
1391
  /**
1274
1392
  * OpeningPrice indicator.
1275
1393
  * @param asset Ticker name (ex. SPY, BTC)
@@ -1470,6 +1588,21 @@ function OptionUnrealizedPnL(underlying, optionType, direction, spreadType) {
1470
1588
  d["spreadType"] = spreadType;
1471
1589
  return d;
1472
1590
  }
1591
+ /**
1592
+ * ParabolicSar indicator.
1593
+ * @param asset Ticker name (ex. SPY, BTC)
1594
+ * @param interval Bar interval the SAR trails on
1595
+ * @param step AF increment per new extreme
1596
+ * @param maximum AF cap
1597
+ */
1598
+ function ParabolicSar(asset, interval = "Day", step = 0.02, maximum = 0.2) {
1599
+ const d = { type: "ParabolicSar" };
1600
+ setAsset(d, "targetAsset", asset);
1601
+ d["interval"] = interval;
1602
+ d["step"] = step;
1603
+ d["maximum"] = maximum;
1604
+ return d;
1605
+ }
1473
1606
  /**
1474
1607
  * Plus indicator.
1475
1608
  */
@@ -1661,6 +1794,24 @@ function SquareRoot(operand) {
1661
1794
  d.indicators = [operand];
1662
1795
  return d;
1663
1796
  }
1797
+ /**
1798
+ * Stochastic indicator.
1799
+ * @param asset Ticker name (ex. SPY, BTC)
1800
+ * @param length Length of time
1801
+ * @param interval Unit of time
1802
+ * @param smoothK Moving-average length applied to raw %K
1803
+ * @param smoothD Moving-average length applied to smoothed %K
1804
+ * @param line Which stochastic line to evaluate
1805
+ */
1806
+ function Stochastic(asset, length = 14, interval = "Day", smoothK = 3, smoothD = 3, line = "k") {
1807
+ const d = { type: "Stochastic" };
1808
+ setAsset(d, "targetAsset", asset);
1809
+ d["smoothK"] = smoothK;
1810
+ d["smoothD"] = smoothD;
1811
+ d["line"] = line;
1812
+ d.window = { length: length, interval: interval };
1813
+ return d;
1814
+ }
1664
1815
  /**
1665
1816
  * StockReport indicator.
1666
1817
  * @param asset Ticker name (ex. SPY, BTC)
@@ -1702,6 +1853,22 @@ function SumOrderQuantity(side, orderStatus = "Filled", length = 1, interval = "
1702
1853
  d.window = { length: length, interval: interval };
1703
1854
  return d;
1704
1855
  }
1856
+ /**
1857
+ * Supertrend indicator.
1858
+ * @param asset Ticker name (ex. SPY, BTC)
1859
+ * @param length Length of time
1860
+ * @param interval Unit of time
1861
+ * @param multiplier How many ATRs from HL2
1862
+ * @param line Band value or trend direction (+1 up, -1 down)
1863
+ */
1864
+ function Supertrend(asset, length = 10, interval = "Day", multiplier = 3, line = "value") {
1865
+ const d = { type: "Supertrend" };
1866
+ setAsset(d, "targetAsset", asset);
1867
+ d["multiplier"] = multiplier;
1868
+ d["line"] = line;
1869
+ d.window = { length: length, interval: interval };
1870
+ return d;
1871
+ }
1705
1872
  /**
1706
1873
  * TrailingSum indicator.
1707
1874
  * @param length Length of the rolling window
@@ -1759,6 +1926,18 @@ function VWAP(asset) {
1759
1926
  setAsset(d, "targetAsset", asset);
1760
1927
  return d;
1761
1928
  }
1929
+ /**
1930
+ * WilliamsR indicator.
1931
+ * @param asset Ticker name (ex. SPY, BTC)
1932
+ * @param length Length of time
1933
+ * @param interval Unit of time
1934
+ */
1935
+ function WilliamsR(asset, length = 14, interval = "Day") {
1936
+ const d = { type: "WilliamsR" };
1937
+ setAsset(d, "targetAsset", asset);
1938
+ d.window = { length: length, interval: interval };
1939
+ return d;
1940
+ }
1762
1941
  /**
1763
1942
  * Year indicator.
1764
1943
  */
@@ -678,6 +678,12 @@ 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
+ * AccumulationDistribution indicator.
683
+ * @param asset Ticker name (ex. SPY, BTC)
684
+ * @param interval Bar interval the line is accumulated on
685
+ */
686
+ export declare function AccumulationDistribution(asset: AssetArg, interval?: Interval): Indicator;
681
687
  /**
682
688
  * AverageDirectionalIndex indicator.
683
689
  * @param asset Ticker name (ex. SPY, BTC)
@@ -716,6 +722,21 @@ export declare function BullishFairValueGap(asset: AssetArg): Indicator;
716
722
  * BuyingPower indicator.
717
723
  */
718
724
  export declare function BuyingPower(): Indicator;
725
+ /**
726
+ * ChaikinMoneyFlow indicator.
727
+ * @param asset Ticker name (ex. SPY, BTC)
728
+ * @param length Length of time
729
+ * @param interval Unit of time
730
+ */
731
+ export declare function ChaikinMoneyFlow(asset: AssetArg, length?: number, interval?: Interval): Indicator;
732
+ /**
733
+ * CommodityChannelIndex indicator.
734
+ * @param asset Ticker name (ex. SPY, BTC)
735
+ * @param length Length of time
736
+ * @param interval Unit of time
737
+ * @param constant Divisor scaling the mean deviation
738
+ */
739
+ export declare function CommodityChannelIndex(asset: AssetArg, length?: number, interval?: Interval, constant?: number): Indicator;
719
740
  /**
720
741
  * CompoundAnnualGrowthRate indicator.
721
742
  * @param asset Ticker name (ex. SPY, BTC)
@@ -826,6 +847,14 @@ export declare function DaysUntilEarnings(asset: AssetArg): Indicator;
826
847
  * Divide indicator.
827
848
  */
828
849
  export declare function Divide(left: Indicator, right: Indicator): Indicator;
850
+ /**
851
+ * DonchianChannel indicator.
852
+ * @param asset Ticker name (ex. SPY, BTC)
853
+ * @param length Length of time
854
+ * @param interval Unit of time
855
+ * @param line Which Donchian line to evaluate
856
+ */
857
+ export declare function DonchianChannel(asset: AssetArg, length?: number, interval?: Interval, line?: "upper" | "lower" | "middle"): Indicator;
829
858
  /**
830
859
  * Economic indicator.
831
860
  * @param metric The economic indicator to use
@@ -865,6 +894,15 @@ export declare function GapSize(asset: AssetArg): Indicator;
865
894
  * @param asset Ticker name (ex. SPY, BTC)
866
895
  */
867
896
  export declare function HighOfDay(asset: AssetArg): Indicator;
897
+ /**
898
+ * IchimokuCloud indicator.
899
+ * @param asset Ticker name (ex. SPY, BTC)
900
+ * @param length Length of time
901
+ * @param interval Unit of time
902
+ * @param spanLength Senkou B lookback in bars (Kijun scales from conversion)
903
+ * @param line Which Ichimoku line to evaluate (unshifted)
904
+ */
905
+ export declare function IchimokuCloud(asset: AssetArg, length?: number, interval?: Interval, spanLength?: number, line?: "tenkan" | "kijun" | "senkouA" | "senkouB" | "chikou"): Indicator;
868
906
  /**
869
907
  * ImpliedVolatility indicator.
870
908
  * @param asset Ticker name (ex. SPY, BTC)
@@ -986,6 +1024,15 @@ export declare function IVPercentile(asset: AssetArg, length?: number, interval?
986
1024
  * @param interval Unit of time
987
1025
  */
988
1026
  export declare function IVRank(asset: AssetArg, length?: number, interval?: Interval): Indicator;
1027
+ /**
1028
+ * KeltnerChannel indicator.
1029
+ * @param asset Ticker name (ex. SPY, BTC)
1030
+ * @param length Length of time
1031
+ * @param interval Unit of time
1032
+ * @param multiplier How many ATRs from the EMA midline
1033
+ * @param line Which Keltner line to evaluate
1034
+ */
1035
+ export declare function KeltnerChannel(asset: AssetArg, length?: number, interval?: Interval, multiplier?: number, line?: "upper" | "middle" | "lower"): Indicator;
989
1036
  /**
990
1037
  * LastOrderPrice indicator.
991
1038
  * @param asset Ticker name (ex. SPY, BTC)
@@ -1078,6 +1125,13 @@ export declare function MinutesSinceOrder(assets: AssetArg | AssetArg[], side: S
1078
1125
  * MinutesUntilClose indicator.
1079
1126
  */
1080
1127
  export declare function MinutesUntilClose(): Indicator;
1128
+ /**
1129
+ * MoneyFlowIndex indicator.
1130
+ * @param asset Ticker name (ex. SPY, BTC)
1131
+ * @param length Length of time
1132
+ * @param interval Unit of time
1133
+ */
1134
+ export declare function MoneyFlowIndex(asset: AssetArg, length?: number, interval?: Interval): Indicator;
1081
1135
  /**
1082
1136
  * Month indicator.
1083
1137
  */
@@ -1100,6 +1154,12 @@ export declare function Multiply(left: Indicator, right: Indicator): Indicator;
1100
1154
  * Negative indicator.
1101
1155
  */
1102
1156
  export declare function Negative(operand: Indicator): Indicator;
1157
+ /**
1158
+ * OnBalanceVolume indicator.
1159
+ * @param asset Ticker name (ex. SPY, BTC)
1160
+ * @param interval Bar interval the volume is accumulated on
1161
+ */
1162
+ export declare function OnBalanceVolume(asset: AssetArg, interval?: Interval): Indicator;
1103
1163
  /**
1104
1164
  * OpeningPrice indicator.
1105
1165
  * @param asset Ticker name (ex. SPY, BTC)
@@ -1206,6 +1266,14 @@ export declare function OptionSpreadEntryPrice(underlying: string, optionType: O
1206
1266
  * @param spreadType Filter by spread type. Leave empty for all.
1207
1267
  */
1208
1268
  export declare function OptionUnrealizedPnL(underlying: string, optionType: OptionType, direction: OptionDirection, spreadType: OptionSpreadType): Indicator;
1269
+ /**
1270
+ * ParabolicSar indicator.
1271
+ * @param asset Ticker name (ex. SPY, BTC)
1272
+ * @param interval Bar interval the SAR trails on
1273
+ * @param step AF increment per new extreme
1274
+ * @param maximum AF cap
1275
+ */
1276
+ export declare function ParabolicSar(asset: AssetArg, interval?: Interval, step?: number, maximum?: number): Indicator;
1209
1277
  /**
1210
1278
  * Plus indicator.
1211
1279
  */
@@ -1314,6 +1382,16 @@ export declare const SMA: typeof SimpleMovingAverage;
1314
1382
  * SquareRoot indicator.
1315
1383
  */
1316
1384
  export declare function SquareRoot(operand: Indicator): Indicator;
1385
+ /**
1386
+ * Stochastic indicator.
1387
+ * @param asset Ticker name (ex. SPY, BTC)
1388
+ * @param length Length of time
1389
+ * @param interval Unit of time
1390
+ * @param smoothK Moving-average length applied to raw %K
1391
+ * @param smoothD Moving-average length applied to smoothed %K
1392
+ * @param line Which stochastic line to evaluate
1393
+ */
1394
+ export declare function Stochastic(asset: AssetArg, length?: number, interval?: Interval, smoothK?: number, smoothD?: number, line?: "k" | "d"): Indicator;
1317
1395
  /**
1318
1396
  * StockReport indicator.
1319
1397
  * @param asset Ticker name (ex. SPY, BTC)
@@ -1337,6 +1415,15 @@ export declare function SumOrderAmount(side: Side, orderStatus?: OrderStatus, le
1337
1415
  * @param assets Ticker name (ex. SPY, BTC)
1338
1416
  */
1339
1417
  export declare function SumOrderQuantity(side: Side, orderStatus?: OrderStatus, length?: number, interval?: Interval, assets?: AssetArg | AssetArg[]): Indicator;
1418
+ /**
1419
+ * Supertrend indicator.
1420
+ * @param asset Ticker name (ex. SPY, BTC)
1421
+ * @param length Length of time
1422
+ * @param interval Unit of time
1423
+ * @param multiplier How many ATRs from HL2
1424
+ * @param line Band value or trend direction (+1 up, -1 down)
1425
+ */
1426
+ export declare function Supertrend(asset: AssetArg, length?: number, interval?: Interval, multiplier?: number, line?: "value" | "direction"): Indicator;
1340
1427
  /**
1341
1428
  * TrailingSum indicator.
1342
1429
  * @param length Length of the rolling window
@@ -1368,6 +1455,13 @@ export declare function Volume(asset: AssetArg, metric?: FundamentalMetric): Ind
1368
1455
  * @param asset Ticker name (ex. SPY, BTC)
1369
1456
  */
1370
1457
  export declare function VWAP(asset: AssetArg): Indicator;
1458
+ /**
1459
+ * WilliamsR indicator.
1460
+ * @param asset Ticker name (ex. SPY, BTC)
1461
+ * @param length Length of time
1462
+ * @param interval Unit of time
1463
+ */
1464
+ export declare function WilliamsR(asset: AssetArg, length?: number, interval?: Interval): Indicator;
1371
1465
  /**
1372
1466
  * Year indicator.
1373
1467
  */
@@ -322,6 +322,17 @@ export function AbsoluteValue(operand) {
322
322
  d.indicators = [operand];
323
323
  return d;
324
324
  }
325
+ /**
326
+ * AccumulationDistribution indicator.
327
+ * @param asset Ticker name (ex. SPY, BTC)
328
+ * @param interval Bar interval the line is accumulated on
329
+ */
330
+ export function AccumulationDistribution(asset, interval = "Day") {
331
+ const d = { type: "AccumulationDistribution" };
332
+ setAsset(d, "targetAsset", asset);
333
+ d["interval"] = interval;
334
+ return d;
335
+ }
325
336
  /**
326
337
  * AverageDirectionalIndex indicator.
327
338
  * @param asset Ticker name (ex. SPY, BTC)
@@ -388,6 +399,32 @@ export function BuyingPower() {
388
399
  const d = { type: "BuyingPower" };
389
400
  return d;
390
401
  }
402
+ /**
403
+ * ChaikinMoneyFlow indicator.
404
+ * @param asset Ticker name (ex. SPY, BTC)
405
+ * @param length Length of time
406
+ * @param interval Unit of time
407
+ */
408
+ export function ChaikinMoneyFlow(asset, length = 20, interval = "Day") {
409
+ const d = { type: "ChaikinMoneyFlow" };
410
+ setAsset(d, "targetAsset", asset);
411
+ d.window = { length: length, interval: interval };
412
+ return d;
413
+ }
414
+ /**
415
+ * CommodityChannelIndex indicator.
416
+ * @param asset Ticker name (ex. SPY, BTC)
417
+ * @param length Length of time
418
+ * @param interval Unit of time
419
+ * @param constant Divisor scaling the mean deviation
420
+ */
421
+ export function CommodityChannelIndex(asset, length = 20, interval = "Day", constant = 0.015) {
422
+ const d = { type: "CommodityChannelIndex" };
423
+ setAsset(d, "targetAsset", asset);
424
+ d["constant"] = constant;
425
+ d.window = { length: length, interval: interval };
426
+ return d;
427
+ }
391
428
  /**
392
429
  * CompoundAnnualGrowthRate indicator.
393
430
  * @param asset Ticker name (ex. SPY, BTC)
@@ -589,6 +626,20 @@ export function Divide(left, right) {
589
626
  d.indicators = [left, right];
590
627
  return d;
591
628
  }
629
+ /**
630
+ * DonchianChannel indicator.
631
+ * @param asset Ticker name (ex. SPY, BTC)
632
+ * @param length Length of time
633
+ * @param interval Unit of time
634
+ * @param line Which Donchian line to evaluate
635
+ */
636
+ export function DonchianChannel(asset, length = 20, interval = "Day", line = "upper") {
637
+ const d = { type: "DonchianChannel" };
638
+ setAsset(d, "targetAsset", asset);
639
+ d["line"] = line;
640
+ d.window = { length: length, interval: interval };
641
+ return d;
642
+ }
592
643
  /**
593
644
  * Economic indicator.
594
645
  * @param metric The economic indicator to use
@@ -659,6 +710,22 @@ export function HighOfDay(asset) {
659
710
  setAsset(d, "targetAsset", asset);
660
711
  return d;
661
712
  }
713
+ /**
714
+ * IchimokuCloud indicator.
715
+ * @param asset Ticker name (ex. SPY, BTC)
716
+ * @param length Length of time
717
+ * @param interval Unit of time
718
+ * @param spanLength Senkou B lookback in bars (Kijun scales from conversion)
719
+ * @param line Which Ichimoku line to evaluate (unshifted)
720
+ */
721
+ export function IchimokuCloud(asset, length = 9, interval = "Day", spanLength = 52, line = "tenkan") {
722
+ const d = { type: "IchimokuCloud" };
723
+ setAsset(d, "targetAsset", asset);
724
+ d["spanLength"] = spanLength;
725
+ d["line"] = line;
726
+ d.window = { length: length, interval: interval };
727
+ return d;
728
+ }
662
729
  /**
663
730
  * ImpliedVolatility indicator.
664
731
  * @param asset Ticker name (ex. SPY, BTC)
@@ -881,6 +948,22 @@ export function IVRank(asset, length = 252, interval = "Day") {
881
948
  d.window = { length: length, interval: interval };
882
949
  return d;
883
950
  }
951
+ /**
952
+ * KeltnerChannel indicator.
953
+ * @param asset Ticker name (ex. SPY, BTC)
954
+ * @param length Length of time
955
+ * @param interval Unit of time
956
+ * @param multiplier How many ATRs from the EMA midline
957
+ * @param line Which Keltner line to evaluate
958
+ */
959
+ export function KeltnerChannel(asset, length = 20, interval = "Day", multiplier = 2, line = "middle") {
960
+ const d = { type: "KeltnerChannel" };
961
+ setAsset(d, "targetAsset", asset);
962
+ d["multiplier"] = multiplier;
963
+ d["line"] = line;
964
+ d.window = { length: length, interval: interval };
965
+ return d;
966
+ }
884
967
  /**
885
968
  * LastOrderPrice indicator.
886
969
  * @param asset Ticker name (ex. SPY, BTC)
@@ -1050,6 +1133,18 @@ export function MinutesUntilClose() {
1050
1133
  const d = { type: "MinutesUntilClose" };
1051
1134
  return d;
1052
1135
  }
1136
+ /**
1137
+ * MoneyFlowIndex indicator.
1138
+ * @param asset Ticker name (ex. SPY, BTC)
1139
+ * @param length Length of time
1140
+ * @param interval Unit of time
1141
+ */
1142
+ export function MoneyFlowIndex(asset, length = 14, interval = "Day") {
1143
+ const d = { type: "MoneyFlowIndex" };
1144
+ setAsset(d, "targetAsset", asset);
1145
+ d.window = { length: length, interval: interval };
1146
+ return d;
1147
+ }
1053
1148
  /**
1054
1149
  * Month indicator.
1055
1150
  */
@@ -1092,6 +1187,17 @@ export function Negative(operand) {
1092
1187
  d.indicators = [operand];
1093
1188
  return d;
1094
1189
  }
1190
+ /**
1191
+ * OnBalanceVolume indicator.
1192
+ * @param asset Ticker name (ex. SPY, BTC)
1193
+ * @param interval Bar interval the volume is accumulated on
1194
+ */
1195
+ export function OnBalanceVolume(asset, interval = "Day") {
1196
+ const d = { type: "OnBalanceVolume" };
1197
+ setAsset(d, "targetAsset", asset);
1198
+ d["interval"] = interval;
1199
+ return d;
1200
+ }
1095
1201
  /**
1096
1202
  * OpeningPrice indicator.
1097
1203
  * @param asset Ticker name (ex. SPY, BTC)
@@ -1292,6 +1398,21 @@ export function OptionUnrealizedPnL(underlying, optionType, direction, spreadTyp
1292
1398
  d["spreadType"] = spreadType;
1293
1399
  return d;
1294
1400
  }
1401
+ /**
1402
+ * ParabolicSar indicator.
1403
+ * @param asset Ticker name (ex. SPY, BTC)
1404
+ * @param interval Bar interval the SAR trails on
1405
+ * @param step AF increment per new extreme
1406
+ * @param maximum AF cap
1407
+ */
1408
+ export function ParabolicSar(asset, interval = "Day", step = 0.02, maximum = 0.2) {
1409
+ const d = { type: "ParabolicSar" };
1410
+ setAsset(d, "targetAsset", asset);
1411
+ d["interval"] = interval;
1412
+ d["step"] = step;
1413
+ d["maximum"] = maximum;
1414
+ return d;
1415
+ }
1295
1416
  /**
1296
1417
  * Plus indicator.
1297
1418
  */
@@ -1483,6 +1604,24 @@ export function SquareRoot(operand) {
1483
1604
  d.indicators = [operand];
1484
1605
  return d;
1485
1606
  }
1607
+ /**
1608
+ * Stochastic indicator.
1609
+ * @param asset Ticker name (ex. SPY, BTC)
1610
+ * @param length Length of time
1611
+ * @param interval Unit of time
1612
+ * @param smoothK Moving-average length applied to raw %K
1613
+ * @param smoothD Moving-average length applied to smoothed %K
1614
+ * @param line Which stochastic line to evaluate
1615
+ */
1616
+ export function Stochastic(asset, length = 14, interval = "Day", smoothK = 3, smoothD = 3, line = "k") {
1617
+ const d = { type: "Stochastic" };
1618
+ setAsset(d, "targetAsset", asset);
1619
+ d["smoothK"] = smoothK;
1620
+ d["smoothD"] = smoothD;
1621
+ d["line"] = line;
1622
+ d.window = { length: length, interval: interval };
1623
+ return d;
1624
+ }
1486
1625
  /**
1487
1626
  * StockReport indicator.
1488
1627
  * @param asset Ticker name (ex. SPY, BTC)
@@ -1524,6 +1663,22 @@ export function SumOrderQuantity(side, orderStatus = "Filled", length = 1, inter
1524
1663
  d.window = { length: length, interval: interval };
1525
1664
  return d;
1526
1665
  }
1666
+ /**
1667
+ * Supertrend indicator.
1668
+ * @param asset Ticker name (ex. SPY, BTC)
1669
+ * @param length Length of time
1670
+ * @param interval Unit of time
1671
+ * @param multiplier How many ATRs from HL2
1672
+ * @param line Band value or trend direction (+1 up, -1 down)
1673
+ */
1674
+ export function Supertrend(asset, length = 10, interval = "Day", multiplier = 3, line = "value") {
1675
+ const d = { type: "Supertrend" };
1676
+ setAsset(d, "targetAsset", asset);
1677
+ d["multiplier"] = multiplier;
1678
+ d["line"] = line;
1679
+ d.window = { length: length, interval: interval };
1680
+ return d;
1681
+ }
1527
1682
  /**
1528
1683
  * TrailingSum indicator.
1529
1684
  * @param length Length of the rolling window
@@ -1581,6 +1736,18 @@ export function VWAP(asset) {
1581
1736
  setAsset(d, "targetAsset", asset);
1582
1737
  return d;
1583
1738
  }
1739
+ /**
1740
+ * WilliamsR indicator.
1741
+ * @param asset Ticker name (ex. SPY, BTC)
1742
+ * @param length Length of time
1743
+ * @param interval Unit of time
1744
+ */
1745
+ export function WilliamsR(asset, length = 14, interval = "Day") {
1746
+ const d = { type: "WilliamsR" };
1747
+ setAsset(d, "targetAsset", asset);
1748
+ d.window = { length: length, interval: interval };
1749
+ return d;
1750
+ }
1584
1751
  /**
1585
1752
  * Year indicator.
1586
1753
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nexustrade",
3
- "version": "1.21.0",
3
+ "version": "1.22.0",
4
4
  "description": "Typed TypeScript SDK for NexusTrade portfolio authoring, backtesting, and optimization",
5
5
  "license": "MIT",
6
6
  "author": "Starks Technology",