You need to store all symbol data and its description in a repository. To do this, provide two directories and add your data files.
- Create a JSON file with symbol descriptions in the
symbol_info/
directory. - For each symbol, create a CSV file with daily data in the
data/
directory.
Tip
We recommend that you check out a step-by-step guide on how to add symbols to the TradingView chart.
Symbol information must be placed into a single JSON file in the symbol_info/
directory.
Follow these requirements when creating a file:
- The file name must be equal to the repository name, and the extension must be
.json
. - The file consists of a JSON object that cannot be empty.
The object consists of the following required fields:
Field | Type | Description | Max value | Note |
---|---|---|---|---|
symbol |
String | Symbol name used in TradingView. | The maximum number of characters in symbol is 42. |
Cannot be empty. Validation rule: ^[A-Z0-9._]+$ . |
description |
String | Symbol description. | The maximum number of characters in description is 128. |
Cannot be empty. |
pricescale |
Integer | Indicates how many decimal places the price has. | The maximum value of pricescale is 10000000000000000000000 (22 zeroes). |
The value format is 10^n , where n is the number of decimal places. For example, if the price has two decimal places 300.01 , set pricescale to 100 . If it has three decimal places 300.001 , set pricescale to 1000 , etc. If the price doesn't have decimals, set pricescale to 1 . |
Note
Each object field is an array with values. For all fields, the length of these arrays must match. However, if all the values in the
pricescale
array are the same, you can specify a single value for the field instead of an array.
Consider the following example. If you specify three symbols in the object, then you also need to specify three descriptions, three price scales, and three currencies (which can be empty) for each symbol.
{
"symbol": [
"BTC_DEV_ACTIVITY",
"BTC_SOCIAL_VOLUME_TOTAL",
"ETH_DEV_ACTIVITY"
],
"pricescale": [10, 10, 10],
"description": [
"Bitcoin developer activity",
"Bitcoin social volume total",
"Ethereum developer activity"
]
}
However, if all added symbols have the same price scale, you can only specify a single value in the pricescale
field:
"pricescale": 10
instead of "pricescale": [10, 10, 10]
.
{
"symbol": [
"BTC_DEV_ACTIVITY",
"BTC_SOCIAL_VOLUME_TOTAL",
"ETH_DEV_ACTIVITY"
],
"pricescale": 10,
"description": [
"Bitcoin developer activity",
"Bitcoin social volume total",
"Ethereum developer activity"
]
}
Both examples above are equivalent and will not cause a validation error.
Each symbol and its daily data must be placed into a separate CSV file in the data/
directory.
Daily data represents the symbol's OHLCV (open-high-low-close-volume) prices on charts.
Note
The EOD (End-of-Day) feed has a limit of 6,000 symbols per repository. Keep this in mind when adding data files. To connect more symbols, you can create another data repository.
Follow these requirements when creating a file:
- File names must be equal to symbol names, capitalized, and URL encoded.
- File extension must be
.csv
. - Values must be comma-separated.
- Do not use headers, blank lines, and spaces.
- The lines of the file must be sorted by
date
in ascending order. - The lines should not contain duplicates by
date
.
Field | Description | Sample |
---|---|---|
date |
Date in YYYYMMDDT format. | 20210101T |
open |
First tick price. | 0.1 |
high |
Maximum tick price. | 0.1 |
low |
Minimum tick price. | 0.1 |
close |
Last tick price. | 0.1 |
volume |
Total number of shares traded. Cannot be negative. | 0.0 |
Note
If your data series has a single value only, fill the
open
,close
,high
, andlow
fields with the same value andvolume
with0
.
CSV file example:
20210101T,0.1,0.1,0.1,0.1,0
Your EOD data is checked and uploaded to the TradingView repository daily. You can see the data for all previous days on the chart. The data checked and uploaded today will appear on the chart the next day. If you don't update the data for three months, it will be removed from the TradingView storage.
Intraday data and real-time updates are possible using a REST protocol, but this option is only available for brokerage integration.
When your data is merged, the Check data action will run on the repository Actions page automatically. This action validates your files and loads them into the TradingView storage.
You can also run the Check data action manually by clicking Run workflow button on the repository Actions tab with selected Check data action. Running action manually can be used when the automatic run fails for some external reason (e.g., GitHub is down, temporary problem with the runner occurred).
Before merging your data, ensure that your files and their content follow the requirements described in this article. Otherwise, you will get errors in the Actions page logs.
Your repository can only be private.