# TradingView data (/features/data/tradingview-data)

How do you get TradingView data into Python? `vbt.TVData` pulls bars for stocks, futures, crypto,
FX, and indexes in TradingView's own symbol notation, without an account, and returns them as one
data object ready for indicators and backtests.

```python title="Pull daily bars for six markets in one call and compare 2024"
>>> symbols = [
...     "NASDAQ:AAPL", "CME_MINI:ES1!", "BINANCE:BTCUSDT",
...     "TVC:DXY", "FX:EURUSD", "TVC:GOLD",
... ]
>>> data = vbt.TVData.pull(symbols, timeframe="1D")  # (1)
>>> year = data.loc["2024"]
>>> first = year.close.apply(lambda s: s.dropna().iloc[0])
>>> last = year.close.apply(lambda s: s.dropna().iloc[-1])
>>> returns = (last / first - 1).round(4)
>>> pd.DataFrame({"bars": year.close.notna().sum(), "return": returns})
                 bars  return
symbol
NASDAQ:AAPL       252  0.3490
CME_MINI:ES1!     252  0.2399
BINANCE:BTCUSDT   366  1.1181
TVC:DXY           259  0.0614
FX:EURUSD         260 -0.0534
TVC:GOLD          252  0.2747
```

1.  Downloads each symbol's available history, from the most recent bar back. The bars arrive in UTC
    on one shared index, with NaN where a market was closed.

A stock, a continuous futures contract, a crypto pair, the dollar index, a currency pair, and gold
came back in one call. Each market keeps its own calendar: Bitcoin traded on all 366 days of 2024,
stocks on 252, and FX on 260, which is why each column above counts its own bars.

## From chart data to Python research \[#from-chart-data-to-python-research]

Use the symbols you already follow on TradingView as inputs to a Python strategy. Once pulled,
`data.close` gives you prices across symbols, and `data.run` can compute indicators from the
available OHLCV fields. Pass the data and your entry and exit signals into a
[signal backtest](/features/backtesting/signal-backtesting/), then compare instruments and
[parameter choices](/features/optimization/strategy-optimization/) in the same workflow.

This is useful for testing a chart idea across several markets, building an index-member universe,
or combining a daily trend with intraday entries through
[multi-timeframe analysis](/features/data/multi-timeframe-analysis/).

## Pulling bars \[#pulling-bars]

Symbols use TradingView's notation, `EXCHANGE:SYMBOL`. Use minute, hourly, daily, weekly, or monthly
bars, as in `"1 minute"`, `"1 hour"`, or `"1D"`. The adapter also accepts second-based timeframes
where TradingView makes them available. `tz` converts the index to a market's local time. Prices are
adjusted for splits by default, `adjustment` also accounts for dividends, and
`extended_session=True` adds pre-market and after-hours bars. For futures, `fut_contract=1` returns
the continuous front contract and `fut_contract=2` the next one. Assign `data = data.update()` to
refresh the available bars and combine them with your stored history.

There is no start date. TradingView serves the most recent bars, up to `limit`, so pull them and
then select the period you need with `data.loc`, as the example above does for 2024. The class
downloads bars only, not the values of TradingView indicators or strategies. An error about data
that could not be parsed usually means the symbol or timeframe does not exist on that exchange, and
`skip_on_error=True` skips such symbols in a larger pull.

## Match the chart you are researching \[#match-the-chart-you-are-researching]

Before comparing an indicator or backtest with a TradingView chart, match the data choices:

| Chart setting                | VBT input                             |
| ---------------------------- | ------------------------------------- |
| Instrument and exchange      | The full `EXCHANGE:SYMBOL` identifier |
| Bar interval                 | `timeframe`                           |
| Regular or extended session  | `extended_session`                    |
| Split or dividend adjustment | `adjustment`                          |
| Display timezone             | `tz`                                  |

Different sessions and adjustments can change the indicator even when its formula is identical.
VBT's [technical indicators](/features/indicators/technical-indicators/) and
[custom indicators](/features/indicators/indicator-development/) let you calculate the studies in
Python from those bars.

