πŸŽ‰ Our Chrome Extension is here! Get live market prices right in your browser.Install Now
RealMarketAPI
πŸ“ˆ
Docs/Technical Indicators

Technical Indicators

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.

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.

πŸ“ŠTrend-following

SMA & EMA smooth noise and reveal the underlying price direction.

πŸ”€Momentum

MACD captures the strength and direction of a trend's acceleration.

πŸ“Oscillators

RSI measures the speed of price changes to spot exhaustion zones.

πŸ”—Composable

Chain indicators together for confluence β€” or use the Sentiment API for a ready-made composite RSI + MACD + EMA score.

⚠ Important: Technical indicators are derived from past price data and are not predictive on their own. Always combine them with proper risk management, context, and multiple confirmations before executing trades.
S

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

SMA(n, t) = ( Close[t] + Close[t-1] + ... + Close[t-n+1] ) / n

API Endpoint

GET /api/v1/indicator/sma?apiKey=YOUR_API_KEY&SymbolCode=AAPL&TimeFrame=H1&Period=20

Common Periods

PeriodTimeframeTypical Use-Case
10M15 / H1Short-term momentum, scalp entries
20H1 / H4Intermediate trend & pullback zones
50H4 / D1Medium-term trend direction
100D1Major trend, institutional reference
200D1Long-term bull/bear market threshold

Signal Interpretation

bullishPrice crosses above SMA β†’ potential uptrend start or pullback entry
bearishPrice crosses below SMA β†’ potential downtrend or overhead resistance
bullishSMA-50 crosses above SMA-200 (Golden Cross) β†’ strong long-term bull signal
bearishSMA-50 crosses below SMA-200 (Death Cross) β†’ strong long-term bear signal
neutralPrice oscillating around SMA β†’ choppy / range-bound market

Code Example

sma.js
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)

Error Responses

400Validation error (missing ApiKey, invalid SymbolCode, invalid TimeFrame, Period out of range)
401/403Invalid API key or plan restriction
404Insufficient historical data for calculation
E

Exponential Moving AverageEMA

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.

Formula

k = 2 / (n + 1) EMA[t] = Close[t] Γ— k + EMA[t-1] Γ— (1 - k)
Tip: Always seed the EMA with an SMA of the same period on the first bar β€” the API handles this automatically so you receive stable values from the very first candle.

API Endpoint

GET /api/v1/indicator/ema?apiKey=YOUR_API_KEY&SymbolCode=AAPL&TimeFrame=H1&Period=20

Common Periods & Multipliers

PeriodMultiplier (k)Typical Use-Case
90.200Short-term signals, scalp/swing triggers
120.154MACD fast line
210.095Crypto & equity swing entries
260.074MACD slow line
500.039Medium-trend filter & dynamic S/R
2000.010Long-term trend, institutional benchmark

Signal Interpretation

bullishPrice crosses above EMA β†’ momentum shift to the upside
bearishPrice crosses below EMA β†’ momentum shift to the downside
bullishShort EMA crosses above long EMA (e.g. EMA-9 > EMA-21) β†’ trend acceleration up
bearishShort EMA crosses below long EMA β†’ trend acceleration down
neutralEMA slope flattening β†’ trend losing momentum, potential reversal zone

Code Example

ema.js
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)

Error Responses

400Validation error (missing ApiKey, invalid SymbolCode, invalid TimeFrame, Period out of range)
401/403Invalid API key or plan restriction
404Insufficient historical data for calculation
W

Weighted Moving AverageWMA

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.

Formula

WMA = Ξ£(Close[i] Γ— Weight[i]) / Ξ£(Weights) Weight = period, period-1, ..., 2, 1 (newest β†’ oldest) Ξ£(Weights) = period Γ— (period + 1) / 2
Note: WMA reacts faster than SMA but smoother than EMA on sharp spikes. Use it when you want recency bias without EMA's exponential tail.

API Endpoint

GET /api/v1/indicator/wma?apiKey=YOUR_API_KEY&SymbolCode=XAUUSD&TimeFrame=H1&Period=21

Query Parameters

