Technical Indicators
Use server indicator endpoints for SMA, EMA, RSI, MACD, and Support & Resistance β plus formulas and production-ready examples.
Overview
Technical indicators are mathematical calculations applied to a security's price and/or volume to forecast future price movements and identify trading opportunities. The indicator APIs on this page return server-computed values for direct consumption, while formulas are included to explain the math behind each model. Every indicator still originates from OHLCV candle data returned by market data endpoints such as /api/v1/history endpoint β no third-party libraries required.
SMA & EMA smooth noise and reveal the underlying price direction.
MACD captures the strength and direction of a trend's acceleration.
RSI measures the speed of price changes to spot exhaustion zones.
Chain indicators together for confirmation β e.g. RSI + EMA crossover.
Simple Moving AverageSMA
Trend-following Β· Lagging
The Simple Moving Average computes the arithmetic mean of closing prices over a rolling window of n periods. It is the foundational building block of nearly every other indicator. The longer the period, the smoother β but laggier β the output.
Formula
API Endpoint
Common Periods
| Period | Timeframe | Typical Use-Case |
|---|---|---|
| 10 | M15 / H1 | Short-term momentum, scalp entries |
| 20 | H1 / H4 | Intermediate trend & pullback zones |
| 50 | H4 / D1 | Medium-term trend direction |
| 100 | D1 | Major trend, institutional reference |
| 200 | D1 | Long-term bull/bear market threshold |
Signal Interpretation
Code Example
const BASE = "https://api.realmarketapi.com"
const API_KEY = "YOUR_API_KEY"
const PERIOD = 20
const url = new URL("/api/v1/indicator/sma", BASE)
url.searchParams.set("apiKey", API_KEY)
url.searchParams.set("SymbolCode", "XAUUSD")
url.searchParams.set("TimeFrame", "H1")
url.searchParams.set("Period", String(PERIOD))
const res = await fetch(url.toString())
if (!res.ok) throw new Error("Request failed: " + res.status)
const data = await res.json()
console.log("SMA API response:", data)Exponential Moving AverageEMA
Trend-following Β· Lagging Β· Faster than SMA
The Exponential Moving Average assigns exponentially decreasing weights to older closes, making it significantly more responsive than the SMA to recent price changes. EMA is the backbone of MACD and many crossover strategies.
Formula
API Endpoint
Common Periods & Multipliers
| Period | Multiplier (k) | Primary Use |
|---|---|---|
| 9 | 0.2000 | Short-term momentum confirmation |
| 12 | 0.1538 | MACD fast line |
| 21 | 0.0952 | Intraday trend filter |
| 26 | 0.0741 | MACD slow line |
| 50 | 0.0392 | Trend bias filter (above = bullish) |
| 200 | 0.0100 | Long-term trend regime |
Signal Interpretation
Code Example
const BASE = "https://api.realmarketapi.com"
const API_KEY = "YOUR_API_KEY"
const PERIOD = 12
const url = new URL("/api/v1/indicator/ema", BASE)
url.searchParams.set("apiKey", API_KEY)
url.searchParams.set("SymbolCode", "XAUUSD")
url.searchParams.set("TimeFrame", "H1")
url.searchParams.set("Period", String(PERIOD))
const res = await fetch(url.toString())
if (!res.ok) throw new Error("Request failed: " + res.status)
const data = await res.json()
console.log("EMA API response:", data)Moving Average Convergence/DivergenceMACD
Trend-following Β· Momentum Β· Components: Line Β· Signal Β· Histogram
MACD was developed by Gerald Appel in the late 1970s and remains one of the most widely used indicators. It reveals the relationship between two EMAs β measuring how fast a trend is accelerating or decelerating β and generates three components used for trade signals.
Formula
API Endpoint
Components
MACD Line
Difference between EMA-12 and EMA-26. Crosses zero when short-term trend reverses direction.
Signal Line
EMA(9) of the MACD Line. Smooths it for cleaner crossover signals.
Histogram
MACD Line minus Signal Line. Growing bars = strengthening momentum; shrinking = weakening.
Standard Parameters
| Parameter | Default | Notes |
|---|---|---|
| Fast EMA | 12 | Captures short-term momentum |
| Slow EMA | 26 | Represents longer-term trend |
| Signal EMA | 9 | Smooths the MACD line for cleaner entries |
| Minimum candles | 35+ | Need β₯ 26 + 9 = 35 bars min for valid values |
Signal Interpretation
Code Example
const BASE = "https://api.realmarketapi.com"
const API_KEY = "YOUR_API_KEY"
const FAST_PERIOD = 12
const SLOW_PERIOD = 26
const SIGNAL_PERIOD = 9
const url = new URL("/api/v1/indicator/macd", BASE)
url.searchParams.set("apiKey", API_KEY)
url.searchParams.set("SymbolCode", "XAUUSD")
url.searchParams.set("TimeFrame", "H1")
url.searchParams.set("FastPeriod", String(FAST_PERIOD))
url.searchParams.set("SlowPeriod", String(SLOW_PERIOD))
url.searchParams.set("SignalPeriod", String(SIGNAL_PERIOD))
const res = await fetch(url.toString())
if (!res.ok) throw new Error("Request failed: " + res.status)
const data = await res.json()
console.log("MACD API response:", data)Relative Strength IndexRSI
Momentum oscillator Β· Range: 0 β 100
Developed by J. Welles Wilder Jr. in 1978, RSI measures the magnitude and velocity of recent price changes to evaluate overbought or oversold conditions. It oscillates between 0 and 100 and is typically applied with a 14-period window.
Formula
API Endpoint
RSI Zones
| RSI Value | Zone | Interpretation |
|---|---|---|
| 70 β 100 | Overbought | Asset may be overextended; momentum could reverse downward |
| 50 β 69 | Bullish zone | Bullish momentum dominant; trend is upward |
| 31 β 49 | Bearish zone | Bearish momentum dominant; trend is downward |
| 0 β 30 | Oversold | Asset may be undervalued; potential bounce or reversal |
| 50 | Midline | Crossover of midline signals potential trend shift |
Signal Interpretation
Code Example
const BASE = "https://api.realmarketapi.com"
const API_KEY = "YOUR_API_KEY"
const PERIOD = 14
const url = new URL("/api/v1/indicator/rsi", BASE)
url.searchParams.set("apiKey", API_KEY)
url.searchParams.set("SymbolCode", "XAUUSD")
url.searchParams.set("TimeFrame", "H1")
url.searchParams.set("Period", String(PERIOD))
const res = await fetch(url.toString())
if (!res.ok) throw new Error("Request failed: " + res.status)
const data = await res.json()
console.log("RSI API response:", data)Support & ResistanceServer-computed API
Price structure Β· Key levels Β· Requires Pro+
The Support & Resistance endpoint returns server-computed key price levels directly. Like the SMA/EMA/RSI/MACD indicator APIs, it analyses historical candle data to identify price zones where buyers (support) or sellers (resistance) have repeatedly stepped in, ranked by touch count.
A price floor. Bulls have historically defended this level. The higher the touch count, the stronger the zone.
A price ceiling. Bears have historically sold at or near this level. Multiple rejections = strong resistance.
How many times price has tested a level. Higher counts indicate institutional memory and greater reliability.
Recency matters. A level tested last week is more relevant than one tested 6 months ago.
Endpoint
403 response. View plans βResponse Structure
{ "SymbolCode": "XAUUSD", "TimeFrame": "H1", "Supports": [ { "Price": 3182.50, "TouchCount": 4, "LastTouchedAt": "2026-03-15T10:00:00Z" }, { "Price": 3155.00, "TouchCount": 3, "LastTouchedAt": "2026-03-14T14:00:00Z" } ], "Resistances": [ { "Price": 3245.00, "TouchCount": 5, "LastTouchedAt": "2026-03-15T17:00:00Z" }, { "Price": 3280.75, "TouchCount": 2, "LastTouchedAt": "2026-03-12T08:00:00Z" } ] }
Signal Interpretation
Code Example
const res = await fetch(
"https://api.realmarketapi.com/api/v1/indicator/support-resistance?apiKey=YOUR_API_KEY&symbolCode=XAUUSD&timeFrame=H1"
)
const { Supports, Resistances } = await res.json()
// Nearest support below current price
const currentPrice = 3210.00
const nearestSupport = Supports
.filter(s => s.Price < currentPrice)
.sort((a, b) => b.Price - a.Price)[0]
// Nearest resistance above current price
const nearestResistance = Resistances
.filter(r => r.Price > currentPrice)
.sort((a, b) => a.Price - b.Price)[0]
console.log(`Nearest support: ${nearestSupport?.Price} (Γ${nearestSupport?.TouchCount} touches)`)
console.log(`Nearest resistance: ${nearestResistance?.Price} (Γ${nearestResistance?.TouchCount} touches)`)Try it live in the Playground
Run a live /api/v1/indicator/support-resistance request with your API key β see the real response instantly in your browser.
Combining Indicators
No single indicator is reliable enough to trade in isolation. Effective strategies stack multiple indicators from different categories β trend, momentum, and oscillator β to get confluent signals that dramatically improve signal quality.
EMA + RSI β Trend Continuation
- 1Filter direction: price above EMA-50 = only look for longs
- 2Wait for RSI to dip into 40β50 (pullback without going oversold)
- 3Enter when RSI starts rising back above 50
- 4Stop below EMA-50; target previous high
MACD + RSI β Reversal Entry
- 1Identify RSI < 30 (oversold) or RSI > 70 (overbought)
- 2Wait for MACD histogram to start shrinking (momentum fading)
- 3Enter on MACD line Γ Signal line crossover
- 4Tight stop beyond the recent swing; RSI returning to 50 as target zone
SMA Golden/Death Cross
- 1Plot SMA-50 and SMA-200 on D1 timeframe
- 2Golden Cross (50 > 200): long-term bull β buy dips above SMA-50
- 3Death Cross (50 < 200): long-term bear β sell rallies below SMA-50
- 4Confirm regime shift with MACD above/below zero
MACD Divergence + EMA Slope
- 1Observe price making new lows while MACD histogram shrinks (bullish divergence)
- 2Confirm EMA-20 slope is flattening or turning up
- 3Enter on EMA-9/21 bullish crossover for timing
- 4Invalidate if price breaks the previous swing low
Minimum Data Requirements
{ "SMA-20": { "minCandles": 20, "endpoint": "GET /api/v1/history", "pageSize": 50 }, "EMA-26": { "minCandles": 52, "endpoint": "GET /api/v1/history", "pageSize": 100 }, "MACD": { "minCandles": 70, "endpoint": "GET /api/v1/history", "pageSize": 150 }, "RSI-14": { "minCandles": 30, "endpoint": "GET /api/v1/history", "pageSize": 50 }, "All four": { "minCandles": 70, "endpoint": "GET /api/v1/history", "pageSize": 200 } }