Skip to content
RealMarketAPI

backtesting historical ohlcv api

Backtest Trading Strategies with Historical OHLCV Data API

Pull years of OHLCV candle history to run reproducible backtests against entry and exit logic without live market exposure.

Summary

Download and replay multi-year candle history to validate strategy logic before deploying capital.

Runnable example

Fetch 1-year XAUUSD hourly candles for backtest. Replace YOUR_KEY with your API key.

Fetch 1-year XAUUSD hourly candles for backtest
curl -X GET "https://api.realmarketapi.com/api/v1/history
  ?ApiKey=YOUR_KEY
  &symbolCode=XAUUSD
  &timeFrame=H1
  &startTime=2025-08-01T00:00:00Z
  &endTime=2026-08-01T00:00:00Z
  &pageSize=1000"

Production notes

  • 01Freeze the history snapshot before each backtest run for fully reproducible results.
  • 02Align candle timestamps to UTC and normalise open/close boundaries per timeframe.
  • 03Account for plan-tier request quotas when scheduling bulk history downloads.

How it works, step by step

Where each step happens, from the price data to the people using what you build.

How you can make money from it

Common business models for this kind of product. Commercial use is allowed on every RealMarketAPI plan, including Free.

  • Research subscription

    Publish tested strategy ideas and their backtest reports to paying subscribers.

  • Backtesting as a service

    Run backtests for traders who have a strategy but not the tooling, and charge per report.

  • Courses and templates

    Teach backtesting with ready-made notebooks and code templates.

  • Strategy tools

    Sell a no-code backtesting tool where users pick rules and see results.

You can build and sell products on any plan; what you cannot do is resell or redistribute the raw price feed itself (see the terms). Building for other developers? The affiliate program pays 25% recurring commission on the paid plans you refer.

Run this example with your own key

Create a free account, then try the request in the playground before wiring it into production.