7 min read· Published July 18, 2026

Technical Indicator Agents: RSI, MACD, and MAs as Triggers

How to hand RSI, MACD and moving-average rules to an agent without inheriting whipsaws, repainting, or an over-optimized backtest. Worked example included.

By Florent Poux
Reviewed by Benjamin Sultan
Three analog gauges feeding their needles into a single mechanical lever above a price chart

Every trader who uses indicators has lived this loop: you define a setup, wait for it, miss it during dinner, chase the late entry, and take a worse price for the same idea. RSI trading automation exists to break that loop. The rule you already trust gets evaluated by a machine on every candle, and executed the same way at 3pm or 3am.

Delegating an indicator is not the same as understanding one, though. This article covers how indicator triggers actually work inside an agent, a worked mean-reversion example, honest combination rules, and the three traps that quietly ruin most indicator bots.

From watching indicators to delegating them

An indicator on your screen is a suggestion. An indicator inside an agent is a contract: when condition X is true, do Y at size Z. That shift sounds small and changes everything, because a contract has to be written precisely enough that a machine cannot misread it.

"Buy when RSI is oversold" fails as a contract immediately. Which RSI period? Which timeframe? Oversold at what value? Checked when: every tick, or on candle close? Buy how much? Sell when? A human chart-watcher answers these on the fly, differently every time, which is exactly the inconsistency that eats returns. Writing the contract forces you to discover what your rule actually is.

The payoff for that rigor is discipline you cannot fake manually. The agent takes the fifth signal of a losing streak with the same size as the first, holds through the boredom of a two-week position, and never widens a stop out of hope. Indicators are mechanical measurements; it turns out they are best obeyed mechanically too. If your grounding in the indicator itself is shaky, start with the fundamentals in RSI Indicator: Use It Without the Beginner Traps before automating anything on top of it.

How indicator triggers work inside an agent

Under the hood, indicator conditions come in three shapes, and each has a mechanical subtlety worth knowing.

Thresholds. The value crosses a line: RSI(14) drops below 30, or ATR exceeds some level. The subtlety is re-arming. If your condition is "RSI < 30" evaluated continuously, it is true on every candle of a long decline, and a naive agent buys again and again all the way down. Proper triggers fire on the crossing into the zone, then re-arm only after the value has left it. One decline, one signal.

Crossovers. Two lines swap order: the 50-day moving average closes above the 200-day, or the MACD line crosses its signal line. Crossovers are self-arming by nature, but they cluster horribly in flat markets, where two nearly parallel lines can cross five times in three weeks. That's a whipsaw factory unless something filters the chop.

Divergences. Price makes a lower low while the oscillator makes a higher low. Divergence is the fuzziest of the three: it depends on which swing points you compare, so two competent implementations can disagree about whether one exists. Automate divergence only if the platform shows you exactly how it defines the swings; otherwise you're delegating to a definition you've never read.

Across all three shapes, one decision matters more than any parameter: evaluate on closed candles. An RSI computed on a candle still in progress changes as the candle forms; a condition can be true at 14:40 and false at 14:59. Acting on unclosed values means trading signals that later un-happen, which is the live version of the repainting problem. Closed-candle evaluation costs you a few minutes of delay and buys you signals that stay true.

An hourglass fused with a candlestick chart, sand settling only when each candle completes.

A worked RSI trading automation, rule by rule

Here's a complete mean-reversion agent, with the reasoning that produced each line.

  • Market: one liquid large-cap ETF or major crypto pair. Mean reversion needs instruments that dip and recover; illiquid assets dip and die.
  • Trend filter: price above its 200-day moving average. This is the load-bearing rule. Buying oversold readings in a downtrend is how RSI strategies famously bleed out, because "oversold" can stay oversold for months while price halves. The filter concedes those months entirely.
  • Entry: RSI(14) crosses below 30 on the 4-hour chart, evaluated on candle close. The 4-hour gives several signals a month on a volatile asset; daily RSI(14) < 30 with the same filter might fire a handful of times a year.
  • Size: 2% of the account per trade, one position at a time. Small enough that a failed dip is a bruise, not a wound.
  • Exits, three ways: take profit when RSI(14) crosses back above 55 (the reversion has happened; don't hang around hoping it becomes a trend); stop-loss 6% below entry (the invalidation: this dip was not the kind that recovers); time stop of 15 daily candles (mean reversion that hasn't reverted in three weeks is a thesis quietly failing).

