Basic Indicators
SMA, EMA, and RSI. The foundational tools of technical analysis.
The Basic Tier contains three of the most widely used indicators in finance. These are highly efficient to calculate and form the basis of many complex trading strategies.
The arithmetic mean of prices over a specific period. It smooths out price data to identify the trend direction by filtering out the "noise" of random price fluctuations.
- Endpoint:
/api/indicators/sma - Method:
POST
| Name | Type | Required | Description |
|---|---|---|---|
period | integer | Yes | The window size for the moving average (e.g., 20, 50, 200). Min: 2. |
Returns an array of numbers representing the SMA value for each corresponding candle index. The first period - 1 values will be null or excluded depending on implementation, as there isn't enough data to calculate them.
[ 65230.5, 65245.2, 65300.1, ... ]- Trend Direction: If the SMA is rising, the trend is up. If falling, the trend is down.
- Support/Resistance: Price often respects major SMAs (like the 50-day or 200-day) as dynamic support or resistance zones.
- Crossovers: A short-term SMA crossing above a long-term SMA (Golden Cross) signals a potential bullish trend.
[!TIP] The 200-period SMA is considered one of the most significant indicators by institutional traders. Breaking it often signals a major regime change.
import { IndicatorsApi, CandlesApi } from "tickcatcher";
// 1. Get Candles
const candles = await new CandlesApi(config).basicCandles({ symbol: "BTCUSDT", timeframe: "1h", limit: 100 });
// 2. Calculate SMA
const values = await new IndicatorsApi(config).sma({
smaRequest: {
data: candles,
params: { period: 20 }
}
});
console.log(`Current SMA: ${values[values.length - 1]}`);Similar to SMA but places greater weight and significance on the most recent data points. It reacts more quickly to price changes than the SMA.
- Endpoint:
/api/indicators/ema - Method:
POST
| Name | Type | Required | Description |
|---|---|---|---|
period | integer | Yes | The window size. Min: 2. |
Returns an array of decimal numbers.
[ 65235.1, 65250.8, ... ]- Responsiveness: Useful for short-term trading where detecting trend reversals early is critical.
- Trend Following: Like the SMA, it helps filter out noise but with less lag.
[!TIP] The 9-period EMA is frequently used by day traders as a tightly trailing stop-loss level.
import { IndicatorsApi, CandlesApi } from "tickcatcher";
// 1. Get Candles
const candles = await new CandlesApi(config).basicCandles({ symbol: "BTCUSDT", timeframe: "1h", limit: 100 });
// 2. Calculate EMA
const values = await new IndicatorsApi(config).ema({
emaRequest: {
data: candles,
params: { period: 9 }
}
});
console.log(`Current EMA: ${values[values.length - 1]}`);A momentum oscillator that measures the speed and change of price movements. It oscillates between 0 and 100.
- Endpoint:
/api/indicators/rsi - Method:
POST
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
period | integer | Yes | 14 | The lookback period. |
Returns an array of values between 0 and 100.
[ 45.2, 48.9, 55.1, 72.4, ... ]- Overbought: > 70. Suggests the asset may be overvalued and due for a pullback.
- Oversold: < 30. Suggests the asset may be undervalued and due for a bounce.
- Divergence: If price makes a new high but RSI fails to (Bearish Divergence), a reversal may be imminent.
[!TIP] In strong bull markets, RSI can remain "overbought" (>70) for extended periods. Do not short blindly just because RSI > 70; wait for a confirmed reversal signal.
import { IndicatorsApi, CandlesApi } from "tickcatcher";
// 1. Get Candles
const candles = await new CandlesApi(config).basicCandles({ symbol: "BTCUSDT", timeframe: "1h", limit: 100 });
// 2. Calculate RSI
const values = await new IndicatorsApi(config).rsi({
rsiRequest: {
data: candles,
params: { period: 14 }
}
});
console.log(`Current RSI: ${values[values.length - 1]}`);