API reference
Technical indicators
Server-computed indicators under GET /api/v1/indicator/*, with the formula behind each one, signal guides, and code examples.
Overview
Technical indicators are calculations on price and/or volume used to gauge trend, momentum and volatility. The indicator APIs return server-computed values ready to use; formulas are included to explain the math. Every indicator originates from the same OHLCV candles returned by market data endpoints such as /api/v1/history. 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 RSI + MACD + EMA composite.
Important
Technical indicators are derived from past prices and are not predictive on their own. Always combine them with proper risk management, context, and multiple confirmations before executing trades.
Simple Moving Average SMA
Trend-following · LaggingThe Simple Moving Average computes the arithmetic mean of closing prices over a rolling window of n periods. It is the foundation of nearly every other indicator. The longer the period, the smoother but laggier the output.
Formula
formula
SMA(n, t) = ( Close[t] + Close[t-1] + ... + Close[t-n+1] ) / nAPI endpoint
Request
GET /api/v1/indicator/sma?apiKey=YOUR_API_KEY&symbolCode=AAPL&timeFrame=H1&period=20Common periods
| Period | Timeframe | Typical use |
|---|---|---|
| 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
- 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)sma.py
import requests
BASE = "https://api.realmarketapi.com"
API_KEY = "YOUR_API_KEY"
PERIOD = 20
resp = requests.get(f"{BASE}/api/v1/indicator/sma", params={
"apiKey": API_KEY,
"SymbolCode": "XAUUSD",
"TimeFrame": "H1",
"Period": PERIOD,
})
resp.raise_for_status()
print("SMA API response:")
print(resp.json())Sma.cs
const string BASE = "https://api.realmarketapi.com";
const string API_KEY = "YOUR_API_KEY";
const int PERIOD = 20;
using var http = new HttpClient();
var url = $"{BASE}/api/v1/indicator/sma?apiKey={API_KEY}&symbolCode=XAUUSD&timeFrame=H1&period={PERIOD}";
var json = await http.GetStringAsync(url);
Console.WriteLine("SMA API response:");
Console.WriteLine(json);Sma.java
import java.net.URI;
import java.net.http.*;
public class Sma {
static final String BASE = "https://api.realmarketapi.com";
static final String API_KEY = "YOUR_API_KEY";
static final int PERIOD = 20;
public static void main(String[] args) throws Exception {
var client = HttpClient.newHttpClient();
var request = HttpRequest.newBuilder()
.uri(URI.create(BASE + "/api/v1/indicator/sma?apiKey=" + API_KEY
+ "&symbolCode=XAUUSD&timeFrame=H1&period=" + PERIOD))
.GET().build();
var body = client.send(request, HttpResponse.BodyHandlers.ofString()).body();
System.out.println("SMA API response:");
System.out.println(body);
}
}Error responses
| Code | Meaning |
|---|---|
| 400 | Validation error (missing ApiKey, invalid SymbolCode, invalid TimeFrame, Period out of range) |
| 401/403 | Invalid API key or plan restriction |
| 404 | Insufficient historical data for calculation |
Exponential Moving Average EMA
Trend-following · Lagging · WeightedThe Exponential Moving Average applies a multiplier that gives more weight to recent prices, so it reacts 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
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 does this automatically, so values are stable from the very first candle.
API endpoint
Request
GET /api/v1/indicator/ema?apiKey=YOUR_API_KEY&symbolCode=AAPL&timeFrame=H1&period=20Common periods & multipliers
| Period | Multiplier (k) | Typical use |
|---|---|---|
| 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 |
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)ema.py
import requests
BASE = "https://api.realmarketapi.com"
API_KEY = "YOUR_API_KEY"
PERIOD = 12
resp = requests.get(f"{BASE}/api/v1/indicator/ema", params={
"apiKey": API_KEY,
"SymbolCode": "XAUUSD",
"TimeFrame": "H1",
"Period": PERIOD,
})
resp.raise_for_status()
print("EMA API response:")
print(resp.json())Ema.cs
const string BASE = "https://api.realmarketapi.com";
const string API_KEY = "YOUR_API_KEY";
const int PERIOD = 12;
using var http = new HttpClient();
var url = $"{BASE}/api/v1/indicator/ema?apiKey={API_KEY}&symbolCode=XAUUSD&timeFrame=H1&period={PERIOD}";
var json = await http.GetStringAsync(url);
Console.WriteLine("EMA API response:");
Console.WriteLine(json);Ema.java
import java.net.URI;
import java.net.http.*;
public class Ema {
static final String BASE = "https://api.realmarketapi.com";
static final String API_KEY = "YOUR_API_KEY";
static final int PERIOD = 12;
public static void main(String[] args) throws Exception {
var client = HttpClient.newHttpClient();
var request = HttpRequest.newBuilder()
.uri(URI.create(BASE + "/api/v1/indicator/ema?apiKey=" + API_KEY
+ "&symbolCode=XAUUSD&timeFrame=H1&period=" + PERIOD))
.GET().build();
var body = client.send(request, HttpResponse.BodyHandlers.ofString()).body();
System.out.println("EMA API response:");
System.out.println(body);
}
}Error responses
| Code | Meaning |
|---|---|
| 400 | Validation error (missing ApiKey, invalid SymbolCode, invalid TimeFrame, Period out of range) |
| 401/403 | Invalid API key or plan restriction |
| 404 | Insufficient historical data for calculation |
Weighted Moving Average WMA
Trend-following · Lagging · Linearly weightedThe Weighted Moving Average assigns linearly increasing weights to closing prices, so recent candles have more impact than older ones. WMA reacts faster than SMA but is smoother than EMA on sharp spikes, a useful middle ground for trend-following strategies.
Formula
formula
WMA = Σ(Close[i] × Weight[i]) / Σ(Weights)
Weight = period, period-1, ..., 2, 1 (newest → oldest)
Σ(Weights) = period × (period + 1) / 2Note
Use WMA when you want recency bias without the EMA's exponential tail.
API endpoint
Request
GET /api/v1/indicator/wma?apiKey=YOUR_API_KEY&symbolCode=XAUUSD&timeFrame=H1&period=21Plan requirement
Requires Pro plan or higher. Not available on Free, Starter, or Plus.
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| apiKey | string | Yes | Your API key |
| SymbolCode | string | Yes | Trading symbol (e.g. XAUUSD, BTCUSD) |
| TimeFrame | string | Yes | M1 · M5 · M15 · M30 · H1 · H4 · D1 |
| Period | int | Yes | Number of periods 2–500 (e.g. 9, 21, 50) |
Common periods
| Period | Timeframe | Typical use |
|---|---|---|
| 9 | M15 / H1 | Short-term momentum, fast signal |
| 21 | H1 / H4 | Swing entries, trend confirmation |
| 50 | H4 / D1 | Medium-term trend direction |
Example response
Response · 200
{
"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.
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
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)wma.py
import requests
BASE = "https://api.realmarketapi.com"
API_KEY = "YOUR_API_KEY"
PERIOD = 21
resp = requests.get(f"{BASE}/api/v1/indicator/wma", params={
"apiKey": API_KEY,
"SymbolCode": "XAUUSD",
"TimeFrame": "H1",
"Period": PERIOD,
})
resp.raise_for_status()
print("WMA API response:")
print(resp.json())Wma.cs
const string BASE = "https://api.realmarketapi.com";
const string API_KEY = "YOUR_API_KEY";
const int PERIOD = 21;
using var http = new HttpClient();
var url = $"{BASE}/api/v1/indicator/wma?apiKey={API_KEY}&symbolCode=XAUUSD&timeFrame=H1&period={PERIOD}";
var json = await http.GetStringAsync(url);
Console.WriteLine("WMA API response:");
Console.WriteLine(json);Wma.java
import java.net.URI;
import java.net.http.*;
public class Wma {
static final String BASE = "https://api.realmarketapi.com";
static final String API_KEY = "YOUR_API_KEY";
static final int PERIOD = 21;
public static void main(String[] args) throws Exception {
var client = HttpClient.newHttpClient();
var request = HttpRequest.newBuilder()
.uri(URI.create(BASE + "/api/v1/indicator/wma?apiKey=" + API_KEY
+ "&symbolCode=XAUUSD&timeFrame=H1&period=" + PERIOD))
.GET().build();
var body = client.send(request, HttpResponse.BodyHandlers.ofString()).body();
System.out.println("WMA API response:");
System.out.println(body);
}
}Error responses
| Code | Meaning |
|---|---|
| ERR_0005_INVALID_API_KEY | API key not found or inactive |
| ERR_0017_REQUEST_QUOTA_EXCEEDED | Request quota exhausted |
| ERR_0012_EMAIL_NOT_VERIFIED | Account email not verified |
| ERR_0007_INVALID_TIME_FRAME | Timeframe not supported by your plan |
| ERR_0008_SYMBOL_NOT_SUPPORTED | Symbol not available on your plan |
| ERR_0014_INVALID_PLAN | Plan does not include indicator access |
| ERR_0001_DATA_NOT_FOUND | No candle data available in Redis for this symbol/timeframe |
Moving Average Convergence Divergence MACD
Momentum · Trend · OscillatorMACD measures the relationship between two EMAs and plots a signal line on top. Together the three components reveal direction, momentum, and potential reversals at a glance.
- MACD line
- EMA(12) − EMA(26)
- Signal line
- EMA(9) of MACD
- Histogram
- MACD − Signal
API endpoint
Request
GET /api/v1/indicator/macd?apiKey=YOUR_API_KEY&symbolCode=AAPL&timeFrame=H1&fastPeriod=12&slowPeriod=26&signalPeriod=9Standard parameters
| Parameter | Default | Notes |
|---|---|---|
| FastPeriod | 12 | Short EMA; lower = more sensitive |
| SlowPeriod | 26 | Long EMA; should be > FastPeriod |
| SignalPeriod | 9 | EMA 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)macd.py
import requests
BASE = "https://api.realmarketapi.com"
API_KEY = "YOUR_API_KEY"
FAST_PERIOD = 12
SLOW_PERIOD = 26
SIGNAL_PERIOD = 9
resp = requests.get(f"{BASE}/api/v1/indicator/macd", params={
"apiKey": API_KEY,
"SymbolCode": "XAUUSD",
"TimeFrame": "H1",
"FastPeriod": FAST_PERIOD,
"SlowPeriod": SLOW_PERIOD,
"SignalPeriod": SIGNAL_PERIOD,
})
resp.raise_for_status()
print("MACD API response:")
print(resp.json())Macd.cs
const string BASE = "https://api.realmarketapi.com";
const string API_KEY = "YOUR_API_KEY";
const int FAST_PERIOD = 12;
const int SLOW_PERIOD = 26;
const int SIGNAL_PERIOD = 9;
using var http = new HttpClient();
var url = $"{BASE}/api/v1/indicator/macd?apiKey={API_KEY}&symbolCode=XAUUSD&timeFrame=H1&fastPeriod={FAST_PERIOD}&slowPeriod={SLOW_PERIOD}&signalPeriod={SIGNAL_PERIOD}";
var json = await http.GetStringAsync(url);
Console.WriteLine("MACD API response:");
Console.WriteLine(json);Macd.java
import java.net.URI;
import java.net.http.*;
public class Macd {
static final String BASE = "https://api.realmarketapi.com";
static final String API_KEY = "YOUR_API_KEY";
static final int FAST_PERIOD = 12;
static final int SLOW_PERIOD = 26;
static final int SIGNAL_PERIOD = 9;
public static void main(String[] args) throws Exception {
var client = HttpClient.newHttpClient();
var request = HttpRequest.newBuilder()
.uri(URI.create(BASE + "/api/v1/indicator/macd?apiKey=" + API_KEY
+ "&symbolCode=XAUUSD&timeFrame=H1"
+ "&fastPeriod=" + FAST_PERIOD
+ "&slowPeriod=" + SLOW_PERIOD
+ "&signalPeriod=" + SIGNAL_PERIOD))
.GET().build();
var body = client.send(request, HttpResponse.BodyHandlers.ofString()).body();
System.out.println("MACD API response:");
System.out.println(body);
}
}Error responses
| Code | Meaning |
|---|---|
| 400 | Validation error (missing ApiKey, invalid SymbolCode, invalid TimeFrame, Period out of range) |
| 401/403 | Invalid API key or plan restriction |
| 404 | Insufficient historical data for calculation |
Relative Strength Index RSI
Momentum · Oscillator · 0–100 scaleThe Relative Strength Index measures the speed and magnitude of recent price changes on a 0–100 scale. Developed by J. Welles Wilder, it is one of the most-used oscillators for spotting overbought and oversold conditions.
Formula
formula
RS = Average Gain (n) / Average Loss (n)
RSI = 100 − 100 / (1 + RS)API endpoint
Request
GET /api/v1/indicator/rsi?apiKey=YOUR_API_KEY&symbolCode=AAPL&timeFrame=H1&period=14RSI zones
| 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 |
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)rsi.py
import requests
BASE = "https://api.realmarketapi.com"
API_KEY = "YOUR_API_KEY"
PERIOD = 14
resp = requests.get(f"{BASE}/api/v1/indicator/rsi", params={
"apiKey": API_KEY,
"SymbolCode": "XAUUSD",
"TimeFrame": "H1",
"Period": PERIOD,
})
resp.raise_for_status()
print("RSI API response:")
print(resp.json())Rsi.cs
const string BASE = "https://api.realmarketapi.com";
const string API_KEY = "YOUR_API_KEY";
const int PERIOD = 14;
using var http = new HttpClient();
var url = $"{BASE}/api/v1/indicator/rsi?apiKey={API_KEY}&symbolCode=XAUUSD&timeFrame=H1&period={PERIOD}";
var json = await http.GetStringAsync(url);
Console.WriteLine("RSI API response:");
Console.WriteLine(json);Rsi.java
import java.net.URI;
import java.net.http.*;
public class Rsi {
static final String BASE = "https://api.realmarketapi.com";
static final String API_KEY = "YOUR_API_KEY";
static final int PERIOD = 14;
public static void main(String[] args) throws Exception {
var client = HttpClient.newHttpClient();
var request = HttpRequest.newBuilder()
.uri(URI.create(BASE + "/api/v1/indicator/rsi?apiKey=" + API_KEY
+ "&symbolCode=XAUUSD&timeFrame=H1&period=" + PERIOD))
.GET().build();
var body = client.send(request, HttpResponse.BodyHandlers.ofString()).body();
System.out.println("RSI API response:");
System.out.println(body);
}
}Error responses
| Code | Meaning |
|---|---|
| 400 | Validation error (missing ApiKey, invalid SymbolCode, invalid TimeFrame, Period out of range) |
| 401/403 | Invalid API key or plan restriction |
| 404 | Insufficient historical data for calculation |
Bollinger Bands BB
Volatility · Upper · Middle · Lower bands · Pro+Developed by John Bollinger in the 1980s, Bollinger Bands place a volatility envelope above and below a simple moving average. The bands widen in high volatility and contract in low volatility, which makes them useful for breakouts, squeezes, and overbought/oversold conditions within a trend.
Formula
formula
Middle = SMA(Close, n)
σ = Standard Deviation of Close over n periods
Upper = Middle + (k × σ)
Lower = Middle − (k × σ)
Default: n = 20, k = 2API endpoint
Request
GET /api/v1/indicator/bollinger-bands?apiKey=YOUR_API_KEY&symbolCode=EURUSD&timeFrame=H1&period=20&multiplier=2Parameters
| Param | Type | Default | Range |
|---|---|---|---|
| period | int | 20 | 2–500 |
| multiplier | decimal | 2 | 0.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 that often precedes a 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)bollinger-bands.py
import requests
BASE = "https://api.realmarketapi.com"
API_KEY = "YOUR_API_KEY"
PERIOD = 20
MULTIPLIER = 2
resp = requests.get(f"{BASE}/api/v1/indicator/bollinger-bands", params={
"apiKey": API_KEY,
"SymbolCode": "EURUSD",
"TimeFrame": "H1",
"Period": PERIOD,
"Multiplier": MULTIPLIER,
})
resp.raise_for_status()
print(resp.json())BollingerBands.cs
const string BASE = "https://api.realmarketapi.com";
const string API_KEY = "YOUR_API_KEY";
const int PERIOD = 20;
const double MULT = 2.0;
using var http = new HttpClient();
var url = $"{BASE}/api/v1/indicator/bollinger-bands?apiKey={API_KEY}&symbolCode=EURUSD&timeFrame=H1&period={PERIOD}&multiplier={MULT}";
var json = await http.GetStringAsync(url);
Console.WriteLine(json);BollingerBands.java
import java.net.URI;
import java.net.http.*;
public class BollingerBands {
static final String BASE = "https://api.realmarketapi.com";
static final String API_KEY = "YOUR_API_KEY";
static final int PERIOD = 20;
static final double MULT = 2.0;
public static void main(String[] args) throws Exception {
var client = HttpClient.newHttpClient();
var request = HttpRequest.newBuilder()
.uri(URI.create(BASE + "/api/v1/indicator/bollinger-bands?apiKey=" + API_KEY
+ "&symbolCode=EURUSD&timeFrame=H1&period=" + PERIOD + "&multiplier=" + MULT))
.GET().build();
System.out.println(client.send(request, HttpResponse.BodyHandlers.ofString()).body());
}
}Stochastic Oscillator %K / %D
Momentum oscillator · Range 0–100 · Pro+Developed by George Lane, the Stochastic oscillator compares a closing price to its range over a given period. It produces a fast %K line and a slower %D signal line, used together to find overbought/oversold conditions and momentum crossovers.
Formula
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 = 3API endpoint
Request
GET /api/v1/indicator/stochastic?apiKey=YOUR_API_KEY&symbolCode=EURUSD&timeFrame=H1&kPeriod=14&dPeriod=3Stochastic zones
| %K / %D value | Zone | Action |
|---|---|---|
| > 80 | Overbought | Consider reducing longs or watch for a %K/%D bearish cross |
| < 20 | Oversold | Consider longs or watch for a %K/%D bullish cross |
| 50 | Midline | Above 50 = bullish bias; below 50 = bearish bias |
Signal interpretation
- bullish%K crosses above %D in the oversold zone (< 20) → strong buy signal
- bearish%K crosses below %D in the overbought zone (> 80) → strong sell signal
- bullishBullish divergence: price makes a new low but Stochastic doesn't → hidden strength
- bearishBearish divergence: price makes a new high but Stochastic doesn't → hidden weakness
- neutralBoth lines hovering in the 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)stochastic.py
import requests
BASE = "https://api.realmarketapi.com"
API_KEY = "YOUR_API_KEY"
K_PERIOD = 14
D_PERIOD = 3
resp = requests.get(f"{BASE}/api/v1/indicator/stochastic", params={
"apiKey": API_KEY,
"SymbolCode": "EURUSD",
"TimeFrame": "H1",
"KPeriod": K_PERIOD,
"DPeriod": D_PERIOD,
})
resp.raise_for_status()
print(resp.json())Stochastic.cs
const string BASE = "https://api.realmarketapi.com";
const string API_KEY = "YOUR_API_KEY";
const int K_PERIOD = 14;
const int D_PERIOD = 3;
using var http = new HttpClient();
var url = $"{BASE}/api/v1/indicator/stochastic?apiKey={API_KEY}&symbolCode=EURUSD&timeFrame=H1&kPeriod={K_PERIOD}&dPeriod={D_PERIOD}";
var json = await http.GetStringAsync(url);
Console.WriteLine(json);Stochastic.java
import java.net.URI;
import java.net.http.*;
public class Stochastic {
static final String BASE = "https://api.realmarketapi.com";
static final String API_KEY = "YOUR_API_KEY";
static final int K_PERIOD = 14;
static final int D_PERIOD = 3;
public static void main(String[] args) throws Exception {
var client = HttpClient.newHttpClient();
var request = HttpRequest.newBuilder()
.uri(URI.create(BASE + "/api/v1/indicator/stochastic?apiKey=" + API_KEY
+ "&symbolCode=EURUSD&timeFrame=H1&kPeriod=" + K_PERIOD + "&dPeriod=" + D_PERIOD))
.GET().build();
System.out.println(client.send(request, HttpResponse.BodyHandlers.ofString()).body());
}
}Average True Range ATR
Volatility · Stop-loss sizing · Pro+Introduced by J. Welles Wilder Jr., ATR measures volatility by averaging the True Range over a period. It does not indicate direction, only how much price is moving, and is the standard tool for placing stops and sizing positions to current conditions.
Formula
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 = 14Practical 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.
API endpoint
Request
GET /api/v1/indicator/atr?apiKey=YOUR_API_KEY&symbolCode=EURUSD&timeFrame=H1&period=14Signal interpretation
- neutralRising ATR → volatility expanding; expect larger swings and 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 a bullish candle → high-conviction move
- neutralATR near a multi-week low → Bollinger Band squeeze likely forming; watch for a 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)atr.py
import requests
BASE = "https://api.realmarketapi.com"
API_KEY = "YOUR_API_KEY"
PERIOD = 14
resp = requests.get(f"{BASE}/api/v1/indicator/atr", params={
"apiKey": API_KEY,
"SymbolCode": "EURUSD",
"TimeFrame": "H1",
"Period": PERIOD,
})
resp.raise_for_status()
print(resp.json())Atr.cs
const string BASE = "https://api.realmarketapi.com";
const string API_KEY = "YOUR_API_KEY";
const int PERIOD = 14;
using var http = new HttpClient();
var url = $"{BASE}/api/v1/indicator/atr?apiKey={API_KEY}&symbolCode=EURUSD&timeFrame=H1&period={PERIOD}";
var json = await http.GetStringAsync(url);
Console.WriteLine(json);Atr.java
import java.net.URI;
import java.net.http.*;
public class Atr {
static final String BASE = "https://api.realmarketapi.com";
static final String API_KEY = "YOUR_API_KEY";
static final int PERIOD = 14;
public static void main(String[] args) throws Exception {
var client = HttpClient.newHttpClient();
var request = HttpRequest.newBuilder()
.uri(URI.create(BASE + "/api/v1/indicator/atr?apiKey=" + API_KEY
+ "&symbolCode=EURUSD&timeFrame=H1&period=" + PERIOD))
.GET().build();
System.out.println(client.send(request, HttpResponse.BodyHandlers.ofString()).body());
}
}Commodity Channel Index CCI
Overbought/oversold oscillator · Unbounded · Pro+Developed by Donald Lambert, CCI measures how far the current typical price has deviated from its average over a rolling window, normalised by mean absolute deviation. Unlike RSI and Stochastic, CCI is unbounded and can go well beyond ±100 in strong trends, so it serves both overbought/oversold detection and trend strength.
Formula
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 = 20API endpoint
Request
GET /api/v1/indicator/cci?apiKey=YOUR_API_KEY&symbolCode=XAUUSD&timeFrame=H1&period=20CCI zones
| 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 |
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 a 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)cci.py
import requests
BASE = "https://api.realmarketapi.com"
API_KEY = "YOUR_API_KEY"
PERIOD = 20
resp = requests.get(f"{BASE}/api/v1/indicator/cci", params={
"apiKey": API_KEY,
"SymbolCode": "XAUUSD",
"TimeFrame": "H1",
"Period": PERIOD,
})
resp.raise_for_status()
print(resp.json())Cci.cs
const string BASE = "https://api.realmarketapi.com";
const string API_KEY = "YOUR_API_KEY";
const int PERIOD = 20;
using var http = new HttpClient();
var url = $"{BASE}/api/v1/indicator/cci?apiKey={API_KEY}&symbolCode=XAUUSD&timeFrame=H1&period={PERIOD}";
var json = await http.GetStringAsync(url);
Console.WriteLine(json);Cci.java
import java.net.URI;
import java.net.http.*;
public class Cci {
static final String BASE = "https://api.realmarketapi.com";
static final String API_KEY = "YOUR_API_KEY";
static final int PERIOD = 20;
public static void main(String[] args) throws Exception {
var client = HttpClient.newHttpClient();
var request = HttpRequest.newBuilder()
.uri(URI.create(BASE + "/api/v1/indicator/cci?apiKey=" + API_KEY
+ "&symbolCode=XAUUSD&timeFrame=H1&period=" + PERIOD))
.GET().build();
System.out.println(client.send(request, HttpResponse.BodyHandlers.ofString()).body());
}
}Williams %R %R
Momentum oscillator · Range -100 to 0 · Pro+Developed by Larry Williams, Williams %R is an inverted momentum oscillator that measures the close relative to the high-low range over a lookback period. It oscillates between -100 and 0, so its overbought/oversold zones are the opposite of most oscillators.
Formula
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 = 14API endpoint
Request
GET /api/v1/indicator/williams-r?apiKey=YOUR_API_KEY&symbolCode=XAUUSD&timeFrame=H1&period=14%R zones
| %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 |
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 up through -80 → early reversal signal; confirms oversold exit
- bearish%R crosses 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)williams-r.py
import requests
BASE = "https://api.realmarketapi.com"
API_KEY = "YOUR_API_KEY"
PERIOD = 14
resp = requests.get(f"{BASE}/api/v1/indicator/williams-r", params={
"apiKey": API_KEY,
"SymbolCode": "XAUUSD",
"TimeFrame": "H1",
"Period": PERIOD,
})
resp.raise_for_status()
print(resp.json())WilliamsR.cs
const string BASE = "https://api.realmarketapi.com";
const string API_KEY = "YOUR_API_KEY";
const int PERIOD = 14;
using var http = new HttpClient();
var url = $"{BASE}/api/v1/indicator/williams-r?apiKey={API_KEY}&symbolCode=XAUUSD&timeFrame=H1&period={PERIOD}";
var json = await http.GetStringAsync(url);
Console.WriteLine(json);WilliamsR.java
import java.net.URI;
import java.net.http.*;
public class WilliamsR {
static final String BASE = "https://api.realmarketapi.com";
static final String API_KEY = "YOUR_API_KEY";
static final int PERIOD = 14;
public static void main(String[] args) throws Exception {
var client = HttpClient.newHttpClient();
var request = HttpRequest.newBuilder()
.uri(URI.create(BASE + "/api/v1/indicator/williams-r?apiKey=" + API_KEY
+ "&symbolCode=XAUUSD&timeFrame=H1&period=" + PERIOD))
.GET().build();
System.out.println(client.send(request, HttpResponse.BodyHandlers.ofString()).body());
}
}Average Directional Index ADX · +DI · −DI
Trend strength · Non-directional · Pro+Also developed by J. Welles Wilder Jr., ADX quantifies the strength of a trend without indicating its direction. It is paired with two directional lines, +DI and −DI, from which both trend strength and direction can be inferred.
Formula
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–100API endpoint
Request
GET /api/v1/indicator/adx?apiKey=YOUR_API_KEY&symbolCode=XAUUSD&timeFrame=H1&period=14ADX strength levels
| ADX value | Trend strength | Strategy implication |
|---|---|---|
| < 20 | Absent / weak | Range-bound; prefer mean-reversion strategies |
| 20–25 | Forming | Trend beginning; wait for confirmation before entering |
| 25–50 | Strong trend | Trend-following strategies perform well |
| 50–75 | Very strong | E.g. a news-driven move; ride with tight trailing stops |
| > 75 | Extremely strong | Very 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 crossover with a strengthening trend
- bearish−DI crosses above +DI while ADX is rising → bearish crossover with a 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)adx.py
import requests
BASE = "https://api.realmarketapi.com"
API_KEY = "YOUR_API_KEY"
PERIOD = 14
resp = requests.get(f"{BASE}/api/v1/indicator/adx", params={
"apiKey": API_KEY,
"SymbolCode": "XAUUSD",
"TimeFrame": "H1",
"Period": PERIOD,
})
resp.raise_for_status()
print(resp.json())Adx.cs
const string BASE = "https://api.realmarketapi.com";
const string API_KEY = "YOUR_API_KEY";
const int PERIOD = 14;
using var http = new HttpClient();
var url = $"{BASE}/api/v1/indicator/adx?apiKey={API_KEY}&symbolCode=XAUUSD&timeFrame=H1&period={PERIOD}";
var json = await http.GetStringAsync(url);
Console.WriteLine(json);Adx.java
import java.net.URI;
import java.net.http.*;
public class Adx {
static final String BASE = "https://api.realmarketapi.com";
static final String API_KEY = "YOUR_API_KEY";
static final int PERIOD = 14;
public static void main(String[] args) throws Exception {
var client = HttpClient.newHttpClient();
var request = HttpRequest.newBuilder()
.uri(URI.create(BASE + "/api/v1/indicator/adx?apiKey=" + API_KEY
+ "&symbolCode=XAUUSD&timeFrame=H1&period=" + PERIOD))
.GET().build();
System.out.println(client.send(request, HttpResponse.BodyHandlers.ofString()).body());
}
}Fibonacci Retracement Fibonacci
Retracement levels · Support/resistance · Pro+Fibonacci retracement levels are horizontal lines that indicate where support and resistance are likely to occur. They are derived from the high and low of a trend, dividing the vertical distance by the key Fibonacci ratios.
Formula
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
Request
GET /api/v1/indicator/fibonacci?apiKey=YOUR_API_KEY&symbolCode=XAUUSD&timeFrame=H1&lookback=50Fibonacci levels
| Level | Ratio | Description |
|---|---|---|
| 0.236 | 23.6% | Minor retracement level, often 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 |
Signal interpretation
- bullishPrice bounces off a Fibonacci level in a downtrend → potential reversal
- bearishPrice rejects a Fibonacci level in an uptrend → potential reversal
- neutralMultiple levels in confluence → stronger signal when levels cluster
- bullishFibonacci level coincides with support & resistance → high-probability setup
- neutralThe Lookback parameter controls swing size; use a 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)fibonacci.py
import requests
BASE = "https://api.realmarketapi.com"
API_KEY = "YOUR_API_KEY"
LOOKBACK = 50 # Optional: periods to look back for high/low
params = {
"apiKey": API_KEY,
"SymbolCode": "XAUUSD",
"TimeFrame": "H1",
}
if LOOKBACK:
params["Lookback"] = LOOKBACK
resp = requests.get(f"{BASE}/api/v1/indicator/fibonacci", params=params)
resp.raise_for_status()
print("Fibonacci API response:")
print(resp.json())Fibonacci.cs
const string BASE = "https://api.realmarketapi.com";
const string API_KEY = "YOUR_API_KEY";
const int? LOOKBACK = 50; // Optional: periods to look back for high/low
using var http = new HttpClient();
var url = $"{BASE}/api/v1/indicator/fibonacci?apiKey={API_KEY}&symbolCode=XAUUSD&timeFrame=H1";
if (LOOKBACK.HasValue) url += $"&lookback={LOOKBACK.Value}";
var json = await http.GetStringAsync(url);
Console.WriteLine("Fibonacci API response:");
Console.WriteLine(json);Fibonacci.java
import java.net.URI;
import java.net.http.*;
public class Fibonacci {
static final String BASE = "https://api.realmarketapi.com";
static final String API_KEY = "YOUR_API_KEY";
static final Integer LOOKBACK = 50; // Optional: periods to look back for high/low
public static void main(String[] args) throws Exception {
var client = HttpClient.newHttpClient();
var uri = BASE + "/api/v1/indicator/fibonacci?apiKey=" + API_KEY
+ "&symbolCode=XAUUSD&timeFrame=H1";
if (LOOKBACK != null) uri += "&lookback=" + LOOKBACK;
var request = HttpRequest.newBuilder()
.uri(URI.create(uri))
.GET().build();
var body = client.send(request, HttpResponse.BodyHandlers.ofString()).body();
System.out.println("Fibonacci API response:");
System.out.println(body);
}
}Error responses
| Code | Meaning |
|---|---|
| 400 | Validation error (missing ApiKey, invalid SymbolCode, invalid TimeFrame, Lookback out of range) |
| 401/403 | Invalid API key or plan restriction (requires Pro+) |
| 404 | Insufficient historical data for calculation |
Support & Resistance S/R
Price structure · Key levels · Pro+The Support & Resistance endpoint returns server-computed key price levels. Like the other indicator APIs it analyses historical candles to find zones where buyers (support) or sellers (resistance) have repeatedly stepped in, ranked by touch count.
API endpoint
Request
GET /api/v1/indicator/support-resistance?apiKey=YOUR_API_KEY&symbolCode=XAUUSD&timeFrame=H1Plan requirement
Requires Pro plan or above. This endpoint computes levels from historical candle data; the Free plan does not include historical data access and receives a 403 response.
Concepts
| Term | Meaning |
|---|---|
| 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. |
| TouchCount | How many times price has tested a level. Higher counts indicate institutional memory and greater reliability. |
| LastTouchedAt | Recency matters. A level tested last week is more relevant than one tested 6 months ago. |
Example response
Response · 200
{
"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 broken; it may now act as new support
- bearishPrice closes below a support level → support broken; it may now act as new resistance
- neutralLevels with low TouchCount (1–2) are weaker; use only with strong additional confluence
- neutralCombine S/R 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)`)support-resistance.py
import requests
res = requests.get(
f"https://api.realmarketapi.com/api/v1/indicator/support-resistance",
params={
"apiKey": "YOUR_API_KEY",
"symbolCode": "XAUUSD",
"timeFrame": "H1",
},
)
levels = res.json()
current_price = 3210.00
# Nearest support below current price
nearest_sup = max(
(s for s in levels["Supports"] if s["Price"] < current_price),
key=lambda s: s["Price"],
default=None,
)
# Nearest resistance above current price
nearest_res = min(
(r for r in levels["Resistances"] if r["Price"] > current_price),
key=lambda r: r["Price"],
default=None,
)
if nearest_sup:
print(f"Nearest support: {nearest_sup['Price']:.2f} (×{nearest_sup['TouchCount']} touches)")
if nearest_res:
print(f"Nearest resistance: {nearest_res['Price']:.2f} (×{nearest_res['TouchCount']} touches)")Error responses
| Code | Meaning |
|---|---|
| 400 | Validation error (missing ApiKey, invalid SymbolCode, invalid TimeFrame) |
| 401/403 | Invalid API key or plan restriction (requires Pro+) |
| 404 | Insufficient historical data for calculation |
Market Sentiment Fear & Greed
Composite · RSI(14) · MACD(12,26,9) · EMA-50/100 · Pro+The Market Sentiment endpoint aggregates several indicators into one human-readable composite. It combines RSI (14), the 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 in a single call.
Formula
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 < 0API endpoint
Request
GET /api/v1/indicator/sentiment?apiKey=YOUR_API_KEY&symbolCode=EURUSD&timeFrame=H1Plan requirement
Requires Pro plan or above. Sentiment is a composite whose sub-components (RSI, MACD, EMA) all require Pro+.
Response fields
| 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 |
Fear & Greed zones
| Score | Sentiment | Interpretation |
|---|---|---|
| 0–20 | ExtremeFear | Market is extremely fearful; potential contrarian buy zone |
| 21–39 | Fear | Bearish sentiment dominates; caution on new long positions |
| 40–59 | Neutral | Balanced 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 |
Example response
Response · 200
{
"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
}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
- neutralSideways trend with Neutral sentiment (40–59) → range-bound; prefer mean-reversion over trend-following
- bullishema50 > ema100 and macdHistogram > 0 → EMA alignment with positive momentum confirms bullish bias
- bearishema50 < ema100 and macdHistogram < 0 → 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)sentiment.py
import requests
BASE = "https://api.realmarketapi.com"
API_KEY = "YOUR_API_KEY"
resp = requests.get(f"{BASE}/api/v1/indicator/sentiment", params={
"apiKey": API_KEY,
"symbolCode": "EURUSD",
"timeFrame": "H1",
})
resp.raise_for_status()
print("Sentiment API response:")
print(resp.json())Sentiment.cs
const string BASE = "https://api.realmarketapi.com";
const string API_KEY = "YOUR_API_KEY";
using var http = new HttpClient();
var url = $"{BASE}/api/v1/indicator/sentiment?apiKey={API_KEY}&symbolCode=EURUSD&timeFrame=H1";
var json = await http.GetStringAsync(url);
Console.WriteLine("Sentiment API response:");
Console.WriteLine(json);Sentiment.java
import java.net.URI;
import java.net.http.*;
public class Sentiment {
static final String BASE = "https://api.realmarketapi.com";
static final String API_KEY = "YOUR_API_KEY";
public static void main(String[] args) throws Exception {
var client = HttpClient.newHttpClient();
var request = HttpRequest.newBuilder()
.uri(URI.create(BASE + "/api/v1/indicator/sentiment?apiKey=" + API_KEY
+ "&symbolCode=EURUSD&timeFrame=H1"))
.GET().build();
var body = client.send(request, HttpResponse.BodyHandlers.ofString()).body();
System.out.println("Sentiment API response:");
System.out.println(body);
}
}Error responses
| Code | Meaning |
|---|---|
| 400 | Validation error (missing apiKey, invalid symbolCode, invalid timeFrame) |
| 401/403 | Invalid API key or plan restriction (requires Pro+) |
| 404 | Insufficient historical data for calculation |
Combining indicators
No single indicator is reliable enough to trade in isolation. Effective strategies stack indicators from different categories (trend, momentum, oscillator) to get confluent signals.
EMA + RSI: trend continuation
- 1.Filter direction: price above EMA-50 = only look for longs
- 2.Wait for RSI to dip into 40–50 (pullback without going oversold)
- 3.Enter when RSI starts rising back above 50
- 4.Stop below EMA-50; target the previous high
MACD + RSI: reversal entry
- 1.Identify RSI < 30 (oversold) or RSI > 70 (overbought)
- 2.Wait for the MACD histogram to start shrinking (momentum fading)
- 3.Enter on the MACD line × signal line crossover
- 4.Tight stop beyond the recent swing; RSI returning to 50 as the target zone
SMA golden / death cross
- 1.Plot SMA-50 and SMA-200 on the D1 timeframe
- 2.Golden Cross (50 > 200): long-term bull; buy dips above SMA-50
- 3.Death Cross (50 < 200): long-term bear; sell rallies below SMA-50
- 4.Confirm the regime shift with MACD above/below zero
MACD divergence + EMA slope
- 1.Observe price making new lows while the MACD histogram shrinks (bullish divergence)
- 2.Confirm the EMA-20 slope is flattening or turning up
- 3.Enter on an EMA-9/21 bullish crossover for timing
- 4.Invalidate 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 }
}Try it in the Playground
Send real requests and inspect live responses in the browser.