My ramblings on various stock analysis and data mining.
- Python 2.7 or 3.6+
- NumPy (http://www.numpy.org)
- SciPy (http://www.scipy.org)
- Pandas (http://pandas.pydata.org/)
- yfinance (https://pypi.org/project/yfinance)
- If required, edit the stock list files in
stock_db/*.txt
. - Run (and possibly edit)
download_historical_data.sh
to download the historical stock data locally from the stock list files. - Run and play with
tradesim.py
python3 -m pip install --upgrade pip
python3 -m pip install ipython
python3 -m pip install jupyter
python3 -m pip install jupyterlab
- Make sure
~/.local/bin/
is in the path
- cd to the current dir where to start
ipython
- cd to the current dir where to start
jupyter notebook
- Or to directly open a notebook:
jupyter notebook tradesim_notebook.ipynb
Jupyter lab has a nicer interface.
- cd to the current dir where to start
jupyter lab
Ref: https://ipython.readthedocs.io/en/stable/interactive/magics.html
%whos
: Print all interactive variables
dd
: delete cella
: insert cell aboveb
: insert cell belowm
: convert cell to markdown (for documentation)y
: convert cell to code (python)Ctrl+Enter
: run current cellShift+Enter
: run & select cell belowAlt+Enter
: run cell & insert below
- Sympy equation wrapper: https://raw.githubusercontent.com/mathcube7/customize-sympy/main/customizer.py