Every number above is a starting point for testing, not a revealed truth. What matters is the structure: a trend filter from one indicator family, an entry oscillator from another, and three exits that each answer a different question (done, wrong, and stale).

Expressing this used to mean code. On Obside you type it as you'd say it: "buy 2% of my account in [asset] when RSI(14) on the 4-hour closes below 30, only while price is above the 200-day moving average; exit when RSI closes above 55, or at minus 6%, or after 15 days." The copilot restates the parsed conditions for approval, the agent evaluates them on live closed candles, and your sizing and stop rules are enforced at execution time rather than left as good intentions.

Combining indicators without curve-fitting

The instinct after a first success is to add confirmations. Resist most of it.

The trap is stacking indicators from the same family. RSI, stochastics and MACD histogram are all derived from recent price momentum; requiring all three is one condition wearing three costumes, adding lag rather than information. Meaningful combination crosses families: a momentum trigger, a trend filter, a volatility gate. Three families, one member each, is a practical ceiling; the worked example above uses two and works fine.

Every added condition also divides your evidence. A rule that fires 60 times in a five-year backtest gives you a sample worth reading; add two more conditions and it may fire nine times, at which point your "improved" win rate is folklore. This sample-shrinking arithmetic, and the broader question of when a beautiful backtest is lying to you, is covered in how to backtest an AI trading agent.

Combination logic beyond indicators (mixing price levels, news-quiet windows and indicator states in one automation) is its own design discipline, covered in multi-condition automations. The short version for indicator work: two or three orthogonal conditions, each of which you can justify in one spoken sentence.

A tightrope walker balancing between two poles labeled with abstract wave patterns, one calm and one jagged.

The three traps: whipsaw, repainting, over-optimization

Whipsaw. Crossover systems lose money in sideways markets by design; the only honest questions are how much and how you cap it. A 50/200 moving-average cross on a ranging asset can flip long, short, long again inside a month, paying the spread each flip. Mitigations that work: a confirmation delay (act only if the cross survives two further closes), a minimum-separation requirement between the averages, or a volatility gate that stands the agent down when the market has no direction. Each mitigation trades lag for fewer false starts; there is no setting that gives you neither.

Repainting. Any signal computed from data that later changes will look brilliant historically and mediocre live. Unclosed candles are the everyday case; some indicator implementations also redraw past values by construction. The test is brutal and simple: would this signal, evaluated at the exact moment the agent would have acted, using only information that existed then, look the same? Backtests that ignore this question overstate results with total confidence.

Over-optimization. If RSI < 30 tests poorly but RSI < 27.5 with a 4.3% stop tests beautifully, you have not found an edge; you have found the noise in one historical sample. Robust rules sit on parameter plateaus: 25, 30 and 35 should all be decent if the underlying idea is real, and round defaults like RSI(14) are respectable precisely because nobody tuned them to your backtest window. When a strategy only works at one exact setting, the setting is the strategy, and it will not travel to the future.

Where to go from here

Write your indicator rule as a contract: entry shape, closed-candle evaluation, size, and all three exits. Check it against the traps: what does it do in chop, does anything repaint, does it survive neighboring parameters? Then follow the boring, correct sequence: backtest across regimes, paper trade until you've seen it handle signals you didn't cherry-pick, and go live small. If you want the phrasing itself handled, the prompt patterns in trading prompts that work map directly onto indicator logic.

The indicators were never the hard part; the consistency was. When you're ready to hand a precise rule to something that never gets bored, Obside turns the sentence into a monitored agent with your risk limits attached, and lets it prove itself on paper before a single real order.

Educational content only. This is not investment advice. Trading involves risk, including possible loss of capital.

FAQ

Yes, and RSI is one of the most commonly automated indicators because its conditions are precisely expressible: a period, a threshold, a timeframe. A complete automation needs more than the trigger, though — you must specify crossing versus level logic, closed-candle evaluation, position size, and exits for profit, invalidation and staleness. Platforms with plain-language agents let you state all of that in a sentence and have it restated for approval.

Related articles

Try Obside on your portfolio

Connect your broker and build your portfolio in one prompt.

Get started