Use server indicator endpoints for SMA, EMA, WMA, RSI, MACD, Bollinger Bands, Stochastic, ATR, CCI, Williams %R, ADX, Sentiment, and more β formulas, signals, and production-ready code examples.
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 confluence β or use the Sentiment API for a ready-made composite RSI + MACD + EMA score.
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.
| 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 |
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)Trend-following Β· Lagging Β· Weighted
The Exponential Moving Average applies a multiplier that gives more weight to recent prices, making it react faster to price changes than an SMA of the same length. Widely used for crossover signals, dynamic support, and as an input to MACD.
| Period | Multiplier (k) | Typical Use-Case |
|---|---|---|
| 9 | 0.200 | Short-term signals, scalp/swing triggers |
| 12 | 0.154 | MACD fast line |
| 21 | 0.095 | Crypto & equity swing entries |
| 26 | 0.074 | MACD slow line |
| 50 | 0.039 | Medium-trend filter & dynamic S/R |
| 200 | 0.010 | Long-term trend, institutional benchmark |
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)Trend-following Β· Lagging Β· Linearly weighted
The Weighted Moving Average assigns linearly increasing weights to closing prices so that more recent candles have a greater impact on the result than older ones. WMA reacts faster than SMA but produces smoother output than EMA on sharp spikes β making it a useful middle-ground for trend-following strategies.
| Parameter | Type | Required | Description |
|---|---|---|---|
| apiKey | string | β | Your API key |
| SymbolCode | string | β | Trading symbol (e.g. XAUUSD, BTCUSD) |
| TimeFrame | string | β | M1 Β· M5 Β· M15 Β· M30 Β· H1 Β· H4 Β· D1 |
| Period | int | β | Number of periods 2β500 (e.g. 9, 21, 50) |
| Period | Timeframe | Typical Use-Case |
|---|---|---|
| 9 | M15 / H1 | Short-term momentum, fast signal |
| 21 | H1 / H4 | Swing entries, trend confirmation |
| 50 | H4 / D1 | Medium-term trend direction |
{
"data": [
{ "openTime": "2025-05-06T10:00:00+00:00", "value": 2324.183456 },
{ "openTime": "2025-05-06T09:00:00+00:00", "value": 2322.876543 },
{ "openTime": "2025-05-06T08:00:00+00:00", "value": 2320.541230 }
],
"total": 3
}Results are returned newest first.
const BASE = "https://api.realmarketapi.com"
const API_KEY = "YOUR_API_KEY"
const PERIOD = 21
const url = new URL("/api/v1/indicator/wma", 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("WMA API response:", data)Momentum Β· Trend Β· Oscillator
MACD measures the relationship between two EMAs and plots a signal line on top. The three components together reveal direction, momentum, and potential reversals in a single glance.
| Parameter | Default | Notes |
|---|---|---|
| FastPeriod | 12 | Short EMA; lower = more sensitive |
| SlowPeriod | 26 | Long EMA; should be > FastPeriod |
| SignalPeriod | 9 | EMA of the MACD line |
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)Momentum Β· Oscillator Β· 0β100 scale
The Relative Strength Index measures the speed and magnitude of recent price changes on a 0β100 scale. Originally developed by J. Welles Wilder, it is one of the most-used oscillators for identifying overbought and oversold conditions.
| RSI Range | Zone | Interpretation |
|---|---|---|
| > 70 | Overbought | Potential reversal down or pullback |
| 50 β 70 | Bullish | Upward momentum, trend continuation |
| 45 β 55 | Neutral | Indecision, range-bound |
| 30 β 50 | Bearish | Downward momentum, trend continuation |
| < 30 | Oversold | Potential reversal up or bounce |
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)Volatility Β· Bands: Upper Β· Middle Β· Lower Β· Requires Pro+
Developed by John Bollinger in the 1980s, Bollinger Bands place a volatility envelope above and below a simple moving average. The bands widen during high volatility and contract during low volatility, making them ideal for identifying breakouts, squeezes, and overbought/oversold conditions within a trend.
| Param | Type | Default | Range |
|---|---|---|---|
| period | int | 20 | 2β500 |
| multiplier | decimal | 2 | 0.1β10 |
const BASE = "https://api.realmarketapi.com"
const API_KEY = "YOUR_API_KEY"
const PERIOD = 20
const MULTIPLIER = 2
const url = new URL("/api/v1/indicator/bollinger-bands", BASE)
url.searchParams.set("apiKey", API_KEY)
url.searchParams.set("SymbolCode", "EURUSD")
url.searchParams.set("TimeFrame", "H1")
url.searchParams.set("Period", String(PERIOD))
url.searchParams.set("Multiplier", String(MULTIPLIER))
const res = await fetch(url.toString())
if (!res.ok) throw new Error("Request failed: " + res.status)
const data = await res.json()
console.log("Bollinger Bands response:", data)Try it live in the Playground
Run a live /api/v1/indicator/bollinger-bands request with your API key β see the real response instantly in your browser.
Momentum oscillator Β· Range: 0 β 100 Β· Requires Pro+
Developed by George Lane, Stochastic compares a closing price to its price range over a given period. It produces two lines β the fast %K and the slower signal line %D β used together to identify overbought/oversold conditions and momentum crossover signals.
| %K / %D Value | Zone | Action |
|---|---|---|
| > 80 | Overbought | Consider reducing longs or watching for %K/%D bearish cross |
| < 20 | Oversold | Consider longs or watch for %K/%D bullish cross |
| 50 | Midline | Strength above 50 = bullish bias; below 50 = bearish bias |
const BASE = "https://api.realmarketapi.com"
const API_KEY = "YOUR_API_KEY"
const K_PERIOD = 14
const D_PERIOD = 3
const url = new URL("/api/v1/indicator/stochastic", BASE)
url.searchParams.set("apiKey", API_KEY)
url.searchParams.set("SymbolCode", "EURUSD")
url.searchParams.set("TimeFrame", "H1")
url.searchParams.set("KPeriod", String(K_PERIOD))
url.searchParams.set("DPeriod", String(D_PERIOD))
const res = await fetch(url.toString())
if (!res.ok) throw new Error("Request failed: " + res.status)
const data = await res.json()
console.log("Stochastic response:", data)Try it live in the Playground
Run a live /api/v1/indicator/stochastic request with your API key β see the real response instantly in your browser.
Volatility Β· Stop-loss sizing Β· Requires Pro+
Introduced by J. Welles Wilder Jr., ATR measures market volatility by computing the average of the True Range over a given period. It does not indicate direction β only how much price is moving. ATR is the industry-standard tool for placing stops and sizing positions proportional to current market conditions.
const BASE = "https://api.realmarketapi.com"
const API_KEY = "YOUR_API_KEY"
const PERIOD = 14
const url = new URL("/api/v1/indicator/atr", BASE)
url.searchParams.set("apiKey", API_KEY)
url.searchParams.set("SymbolCode", "EURUSD")
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("ATR response:", data)Try it live in the Playground
Run a live /api/v1/indicator/atr request with your API key β see the real response instantly in your browser.
Overbought/Oversold oscillator Β· Unbounded Β· Requires Pro+
Developed by Donald Lambert, CCI measures how far the current Typical Price has deviated from its average over a rolling window, normalized by mean absolute deviation. Unlike RSI and Stochastic, CCI is unbounded β it can go well beyond Β±100 during strong trends, making it useful for both overbought/oversold detection and trend strength.
| CCI Value | Zone | Interpretation |
|---|---|---|
| > +200 | Extreme overbought | Very rare; strong upward momentum; possible reversal warning |
| +100 to +200 | Overbought | Upward breakout zone; trend may continue but stretched |
| -100 to +100 | Neutral | Normal range; no extreme signal; watch for direction |
| -200 to -100 | Oversold | Downward breakout zone; trend may continue but stretched |
| < -200 | Extreme oversold | Very rare; panic selling; possible bounce or capitulation |
const BASE = "https://api.realmarketapi.com"
const API_KEY = "YOUR_API_KEY"
const PERIOD = 20
const url = new URL("/api/v1/indicator/cci", 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("CCI response:", data)Try it live in the Playground
Run a live /api/v1/indicator/cci request with your API key β see the real response instantly in your browser.
Momentum oscillator Β· Range: -100 to 0 Β· Requires Pro+
Developed by Larry Williams, Williams %R is an inverted momentum oscillator that measures the current closing price relative to the high-low range over a lookback period. It oscillates between -100 and 0, making overbought/oversold zones the opposite of most oscillators.
| %R Value | Zone | Interpretation |
|---|---|---|
| 0 to β20 | Overbought | Price near the recent high; bulls in control but stretched |
| β20 to β80 | Neutral | No extreme signal |
| β80 to β100 | Oversold | Price near the recent low; bears in control but stretched |
const BASE = "https://api.realmarketapi.com"
const API_KEY = "YOUR_API_KEY"
const PERIOD = 14
const url = new URL("/api/v1/indicator/williams-r", 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("Williams %R response:", data)Try it live in the Playground
Run a live /api/v1/indicator/williams-r request with your API key β see the real response instantly in your browser.
Trend strength Β· Non-directional Β· Requires Pro+
Also developed by J. Welles Wilder Jr., ADX quantifies the strength of a trend without indicating its direction. It is always plotted with two directional lines β +DI (positive directional indicator) and βDI (negative directional indicator) β from which both trend strength and direction can be inferred together.
| ADX Value | Trend Strength | Strategy Implication |
|---|---|---|
| < 20 | Absent / Weak | Range-bound; prefer mean-reversion strategies |
| 20β25 | Forming | Trend beginning; watch for confirmation before entering |
| 25β50 | Strong trend | Trend-following strategies perform well |
| 50β75 | Very strong | E.g. news-driven move; ride with tight trailing stops |
| > 75 | Extremely strong | Very rare; expect eventual exhaustion / reversal |
const BASE = "https://api.realmarketapi.com"
const API_KEY = "YOUR_API_KEY"
const PERIOD = 14
const url = new URL("/api/v1/indicator/adx", 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()
// data[0] => { openTime, adx, plusDI, minusDI }
console.log("ADX response:", data)Try it live in the Playground
Run a live /api/v1/indicator/adx request with your API key β see the real response instantly in your browser.
Retracement levels Β· Support/Resistance Β· Requires Pro+
Fibonacci retracement levels are horizontal lines that indicate where support and resistance are likely to occur. They are based on Fibonacci numbers and are used to identify potential reversal points. The levels are calculated by taking the high and low points of a trend and dividing the vertical distance by the key Fibonacci ratios.
| Level | Ratio | Description |
|---|---|---|
| 0.236 | 23.6% | Minor retracement level, often acts as support in uptrends |
| 0.382 | 38.2% | Common retracement level, confluence with other indicators |
| 0.500 | 50.0% | Midpoint, psychological level, often strong resistance/support |
| 0.618 | 61.8% | Golden ratio, major retracement level |
| 0.786 | 78.6% | Deep retracement, potential reversal zone |
const BASE = "https://api.realmarketapi.com"
const API_KEY = "YOUR_API_KEY"
const LOOKBACK = 50 // Optional: periods to look back for high/low
const url = new URL("/api/v1/indicator/fibonacci", BASE)
url.searchParams.set("apiKey", API_KEY)
url.searchParams.set("SymbolCode", "XAUUSD")
url.searchParams.set("TimeFrame", "H1")
if (LOOKBACK) url.searchParams.set("Lookback", String(LOOKBACK))
const res = await fetch(url.toString())
if (!res.ok) throw new Error("Request failed: " + res.status)
const data = await res.json()
console.log("Fibonacci API response:", data)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.
403 response. View plans β{ "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" } ] }
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.
Composite indicator Β· RSI(14) Β· MACD(12,26,9) Β· EMA-50/100 Β· Requires Pro+
The Market Sentiment endpoint aggregates multiple technical indicators into a single, human-readable composite score. It combines RSI (14-period), MACD histogram (12/26/9), and the relationship between EMA-50 and EMA-100 to produce a Fear & Greed score (0β100), a sentiment label, and a trend classification β all server-computed in a single API call.
{ "symbolCode": "EURUSD", "timeFrame": "H1", "calculatedAt": "2026-03-29T08:00:00Z", "trend": "StrongUptrend", "sentiment": "Greed", "fearGreedScore": 68, "rsi": 61.4, "macdHistogram": 0.000312, "ema50": 1.082540, "ema100": 1.079810, "currentClose": 1.084200 }
| Field | Type | Description |
|---|---|---|
| symbolCode | string | Trading symbol requested |
| timeFrame | string | Timeframe requested |
| calculatedAt | ISO 8601 | UTC timestamp of the calculation |
| trend | enum | StrongUptrend Β· Uptrend Β· Sideways Β· Downtrend Β· StrongDowntrend |
| sentiment | enum | ExtremeFear Β· Fear Β· Neutral Β· Greed Β· ExtremeGreed |
| fearGreedScore | integer | Composite score 0β100 (0 = Extreme Fear, 100 = Extreme Greed) |
| rsi | decimal | RSI value computed with period = 14 |
| macdHistogram | decimal | MACD histogram value (fast=12, slow=26, signal=9) |
| ema50 | decimal | EMA value computed with period = 50 |
| ema100 | decimal | EMA value computed with period = 100 |
| currentClose | decimal | Latest closing price used for calculations |
| Score | Sentiment | Interpretation |
|---|---|---|
| 0β20 | ExtremeFear | Market is extremely fearful β potential contrarian buy zone |
| 21β39 | Fear | Bearish sentiment dominates β caution advised on new long positions |
| 40β59 | Neutral | Balanced market conditions β wait for directional confirmation |
| 60β79 | Greed | Bullish sentiment rising β trend-following strategies in favour |
| 80β100 | ExtremeGreed | Market may be overextended β tighten risk management |
const BASE = "https://api.realmarketapi.com"
const API_KEY = "YOUR_API_KEY"
const url = new URL("/api/v1/indicator/sentiment", BASE)
url.searchParams.set("apiKey", API_KEY)
url.searchParams.set("symbolCode", "EURUSD")
url.searchParams.set("timeFrame", "H1")
const res = await fetch(url.toString())
if (!res.ok) throw new Error("Request failed: " + res.status)
const data = await res.json()
console.log("Sentiment API response:", data)Try it live in the Playground
Run a live /api/v1/indicator/sentiment request with your API key β see the real response instantly in your browser.
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.
{ "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 } }