ParameterTypeRequiredDescription
apiKeystringβœ…Your API key
SymbolCodestringβœ…Trading symbol (e.g. XAUUSD, BTCUSD)
TimeFramestringβœ…M1 Β· M5 Β· M15 Β· M30 Β· H1 Β· H4 Β· D1
Periodintβœ…Number of periods 2–500 (e.g. 9, 21, 50)
Plan requirement: Requires Pro plan or higher. Not available on Free, Starter, or Plus.

Common Periods

PeriodTimeframeTypical Use-Case
9M15 / H1Short-term momentum, fast signal
21H1 / H4Swing entries, trend confirmation
50H4 / D1Medium-term trend direction

Signal Interpretation

bullishPrice crosses above WMA β†’ potential uptrend start or pullback entry
bearishPrice crosses below WMA β†’ potential downtrend or overhead resistance
bullishWMA-9 crosses above WMA-21 β†’ short-term momentum turning bullish
bearishWMA-9 crosses below WMA-21 β†’ short-term momentum turning bearish
neutralPrice oscillating around WMA β†’ choppy / range-bound market

Example Response

{
  "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.

Code Example

wma.js
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)

Error Responses

ERR_0005_INVALID_API_KEYAPI key not found or inactive
ERR_0017_REQUEST_QUOTA_EXCEEDEDRequest quota exhausted
ERR_0012_EMAIL_NOT_VERIFIEDAccount email not verified
ERR_0007_INVALID_TIME_FRAMETimeframe not supported by your plan
ERR_0008_SYMBOL_NOT_SUPPORTEDSymbol not available on your plan
ERR_0014_INVALID_PLANPlan does not include indicator access
ERR_0001_DATA_NOT_FOUNDNo candle data available in Redis for this symbol/timeframe
M

MACDMoving Average Convergence Divergence

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.

MACD Line
EMA(12) βˆ’ EMA(26)
Signal Line
EMA(9) of MACD
Histogram
MACD βˆ’ Signal

API Endpoint

GET /api/v1/indicator/macd?apiKey=YOUR_API_KEY&SymbolCode=AAPL&TimeFrame=H1&FastPeriod=12&SlowPeriod=26&SignalPeriod=9

Standard Parameters

ParameterDefaultNotes
FastPeriod12Short EMA; lower = more sensitive
SlowPeriod26Long EMA; should be > FastPeriod
SignalPeriod9EMA of the MACD line

Signal Interpretation

bullishMACD Line crosses above Signal Line (bullish crossover) β†’ buy signal
bearishMACD Line crosses below Signal Line (bearish crossover) β†’ sell signal
bullishHistogram bars turning positive / growing β†’ increasing bullish momentum
bearishHistogram bars turning negative / shrinking β†’ increasing bearish momentum
bullishBullish divergence: price makes lower low, MACD makes higher low β†’ weakening downtrend
bearishBearish divergence: price makes higher high, MACD makes lower high β†’ weakening uptrend
neutralMACD and Signal lines near zero β†’ lack of trend direction

Code Example

macd.js
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)

Error Responses

400Validation error (missing ApiKey, invalid SymbolCode, invalid TimeFrame, Period out of range)
401/403Invalid API key or plan restriction
404Insufficient historical data for calculation
R

Relative Strength IndexRSI

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.

Formula

RS = Average Gain (n) / Average Loss (n) RSI = 100 βˆ’ 100 / (1 + RS)

API Endpoint

GET /api/v1/indicator/rsi?apiKey=YOUR_API_KEY&SymbolCode=AAPL&TimeFrame=H1&Period=14

RSI Zones

RSI RangeZoneInterpretation
> 70OverboughtPotential reversal down or pullback
50 – 70BullishUpward momentum, trend continuation
45 – 55NeutralIndecision, range-bound
30 – 50BearishDownward momentum, trend continuation
< 30OversoldPotential reversal up or bounce

Signal Interpretation

bearishRSI above 70 β†’ overbought; watch for reversal or pullback confirmation
bullishRSI below 30 β†’ oversold; watch for reversal or bounce confirmation
bullishRSI crosses above 50 β†’ momentum turning bullish
bearishRSI crosses below 50 β†’ momentum turning bearish
bullishBullish divergence (price lower low, RSI higher low) β†’ potential trend reversal up
bearishBearish divergence (price higher high, RSI lower high) β†’ potential trend reversal down
neutralRSI oscillating around 50 without extremes β†’ consolidation / no trend

Code Example

rsi.js
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)

Error Responses

