nexustrade 5.1.0 → 5.2.2

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.
@@ -360,7 +360,7 @@ export const portfolio = (name, strategies, options = {}) => {
360
360
  };
361
361
  // ---- generated indicator builders ----
362
362
  /**
363
- * AbsoluteValue indicator.
363
+ * The absolute value of an indicator.
364
364
  */
365
365
  export function AbsoluteValue(operand) {
366
366
  const d = { type: "AbsoluteValue" };
@@ -368,7 +368,7 @@ export function AbsoluteValue(operand) {
368
368
  return d;
369
369
  }
370
370
  /**
371
- * AccumulationDistribution indicator.
371
+ * Running total of close-location value times volume. Unlike OBV it weights where in the range the bar closed, so weak closes on high volume distribute. Range: Unbounded (cumulative).
372
372
  * @param asset Ticker name (ex. SPY, BTC)
373
373
  * @param interval Bar interval the line is accumulated on
374
374
  */
@@ -379,7 +379,7 @@ export function AccumulationDistribution(asset, interval = "Day") {
379
379
  return d;
380
380
  }
381
381
  /**
382
- * AverageDirectionalIndex indicator.
382
+ * Wilder's ADX: trend strength on 0-100, with optional +DI and -DI trend-direction lines. ADX above ~25 is conventionally a strong trend. Range: 0 to 100.
383
383
  * @param asset Ticker name (ex. SPY, BTC)
384
384
  * @param length Length of time
385
385
  * @param interval Unit of time
@@ -393,7 +393,7 @@ export function AverageDirectionalIndex(asset, length = 14, interval = "Day", li
393
393
  return d;
394
394
  }
395
395
  /**
396
- * AverageTrueRange indicator.
396
+ * The average of True Range over a window. A smoothed measure of volatility used for position sizing and stop-losses. Range: >= 0.
397
397
  * @param asset Ticker name (ex. SPY, BTC)
398
398
  * @param length Length of time
399
399
  * @param interval Unit of time
@@ -405,7 +405,7 @@ export function AverageTrueRange(asset, length = 14, interval = "Day") {
405
405
  return d;
406
406
  }
407
407
  /**
408
- * BearishFairValueGap indicator.
408
+ * Detects a bearish fair value gap (3-candle gap down) on minute bars. Returns the gap's resistance price (candle1 low) while the pattern is active; otherwise no value (condition fails). Not a 0/1 flag — never compare to 1. Range: price when present.
409
409
  * @param asset Ticker name (ex. SPY, BTC)
410
410
  */
411
411
  export function BearishFairValueGap(asset) {
@@ -414,7 +414,7 @@ export function BearishFairValueGap(asset) {
414
414
  return d;
415
415
  }
416
416
  /**
417
- * BollingerBand indicator.
417
+ * One Bollinger band, returned as a single number: the simple moving average of price plus the given number of standard deviations of price over the same window. A positive number gives the upper band, a negative number the lower band, and 0 the moving average itself. Range: Same scale as price.
418
418
  * @param asset Ticker name (ex. SPY, BTC)
419
419
  * @param length Length of time
420
420
  * @param interval Unit of time
@@ -429,7 +429,7 @@ export function BollingerBand(asset, length = 30, interval = "Day", numStandardD
429
429
  }
430
430
  export const BBand = BollingerBand;
431
431
  /**
432
- * BullishFairValueGap indicator.
432
+ * Detects a bullish fair value gap (3-candle gap up) on minute bars. Returns the gap's support price (candle1 high) while the pattern is active; otherwise no value (condition fails). Not a 0/1 flag — never compare to 1 (that is for CrossAbove/CrossBelow). Range: price when present.
433
433
  * @param asset Ticker name (ex. SPY, BTC)
434
434
  */
435
435
  export function BullishFairValueGap(asset) {
@@ -438,14 +438,14 @@ export function BullishFairValueGap(asset) {
438
438
  return d;
439
439
  }
440
440
  /**
441
- * BuyingPower indicator.
441
+ * The amount of cash available to make new purchases. Range: >= 0.
442
442
  */
443
443
  export function BuyingPower() {
444
444
  const d = { type: "BuyingPower" };
445
445
  return d;
446
446
  }
447
447
  /**
448
- * ChaikinMoneyFlow indicator.
448
+ * Money flow volume over money volume across N bars, bounded in -1 to +1. Sustained readings above +0.2 show institutional accumulation. Range: -1 to +1.
449
449
  * @param asset Ticker name (ex. SPY, BTC)
450
450
  * @param length Length of time
451
451
  * @param interval Unit of time
@@ -457,7 +457,7 @@ export function ChaikinMoneyFlow(asset, length = 20, interval = "Day") {
457
457
  return d;
458
458
  }
459
459
  /**
460
- * ChartBar indicator.
460
+ * Prices, the average close, or the end time of completed chart candles, built from contiguous minute data. Stock candles align to the regular trading session. Range: Same scale as price for open, high, low, close and sma; the endTime line returns the end time of the newest selected candle in Unix seconds.
461
461
  * @param asset Ticker name (ex. SPY, BTC)
462
462
  * @param barMinutes Completed candles: stocks divide the 390-minute regular session from 9:30 ET. Crypto divides the 1440-minute UTC day or uses 10080 for a Monday UTC week; legacy intraday sizes remain valid. Observation cadence must be Minute even for daily/weekly candles.
463
463
  * @param line open: oldest selected candle; close: newest; high/low: range; sma: mean candle closes.
@@ -476,7 +476,7 @@ export function ChartBar(asset, barMinutes = 5, line = "close", bars = 1, offset
476
476
  return d;
477
477
  }
478
478
  /**
479
- * CommodityChannelIndex indicator.
479
+ * Deviation of the typical price from its moving average, scaled by mean deviation. Readings above +100 are overbought, below -100 oversold. Range: Unbounded (typically -300 to +300).
480
480
  * @param asset Ticker name (ex. SPY, BTC)
481
481
  * @param length Length of time
482
482
  * @param interval Unit of time
@@ -490,7 +490,7 @@ export function CommodityChannelIndex(asset, length = 20, interval = "Day", cons
490
490
  return d;
491
491
  }
492
492
  /**
493
- * CompoundAnnualGrowthRate indicator.
493
+ * The annualized growth rate of a fundamental metric over a specified number of years. Smooths out quarterly volatility to show the long-term trend. Range: Unbounded (percentage).
494
494
  * @param asset Ticker name (ex. SPY, BTC)
495
495
  * @param metric The fundamental metric to use
496
496
  * @param years Floating point years value
@@ -541,8 +541,8 @@ export function ConsecutiveTrue(condition, length = 1, interval = "Day") {
541
541
  return d;
542
542
  }
543
543
  /**
544
- * Correlation indicator.
545
- * @param operands Sub-indicators this compound operates on.
544
+ * Rolling Pearson correlation (-1 to 1) of two indicators' period-over-period returns over N paired observations. Flat or degenerate windows read no-signal instead of a fabricated number.
545
+ * @param operands One list of exactly 2 sub-indicators.
546
546
  * @param length Length of time
547
547
  * @param interval Unit of time
548
548
  */
@@ -584,21 +584,21 @@ export function CrossBelow(left, right) {
584
584
  return d;
585
585
  }
586
586
  /**
587
- * CurrentTimeHours indicator.
587
+ * Hours since midnight in America/New_York time, including fractional hours. For example, 9:30 AM returns 9.5. Daylight saving time is handled automatically.
588
588
  */
589
589
  export function CurrentTimeHours() {
590
590
  const d = { type: "CurrentTimeHours" };
591
591
  return d;
592
592
  }
593
593
  /**
594
- * CurrentTimeMinutes indicator.
594
+ * Minutes since midnight in America/New_York time, including fractional minutes. For example, 9:30 AM returns 570. Daylight saving time is handled automatically.
595
595
  */
596
596
  export function CurrentTimeMinutes() {
597
597
  const d = { type: "CurrentTimeMinutes" };
598
598
  return d;
599
599
  }
600
600
  /**
601
- * CurrentTimeSeconds indicator.
601
+ * Seconds since midnight in America/New_York time, including fractions of a second. For example, 9:30 AM returns 34200. Daylight saving time is handled automatically.
602
602
  */
603
603
  export function CurrentTimeSeconds() {
604
604
  const d = { type: "CurrentTimeSeconds" };
@@ -620,7 +620,7 @@ export function CurrentValue(operand) {
620
620
  return d;
621
621
  }
622
622
  /**
623
- * CustomIndicator indicator.
623
+ * Account-owned timestamp/value data uploaded through CSV or JSON ingestion. Range: User-defined numeric value.
624
624
  * @param asset Pass CANDIDATE inside a rebalance pipeline to bind per candidate.
625
625
  * @param customIndicatorId 24-char hex ObjectId of the owned series (list_custom_indicators).
626
626
  */
@@ -631,28 +631,28 @@ export function CustomIndicator(asset, customIndicatorId) {
631
631
  return d;
632
632
  }
633
633
  /**
634
- * Date indicator.
634
+ * The day of the month in America/New_York, from 1 through 31. Combine with Month and Year for a specific calendar date.
635
635
  */
636
636
  export function Date() {
637
637
  const d = { type: "Date" };
638
638
  return d;
639
639
  }
640
640
  /**
641
- * Day indicator.
641
+ * The weekday in America/New_York: Monday = 1 through Sunday = 7. Use Date for the day of the month.
642
642
  */
643
643
  export function Day() {
644
644
  const d = { type: "Day" };
645
645
  return d;
646
646
  }
647
647
  /**
648
- * DaysSinceAgent indicator.
648
+ * The number of days since an AI agent was launched by this strategy. Useful for rate-limiting agent launches. Range: >= 0.
649
649
  */
650
650
  export function DaysSinceAgent() {
651
651
  const d = { type: "DaysSinceAgent" };
652
652
  return d;
653
653
  }
654
654
  /**
655
- * DaysSinceAlert indicator.
655
+ * The number of days since an alert was triggered. Useful for rate-limiting alerts. Range: >= 0.
656
656
  * @param message (Optional) Message to display when the indicator is triggered
657
657
  */
658
658
  export function DaysSinceAlert(message) {
@@ -661,7 +661,7 @@ export function DaysSinceAlert(message) {
661
661
  return d;
662
662
  }
663
663
  /**
664
- * DaysSinceEarnings indicator.
664
+ * Calendar days since the asset's most recent earnings report. In backtests and live, this is the last actually-reported quarter at-or-before the decision time (no look-ahead). Use to time post-earnings entries (e.g. fade the gap after N days, or wait for the IV crush to settle). Range: >= 0 (0 on the report day; grows as time passes).
665
665
  * @param asset Ticker name (ex. SPY, BTC)
666
666
  */
667
667
  export function DaysSinceEarnings(asset) {
@@ -670,14 +670,14 @@ export function DaysSinceEarnings(asset) {
670
670
  return d;
671
671
  }
672
672
  /**
673
- * DaysSinceLastRebalanceOptionOrder indicator.
673
+ * Elapsed days since the latest Filled-matching portfolio order stamped RebalanceOption, RebalanceOptionRenewal or RebalanceOptionFunding. It uses fill time and ignores strategy ID, so these strategies share a cooldown. Unfilled or canceled orders do not reset it. Range: >= 0 (days), or a large number if no RebalanceOption-generated order exists.
674
674
  */
675
675
  export function DaysSinceLastRebalanceOptionOrder() {
676
676
  const d = { type: "DaysSinceLastRebalanceOptionOrder" };
677
677
  return d;
678
678
  }
679
679
  /**
680
- * DaysSinceOptionOrder indicator.
680
+ * The number of days since the most recent option order matching the specified filters. Supports filtering by underlying, option type (call/put), spread type, direction (long/short), position effect (open/close), and days to expiration at order time. Range: >= 0 (days), or a large number if no matching order exists.
681
681
  * @param underlying Filter by underlying (e.g., AAPL, SPY). Leave empty for all.
682
682
  * @param optionType Filter by Call or Put. Leave empty for all.
683
683
  * @param direction Filter by Long or Short. Leave empty for all.
@@ -700,7 +700,7 @@ export function DaysSinceOptionOrder(underlying, optionType, direction, spreadTy
700
700
  return d;
701
701
  }
702
702
  /**
703
- * DaysSinceOrder indicator.
703
+ * The number of days since the most recent order matching the specified filters. Range: >= 0 (days), or a large number if no matching order exists.
704
704
  * @param assets Ticker(s) whose orders are counted. One string or an array.
705
705
  * @param side Buy or Sell
706
706
  */
@@ -712,14 +712,14 @@ export function DaysSinceOrder(assets, side, orderStatus = "Filled") {
712
712
  return d;
713
713
  }
714
714
  /**
715
- * DaysSinceStrategyFired indicator.
715
+ * The number of days since the current strategy last produced an execution artifact. Counts same-strategy order rows, rebalance orders, and launched agents. Range: >= 0 (days), or a large number if the strategy has never fired.
716
716
  */
717
717
  export function DaysSinceStrategyFired() {
718
718
  const d = { type: "DaysSinceStrategyFired" };
719
719
  return d;
720
720
  }
721
721
  /**
722
- * DaysUntilEarnings indicator.
722
+ * Calendar days until the asset's next expected earnings report. In backtests the next date is a point-in-time cadence estimate from the last report (no look-ahead); live trading uses the real next scheduled date. Use to time entries and exits around earnings. Range: >= 0 (0 on/after the expected report day; counts down as it nears).
723
723
  * @param asset Ticker name (ex. SPY, BTC)
724
724
  */
725
725
  export function DaysUntilEarnings(asset) {
@@ -728,7 +728,7 @@ export function DaysUntilEarnings(asset) {
728
728
  return d;
729
729
  }
730
730
  /**
731
- * Divide indicator.
731
+ * Quotient of indicators.
732
732
  */
733
733
  export function Divide(left, right) {
734
734
  const d = { type: "Divide" };
@@ -736,7 +736,7 @@ export function Divide(left, right) {
736
736
  return d;
737
737
  }
738
738
  /**
739
- * DonchianChannel indicator.
739
+ * Highest high and lowest low over N bars with a midline. Breaks of either edge are breakout entries; the midline is the first pullback level. Range: Price scale.
740
740
  * @param asset Ticker name (ex. SPY, BTC)
741
741
  * @param length Length of time
742
742
  * @param interval Unit of time
@@ -750,7 +750,7 @@ export function DonchianChannel(asset, length = 20, interval = "Day", line = "up
750
750
  return d;
751
751
  }
752
752
  /**
753
- * Economic indicator.
753
+ * Macroeconomic data not tied to a specific asset.
754
754
  * @param metric The economic indicator to use
755
755
  */
756
756
  export function Economic(metric) {
@@ -772,7 +772,7 @@ export function ExponentialMovingAverage(asset, length, interval = "Day") {
772
772
  }
773
773
  export const EMA = ExponentialMovingAverage;
774
774
  /**
775
- * Exponentiation indicator.
775
+ * Raises an indicator to a specified power.
776
776
  * @param exponent The exponent to raise the value to
777
777
  */
778
778
  export function Exponentiation(operand, exponent = 2) {
@@ -782,7 +782,7 @@ export function Exponentiation(operand, exponent = 2) {
782
782
  return d;
783
783
  }
784
784
  /**
785
- * Fundamental indicator.
785
+ * A financial metric from a company's statements or derived valuation ratios.
786
786
  * @param asset Ticker name (ex. SPY, BTC)
787
787
  * @param metric The fundamental metric to use
788
788
  */
@@ -793,7 +793,7 @@ export function Fundamental(asset, metric) {
793
793
  return d;
794
794
  }
795
795
  /**
796
- * GapPercentage indicator.
796
+ * The gap size expressed as a percentage of the previous close. Range: Unbounded (percentage).
797
797
  * @param asset Ticker name (ex. SPY, BTC)
798
798
  */
799
799
  export function GapPercentage(asset) {
@@ -802,7 +802,7 @@ export function GapPercentage(asset) {
802
802
  return d;
803
803
  }
804
804
  /**
805
- * GapSize indicator.
805
+ * The dollar difference between today's opening price and yesterday's closing price. Range: Unbounded.
806
806
  * @param asset Ticker name (ex. SPY, BTC)
807
807
  */
808
808
  export function GapSize(asset) {
@@ -811,7 +811,7 @@ export function GapSize(asset) {
811
811
  return d;
812
812
  }
813
813
  /**
814
- * HeikinAshi indicator.
814
+ * Heikin-Ashi candles built from COMPLETED one-minute bars in the regular session (9:30-15:59 bar opens; pre-market and after-hours bars are skipped), identically in backtests and live trading. The first bar seeds HA open = (O+C)/2 with its own high, low and close; after that HA close = (O+H+L+C)/4, HA open = (prior HA open + prior HA close)/2, HA high = max(H, HA open, HA close), HA low = min(L, HA open, HA close). The recursion carries across sessions and advances once per new bar. The streak line is the signed length of the current same-color run, counted from the color change (+3 on the third green candle, -3 on the third red); it reads 0 on a doji and for the rest of any run in which a candle shows an opposite-direction wick (a lower wick on green, an upper wick on red). Range: Price scale; streak is a signed integer.
815
815
  * @param asset Ticker name (ex. SPY, BTC)
816
816
  * @param line Which one-minute Heikin-Ashi value to evaluate. streak is the signed length of the current same-color run (0 once it shows an opposite-direction wick, and on a doji)
817
817
  */
@@ -822,7 +822,7 @@ export function HeikinAshi(asset, line = "close") {
822
822
  return d;
823
823
  }
824
824
  /**
825
- * HighOfDay indicator.
825
+ * The highest price reached during the current trading session. Range: > 0.
826
826
  * @param asset Ticker name (ex. SPY, BTC)
827
827
  */
828
828
  export function HighOfDay(asset) {
@@ -831,7 +831,7 @@ export function HighOfDay(asset) {
831
831
  return d;
832
832
  }
833
833
  /**
834
- * IchimokuCloud indicator.
834
+ * Five-line trend system: Tenkan and Kijun midpoints, Senkou A/B cloud bands, and the Chikou lagging line. Lines are evaluated unshifted. Price above the cloud with Tenkan above Kijun is the full bullish alignment. Range: Price scale.
835
835
  * @param asset Ticker name (ex. SPY, BTC)
836
836
  * @param length Length of time
837
837
  * @param interval Unit of time
@@ -847,7 +847,7 @@ export function IchimokuCloud(asset, length = 9, interval = "Day", spanLength =
847
847
  return d;
848
848
  }
849
849
  /**
850
- * ImpliedVolatility indicator.
850
+ * Constant-maturity at-the-money implied volatility for the underlying, built from the options chain (near-target-DTE expirations, |delta|≈0.50 call/put average, linearly interpolated). Units are annualized decimals (0.25 = 25%). Used on each candidate of a dynamic rebalance over a broad universe (all US stocks, an index or a watchlist), it reads options chains with Greeks for every stock in that universe instead of one underlying, so the run is heavier than with a named ticker or a specific asset list. Range: > 0 (annualized decimal).
851
851
  * @param asset Ticker name (ex. SPY, BTC)
852
852
  * @param dte Target constant-maturity tenor in calendar days (e.g. 30)
853
853
  */
@@ -858,7 +858,7 @@ export function ImpliedVolatility(asset, dte = 30) {
858
858
  return d;
859
859
  }
860
860
  /**
861
- * Index indicator.
861
+ * Daily level for a market index or benchmark (e.g. VIX, SPX) from hydrated index price data — not a tradable equity price. Range: Unbounded (index points).
862
862
  * @param metric Ticker key matching hydrated index price data (add more in BigQuery + rehydrate as needed)
863
863
  */
864
864
  export function Index(metric = "VIX") {
@@ -883,7 +883,7 @@ export function IndicatorAtCondition(operand, condition, selection = "First", cl
883
883
  return d;
884
884
  }
885
885
  /**
886
- * IndicatorAtEntry indicator.
886
+ * The value an indicator held at a matching fill of the asset. The entry anchor chooses the fill: LatestFill (the default) follows the most recent matching fill; HoldingEntry preserves the original holding entry when shares are added. The captured level stays fixed instead of rolling forward. In the form, a candidate-bound condition may leave the asset empty and the surrounding action supplies it; SDK code always passes the asset, using CANDIDATE inside a rebalance pipeline.
887
887
  * @param asset Ticker name (ex. SPY, BTC)
888
888
  * @param side The side of the fill the value is anchored to
889
889
  * @param orderStatus Matches order events with this status
@@ -898,7 +898,7 @@ export function IndicatorAtEntry(operand, asset, side, orderStatus = "Filled", a
898
898
  return d;
899
899
  }
900
900
  /**
901
- * IndicatorAtMinutesAfterOpen indicator.
901
+ * Captures the first non-null evaluated indicator value at or after the configured number of minutes after market open. The captured value is then frozen until its next daily reset. A delayed evaluation can capture after the target minute.
902
902
  * @param minutesAfterOpen The number of minutes after market open to capture the indicator value
903
903
  */
904
904
  export function IndicatorAtMinutesAfterOpen(operand, minutesAfterOpen = 30) {
@@ -908,7 +908,7 @@ export function IndicatorAtMinutesAfterOpen(operand, minutesAfterOpen = 30) {
908
908
  return d;
909
909
  }
910
910
  /**
911
- * IndicatorExponentialMovingAverage indicator.
911
+ * Computes the Exponential Moving Average of any other indicator. TradingDay follows the input markets: crypto-only inputs use elapsed 24-hour days, including weekends, just like Day. Stock, option, mixed-market and asset-free expressions use confirmed exchange sessions. The window does not change intraday prices into daily closing prices. TradingMinute counts regular-session minutes the same way, so a 70 TradingMinute window at 9:45 reaches back to 3:06 PM on the prior session (the overnight gap is one step); crypto-only inputs use elapsed minutes. It allows at most 1439 minutes; use TradingDay for longer lookbacks. Indicators read every tick have no TradingMinute value outside regular hours, and windows over a ChartBar keep the value of its latest completed candle.
912
912
  * @param length Length of time
913
913
  * @param interval Unit of time
914
914
  */
@@ -930,7 +930,7 @@ export function IndicatorMaximum(operand, length = 30, interval = "Day") {
930
930
  return d;
931
931
  }
932
932
  /**
933
- * IndicatorMeanAbsoluteDeviation indicator.
933
+ * Computes the MAD of any indicator over a window. Less sensitive to outliers than standard deviation.
934
934
  * @param length Length of time
935
935
  * @param interval Unit of time
936
936
  */
@@ -952,7 +952,7 @@ export function IndicatorMinimum(operand, length = 30, interval = "Day") {
952
952
  return d;
953
953
  }
954
954
  /**
955
- * IndicatorRateOfChange indicator.
955
+ * The percentage change of any indicator over a window.
956
956
  * @param length Length of time
957
957
  * @param interval Unit of time
958
958
  */
@@ -963,7 +963,7 @@ export function IndicatorRateOfChange(operand, length = 30, interval = "Day") {
963
963
  return d;
964
964
  }
965
965
  /**
966
- * IndicatorSimpleMovingAverage indicator.
966
+ * Computes the Simple Moving Average of any other indicator over a window. TradingDay follows the input markets: crypto-only inputs use elapsed 24-hour days, including weekends, just like Day. Stock, option, mixed-market and asset-free expressions use confirmed exchange sessions. The window does not change intraday prices into daily closing prices. TradingMinute counts regular-session minutes the same way, so a 70 TradingMinute window at 9:45 reaches back to 3:06 PM on the prior session (the overnight gap is one step); crypto-only inputs use elapsed minutes. It allows at most 1439 minutes; use TradingDay for longer lookbacks. Indicators read every tick have no TradingMinute value outside regular hours, and windows over a ChartBar keep the value of its latest completed candle.
967
967
  * @param length Length of time
968
968
  * @param interval Unit of time
969
969
  */
@@ -974,7 +974,7 @@ export function IndicatorSimpleMovingAverage(operand, length = 30, interval = "D
974
974
  return d;
975
975
  }
976
976
  /**
977
- * IndicatorStandardDeviation indicator.
977
+ * Computes the standard deviation of any indicator over a window.
978
978
  * @param length Length of time
979
979
  * @param interval Unit of time
980
980
  */
@@ -1013,14 +1013,14 @@ export function IndustryNewsSentiment(industry, measure = "Mean", lookbackDays =
1013
1013
  return d;
1014
1014
  }
1015
1015
  /**
1016
- * InitialValue indicator.
1016
+ * The starting value of the portfolio when it was created or when the backtest began. Range: > 0.
1017
1017
  */
1018
1018
  export function InitialValue() {
1019
1019
  const d = { type: "InitialValue" };
1020
1020
  return d;
1021
1021
  }
1022
1022
  /**
1023
- * InsiderTrades indicator.
1023
+ * Disclosed purchases (code P, including open-market or private transactions), sales (code S), and a separate exact-owner AwardCount for code A issuer grants or other acquisitions over a trailing publication window. AcquisitionCount combines code P and code A as distinct acquisition signals for modeled follower strategies; awards are not reclassified as purchases or sales and do not prove vested common-share ownership. Exact-owner strategies use versioned common-share, call/put, and issuer-award evidence; exercises and warrants are excluded from tradable purchase signals. A signal becomes eligible when its filing is public, never on an earlier transaction date. Range: Dollars, shares, counts or budget percent; unknown owner/amendment coverage has no value.
1024
1024
  * @param asset Pass CANDIDATE in a dynamic rebalance pipeline.
1025
1025
  * @param ownerCik Exact nonzero SEC reporting owner CIK, up to 10 digits. Omit for a whole company (with issuerCik) or aggregate activity.
1026
1026
  * @param issuerCik Company CIK. With ownerCik, restricts that owner to this company. Alone, every reporting owner's events at this company, a joint filing counted once.
@@ -1041,7 +1041,7 @@ export function InsiderTrades(asset, metric, role, windowDays, ownerCik, issuerC
1041
1041
  return d;
1042
1042
  }
1043
1043
  /**
1044
- * InstitutionalHoldings indicator.
1044
+ * Institutional positions in the asset disclosed on SEC Form 13F. Naming a manager follows one institution; an empty manager reads every manager holding the asset (SDK code passes an empty string). Level metrics read the latest quarter whose filing became public on or before the evaluation date; change metrics compare it with the quarter before. Positions are never summed across quarters, and an amended filing replaces the original only from the moment the amendment became public. Range: Counts, shares, dollars or a top-5 share of holdings; 0 when no 13F naming the asset was public within the window.
1045
1045
  * @param asset Ticker name (ex. SPY, BTC)
1046
1046
  * @param manager Optional: a CIK such as 1067983, or part of a manager's name such as Renaissance Technologies. Leave empty for every manager. A CIK is exact; a name can match several firms
1047
1047
  * @param metric Managers holding, shares or value held, concentration, or the change since the previous quarter
@@ -1058,7 +1058,7 @@ export function InstitutionalHoldings(asset, manager, metric = "HolderCount", wi
1058
1058
  return d;
1059
1059
  }
1060
1060
  /**
1061
- * IsAsset indicator.
1061
+ * Returns 1 if the asset matches a specific symbol. Useful for including specific assets in multi-asset strategies.
1062
1062
  * @param matchAsset The specific asset to compare against (ex. UPRO, GLD)
1063
1063
  * @param asset Ticker name (ex. SPY, BTC)
1064
1064
  */
@@ -1069,7 +1069,7 @@ export function IsAsset(matchAsset, asset) {
1069
1069
  return d;
1070
1070
  }
1071
1071
  /**
1072
- * IsAssetType indicator.
1072
+ * Returns 1 if the asset matches Stock, Cryptocurrency, Option or Other, and 0 otherwise. ETFs are Stock assets; use separate stock metadata or a universe filter to select ETFs.
1073
1073
  * @param asset Ticker name (ex. SPY, BTC)
1074
1074
  * @param assetType The asset type to check against
1075
1075
  */
@@ -1080,7 +1080,7 @@ export function IsAssetType(asset, assetType = "Stock") {
1080
1080
  return d;
1081
1081
  }
1082
1082
  /**
1083
- * IsIndexMember indicator.
1083
+ * Returns 1 if the asset is a member of a specified index, 0 otherwise.
1084
1084
  * @param asset Ticker name (ex. SPY, BTC)
1085
1085
  * @param index The index to check membership against
1086
1086
  */
@@ -1091,7 +1091,7 @@ export function IsIndexMember(asset, index = "SP500") {
1091
1091
  return d;
1092
1092
  }
1093
1093
  /**
1094
- * IsIndustry indicator.
1094
+ * Returns 1 if the asset belongs to a specified industry, 0 otherwise. Over 100 categories supported including Artificial Intelligence, Semiconductor, Electric Vehicles, Space Exploration, Healthcare, Biotechnology, Cloud Computing, Cybersecurity, Renewable Energy, and many more.
1095
1095
  * @param asset Ticker name (ex. SPY, BTC)
1096
1096
  * @param industry The industry to check membership against
1097
1097
  */
@@ -1102,7 +1102,7 @@ export function IsIndustry(asset, industry) {
1102
1102
  return d;
1103
1103
  }
1104
1104
  /**
1105
- * IsNotAsset indicator.
1105
+ * Returns 1 if the asset does NOT match a specific symbol. Useful for excluding specific assets.
1106
1106
  * @param matchAsset The specific asset to compare against (ex. UPRO, GLD)
1107
1107
  * @param asset Ticker name (ex. SPY, BTC)
1108
1108
  */
@@ -1113,7 +1113,7 @@ export function IsNotAsset(matchAsset, asset) {
1113
1113
  return d;
1114
1114
  }
1115
1115
  /**
1116
- * IVHVRatio indicator.
1116
+ * Constant-maturity ATM implied volatility divided by annualized close-to-close realized volatility (HV) over hvWindow trading days. Values > 1 mean options are pricing more vol than recently realized. Used on each candidate of a dynamic rebalance over a broad universe (all US stocks, an index or a watchlist), it reads options chains with Greeks for every stock in that universe instead of one underlying, so the run is heavier than with a named ticker or a specific asset list. Range: > 0.
1117
1117
  * @param asset Ticker name (ex. SPY, BTC)
1118
1118
  * @param hvWindow Trading days of log-return history for realized volatility
1119
1119
  */
@@ -1124,7 +1124,7 @@ export function IVHVRatio(asset, hvWindow = 20) {
1124
1124
  return d;
1125
1125
  }
1126
1126
  /**
1127
- * IVPercentile indicator.
1127
+ * Percent of sessions in the lookback window whose constant-maturity ATM IV was strictly below today's (0–100). Distinct from IV Rank. Used on each candidate of a dynamic rebalance over a broad universe (all US stocks, an index or a watchlist), it reads options chains with Greeks for every stock in that universe instead of one underlying, so the run is heavier than with a named ticker or a specific asset list. Range: 0–100.
1128
1128
  * @param asset Ticker name (ex. SPY, BTC)
1129
1129
  * @param length Length of time
1130
1130
  * @param interval Unit of time
@@ -1136,7 +1136,7 @@ export function IVPercentile(asset, length = 252, interval = "Day") {
1136
1136
  return d;
1137
1137
  }
1138
1138
  /**
1139
- * IVRank indicator.
1139
+ * Where today's constant-maturity ATM IV sits between the lookback window's high and low: (IV − IV_low) / (IV_high − IV_low) × 100. Distinct from IV Percentile. Used on each candidate of a dynamic rebalance over a broad universe (all US stocks, an index or a watchlist), it reads options chains with Greeks for every stock in that universe instead of one underlying, so the run is heavier than with a named ticker or a specific asset list. Range: 0–100.
1140
1140
  * @param asset Ticker name (ex. SPY, BTC)
1141
1141
  * @param length Length of time
1142
1142
  * @param interval Unit of time
@@ -1148,7 +1148,7 @@ export function IVRank(asset, length = 252, interval = "Day") {
1148
1148
  return d;
1149
1149
  }
1150
1150
  /**
1151
- * KeltnerChannel indicator.
1151
+ * EMA midline with ATR bands above and below. Tighter than Bollinger in calm tape, so closes outside the bands mean stronger conviction moves. Range: Price scale.
1152
1152
  * @param asset Ticker name (ex. SPY, BTC)
1153
1153
  * @param length Length of time
1154
1154
  * @param interval Unit of time
@@ -1173,7 +1173,7 @@ export function LastDividend(asset) {
1173
1173
  return d;
1174
1174
  }
1175
1175
  /**
1176
- * LastOrderPrice indicator.
1176
+ * The execution price of the most recent order matching the specified filters. Range: > 0.
1177
1177
  * @param asset Ticker name (ex. SPY, BTC)
1178
1178
  * @param side Matches order events with this side (buy or sell)
1179
1179
  * @param orderStatus Matches order events with this status
@@ -1186,7 +1186,7 @@ export function LastOrderPrice(asset, side, orderStatus = "Filled") {
1186
1186
  return d;
1187
1187
  }
1188
1188
  /**
1189
- * Log indicator.
1189
+ * Logarithm of an indicator with a specified base.
1190
1190
  * @param base The base for the logarithm
1191
1191
  */
1192
1192
  export function Log(operand, base = 10) {
@@ -1196,7 +1196,7 @@ export function Log(operand, base = 10) {
1196
1196
  return d;
1197
1197
  }
1198
1198
  /**
1199
- * LowOfDay indicator.
1199
+ * The lowest price reached during the current trading session. Range: > 0.
1200
1200
  * @param asset Ticker name (ex. SPY, BTC)
1201
1201
  */
1202
1202
  export function LowOfDay(asset) {
@@ -1205,7 +1205,7 @@ export function LowOfDay(asset) {
1205
1205
  return d;
1206
1206
  }
1207
1207
  /**
1208
- * Max indicator.
1208
+ * The maximum value of two or more indicators. The SDK builder takes exactly two operands; nest it to compare more.
1209
1209
  */
1210
1210
  export function Max(left, right) {
1211
1211
  const d = { type: "Max" };
@@ -1213,7 +1213,7 @@ export function Max(left, right) {
1213
1213
  return d;
1214
1214
  }
1215
1215
  /**
1216
- * MaxDrawdown indicator.
1216
+ * The largest peak-to-trough percentage decline of the asset's price inside the window, reported as a positive number: 10 means a 10% fall from a high to a later low, and 0 means the price never fell below an earlier price in the window. Measures worst-case downside risk. Range: 0 to 100 (percent, never negative).
1217
1217
  * @param asset Ticker name (ex. SPY, BTC)
1218
1218
  * @param length Length of time
1219
1219
  * @param interval Unit of time
@@ -1225,7 +1225,7 @@ export function MaxDrawdown(asset, length = 30, interval = "Day") {
1225
1225
  return d;
1226
1226
  }
1227
1227
  /**
1228
- * MaxDrawup indicator.
1228
+ * The maximum trough-to-peak percentage increase over a window. Range: >= 0 (percentage).
1229
1229
  * @param asset Ticker name (ex. SPY, BTC)
1230
1230
  * @param length Length of time
1231
1231
  * @param interval Unit of time
@@ -1237,7 +1237,7 @@ export function MaxDrawup(asset, length = 30, interval = "Day") {
1237
1237
  return d;
1238
1238
  }
1239
1239
  /**
1240
- * MaximumPrice indicator.
1240
+ * The highest of the asset's observed prices over a window, including the current one. Each observation is the price at that time (a completed day contributes its close, a completed minute its closing price), not an intrabar high. Range: > 0.
1241
1241
  * @param asset Ticker name (ex. SPY, BTC)
1242
1242
  * @param length Length of time
1243
1243
  * @param interval Unit of time
@@ -1249,7 +1249,7 @@ export function MaximumPrice(asset, length = 30, interval = "Day") {
1249
1249
  return d;
1250
1250
  }
1251
1251
  /**
1252
- * Min indicator.
1252
+ * The minimum value of two or more indicators. The SDK builder takes exactly two operands; nest it to compare more.
1253
1253
  */
1254
1254
  export function Min(left, right) {
1255
1255
  const d = { type: "Min" };
@@ -1257,7 +1257,7 @@ export function Min(left, right) {
1257
1257
  return d;
1258
1258
  }
1259
1259
  /**
1260
- * MinimumPrice indicator.
1260
+ * The lowest of the asset's observed prices over a window, including the current one. Each observation is the price at that time (a completed day contributes its close, a completed minute its closing price), not an intrabar low. Range: > 0.
1261
1261
  * @param asset Ticker name (ex. SPY, BTC)
1262
1262
  * @param length Length of time
1263
1263
  * @param interval Unit of time
@@ -1269,7 +1269,7 @@ export function MinimumPrice(asset, length = 30, interval = "Day") {
1269
1269
  return d;
1270
1270
  }
1271
1271
  /**
1272
- * Minus indicator.
1272
+ * Difference between indicators.
1273
1273
  */
1274
1274
  export function Minus(left, right) {
1275
1275
  const d = { type: "Minus" };
@@ -1277,7 +1277,7 @@ export function Minus(left, right) {
1277
1277
  return d;
1278
1278
  }
1279
1279
  /**
1280
- * MinuteBarHigh indicator.
1280
+ * The high of the most recently COMPLETED one-minute bar. The bar that opens at 9:30 is readable from 9:31, identically in backtests and live trading; the forming bar is never used. Not the day's high (use High of Day). Pre-market and after-hours bars count. Strategies using it run on one-minute data. Range: > 0.
1281
1281
  * @param asset Ticker name (ex. SPY, BTC)
1282
1282
  */
1283
1283
  export function MinuteBarHigh(asset) {
@@ -1286,7 +1286,7 @@ export function MinuteBarHigh(asset) {
1286
1286
  return d;
1287
1287
  }
1288
1288
  /**
1289
- * MinuteBarLow indicator.
1289
+ * The low of the most recently COMPLETED one-minute bar. The bar that opens at 9:30 is readable from 9:31, identically in backtests and live trading; the forming bar is never used. Not the day's low (use Low of Day). Pre-market and after-hours bars count. Strategies using it run on one-minute data. Range: > 0.
1290
1290
  * @param asset Ticker name (ex. SPY, BTC)
1291
1291
  */
1292
1292
  export function MinuteBarLow(asset) {
@@ -1295,21 +1295,21 @@ export function MinuteBarLow(asset) {
1295
1295
  return d;
1296
1296
  }
1297
1297
  /**
1298
- * MinutesAfterOpen indicator.
1298
+ * Whole minutes since the regular US market open (9:30 AM ET), read from the Eastern clock. The value is not clamped to the session: it is negative before the open and keeps rising above 390 after the 4:00 PM close. Range: 0 to 390 during a regular session; negative before 9:30 AM ET and above 390 after the close.
1299
1299
  */
1300
1300
  export function MinutesAfterOpen() {
1301
1301
  const d = { type: "MinutesAfterOpen" };
1302
1302
  return d;
1303
1303
  }
1304
1304
  /**
1305
- * MinutesSinceAgent indicator.
1305
+ * The number of minutes since an AI agent was launched by this strategy. Useful for fine-grained rate-limiting of agent launches within a single day. Range: >= 0.
1306
1306
  */
1307
1307
  export function MinutesSinceAgent() {
1308
1308
  const d = { type: "MinutesSinceAgent" };
1309
1309
  return d;
1310
1310
  }
1311
1311
  /**
1312
- * MinutesSinceAlert indicator.
1312
+ * The number of minutes since an alert was triggered. Useful for fine-grained rate-limiting of alerts within a single day. Range: >= 0.
1313
1313
  * @param message (Optional) Message to display when the indicator is triggered
1314
1314
  */
1315
1315
  export function MinutesSinceAlert(message) {
@@ -1318,7 +1318,7 @@ export function MinutesSinceAlert(message) {
1318
1318
  return d;
1319
1319
  }
1320
1320
  /**
1321
- * MinutesSinceOptionOrder indicator.
1321
+ * The number of minutes since the most recent option order matching the specified filters. Same filters as Days Since Option Order but measured in minutes for intraday strategies. Range: >= 0 (minutes), or a large number if no matching order exists.
1322
1322
  * @param underlying Filter by underlying (e.g., AAPL, SPY). Leave empty for all.
1323
1323
  * @param optionType Filter by Call or Put. Leave empty for all.
1324
1324
  * @param direction Filter by Long or Short. Leave empty for all.
@@ -1341,7 +1341,7 @@ export function MinutesSinceOptionOrder(underlying, optionType, direction, sprea
1341
1341
  return d;
1342
1342
  }
1343
1343
  /**
1344
- * MinutesSinceOrder indicator.
1344
+ * Same as Days Since Order but measured in minutes. Useful for intraday strategies. Range: >= 0 (minutes).
1345
1345
  * @param assets Ticker(s) whose orders are counted. One string or an array.
1346
1346
  * @param side Buy or Sell
1347
1347
  * @param clock Optional elapsed-time clock; omitted retains calendar minutes.
@@ -1356,14 +1356,14 @@ export function MinutesSinceOrder(assets, side, orderStatus = "Filled", clock) {
1356
1356
  return d;
1357
1357
  }
1358
1358
  /**
1359
- * MinutesUntilClose indicator.
1359
+ * Whole minutes until the US equity session close, read from the Eastern clock. The close is that day's real session close, so an early-close day counts down to 1:00 PM ET instead of 4:00 PM. The value is not clamped to the session: it is negative after the close and above 390 before the 9:30 AM open. Range: 0 to 390 during a regular session (0 to 210 on a 1:00 PM early close); negative after the close and above 390 before the open.
1360
1360
  */
1361
1361
  export function MinutesUntilClose() {
1362
1362
  const d = { type: "MinutesUntilClose" };
1363
1363
  return d;
1364
1364
  }
1365
1365
  /**
1366
- * MoneyFlowIndex indicator.
1366
+ * Volume-weighted RSI: money flow direction over N bars on a 0-100 scale. Above 80 is overbought, below 20 oversold. Requires volume data. Range: 0 to 100.
1367
1367
  * @param asset Ticker name (ex. SPY, BTC)
1368
1368
  * @param length Length of time
1369
1369
  * @param interval Unit of time
@@ -1375,14 +1375,14 @@ export function MoneyFlowIndex(asset, length = 14, interval = "Day") {
1375
1375
  return d;
1376
1376
  }
1377
1377
  /**
1378
- * Month indicator.
1378
+ * The current month (1–12).
1379
1379
  */
1380
1380
  export function Month() {
1381
1381
  const d = { type: "Month" };
1382
1382
  return d;
1383
1383
  }
1384
1384
  /**
1385
- * MovingAverageConvergenceDivergence indicator.
1385
+ * MACD line (fast EMA minus slow EMA), its signal EMA, or the histogram (MACD minus signal). Classic trend/momentum indicator. Range: Positive or negative for all three lines, in price units: each is a difference of moving averages, not a price level.
1386
1386
  * @param asset Ticker name (ex. SPY, BTC)
1387
1387
  * @param fastLength Period of the fast EMA
1388
1388
  * @param slowLength Period of the slow EMA (must exceed the fast length)
@@ -1401,7 +1401,7 @@ export function MovingAverageConvergenceDivergence(asset, fastLength = 12, slowL
1401
1401
  return d;
1402
1402
  }
1403
1403
  /**
1404
- * Multiply indicator.
1404
+ * Product of indicators.
1405
1405
  */
1406
1406
  export function Multiply(left, right) {
1407
1407
  const d = { type: "Multiply" };
@@ -1409,7 +1409,7 @@ export function Multiply(left, right) {
1409
1409
  return d;
1410
1410
  }
1411
1411
  /**
1412
- * Negative indicator.
1412
+ * Negates an indicator's value.
1413
1413
  */
1414
1414
  export function Negative(operand) {
1415
1415
  const d = { type: "Negative" };
@@ -1417,7 +1417,7 @@ export function Negative(operand) {
1417
1417
  return d;
1418
1418
  }
1419
1419
  /**
1420
- * NewInsiderDisclosure indicator.
1420
+ * True when a newly public Form 4 version matches the selected owner, issuer, role, instrument and action and awaits a strategy decision. Exact-owner corrections count as new versions. A company CIK without an owner watches every reporting owner at that company, and a joint filing fires once. A handled event does not fire again on later price ticks; unverified owner coverage has no value, and a company is only as covered as its least-covered matching owner. Range: 1 while a public Form 4 version awaits a decision; otherwise 0.
1421
1421
  * @param ownerCik Exact SEC reporting owner CIK. Omit for a whole company (with issuerCik) or aggregate Form 4 activity.
1422
1422
  * @param issuerCik Company CIK. With ownerCik, restricts that owner; alone, every reporting owner at this company, a joint filing once.
1423
1423
  * @param role The reporting owner's role.
@@ -1436,7 +1436,7 @@ export function NewInsiderDisclosure(ownerCik, issuerCik, role = "Any", instrume
1436
1436
  return d;
1437
1437
  }
1438
1438
  /**
1439
- * NewInstitutionalFiling indicator.
1439
+ * True when an exact manager CIK has a newly public 13F filing or amendment this strategy has not handled. Each accession creates one decision; later price ticks do not repeat it. The current InstitutionalHoldings book still sets target positions. Range: 1 while a public filing awaits a decision; otherwise 0.
1440
1440
  * @param manager Exact numeric SEC manager CIK. A new 13F accession, including an amendment, triggers one decision.
1441
1441
  */
1442
1442
  export function NewInstitutionalFiling(manager) {
@@ -1445,7 +1445,7 @@ export function NewInstitutionalFiling(manager) {
1445
1445
  return d;
1446
1446
  }
1447
1447
  /**
1448
- * NewPoliticalDisclosure indicator.
1448
+ * True when a selected member has a newly public equity or option trade disclosure that this strategy has not handled. Corrections count when they become public. A handled disclosure does not fire again on later price ticks. Range: 1 while a new disclosure awaits a decision; otherwise 0.
1449
1449
  * @param memberId Exact Bioguide member ID, such as P000197.
1450
1450
  * @param instrument Equity or option disclosures, never both for a public bot arm.
1451
1451
  * @param disclosureAction Which newly public trade sides trigger a decision.
@@ -1471,14 +1471,14 @@ export function NewsSentiment(asset, measure = "Mean", lookbackDays = 1) {
1471
1471
  return d;
1472
1472
  }
1473
1473
  /**
1474
- * NewTradingWeek indicator.
1474
+ * True on the first evaluated trading tick of an ISO week until the strategy makes a decision. A no-order decision still consumes that week, and live portfolios persist the decision through a restart. Use with an option disclosure trigger for modeled maintenance. Range: 1 while this week's first decision is pending; otherwise 0.
1475
1475
  */
1476
1476
  export function NewTradingWeek() {
1477
1477
  const d = { type: "NewTradingWeek" };
1478
1478
  return d;
1479
1479
  }
1480
1480
  /**
1481
- * OnBalanceVolume indicator.
1481
+ * Running total of signed volume: adds the bar's volume on up closes, subtracts on down closes. Rising OBV with flat price is accumulation. Range: Unbounded (cumulative).
1482
1482
  * @param asset Ticker name (ex. SPY, BTC)
1483
1483
  * @param interval Bar interval the volume is accumulated on
1484
1484
  */
@@ -1489,7 +1489,7 @@ export function OnBalanceVolume(asset, interval = "Day") {
1489
1489
  return d;
1490
1490
  }
1491
1491
  /**
1492
- * OpeningPrice indicator.
1492
+ * The price of an asset at market open. Range: > 0.
1493
1493
  * @param asset Ticker name (ex. SPY, BTC)
1494
1494
  */
1495
1495
  export function OpeningPrice(asset) {
@@ -1498,7 +1498,7 @@ export function OpeningPrice(asset) {
1498
1498
  return d;
1499
1499
  }
1500
1500
  /**
1501
- * OptionCollateral indicator.
1501
+ * Returns the total collateral locked across option spreads matching the filter. Range: 0 to ∞ (dollars).
1502
1502
  * @param underlying Filter by underlying (e.g., AAPL, SPY). Leave empty for all.
1503
1503
  * @param optionType Filter by Call or Put. Leave empty for all.
1504
1504
  * @param direction Filter by Long or Short. Leave empty for all.
@@ -1513,7 +1513,7 @@ export function OptionCollateral(underlying, optionType, direction, spreadType)
1513
1513
  return d;
1514
1514
  }
1515
1515
  /**
1516
- * OptionDaysHeld indicator.
1516
+ * Returns the minimum or maximum days since entry across option spreads matching the filter. Range: 0 to ∞.
1517
1517
  * @param underlying Filter by underlying (e.g., AAPL, SPY). Leave empty for all.
1518
1518
  * @param optionType Filter by Call or Put. Leave empty for all.
1519
1519
  * @param direction Filter by Long or Short. Leave empty for all.
@@ -1530,7 +1530,7 @@ export function OptionDaysHeld(underlying, optionType, direction, spreadType, mi
1530
1530
  return d;
1531
1531
  }
1532
1532
  /**
1533
- * OptionDaysToExpiration indicator.
1533
+ * Returns the minimum or maximum days to expiration across option spreads matching the filter. Range: 0 to 365+.
1534
1534
  * @param underlying Filter by underlying (e.g., AAPL, SPY). Leave empty for all.
1535
1535
  * @param optionType Filter by Call or Put. Leave empty for all.
1536
1536
  * @param direction Filter by Long or Short. Leave empty for all.
@@ -1547,14 +1547,14 @@ export function OptionDaysToExpiration(underlying, optionType, direction, spread
1547
1547
  return d;
1548
1548
  }
1549
1549
  /**
1550
- * OptionGrossExposurePercent indicator.
1550
+ * Sum of absolute option leg marks divided by portfolio value (percent). Matches gross deployment audits. Unfiltered portfolio-wide only. Range: 0% to ∞.
1551
1551
  */
1552
1552
  export function OptionGrossExposurePercent() {
1553
1553
  const d = { type: "OptionGrossExposurePercent" };
1554
1554
  return d;
1555
1555
  }
1556
1556
  /**
1557
- * OptionPositionCount indicator.
1557
+ * Returns the number of open option contract positions/legs matching the filter criteria. Portfolio-wide (no underlying, option type, direction, or spread filters): open legs plus legs reserved by earlier true OpenOption signals in the same tick's strategy loop. Filtered counts (e.g. per ticker) use open legs only. Use Option Spread Count for multi-leg spread groups. Range: 0 to ∞.
1558
1558
  * @param underlying Filter by underlying (e.g., AAPL, SPY). Leave empty for all.
1559
1559
  * @param optionType Filter by Call or Put. Leave empty for all.
1560
1560
  * @param direction Filter by Long or Short. Leave empty for all.
@@ -1569,7 +1569,7 @@ export function OptionPositionCount(underlying, optionType, direction, spreadTyp
1569
1569
  return d;
1570
1570
  }
1571
1571
  /**
1572
- * OptionPositionMaxDrawdown indicator.
1572
+ * Peak-to-current drawdown of the aggregated P&L percentage across option spreads matching the filter. Stateful counterpart of the Option Position P&L% indicator (OptionPositionPercentChange): while that indicator returns the current P&L percentage, this one tracks the highest value observed and returns how far the position has fallen from that peak. Resets when no matching spreads remain so a fresh entry starts from a clean peak. Range: >= 0 (percentage points of P&L).
1573
1573
  * @param underlying Filter by underlying (e.g., AAPL, SPY). Leave empty for all.
1574
1574
  * @param optionType Filter by Call or Put. Leave empty for all.
1575
1575
  * @param direction Filter by Long or Short. Leave empty for all.
@@ -1584,7 +1584,7 @@ export function OptionPositionMaxDrawdown(underlying, optionType, direction, spr
1584
1584
  return d;
1585
1585
  }
1586
1586
  /**
1587
- * OptionPositionPercentChange indicator.
1587
+ * Returns the weighted average P&L percentage across option spreads matching the filter. Range: -100% to ∞.
1588
1588
  * @param underlying Filter by underlying (e.g., AAPL, SPY). Leave empty for all.
1589
1589
  * @param optionType Filter by Call or Put. Leave empty for all.
1590
1590
  * @param direction Filter by Long or Short. Leave empty for all.
@@ -1599,7 +1599,7 @@ export function OptionPositionPercentChange(underlying, optionType, direction, s
1599
1599
  return d;
1600
1600
  }
1601
1601
  /**
1602
- * OptionPositionValue indicator.
1602
+ * Returns the total market value of option spreads matching the filter criteria. Range: 0 to ∞ (dollars).
1603
1603
  * @param underlying Filter by underlying (e.g., AAPL, SPY). Leave empty for all.
1604
1604
  * @param optionType Filter by Call or Put. Leave empty for all.
1605
1605
  * @param direction Filter by Long or Short. Leave empty for all.
@@ -1614,7 +1614,7 @@ export function OptionPositionValue(underlying, optionType, direction, spreadTyp
1614
1614
  return d;
1615
1615
  }
1616
1616
  /**
1617
- * OptionRealizedPnL indicator.
1617
+ * Returns the net realized P&L in dollars from CLOSED option positions matching the filter, long and short alike. Losing closes count as negative. Measures closes only and subtracts nothing for premium already spent. Lookback Days limits it to closes within that many days of the evaluation date; omit it for the whole life of the book. Range: -∞ to ∞ (dollars).
1618
1618
  * @param underlying Filter by underlying (e.g., AAPL, SPY). Leave empty for all.
1619
1619
  * @param optionType Filter by Call or Put. Leave empty for all.
1620
1620
  * @param direction Filter by Long or Short. Leave empty for all.
@@ -1632,7 +1632,7 @@ export function OptionRealizedPnL(underlying, optionType, direction, spreadType,
1632
1632
  return d;
1633
1633
  }
1634
1634
  /**
1635
- * OptionRealizedPremium indicator.
1635
+ * Returns realized option premium still available to spend: net realized P&L from closed short option positions, minus premium already spent by opens sized with Percent of Realized Premium. Proceeds from closing long options are not added back. This is the balance that allocation sizes against. It goes negative when closed shorts lost money, and a negative balance funds nothing. Lookback Days limits it to activity within that many days of the evaluation date; omit it for the whole life of the book. Range: -∞ to ∞ (dollars).
1636
1636
  * @param underlying Filter by underlying (e.g., AAPL, SPY). Leave empty for all.
1637
1637
  * @param lookbackDays Only count activity within this many days of the evaluation date. Leave empty for the whole life of the book.
1638
1638
  */
@@ -1644,7 +1644,7 @@ export function OptionRealizedPremium(underlying, lookbackDays) {
1644
1644
  return d;
1645
1645
  }
1646
1646
  /**
1647
- * OptionSpreadCount indicator.
1647
+ * Returns the number of distinct economic open multi-leg option spreads matching the filter criteria, deduplicating equal economic spread keys. Does not count standalone single-leg option positions. Range: 0 to ∞.
1648
1648
  * @param underlying Filter by underlying (e.g., AAPL, SPY). Leave empty for all.
1649
1649
  * @param optionType Filter by Call or Put. Leave empty for all.
1650
1650
  * @param direction Filter by Long or Short. Leave empty for all.
@@ -1659,7 +1659,7 @@ export function OptionSpreadCount(underlying, optionType, direction, spreadType)
1659
1659
  return d;
1660
1660
  }
1661
1661
  /**
1662
- * OptionSpreadEntryPrice indicator.
1662
+ * Returns the net price per share paid or collected to open the option spreads matching the filter: positive for a net debit, negative for a net credit. Several matching spreads average by contracts. Has no value when no matching spread is open. Use it as an option limit amount to price one spread off another spread's fill; wrap a credit spread's price in Absolute Value first, because a limit must be positive. Range: -∞ to ∞ (dollars per share).
1663
1663
  * @param underlying Filter by underlying (e.g., AAPL, SPY). Leave empty for all.
1664
1664
  * @param optionType Filter by Call or Put. Leave empty for all.
1665
1665
  * @param direction Filter by Long or Short. Leave empty for all.
@@ -1674,7 +1674,7 @@ export function OptionSpreadEntryPrice(underlying, optionType, direction, spread
1674
1674
  return d;
1675
1675
  }
1676
1676
  /**
1677
- * OptionUnrealizedPnL indicator.
1677
+ * Returns the total unrealized P&L in dollars across option spreads matching the filter. Range: -∞ to ∞ (dollars).
1678
1678
  * @param underlying Filter by underlying (e.g., AAPL, SPY). Leave empty for all.
1679
1679
  * @param optionType Filter by Call or Put. Leave empty for all.
1680
1680
  * @param direction Filter by Long or Short. Leave empty for all.
@@ -1689,7 +1689,7 @@ export function OptionUnrealizedPnL(underlying, optionType, direction, spreadTyp
1689
1689
  return d;
1690
1690
  }
1691
1691
  /**
1692
- * ParabolicSar indicator.
1692
+ * Trailing stop-and-reverse level that accelerates toward price as the trend extends. Price crossing the SAR flips the trend. Range: Price scale.
1693
1693
  * @param asset Ticker name (ex. SPY, BTC)
1694
1694
  * @param interval Bar interval the SAR trails on
1695
1695
  * @param step AF increment per new extreme
@@ -1704,7 +1704,7 @@ export function ParabolicSar(asset, interval = "Day", step = 0.02, maximum = 0.2
1704
1704
  return d;
1705
1705
  }
1706
1706
  /**
1707
- * Plus indicator.
1707
+ * Sum of two or more indicators. The SDK builder takes exactly two operands; nest it to add more.
1708
1708
  */
1709
1709
  export function Plus(left, right) {
1710
1710
  const d = { type: "Plus" };
@@ -1712,7 +1712,7 @@ export function Plus(left, right) {
1712
1712
  return d;
1713
1713
  }
1714
1714
  /**
1715
- * PoliticalPurchaseShare indicator.
1715
+ * A member's publicly known equity or option purchase dollars divided by the sum of both, across all disclosed tickers. Event versions enter only when public. Unclassified instruments are excluded. purchaseScope defaults to AllPurchases for historical flow. RemainingLots sums surviving original purchase costs after reported full sales and exercises, excluding unresolved ticker buckets. Unknown partial quantities retain their estimate. Neither setting is current market value or verified holdings. Range: 0 to 100 percent; zero before a qualifying purchase.
1716
1716
  * @param memberId Bioguide member id, for example P000197. The share uses the member's whole public purchase record.
1717
1717
  * @param instrument Which side of the equity/option purchase mix to return, as a percent from 0 to 100.
1718
1718
  * @param amountBasis Estimate for disclosed purchase ranges. Midpoint is the default.
@@ -1727,7 +1727,7 @@ export function PoliticalPurchaseShare(memberId, instrument = "Equity", amountBa
1727
1727
  return d;
1728
1728
  }
1729
1729
  /**
1730
- * PoliticalTrades indicator.
1730
+ * Trades by members of Congress in the asset, from the unified House and Senate disclosure lake, over a trailing window. A trade counts from the moment its report became public, never its trade date, and an amended report changes a value only from the moment the amendment became public. Amount metrics can use the lower, midpoint, or upper end of every disclosed range. Equity disclosures are the default; confirmed option disclosures can be selected separately for numeric activity. Held requires Equity and reads the member's whole public record instead: 1 while their latest equity disclosure for the asset is a purchase or partial sale, 0 after a full sale. Held is a disclosure signal, not verified holdings or share quantity. RemainingBuyAmount reads the full public history and sums original purchase ranges of remaining lots after full sales and exercises. Unknown partial quantities retain their purchase amount estimate; sale proceeds are never subtracted. This is estimated remaining cost, not current market value. Printed expirations identify lots but do not implicitly end modeled renewal exposure. Range: Disclosed amount-range values or counts over the window, or 1/0 for Held; 0 when no matching trade was disclosed.
1731
1731
  * @param asset Pass CANDIDATE inside a rebalance pipeline to bind each stock.
1732
1732
  * @param filer Member full or last name. Pass an empty string for all members.
1733
1733
  * @param metric Amount-range aggregate, event count, distinct purchasing members, RemainingBuyAmount (surviving original purchase amounts; ignores window; unknown partial quantities retained), or Held: 1 while the member still holds the asset (latest public disclosure is a purchase or partial sale), ignoring the window.
@@ -1750,7 +1750,7 @@ export function PoliticalTrades(asset, filer, metric = "BuyAmount", windowDays =
1750
1750
  return d;
1751
1751
  }
1752
1752
  /**
1753
- * PortfolioValue indicator.
1753
+ * The total current value of your portfolio (cash + all positions). Range: >= 0.
1754
1754
  */
1755
1755
  export function PortfolioValue() {
1756
1756
  const d = { type: "PortfolioValue" };
@@ -1766,7 +1766,7 @@ export function PositionEntryPrice(asset) {
1766
1766
  return d;
1767
1767
  }
1768
1768
  /**
1769
- * PositionMaxDrawdown indicator.
1769
+ * The maximum percentage decline in the position's unrealized P&L from its peak. Aggregates the stock or crypto holding plus all option spreads on that underlying. Returns 0 at a new high water mark; rises as P&L falls below the peak, so it is never negative. Range: >= 0 (percentage points of P&L).
1770
1770
  * @param asset Ticker name (ex. SPY, BTC)
1771
1771
  */
1772
1772
  export function PositionMaxDrawdown(asset) {
@@ -1775,7 +1775,7 @@ export function PositionMaxDrawdown(asset) {
1775
1775
  return d;
1776
1776
  }
1777
1777
  /**
1778
- * PositionMaxDrawup indicator.
1778
+ * The percentage increase of the asset's current market price from the lowest price observed by this indicator. Share purchases and sales do not change the calculation; it does not use position cost basis. Range: >= 0 (percentage).
1779
1779
  * @param asset Ticker name (ex. SPY, BTC)
1780
1780
  */
1781
1781
  export function PositionMaxDrawup(asset) {
@@ -1802,7 +1802,7 @@ export function PositionPeakPrice(asset) {
1802
1802
  return d;
1803
1803
  }
1804
1804
  /**
1805
- * PositionPercentChange indicator.
1805
+ * How much your position has gained or lost as a percentage since you opened it. Range: Unbounded (percentage).
1806
1806
  * @param assets Ticker name (ex. SPY, BTC)
1807
1807
  */
1808
1808
  export function PositionPercentChange(assets) {
@@ -1811,7 +1811,7 @@ export function PositionPercentChange(assets) {
1811
1811
  return d;
1812
1812
  }
1813
1813
  /**
1814
- * PositionValue indicator.
1814
+ * The current dollar value of your position in one or more assets. Range: >= 0.
1815
1815
  * @param assets Ticker name (ex. SPY, BTC)
1816
1816
  */
1817
1817
  export function PositionValue(assets) {
@@ -1820,7 +1820,7 @@ export function PositionValue(assets) {
1820
1820
  return d;
1821
1821
  }
1822
1822
  /**
1823
- * PreviousClosingPrice indicator.
1823
+ * The closing price from the previous trading session. It already has a one-session offset; wrapping it in Indicator Window Ago adds another lag rather than selecting that same previous close. Range: > 0.
1824
1824
  * @param asset Ticker name (ex. SPY, BTC)
1825
1825
  */
1826
1826
  export function PreviousClosingPrice(asset) {
@@ -1829,7 +1829,7 @@ export function PreviousClosingPrice(asset) {
1829
1829
  return d;
1830
1830
  }
1831
1831
  /**
1832
- * Price indicator.
1832
+ * The current market price of any asset. Range: > 0.
1833
1833
  * @param asset Ticker name (ex. SPY, BTC)
1834
1834
  */
1835
1835
  export function Price(asset) {
@@ -1838,7 +1838,7 @@ export function Price(asset) {
1838
1838
  return d;
1839
1839
  }
1840
1840
  /**
1841
- * PriceChangeSinceOpen indicator.
1841
+ * The dollar change in price since market open. Range: Unbounded.
1842
1842
  * @param asset Ticker name (ex. SPY, BTC)
1843
1843
  */
1844
1844
  export function PriceChangeSinceOpen(asset) {
@@ -1847,7 +1847,7 @@ export function PriceChangeSinceOpen(asset) {
1847
1847
  return d;
1848
1848
  }
1849
1849
  /**
1850
- * PriceMeanAbsoluteDeviation indicator.
1850
+ * The mean absolute deviation of an asset's price over a window. Similar to standard deviation but less sensitive to outliers. Range: >= 0.
1851
1851
  * @param asset Ticker name (ex. SPY, BTC)
1852
1852
  * @param length Length of time
1853
1853
  * @param interval Unit of time
@@ -1859,7 +1859,7 @@ export function PriceMeanAbsoluteDeviation(asset, length = 30, interval = "Day")
1859
1859
  return d;
1860
1860
  }
1861
1861
  /**
1862
- * PriceRateOfChange indicator.
1862
+ * Measures the percentage change in price between the current price and the price N periods ago. Range: Unbounded (percentage).
1863
1863
  * @param asset Ticker name (ex. SPY, BTC)
1864
1864
  * @param length Length of time
1865
1865
  * @param interval Unit of time
@@ -1871,7 +1871,7 @@ export function PriceRateOfChange(asset, length = 30, interval = "Day") {
1871
1871
  return d;
1872
1872
  }
1873
1873
  /**
1874
- * PriceStandardDeviation indicator.
1874
+ * The standard deviation of an asset's closing price over a window. Measures price volatility. Range: >= 0.
1875
1875
  * @param asset Ticker name (ex. SPY, BTC)
1876
1876
  * @param length Length of time
1877
1877
  * @param interval Unit of time
@@ -1884,7 +1884,7 @@ export function PriceStandardDeviation(asset, length = 30, interval = "Day") {
1884
1884
  }
1885
1885
  export const PriceStdDev = PriceStandardDeviation;
1886
1886
  /**
1887
- * RebalanceDecisionMetric indicator.
1887
+ * Exposes the allocation plan that a DynamicRebalance or RebalanceOption action is about to execute, so the strategy condition can decide whether that plan is worthwhile. Range: Drift and turnover are portfolio fractions; cost and benefit metrics are dollar amounts.
1888
1888
  * @param metric Reads the prospective plan calculated by DynamicRebalance or RebalanceOption before the strategy condition runs.
1889
1889
  */
1890
1890
  export function RebalanceDecisionMetric(metric = "netBenefit") {
@@ -1893,7 +1893,7 @@ export function RebalanceDecisionMetric(metric = "netBenefit") {
1893
1893
  return d;
1894
1894
  }
1895
1895
  /**
1896
- * RelativeStrengthIndex indicator.
1896
+ * Measures the speed and magnitude of recent price changes. Oscillates between 0 and 100. Range: 0 to 100.
1897
1897
  * @param asset Ticker name (ex. SPY, BTC)
1898
1898
  * @param length Length of time
1899
1899
  * @param interval Unit of time
@@ -1906,7 +1906,7 @@ export function RelativeStrengthIndex(asset, length = 30, interval = "Day") {
1906
1906
  }
1907
1907
  export const RSI = RelativeStrengthIndex;
1908
1908
  /**
1909
- * RelativeVolume indicator.
1909
+ * Current bar volume divided by the average volume of the trailing N completed bars. 1.0 means the bar is trading exactly its recent pace. Range: >= 0 (ratio around 1.0).
1910
1910
  * @param asset Ticker name (ex. SPY, BTC)
1911
1911
  * @param length Length of time
1912
1912
  * @param interval Unit of time
@@ -1931,7 +1931,7 @@ export function SimpleMovingAverage(asset, length = 30, interval = "Day") {
1931
1931
  }
1932
1932
  export const SMA = SimpleMovingAverage;
1933
1933
  /**
1934
- * SquareRoot indicator.
1934
+ * Square root of an indicator.
1935
1935
  */
1936
1936
  export function SquareRoot(operand) {
1937
1937
  const d = { type: "SquareRoot" };
@@ -1939,7 +1939,7 @@ export function SquareRoot(operand) {
1939
1939
  return d;
1940
1940
  }
1941
1941
  /**
1942
- * Stochastic indicator.
1942
+ * Momentum oscillator comparing the close to the high-low range over N bars, with %K smoothing and a %D signal average. Readings above 80 are overbought, below 20 oversold. Range: 0 to 100.
1943
1943
  * @param asset Ticker name (ex. SPY, BTC)
1944
1944
  * @param length Length of time
1945
1945
  * @param interval Unit of time
@@ -1957,7 +1957,7 @@ export function Stochastic(asset, length = 14, interval = "Day", smoothK = 3, sm
1957
1957
  return d;
1958
1958
  }
1959
1959
  /**
1960
- * StockReport indicator.
1960
+ * AI stock report rating: a fundamental-strength score from 1 to 5, higher is stronger, synthesizing revenue growth, profitability, balance sheet health, valuation and competitive positioning. Point-in-time: a backtest reads the rating in effect on each date. Works on a named ticker and on CANDIDATE inside a rebalance filter, rank or weight, e.g. gte(StockReport(CANDIDATE), Value(3.5)) for fundamentally strong stocks.
1961
1961
  * @param asset Ticker name (ex. SPY, BTC)
1962
1962
  */
1963
1963
  export function StockReport(asset) {
@@ -1966,7 +1966,7 @@ export function StockReport(asset) {
1966
1966
  return d;
1967
1967
  }
1968
1968
  /**
1969
- * SumOrderAmount indicator.
1969
+ * The total dollar amount across all matching orders within a window. Range: >= 0.
1970
1970
  * @param side Matches order events with this side (buy or sell)
1971
1971
  * @param orderStatus Matches order events with this status
1972
1972
  * @param length Length of time
@@ -1982,7 +1982,7 @@ export function SumOrderAmount(side, orderStatus = "Filled", length = 1, interva
1982
1982
  return d;
1983
1983
  }
1984
1984
  /**
1985
- * SumOrderQuantity indicator.
1985
+ * The total number of shares across all matching orders within a window. Range: >= 0.
1986
1986
  * @param side Matches order events with this side (buy or sell)
1987
1987
  * @param orderStatus Matches order events with this status
1988
1988
  * @param length Length of time
@@ -1998,7 +1998,7 @@ export function SumOrderQuantity(side, orderStatus = "Filled", length = 1, inter
1998
1998
  return d;
1999
1999
  }
2000
2000
  /**
2001
- * Supertrend indicator.
2001
+ * ATR trailing band that ratchets with the trend and flips sides on a close through it. The direction line reads +1 in an uptrend, -1 in a downtrend. Range: Price scale (value); +1 / -1 (direction).
2002
2002
  * @param asset Ticker name (ex. SPY, BTC)
2003
2003
  * @param length Length of time
2004
2004
  * @param interval Unit of time
@@ -2014,7 +2014,7 @@ export function Supertrend(asset, length = 10, interval = "Day", multiplier = 3,
2014
2014
  return d;
2015
2015
  }
2016
2016
  /**
2017
- * TrailingSum indicator.
2017
+ * The sum of the last N accepted observations of the inner indicator. Generic inputs append when the value changes; source-backed inputs use their own observation identities. Length counts retained observations rather than every evaluation tick.
2018
2018
  * @param length Length of the rolling window
2019
2019
  */
2020
2020
  export function TrailingSum(operand, length = 4) {
@@ -2024,7 +2024,7 @@ export function TrailingSum(operand, length = 4) {
2024
2024
  return d;
2025
2025
  }
2026
2026
  /**
2027
- * TrueRange indicator.
2027
+ * The greatest of: current high minus low, |high − previous close|, or |low − previous close|. Measures single-period volatility. Range: >= 0.
2028
2028
  * @param asset Ticker name (ex. SPY, BTC)
2029
2029
  */
2030
2030
  export function TrueRange(asset) {
@@ -2033,7 +2033,7 @@ export function TrueRange(asset) {
2033
2033
  return d;
2034
2034
  }
2035
2035
  /**
2036
- * UnderlyingMaxDrawdown indicator.
2036
+ * The current percentage decline of the asset's market price from the highest price observed by this indicator. Tracks the underlying price independently of position state. Range: 0 to 100 (percentage).
2037
2037
  * @param asset Ticker name (ex. SPY, BTC)
2038
2038
  */
2039
2039
  export function UnderlyingMaxDrawdown(asset) {
@@ -2042,7 +2042,7 @@ export function UnderlyingMaxDrawdown(asset) {
2042
2042
  return d;
2043
2043
  }
2044
2044
  /**
2045
- * Value indicator.
2045
+ * A fixed numeric value. Useful as one side of a comparison.
2046
2046
  * @param value Constant value
2047
2047
  */
2048
2048
  export function Value(value = 0) {
@@ -2051,7 +2051,7 @@ export function Value(value = 0) {
2051
2051
  return d;
2052
2052
  }
2053
2053
  /**
2054
- * Volume indicator.
2054
+ * Trading volume for the asset. It is the Fundamental indicator with its metric preset to Volume, on the same pipeline and data sources. Keep the metric at Volume: any other metric returns that fundamental metric instead of volume. Range: >= 0.
2055
2055
  * @param asset Ticker name (ex. SPY, BTC)
2056
2056
  * @param metric The fundamental metric to use
2057
2057
  */
@@ -2062,7 +2062,7 @@ export function Volume(asset, metric = "volume") {
2062
2062
  return d;
2063
2063
  }
2064
2064
  /**
2065
- * VWAP indicator.
2065
+ * The average price weighted by volume throughout the trading session. A key intraday benchmark. Range: > 0.
2066
2066
  * @param asset Ticker name (ex. SPY, BTC)
2067
2067
  */
2068
2068
  export function VWAP(asset) {
@@ -2071,7 +2071,7 @@ export function VWAP(asset) {
2071
2071
  return d;
2072
2072
  }
2073
2073
  /**
2074
- * WilliamsR indicator.
2074
+ * Momentum oscillator placing the close within the high-low range over N bars, on a -100 to 0 scale. Above -20 is overbought, below -80 oversold. Range: -100 to 0.
2075
2075
  * @param asset Ticker name (ex. SPY, BTC)
2076
2076
  * @param length Length of time
2077
2077
  * @param interval Unit of time
@@ -2083,7 +2083,7 @@ export function WilliamsR(asset, length = 14, interval = "Day") {
2083
2083
  return d;
2084
2084
  }
2085
2085
  /**
2086
- * Year indicator.
2086
+ * The current year.
2087
2087
  */
2088
2088
  export function Year() {
2089
2089
  const d = { type: "Year" };