Advanced Indicators
Compound indicators, math operators, boolean filters, and condition-based indicators.
Advanced Indicators
Advanced indicators operate on other indicators, perform mathematical operations, or filter based on asset metadata. These are the building blocks for sophisticated, multi-layered strategies.
Compound Indicators (Indicators of Indicators)
SMA of Indicator
Computes the Simple Moving Average of any other indicator over a window.
- Parameters: Inner indicator, Window
- Example condition:
SMA(RSI(AAPL, 14), 10 days) — The 10-day average of AAPL's RSI. Smooths out noise.
EMA of Indicator
Computes the Exponential Moving Average of any other indicator.
- Parameters: Inner indicator, Window
- Example condition:
EMA(Volume(SPY), 20 days) — The 20-day EMA of SPY's volume. Useful for detecting volume surges.
Standard Deviation of Indicator
Computes the standard deviation of any indicator over a window.
- Parameters: Inner indicator, Window
- Example condition:
StdDev(RSI(AAPL, 14), 30 days) — How much RSI has been fluctuating over the last 30 days.
Mean Absolute Deviation of Indicator
Computes the MAD of any indicator over a window. Less sensitive to outliers than standard deviation.
- Parameters: Inner indicator, Window
Rate of Change of Indicator
The percentage change of any indicator over a window.
- Parameters: Inner indicator, Window
- Example condition:
ROC(Revenue(AAPL), 4 quarters) — Quarterly revenue growth rate.
Indicator at Minutes After Open
Captures the value of any indicator at a specific number of minutes after market open. The value is frozen for the rest of the day.
- Parameters: Inner indicator, Minutes after open (0–390)
- Example condition:
Price at 30 Min After Open(SPY) — SPY's price 30 minutes after open, useful for opening range breakout strategies.
Indicator Window Ago
The value of any indicator N periods ago.
- Parameters: Inner indicator, Window
- Example condition:
Price 5 Days Ago(AAPL) — What was AAPL's price 5 trading days ago?
Trailing Sum
The sum of an indicator's values over the last N periods.
- Parameters: Inner indicator, Length (number of periods)
- Example condition:
Trailing Sum(Volume(SPY), 5) — Total volume over the last 5 bars.
Indicator At Entry
The value any indicator held at the most recent matching fill. The level is frozen at entry instead of rolling forward, so a stop written against it is a real stop rather than a trailing one.
- Parameters: Inner indicator, Asset, Order side, Order status
- Example condition:
Minimum Price(SPY, 5 Minute) at last Filled Buy entry of SPY — the swing low that was there when the position was opened, which stays put for the life of the trade.
Tip: This reads order state, so a book using it cannot be evaluated on the fast columnar path. Reach for it when the level genuinely has to be anchored to a fill.
Consecutive Increase
Number of consecutive completed calendar periods (America/New_York; period is Year, Quarter or Month), ending with the last completed period, whose closing value of the inner indicator was strictly higher (ConsecutiveIncrease) or strictly lower (ConsecutiveDecrease) than the previous period's closing value. A period's closing value is the inner indicator's last non-null value observed in that period. The in-progress current period never counts, equal values are not a change, and a completed period with no value breaks the streak. The count is capped at lookback (an integer from 1 to 60). Returns null when no completed period has a value.
- Parameters: Inner indicator, Period (Year, Quarter or Month), Lookback (1–60)
- Range: 0 to lookback, or null when no completed period has a value
- Example condition:
ConsecutiveIncrease(LastDividend(KO), Year, 10) >= 10 (KO raised its regular dividend per share in each of the last 10 completed years); ConsecutiveIncrease(Fundamental(AAPL, totalRevenue), Quarter, 8) >= 4 (AAPL's reported revenue rose for at least the last 4 completed quarters)
Tip: Inside a DynamicRebalance filter, pass the candidate to the inner indicator to screen for dividend growers or steady revenue growers. Set lookback to the streak you compare against, since the count never exceeds it.
Consecutive Decrease
Number of consecutive completed calendar periods (America/New_York; period is Year, Quarter or Month), ending with the last completed period, whose closing value of the inner indicator was strictly higher (ConsecutiveIncrease) or strictly lower (ConsecutiveDecrease) than the previous period's closing value. A period's closing value is the inner indicator's last non-null value observed in that period. The in-progress current period never counts, equal values are not a change, and a completed period with no value breaks the streak. The count is capped at lookback (an integer from 1 to 60). Returns null when no completed period has a value.
- Parameters: Inner indicator, Period (Year, Quarter or Month), Lookback (1–60)
- Range: 0 to lookback, or null when no completed period has a value
- Example condition:
ConsecutiveDecrease(LastDividend(T), Year, 3) >= 1 (T's regular dividend per share fell in the last completed year); ConsecutiveDecrease(Fundamental(INTC, totalRevenue), Quarter, 8) >= 3 (INTC's reported revenue fell for the last 3 completed quarters)
Tip: Use it as an exit or exclusion filter, for example selling a holding whose dividend was cut or whose revenue has shrunk several quarters in a row.
Mathematical Operators
Plus (+)
Sum of two or more indicators.
- Parameters: Two or more indicators
- Example condition:
Price(AAPL) + Price(MSFT) — Combined price (useful with position sizing).
Minus (−)
Difference between indicators.
- Parameters: Two or more indicators
- Example condition:
SMA(SPY, 50) - SMA(SPY, 200) — The spread between the 50 and 200-day SMA. Positive = bullish trend.
Multiply (×)
Product of indicators.
- Parameters: Two or more indicators
- Example condition:
Price(AAPL) × Shares Outstanding(AAPL) — Manually compute market cap.
Divide (÷)
Quotient of indicators.
- Parameters: Two or more indicators
- Example condition:
Net Income(AAPL) ÷ Revenue(AAPL) — Net profit margin as a ratio.
Max
The maximum value of two or more indicators.
- Parameters: Two or more indicators
- Example condition:
Max(RSI(AAPL, 14), RSI(MSFT, 14)) — The higher RSI of the two.
Min
The minimum value of two or more indicators.
- Parameters: Two or more indicators
Negative
Negates an indicator's value.
- Parameters: One indicator
- Example condition:
Negative(Max Drawdown(SPY, 30)) — Converts drawdown to a positive number for easier comparison.
Absolute Value
The absolute value of an indicator.
- Parameters: One indicator
- Example condition:
Abs(Price Change Since Open(TSLA)) — The magnitude of today's move regardless of direction.
Square Root
Square root of an indicator.
- Parameters: One indicator
Logarithm
Logarithm of an indicator with a specified base.
- Parameters: One indicator, Base (> 0, ≠ 1)
Exponentiation
Raises an indicator to a specified power.
- Parameters: One indicator, Exponent
- Example condition:
Exponentiation(1 + ROC(SPY, 252) / 100, 1/3) — Approximate annualized 3-year return.
Boolean / Metadata Indicators
Is Industry
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.
- Parameters: Asset, Industry name
- Example condition:
Is Industry(asset, "Artificial Intelligence") = 1 (Only trade AI stocks)
Is Index Member
Returns 1 if the asset is a member of a specified index, 0 otherwise.
- Parameters: Asset, Index name (S&P 500, Nasdaq-100, or DJIA)
- Example condition:
Is Index Member(asset, "SP500") = 1 (Only trade S&P 500 components)
Is Asset Type
Returns 1 if the asset matches a specified type (stock, ETF, etc.), 0 otherwise.
- Parameters: Asset, Asset type
- Example condition:
Is Asset Type(asset, "ETF") = 1 (Only trade ETFs)
Is Asset
Returns 1 if the asset matches a specific symbol. Useful for including specific assets in multi-asset strategies.
- Parameters: Asset, Match symbol
- Example condition:
Is Asset(asset, "SPY") = 1 (Apply this condition only to SPY)
Is Not Asset
Returns 1 if the asset does NOT match a specific symbol. Useful for excluding specific assets.
- Parameters: Asset, Match symbol
- Example condition:
Is Not Asset(asset, "SPY") = 1 (Apply this condition to everything except SPY)
Condition-Based Indicators
Consecutive True
Returns 1 if a condition has been true for N consecutive periods in a row, 0 otherwise.
- Parameters: Condition, Window
- Example condition:
Consecutive True(RSI(AAPL, 14) < 30, 3 days) = 1 (RSI has been oversold for 3 straight days — stronger signal than a single reading)
Count True
Counts how many times a condition was true over a window.
- Parameters: Condition, Window
- Example condition:
Count True(Price(SPY) > SMA(SPY, 200), 30 days) > 20 (SPY has been above its 200-day SMA for at least 20 of the last 30 days — sustained uptrend)
Option Position Indicators
Option Position Value
Returns the total market value of option spreads matching the filter criteria.
- Parameters: Underlying (optional), Option Type (call/put, optional), Direction (long/short, optional), Spread Type (optional)
- Range: 0 to ∞ (dollars)
- Example condition:
Option Position Value(AAPL) > 1000 (Total value of AAPL option positions exceeds $1,000)
Option Position Count
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.
- Parameters: Underlying (optional), Option Type (call/put, optional), Direction (long/short, optional), Spread Type (optional)
- Range: 0 to ∞
- Example condition:
Open option position count (portfolio-wide) < 4 (Global leg cap for single-leg entries; use < maxOpenLegs - 1 for 2-leg verticals)
Option Position P&L%
Returns the weighted average P&L percentage across option spreads matching the filter.
- Parameters: Underlying (optional), Option Type (optional), Direction (optional), Spread Type (optional)
- Range: -100% to ∞
- Example condition:
Option Position P&L% > 50 (Option positions are up over 50%)
Option Position Max Drawdown
Peak-to-current drawdown of the aggregated P&L percentage across option spreads matching the filter. Stateful sibling of Option Position P&L%: while P&L% returns the current value, this indicator tracks the highest P&L% 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.
- Parameters: Underlying (optional), Option Type (optional), Direction (optional), Spread Type (optional)
- Range: >= 0 (percentage points of P&L)
- Example condition:
Option Position Max Drawdown(AVGO) > 25 (Close AVGO option exposure when it has given back 25% of its peak P&L since entry)
Option Days to Expiration
Returns the minimum or maximum days to expiration across option spreads matching the filter.
- Parameters: Min/Max, Underlying (optional), Option Type (optional), Direction (optional), Spread Type (optional)
- Range: 0 to 365+
- Example condition:
Min DTE < 7 (Closest option position expires within 7 days — consider closing)
Option Days Held
Returns the minimum or maximum days since entry across option spreads matching the filter.
- Parameters: Min/Max, Underlying (optional), Option Type (optional), Direction (optional), Spread Type (optional)
- Range: 0 to ∞
- Example condition:
Max Days Held > 30 (Oldest position held for over 30 days)
Option Collateral
Returns the total collateral locked across option spreads matching the filter.
- Parameters: Underlying (optional), Option Type (optional), Direction (optional), Spread Type (optional)
- Range: 0 to ∞ (dollars)
- Example condition:
Option Collateral < 5000 (Less than $5,000 locked in option collateral)
Option Spread Count
Returns the number of open multi-leg option spreads matching the filter criteria. Does not count standalone single-leg option positions.
- Parameters: Underlying (optional), Option Type (optional), Direction (optional), Spread Type (optional)
- Range: 0 to ∞
- Example condition:
Option Spread Count < 5 (Have fewer than 5 open option spreads)
Option Spread Entry Price
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.
- Parameters: Underlying (optional), Option Type (optional), Direction (optional), Spread Type (optional)
- Range: -∞ to ∞ (dollars per share)
- Example condition:
Minimum net credit = Option Spread Entry Price (SPX · long · call · vertical) + 0.50 (Sell the next spread for the held debit spread's fill plus $0.50)
Option Unrealized P&L
Returns the total unrealized P&L in dollars across option spreads matching the filter.
- Parameters: Underlying (optional), Option Type (optional), Direction (optional), Spread Type (optional)
- Range: -∞ to ∞ (dollars)
- Example condition:
Option Unrealized P&L(AAPL) > 500 (AAPL option positions are up over $500)
Option Gross Exposure %
Sum of absolute option leg marks divided by portfolio value (percent). Matches gross deployment audits. Unfiltered portfolio-wide only.
- Parameters: None
- Range: 0% to ∞
- Example condition:
Option gross exposure % < 40 (block new entries when gross option marks exceed 40% of portfolio value)
Option Realized P&L
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; leave it empty for the whole life of the book.
- Parameters: Underlying (optional), Option Type (optional), Direction (optional), Spread Type (optional), Lookback Days (optional)
- Range: -∞ to ∞ (dollars)
- Example condition:
Option Realized P&L(IBIT, put, short) > 0 (closed IBIT short puts have made money overall)
Option Realized Premium
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; leave it empty for the whole life of the book.
- Parameters: Underlying (optional), Lookback Days (optional)
- Range: -∞ to ∞ (dollars)
- Example condition:
Option Realized Premium(IBIT) > 500 (at least $500 of banked IBIT premium is available to fund long options)
Tip: Filtered by underlying only, never by option type: put premium funding calls is the point, and a put-only balance would ignore the call debits. Check it against Option Realized P&L, which measures the same closes without the spending.
Tip: Compound and math indicators can be nested. For example, you can compute the SMA of (Price minus SMA), or the Rate of Change of a Trailing Sum. The composability is what makes NexusTrade's indicator system so powerful.