If you need values already calculated on a chart, TradingView can
[export chart data and indicators to CSV](https://www.tradingview.com/support/solutions/43000537255-how-to-export-chart-data/).
Load that export with `vbt.CSVData` or Pandas, keeping its timestamp and indicator columns. The
[storage page](/features/data/data-storage-and-databases/#files) covers file inputs. This provides
another route for comparing chart outputs with your Python calculations.

## Finding symbols \[#finding-symbols]

`vbt.TVData.list_symbols` searches TradingView's symbols by pattern, exchange, or text, and its
market scanner lists symbols by market, by field values such as sector, or by index membership:

```python title="List the members of the Nasdaq-100"
>>> ndx = vbt.TVData.list_symbols(groups=dict(index="NASDAQ:NDX"))
>>> len(ndx), ndx[:5]
(101, ['NASDAQ:AAPL', 'NASDAQ:ABNB', 'NASDAQ:ADBE', 'NASDAQ:ADI', 'NASDAQ:ADP'])
```

The list holds today's members, so a backtest over past years built from it carries survivorship
bias, as the [Realistic backtests](/features/backtesting/backtest-realism/#point-in-time-universes)
page explains.

You can also request scanner fields such as sector, currency, or market capitalization and filter
the results before downloading bars. With `return_field_data=True`, symbol discovery returns those
fields alongside the symbol names, so you can keep the information used to select your research
universe.

## History and accounts \[#history-and-accounts]

TradingView serves a limited number of bars per symbol, so the depth of history depends on the
timeframe: daily bars reach back years, while one-minute bars covered about the last six weeks for
AAPL on October 2, 2026. VBT requests up to 20,000 bars by default. Signing in with your own
TradingView username and password, or a session token, through `client_config` uses the access of
your account. You can reuse an authenticated `TVClient` across pulls instead of creating a new
client for each one. TradingView's
[exchange data subscriptions](https://www.tradingview.com/support/solutions/43000471705-how-to-purchase-additional-market-data/)
are separate from VBT PRO, and TradingView says its paid plans do not include exchange data fees.

Standard `TVData` pulls retrieve recent bars. They do not automate TradingView's Bar Replay or page
backward through the full chart history. Updating requests the recent window again and merges it
into the existing object. For long intraday history, the commercial providers on the
[Market data sources](/features/data/market-data-sources/) page fit better, and
[Data storage and databases](/features/data/data-storage-and-databases/) keeps what you download
growing over time.

!!! info "Terms of use"
    TradingView data is subject to TradingView's terms. Use your own account where they require it,
    and check them before using the data beyond personal research.

## Trading View \[#trading-view]

New in 1.9.0

✅ A new class specialized for pulling data from [TradingView](https://www.tradingview.com/) is now
available.

```python title="Pull 1-minute AAPL data"
>>> data = vbt.TVData.pull(
...     "NASDAQ:AAPL",
...     timeframe="1 minute",
...     tz="US/Eastern"
... )
>>> data.get()
                             Open    High     Low   Close   Volume
datetime
2022-12-05 09:30:00-05:00  147.75  148.31  147.50  148.28  37769.0
2022-12-05 09:31:00-05:00  148.28  148.67  148.28  148.49  10525.0
2022-12-05 09:32:00-05:00  148.50  148.73  148.30  148.30   4860.0
2022-12-05 09:33:00-05:00  148.25  148.73  148.25  148.64   5306.0
2022-12-05 09:34:00-05:00  148.62  148.97  148.52  148.97   5808.0
...                           ...     ...     ...     ...      ...
2023-01-17 15:55:00-05:00  135.80  135.91  135.80  135.86  37573.0
2023-01-17 15:56:00-05:00  135.85  135.88  135.80  135.88  18796.0
2023-01-17 15:57:00-05:00  135.88  135.93  135.85  135.91  21019.0
2023-01-17 15:58:00-05:00  135.90  135.97  135.89  135.95  20934.0
2023-01-17 15:59:00-05:00  135.94  136.00  135.84  135.94  86696.0

[11310 rows x 5 columns]
```


## Related pages

*   [Market data sources](/features/data/market-data-sources/): Pull stock, crypto, futures, and FX data from many providers with one interface
*   [Binance data](/features/data/binance-data/): Download Binance spot and futures klines with trade counts and taker volume
*   [Data pipelines](/features/data/financial-data-pipelines/): Align, update, transform, and analyze multi-symbol market data in one object
*   [Data storage and databases](/features/data/data-storage-and-databases/): Save and query market data in files, DuckDB, SQL databases, and ArcticDB