Intermediate ~15 min HTTPPython Build guide

Multi-Timeframe Analysis

Professional traders never rely on a single timeframe. Learn how to combine higher and lower timeframes for stronger trade setups using the TickAtlas API.

2 sections 2 copy-paste code samples HTTP · Python
2Guide sections
2Code samples
IntermediateLevel
15 minTime

The Concept

Multi-Timeframe Analysis (MTF) uses multiple timeframes to identify confluence — when signals from different time perspectives agree on market direction.

01 Higher Timeframe Determines overall trend direction. D1 or H4 for swing trading.
02 Trading Timeframe Your primary chart for entries. H1 or H4 for swing trading.
03 Lower Timeframe Fine-tune entries and exits. M15 or M30 for precision.

Using the Multi Endpoint

Query indicators across all timeframes in a single API call:

HTTP Using the Multi Endpoint
GET /v1/multi?symbols=EURUSD&indicators=RSI_14,MACD_hist,ADX,SMA_200&timeframe=M30,H1,H4,D1

Python Implementation

Python Python Implementation
import requests

def mtf_analysis(symbol, api_key):
    """Multi-timeframe analysis using 4 timeframes."""
    url = "https://tickatlas.com/v1/multi"
    headers = {"X-API-Key": api_key}

    # /v1/multi takes ONE timeframe per call, so loop the four you want.
    analysis = {}
    for tf in ["D1", "H4", "H1", "M30"]:
        params = {
            "symbols": symbol,
            "indicators": "RSI_14,MACD_hist,ADX,SMA_200",
            "timeframe": tf
        }
        response = requests.get(url, headers=headers, params=params)

        # {"success": true, "data": {"timeframe": ..., "data": {SYMBOL: {...}}}}
        # Every indicator comes back as a bare float, not a nested object.
        tf_data = response.json()["data"]["data"].get(symbol, {})
        rsi = tf_data.get("RSI_14", 50)
        macd = tf_data.get("MACD_hist", 0)
        adx = tf_data.get("ADX", 0)

        bias = "BULLISH" if rsi > 50 and macd > 0 else "BEARISH" if rsi < 50 and macd < 0 else "NEUTRAL"
        trending = adx > 25

        analysis[tf] = {"bias": bias, "trending": trending, "rsi": rsi, "adx": adx}

    # Confluence check: higher TFs must agree
    d1_bias = analysis["D1"]["bias"]
    h4_bias = analysis["H4"]["bias"]
    h1_bias = analysis["H1"]["bias"]

    if d1_bias == h4_bias == h1_bias and d1_bias != "NEUTRAL":
        signal = "STRONG_" + d1_bias
    elif d1_bias == h4_bias and d1_bias != "NEUTRAL":
        signal = d1_bias
    else:
        signal = "NO_TRADE"

    return {"symbol": symbol, "signal": signal, "timeframes": analysis}

result = mtf_analysis("EURUSD", "YOUR_API_KEY")
print(f"Signal: {result['signal']}")
for tf, data in result["timeframes"].items():
    print(f"  {tf}: {data['bias']} (RSI: {data['rsi']:.1f}, ADX: {data['adx']:.1f})")

Recommended Timeframe Combinations

Trading StyleHigher TFTrading TFEntry TF
ScalpingH1M15M1–M5
Day TradingH4H1M15–M30
Swing TradingD1H4H1
Position TradingD1D1H4

Production hardening

The code above is the happy path. These are the concerns that decide whether it survives contact with a real deployment.

Keep the key server-side. The API key authenticates with the X-API-Key header and must never reach a browser bundle. Proxy it, or use a public widget key, which is domain-scoped and revocable. Authentication
Handle 429 before you need to. Rate limits are per key and per minute. Back off on 429 rather than retrying immediately, and read the X-RateLimit-* headers on every response. Rate limits
Branch on the error code, not the message. Errors carry a stable machine-readable code; the human-readable text can change. Codes were unified in v3.15. Error handling
Expect gaps, and do not invent values. Markets close, feeds stall, and a retention window can reject a request outright. Surface an explicit unavailable state rather than substituting a zero or the last known price. Troubleshooting
Cache what you poll. Responses are already cached briefly upstream, so polling faster than the data changes spends credits without improving freshness. Cache on your side and poll on the cadence your timeframe actually updates. Pricing and credits
Watch retention per timeframe. History depth is set per timeframe, never per plan, so a request that works on D1 can fall outside the window on M1. Check the published windows before backfilling. Timeframes
Rotate keys and scope them. Issue a separate key per deployment so one can be revoked without taking the others down, and rotate on a schedule rather than after an incident. Authentication
Log the request, not the key. Record endpoint, parameters, status and latency so a failure is reproducible. Never log the key itself, and scrub it from error reports.

Related Resources

Everything this guide touches, linked directly — so it never dead-ends.

Build against live market data

Start with the data layer already solved.

Create an API key, run the first request, then extend one layer at a time. Every account starts pay-as-you-go with $2.50 of credit.