The trading_grapher.py
Python script visualizes the results of stock day
trading in a spreadsheet, as well as the MACD and the stochastics, using the
mplfinance
package based on historical data from Yahoo
Finance.
trading_grapher.py
has been tested on Debian Testing on WSL 2 and requires
the following packages:
mplfinance
to plot trade data and the indicators based on historical dataodfpy
to read the trading journal recorded in an OpenDocument Spreadsheet fileprompt_toolkit
to complete possible values or a previous value in configuringyfinance
to retrieve historical data from Yahoo Finance
Install each package as needed. For example:
python -m venv .venv
. .venv/bin/activate
python -m pip install -r requirements.txt -U
First, configure the path to your trading journal spreadsheet, the sheet name, and the directory path for storing historical data and charts:
./trading_grapher.py -G
Next, configure the columns of the trading journal:
./trading_grapher.py -J
The ~/.config/trading-grapher/trading_grapher.ini
configuration file stores
the configurations above. Then, execute:
./trading_grapher.py [%Y-%m-%d ...]
-f FILE
: specify the file path to the trading journal spreadsheet-d DIRECTORY
: specify the directory path for storing historical data and charts-BS
: generate a Bash script to launch this script and exit-G
: configure general options and exit-J
: configure the columns of the trading journal and exit-S
: configure the styles based on the trade context and exit-C
: check configuration changes and exit
trading_grapher.py
provides the following style modules, which you can
specify using the -S
option.