400Validation error (missing ApiKey, invalid SymbolCode, invalid TimeFrame, Period out of range)
401/403Invalid API key or plan restriction
404Insufficient historical data for calculation
BB

Bollinger BandsBB

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.

Formula

Middle = SMA(Close, n) Οƒ = Standard Deviation of Close over n periods Upper = Middle + (k Γ— Οƒ) Lower = Middle βˆ’ (k Γ— Οƒ) Default: n = 20, k = 2

API Endpoint

GET /api/v1/indicator/bollinger-bands?apiKey=YOUR_API_KEY&SymbolCode=EURUSD&TimeFrame=H1&Period=20&Multiplier=2

Parameters

ParamTypeDefaultRange
periodint202–500
multiplierdecimal20.1–10

Signal Interpretation

bearishPrice touches or crosses above the upper band β€” overbought; momentum may be exhausting
bullishPrice touches or crosses below the lower band β€” oversold; potential bounce or reversal zone
neutralBands narrow (squeeze) β†’ low volatility consolidation; precedes an imminent breakout
bullishPrice breaks above the upper band after a squeeze with rising volume β†’ bullish breakout
bearishPrice breaks below the lower band after a squeeze β†’ bearish breakdown
neutralMiddle band (SMA-20) acts as dynamic support in uptrends and dynamic resistance in downtrends

Code Example

bollinger-bands.js
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.

Open Playground
%K

Stochastic Oscillator%K / %D

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.

Formula

%K = 100 Γ— (Close βˆ’ Lowest Low(K)) / (Highest High(K) βˆ’ Lowest Low(K)) %D = SMA(%K, D) -- signal line (smoothed %K) Default: K = 14, D = 3

API Endpoint

GET /api/v1/indicator/stochastic?apiKey=YOUR_API_KEY&SymbolCode=EURUSD&TimeFrame=H1&KPeriod=14&DPeriod=3

Stochastic Zones

%K / %D ValueZoneAction
> 80OverboughtConsider reducing longs or watching for %K/%D bearish cross
< 20OversoldConsider longs or watch for %K/%D bullish cross
50MidlineStrength above 50 = bullish bias; below 50 = bearish bias

Signal Interpretation

bullish%K crosses above %D in oversold zone (< 20) β†’ strong buy signal
bearish%K crosses below %D in overbought zone (> 80) β†’ strong sell signal
bullishBullish divergence: price makes new low but Stochastic doesn't β†’ hidden strength
bearishBearish divergence: price makes new high but Stochastic doesn't β†’ hidden weakness
neutralBoth lines hovering in 40–60 range β†’ no clear directional conviction

Code Example

stochastic.js
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.

Open Playground
ATR

Average True RangeATR

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.

Formula

True Range (TR) = max( High[t] βˆ’ Low[t], |High[t] βˆ’ Close[t-1]|, |Low[t] βˆ’ Close[t-1]| ) ATR[0] = SMA(TR, n) -- seed with simple average ATR[t] = (ATR[t-1] Γ— (n-1) + TR[t]) / n -- Wilder smoothing Default: n = 14

API Endpoint

GET /api/v1/indicator/atr?apiKey=YOUR_API_KEY&SymbolCode=EURUSD&TimeFrame=H1&Period=14
Practical use: A common stop-loss rule is 2 Γ— ATR below entry for longs and 2 Γ— ATR above entry for shorts. This keeps stops proportional to actual market noise and reduces the chance of being stopped out by random fluctuations.

Signal Interpretation

neutralRising ATR β†’ volatility expanding; expect larger swings, widen stops accordingly
neutralFalling ATR β†’ volatility contracting; typical of consolidation before a breakout
bearishVolatility spike on a bearish move β†’ sellers panicking; trend may accelerate downward
bullishATR spike on a breakout above resistance with bullish candle β†’ high-conviction move
neutralATR near multi-week low β†’ Bollinger Band squeeze likely forming; watch for breakout setup

Code Example

atr.js
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.

Open Playground
CCI

Commodity Channel IndexCCI

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.

Formula

Typical Price (TP) = (High + Low + Close) / 3 SMA_TP = SMA(TP, n) Mean Dev = (1/n) Γ— Ξ£|TP[i] βˆ’ SMA_TP| for i in [t-n+1, t] CCI = (TP βˆ’ SMA_TP) / (0.015 Γ— Mean Dev) Default: n = 20

