-
Notifications
You must be signed in to change notification settings - Fork 0
Setup
The configuration file for RRG-Lite
uses a JSON file. By default, it looks for src/user.json
. However, you can define multiple configuration files.
For a quick setup, refer to Steps to create a configuration file
Below is a sample configuration file set to its default values:
{
"DATA_PATH": "",
"WATCHLIST_FILE": null,
"BENCHMARK": null,
"PERIOD": 52,
"WINDOW": 14,
"LOADER": "EODFileLoader",
"DEFAULT_TF": "daily",
"DATE_COLUMN": "Date",
"DATE_FORMAT": null
}
- DATA_PATH: (REQUIRED) - The path to the folder containing OHLC (Open, High, Low, Close) data files in CSV format.
- WATCHLIST_FILE: (OPTIONAL) - The path to the watchlist file (text or CSV file) with stock / ticker names listed one per line. See watchlist file format
-
LOADER: (OPTIONAL - Default
EODFileLoader
) - The class used for loading the OHLC data. -
DEFAULT_TF: (OPTIONAL - Default
daily
) - The default timeframe for the OHLC data in your CSV files. Options depend on theLoader
class:-
"EODFileLoader"
:daily
,weekly
,monthly
,quarterly
.
-
-
DATE_COLUMN: (OPTIONAL - Default
Date
) - The name of the date column in your OHLC files. If the column is not namedDate
, specify the name here.
-
BENCHMARK: (OPTIONAL) The benchmark index. The name must match a filename in
DATA_PATH
.- For
Nifty 50
, a file namedNifty 50.csv
must exist inDATA_PATH
.
- For
-
PERIOD: (OPTIONAL - Default
52
) Number of candles of a timeframe to load. -
WINDOW: (OPTIONAL - Default
14
) Period used in moving average calculations
The file can be a text or CSV file. It can contain a list of stock or ticker names (One on each line)
The name must match the filename in the DATA_PATH
folder. For example hdfcbank
must match a file hdfcbank.csv
. (Case sensitive)
hdfcbank
infy
If the ticker names are too long, an optional short name can be added separated by comma.
Nifty Consumer Durables,Cons. Dur
Nifty Media
Nifty IT
In the above example,
-
Cons. Dur
will be displayed as label on charts instead ofNifty Consumer Durables
. -
Nifty Media
andNifty IT
will be displayed as is, since there is no short name defined.
-
Create a New JSON File: Create a new file named
user.json
in thesrc
folder. -
Set Up
DATA_PATH
: Specify the full file path to the folder containing your OHLC data files. (Must be a folder)."DATA_PATH": "path/to/ohlc/data"
-
Set
DATE_COLUMN
(If Needed): If your OHLC files use a different date column name, specify it here. Otherwise, it defaults to"Date"
."DATE_COLUMN": "Date"
-
Provide
WATCHLIST_FILE
(Optional): Specify the path to your watchlist CSV file. See Watchlist file format"WATCHLIST_FILE": "path/to/watchlist/file"
-
Save the Configuration File: Save the
user.json
file with the specified settings.
You can create multiple config files for different data sources.
To use a config file other than user.json, use the -c
or --config
followed by the file path to your config file.
py init.py -c bank.json
OHLC data must be a CSV file and contain Open, High, Low, Close
columns to work correctly.
Windows users - Use forward slash /
in your file paths to avoid JSON parsing errors. ~/path/to/folder