datashaft / q4_majorshortsqueezes

Using this repo we try to answer the question how many major short squeezes have happened in the US stock market.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

q4_majorshortsqueezes

Using this repo we try to answer the question how many major short squeezes have happened in the US stock market.

Getting Started

Install

We have the same building infrastructure as the GameStonkTerminal: https://github.com/GamestonkTerminal/GamestonkTerminal

If you want to use or contribute to the GameStonkTerminal you can use the same tech stack.

Install

This project supports Python 3.9.

Our current recommendation is to use this project with Anaconda's Python distribution - either full Anaconda3 Latest or Miniconda3 Latest. Several features in this project utilize Machine Learning. Machine Learning Python dependencies are optional. If you decided to add Machine Learning features at a later point, you will likely have better user experience with Anaconda's Python distribution.

  1. Install Anaconda

Confirm that you have it with: conda -V. The output should be something along the lines of: conda 4.9.2

  1. Install git
conda install -c anaconda git
  1. Clone the Project
  • Via HTTPS: git clone https://github.com/DidierRLopes/GamestonkTerminal.git
  • via SSH: git clone git@github.com:DidierRLopes/GamestonkTerminal.git
  1. Navigate into the project's folder
cd GamestonkTerminal/
  1. Create Environment

You can name the environment whatever you want. Although you could use names such as: welikethestock, thisistheway or diamondhands, we recommend something simple and intuitive like gst. This is because this name will be used from now onwards.

conda create -n q4 --file conda/conda-3-9-env.yaml
  1. Activate the virtual environment
conda activate q4

Note: At the end, you can deactivate it with: conda deactivate.

  1. Install poetry dependencies
poetry install

This is a library for package management, and ensures a smoother experience than: pip install -r requirements.txt

  1. You are ready to interact with the package. The following pulls GME, AMC and TSLA and returns only the tickers that have doubled in value within 5 consecutive days in 2021. The historical price data of the returned tickers is written to the ./ticker_data dir.
poetry run python bin/pull_data.py --tickers GME AMC TSLA --start-date "2020-01-01" --filters "q4_majorshortsqueezes.filter/double_price_within_a_week" --output-path ./ticker_data

For help messages use the -h option:

poetry run python bin/pull_data.py -h

About

Using this repo we try to answer the question how many major short squeezes have happened in the US stock market.

License:MIT License


Languages

Language:Python 96.5%Language:Shell 3.5%