API Endpoint

GET /api/v1/indicator/cci?apiKey=YOUR_API_KEY&SymbolCode=XAUUSD&TimeFrame=H1&Period=20

CCI Zones

CCI ValueZoneInterpretation
> +200Extreme overboughtVery rare; strong upward momentum; possible reversal warning
+100 to +200OverboughtUpward breakout zone; trend may continue but stretched
-100 to +100NeutralNormal range; no extreme signal; watch for direction
-200 to -100OversoldDownward breakout zone; trend may continue but stretched
< -200Extreme oversoldVery rare; panic selling; possible bounce or capitulation

Signal Interpretation

bullishCCI crosses above +100 from below β†’ bullish breakout signal; price above its mean
bearishCCI crosses below -100 from above β†’ bearish breakdown signal; price below its mean
bullishCCI returns above -100 after being oversold β†’ potential reversal buy entry
bearishCCI returns below +100 after being overbought β†’ potential reversal sell entry
neutralCCI divergence from price (like RSI) signals trend weakening ahead of reversal

Code Example

cci.js
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.

Open Playground
%R

Williams %R%R

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.

Formula

Highest High = max(High[i]) for i in [t - n + 1, t] Lowest Low = min(Low[i]) for i in [t - n + 1, t] %R = βˆ’100 Γ— (Highest High βˆ’ Close) / (Highest High βˆ’ Lowest Low) Range: βˆ’100 (extreme oversold) to 0 (extreme overbought) Default: n = 14

API Endpoint

GET /api/v1/indicator/williams-r?apiKey=YOUR_API_KEY&SymbolCode=XAUUSD&TimeFrame=H1&Period=14

%R Zones

%R ValueZoneInterpretation
0 to βˆ’20OverboughtPrice near the recent high; bulls in control but stretched
βˆ’20 to βˆ’80NeutralNo extreme signal
βˆ’80 to βˆ’100OversoldPrice near the recent low; bears in control but stretched

Signal Interpretation

bearish%R rises above -20 β†’ overbought territory; possible reversal or slow-down ahead
bullish%R falls below -80 β†’ oversold territory; possible reversal or bounce zone
bullish%R crosses from below -80 up through -80 β†’ early reversal signal; confirms oversold exit
bearish%R crosses from above -20 down through -20 β†’ early reversal signal; confirms overbought exit
neutralCombine with EMA direction: oversold %R + price above EMA = higher-probability long setup

Code Example

williams-r.js
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.

Open Playground
ADX

Average Directional IndexADX Β· +DI Β· βˆ’DI

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.

Formula

+DM = max(High[t] βˆ’ High[t-1], 0) if > βˆ’DM, else 0 βˆ’DM = max(Low[t-1] βˆ’ Low[t], 0) if > +DM, else 0 Smoothed using Wilder's method over n periods: +DI = 100 Γ— Smooth(+DM) / ATR(n) βˆ’DI = 100 Γ— Smooth(βˆ’DM) / ATR(n) DX = 100 Γ— |+DI βˆ’ βˆ’DI| / (+DI + βˆ’DI) ADX = Wilder's smoothed average of DX over n periods Default: n = 14 Range: 0–100

API Endpoint

GET /api/v1/indicator/adx?apiKey=YOUR_API_KEY&SymbolCode=XAUUSD&TimeFrame=H1&Period=14

ADX Strength Levels

ADX ValueTrend StrengthStrategy Implication
< 20Absent / WeakRange-bound; prefer mean-reversion strategies
20–25FormingTrend beginning; watch for confirmation before entering
25–50Strong trendTrend-following strategies perform well
50–75Very strongE.g. news-driven move; ride with tight trailing stops
> 75Extremely strongVery rare; expect eventual exhaustion / reversal

Signal Interpretation

bullishADX > 25 AND +DI > βˆ’DI β†’ confirmed bullish trend β€” bias long
bearishADX > 25 AND βˆ’DI > +DI β†’ confirmed bearish trend β€” bias short
bullish+DI crosses above βˆ’DI while ADX is rising β†’ bullish directional crossover with strengthening trend
bearishβˆ’DI crosses above +DI while ADX is rising β†’ bearish directional crossover with strengthening trend
neutralADX < 20 regardless of DI position β†’ avoid trend-following; use RSI/Stochastic for range trading
neutralADX peaks and turns down β†’ trend exhausting; consider tightening trailing stops

