Skip to main content
Indicators normally work with market data that the platform provides. External data sources let an indicator also use data you bring yourself: your own candle series, trading signals, ML model outputs, risk factors or any other time-stamped values. You publish the data as a CSV file at a public HTTPS URL and declare it in the indicator code with a source descriptor:
TakeProfit servers download and validate the file and deliver its rows to your indicator. The Indie code itself never performs any network or file I/O — it only declares the dependency and reads ready-made values, the same way it reads market data.

Three ways to use external data

What you write depends on what is in the file:
  • If the file contains OHLCV candles, write a @sec_context callback and attach it with Context.calc_on(source=...), the same way you attach an additional instrument. See External candles from CSV.
  • If the rows have their own shape and each row needs processing, describe the row with a @dataclass and write a @data_context callback for Context.calc_on(source=...). See Typed external data.
  • If you only need the latest row value on each chart bar, skip the callback and read the rows directly with request_series[T](source=...).

Quick example

This indicator plots the daily close prices from an external candle CSV on any chart:
External candle close

The data is a snapshot

The file is fetched once, when the indicator instance is created. After that the data is frozen: the indicator works with the file’s history and receives no live updates, even if the file changes on your server. To pick up a new version, re-add the indicator to the chart. A cached copy may be served for up to about 10 minutes after the previous fetch.
The platform does not archive your file. If it changes, the next run of the indicator or backtest can see different data. Keep a stable copy of the file if you need reproducible backtests.

Rules common to all external sources

  • External sources count toward the same limit as additional instruments requested with Context.calc_on(). Identical requests are counted once; a request that differs in URL, time_column, time frame or lookahead counts as a separate instrument.
  • The time frame belongs to the call site, not to the file: you pass time_frame= to Context.calc_on() or request_series(). For candle CSVs it is required, for typed data it is optional, and tick time frames are not supported.
  • The file must be a public HTTPS URL with a valid certificate; authentication headers cannot be sent. See CSV format and limits for the full requirements, size limits and error reference.
Indicators that use external data sources cannot be published to the TakeProfit marketplace.