Triggers (Conditions + Indicators)
In Auto, a trigger is a condition tree that evaluates continuously. When the tree resolves to true, configured actions run.
Market Coverage
Auto supports broad CEX/perps and DEX/on-chain symbol coverage, including markets indexed through our market-data providers.
Trigger Shape
All triggers are expressed as conditions with a root boolean group:
{
"conditions": {
"AND": [
{
"source": "ta",
"method": "rsi",
"args": { "symbol": "BTC", "timeframe": "1h", "period": 14 },
"operator": "<",
"value": 30
}
]
}
}
Rules:
- Root group must be
ANDorOR. - Groups can be nested.
- Max condition tree depth:
3. - Max leaf conditions per query:
10.
Supported Condition Sources
Price Source (price)
| Method | Arguments | Returns | Description |
|---|---|---|---|
current | symbol | number | Current market price |
change | symbol, period | number | Percent price change over period |
high | symbol, period | number | Highest price in period |
low | symbol, period | number | Lowest price in period |
volume | symbol, period | number | Volume in USD over period |
TA Source (ta) - Indicator Methods
| Indicator method | Arguments | Returns | Description |
|---|---|---|---|
rsi | symbol, timeframe, period? | number | RSI (0-100), default period=14 |
macd_value | symbol, timeframe | number | MACD line value |
macd_signal | symbol, timeframe | number | MACD signal line |
macd_histogram | symbol, timeframe | number | MACD histogram |
bbands_upper | symbol, timeframe, period? | number | Upper Bollinger Band |
bbands_middle | symbol, timeframe, period? | number | Middle Bollinger Band |
bbands_lower | symbol, timeframe, period? | number | Lower Bollinger Band |
ema | symbol, timeframe, period | number | Exponential moving average |
sma | symbol, timeframe, period | number | Simple moving average |
atr | symbol, timeframe, period? | number | Average true range |
stoch_k | symbol, timeframe | number | Stochastic %K |
stoch_d | symbol, timeframe | number | Stochastic %D |
cci | symbol, timeframe, period? | number | Commodity Channel Index |
willr | symbol, timeframe, period? | number | Williams %R |
TA Args Contract
This is the exact args contract validated by Athena for TA methods.
| Method | Required args | Optional args | Notes |
|---|---|---|---|
rsi | symbol:string, timeframe:string | period:number (default 14) | period is optional. |
macd_value | symbol:string, timeframe:string | None | Uses MACD defaults internally. |
macd_signal | symbol:string, timeframe:string | None | Uses MACD defaults internally. |
macd_histogram | symbol:string, timeframe:string | None | Uses MACD defaults internally. |
bbands_upper | symbol:string, timeframe:string | period:number (default 20) | period is optional. |
bbands_middle | symbol:string, timeframe:string | period:number (default 20) | period is optional. |
bbands_lower | symbol:string, timeframe:string | period:number (default 20) | period is optional. |
ema | symbol:string, timeframe:string, period:number | None | period is required. |
sma | symbol:string, timeframe:string, period:number | None | period is required. |
atr | symbol:string, timeframe:string | period:number (default 14) | period is optional. |
stoch_k | symbol:string, timeframe:string | None | No period argument in EQL. |
stoch_d | symbol:string, timeframe:string | None | No period argument in EQL. |
cci | symbol:string, timeframe:string | period:number (default 20) | period is optional. |
willr | symbol:string, timeframe:string | period:number (default 14) | period is optional. |
Common TA Arg Errors
emaandsmarequireperiod;lengthis not a recognized alias.periodmust be a JSON number (for example14), not a string ("14").timeframeis required for all TA methods.
Invalid EMA example (length used, period missing):
{
"source": "ta",
"method": "ema",
"args": { "symbol": "BTC", "timeframe": "1h", "length": 20 },
"operator": ">",
"value": 100000
}
Expected validation failure:
EQL_MISSING_ARGforperiodon methodema
Valid EMA example:
{
"source": "ta",
"method": "ema",
"args": { "symbol": "BTC", "timeframe": "1h", "period": 20 },
"operator": ">",
"value": 100000
}
Cron Source (cron)
| Method | Arguments | Returns | Description |
|---|---|---|---|
once | period | boolean | True on first due evaluation at/after createdAt + period |
onceRemainTrue | period | boolean | True on first due evaluation and remains true afterward |
every | period | boolean | True at each period interval from query creation |
LLM Source (llm)
| Method | Arguments | Returns | Description |
|---|---|---|---|
athena_condition | query, period, speed? | boolean | LLM-evaluated condition |
Note:
cronandllmsupport shorthand forms and are expanded server-side.
Supported Operators
><>=<===!=crosses_abovecrosses_below
Cross operators use previous-state tracking and evaluate transitions:
crosses_above: previous<threshold and current>=thresholdcrosses_below: previous>threshold and current<=threshold
Dynamic Comparisons (Dynamic Values)
value does not need to be a static literal. It can also reference another
data source result at evaluation time.
This lets you compare one live metric against another live metric, for example current price vs. an indicator band.
Example: trigger when ETH price crosses above the current 4h upper Bollinger Band.
{
"conditions": {
"AND": [
{
"source": "price",
"method": "current",
"args": { "symbol": "ETH" },
"operator": "crosses_above",
"value": {
"source": "ta",
"method": "bbands_upper",
"args": { "symbol": "ETH", "timeframe": "4h" }
}
}
]
}
}
Important:
- Dynamic values are supported only in condition
value. - Dynamic values are not supported in action parameters.
Timeframe and Period Enums
TA timeframe values:
1m,5m,15m,30m,1h,2h,4h,8h,12h,1d
period values:
5m,15m,30m,1h,2h,4h,8h,12h,24h,1d,7d