Code Example

adx.js
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.

Open Playground
F

Fibonacci RetracementFibonacci

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.

Formula

// Identify swing high and swing low over the lookback period High = max(High[i]) for i in [t - lookback, t] Low = min(Low[i]) for i in [t - lookback, t] // Calculate retracement levels Range = High - Low Fib_0.236 = High - (Range * 0.236) Fib_0.382 = High - (Range * 0.382) Fib_0.500 = High - (Range * 0.500) Fib_0.618 = High - (Range * 0.618) Fib_0.786 = High - (Range * 0.786)

API Endpoint

GET /api/v1/indicator/fibonacci?apiKey=YOUR_API_KEY&SymbolCode=XAUUSD&TimeFrame=H1&Lookback=50

Fibonacci Levels

LevelRatioDescription
0.23623.6%Minor retracement level, often acts as support in uptrends
0.38238.2%Common retracement level, confluence with other indicators
0.50050.0%Midpoint, psychological level, often strong resistance/support
0.61861.8%Golden ratio, major retracement level
0.78678.6%Deep retracement, potential reversal zone

Signal Interpretation

bullishPrice bounces off Fibonacci level in downtrend β€” potential reversal
bearishPrice rejects Fibonacci level in uptrend β€” potential reversal
neutralMultiple levels confluence β€” stronger signal when levels cluster
bullishFibonacci level coincides with support & resistance β€” high probability setup
neutralLookback parameter controls swing size β€” larger lookback for major trends

Code Example

fibonacci.js
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)

Error Responses

400Validation error (missing ApiKey, invalid SymbolCode, invalid TimeFrame, Lookback out of range)
401/403Invalid API key or plan restriction (requires Pro+)
404Insufficient historical data for calculation
SR

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.

🟒Support

A price floor. Bulls have historically defended this level. The higher the touch count, the stronger the zone.

πŸ”΄Resistance

A price ceiling. Bears have historically sold at or near this level. Multiple rejections = strong resistance.

πŸ“ŠTouch Count

How many times price has tested a level. Higher counts indicate institutional memory and greater reliability.

⏰Last Touched

Recency matters. A level tested last week is more relevant than one tested 6 months ago.

Endpoint

GET /api/v1/indicator/support-resistance?apiKey=YOUR_API_KEY&symbolCode=XAUUSD&timeFrame=H1
πŸ”’ Requires Pro plan or above. This endpoint computes levels from historical candle data. The Free plan does not include historical data access and will receive a 403 response. View plans β†’

Response Structure

response.json
{
  "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

bullishPrice approaching a support level with high TouchCount β€” potential bounce zone; look for bullish confirmation candles
bearishPrice approaching a resistance level with high TouchCount β€” potential reversal zone; consider tightening stops on longs
bullishPrice closes above a resistance level β€” resistance has been broken and may now act as new support
bearishPrice closes below a support level β€” support has been broken and may now act as new resistance
neutralLevels with low TouchCount (1–2) are weaker and less reliable β€” use only with strong additional confluence
neutralCombine SR levels with RSI (overbought/oversold) and EMA slope for high-probability entries

Code Example

support-resistance.js
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)`)

Error Responses

400Validation error (missing ApiKey, invalid SymbolCode, invalid TimeFrame)
401/403Invalid API key or plan restriction (requires Pro+)
404Insufficient historical data for calculation
▢️

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.

Open Playground
Sn

Market SentimentFear & Greed

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.

Composite Formula

// Inputs RSI_14 = RSI with period = 14 MACD_Histogram = MACD line βˆ’ Signal line (fast=12, slow=26, signal=9) EMA_50 = EMA with period = 50 EMA_100 = EMA with period = 100 // Fear & Greed Score (0 = Extreme Fear Β· 100 = Extreme Greed) FearGreedScore = weighted_composite(RSI_14, MACD_Histogram, EMA_50, EMA_100) // Trend Classification StrongUptrend β†’ currentClose > EMA_50 > EMA_100 AND MACD_Histogram > 0 Uptrend β†’ currentClose > EMA_50 > EMA_100 Sideways β†’ |EMA_50 βˆ’ EMA_100| β‰ˆ 0 Downtrend β†’ currentClose < EMA_50 < EMA_100 StrongDowntrend β†’ currentClose < EMA_50 < EMA_100 AND MACD_Histogram < 0

API Endpoint

GET /api/v1/indicator/sentiment?apiKey=YOUR_API_KEY&symbolCode=EURUSD&timeFrame=H1
πŸ”’ Requires Pro plan or above. Sentiment is a composite indicator whose sub-components (RSI, MACD, EMA) all require Pro+. View plans β†’

Response Structure

response.json
{
  "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
}

Response Fields

FieldTypeDescription
symbolCodestringTrading symbol requested
timeFramestringTimeframe requested
calculatedAtISO 8601UTC timestamp of the calculation
trendenumStrongUptrend Β· Uptrend Β· Sideways Β· Downtrend Β· StrongDowntrend
sentimentenumExtremeFear Β· Fear Β· Neutral Β· Greed Β· ExtremeGreed
fearGreedScoreintegerComposite score 0–100 (0 = Extreme Fear, 100 = Extreme Greed)
rsidecimalRSI value computed with period = 14
macdHistogramdecimalMACD histogram value (fast=12, slow=26, signal=9)
ema50decimalEMA value computed with period = 50
ema100decimalEMA value computed with period = 100
currentClosedecimalLatest closing price used for calculations

Fear & Greed Zones

ScoreSentimentInterpretation
0–20ExtremeFearMarket is extremely fearful β€” potential contrarian buy zone
21–39FearBearish sentiment dominates β€” caution advised on new long positions
40–59NeutralBalanced market conditions β€” wait for directional confirmation
60–79GreedBullish sentiment rising β€” trend-following strategies in favour
80–100ExtremeGreedMarket may be overextended β€” tighten risk management

Signal Interpretation

bullishfearGreedScore rises above 60 β†’ Greed zone entered; bullish momentum building β€” favour long setups
bearishfearGreedScore falls below 40 β†’ Fear zone; risk-off pressure increasing β€” reduce long exposure
bullishtrend = StrongUptrend AND fearGreedScore 60–79 β†’ strong directional confluence β€” high-confidence long bias
bearishtrend = StrongDowntrend AND fearGreedScore 21–39 β†’ strong bearish confluence β€” avoid longs, look for shorts
neutralSideways trend with Neutral sentiment (40–59) β†’ range-bound conditions β€” mean-reversion over trend-following
bullishema50 > ema100 AND macdHistogram > 0 β†’ dual EMA alignment with positive momentum confirms bullish bias
bearishema50 < ema100 AND macdHistogram < 0 β†’ dual EMA alignment with negative momentum confirms bearish bias

Code Example

sentiment.js
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)

Error Responses

400Validation error (missing apiKey, invalid symbolCode, invalid timeFrame)
401/403Invalid API key or plan restriction (requires Pro+)
404Insufficient historical data for calculation
▢️

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.

Open Playground

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

  1. 1Filter direction: price above EMA-50 = only look for longs
  2. 2Wait for RSI to dip into 40–50 (pullback without going oversold)
  3. 3Enter when RSI starts rising back above 50
  4. 4Stop below EMA-50; target previous high
πŸ”€

MACD + RSI β€” Reversal Entry

  1. 1Identify RSI < 30 (oversold) or RSI > 70 (overbought)
  2. 2Wait for MACD histogram to start shrinking (momentum fading)
  3. 3Enter on MACD line Γ— Signal line crossover
  4. 4Tight stop beyond the recent swing; RSI returning to 50 as target zone
βœ–

SMA Golden/Death Cross

  1. 1Plot SMA-50 and SMA-200 on D1 timeframe
  2. 2Golden Cross (50 > 200): long-term bull β€” buy dips above SMA-50
  3. 3Death Cross (50 < 200): long-term bear β€” sell rallies below SMA-50
  4. 4Confirm regime shift with MACD above/below zero
πŸ“

MACD Divergence + EMA Slope

  1. 1Observe price making new lows while MACD histogram shrinks (bullish divergence)
  2. 2Confirm EMA-20 slope is flattening or turning up
  3. 3Enter on EMA-9/21 bullish crossover for timing
  4. 4Invalidate if price breaks the previous swing low

Minimum Data Requirements

candle-requirements.json
{
  "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 }
}
Feedback