Giter Club home page Giter Club logo

relative-strength's Introduction

NOTE: This is no longer maintained. If you need it, fork it or something.


relative-strength

IBD Style Relative Strength Percentile Ranking of Stocks (i.e. 0-100 Score).
I also made a TradingView indicator, but it cannot give you the percentile ranking, it just shows you the Relative Strength: https://www.tradingview.com/script/SHE1xOMC-Relative-Strength-IBD-Style/

Daily Generated Outputs

Stocks: https://github.com/skyte/rs-log/blob/main/output/rs_stocks.csv
Industries: https://github.com/skyte/rs-log/blob/main/output/rs_industries.csv

Known Issues

Unfortunately the close prices loaded from the price history API are not always split adjusted. So if a stock had a split recently there is a chance the relative strength value will be wrong...

Calculation

Yearly performance of stock (most recent quarter is weighted double) divided by yearly performance of reference index (SPY by default).

Considered Stocks

Tickers from ftp://ftp.nasdaqtrader.com/symboldirectory/nasdaqtraded.txt disregarding ETFs and all stocks where the industry and sector information couldn't be retrieved from yahoo finance.

How To Run

Run EXE

  1. Open the latest successful run here: https://github.com/skyte/relative-strength/actions/workflows/exe.yml
  2. Download exe-package at the bottom (need to be logged in into github)
  3. Exctract the relative-strength folder and enter it
    • If needed open config.yaml and put in your preferences
  4. Run relative-strength.exe

Run Python Script

  1. Open config.yaml and put in your preferences
  2. Install requirements: python -m pip install -r requirements.txt
  3. Run relative-strength.py

Separate Steps

Instead of running relative-strength.py you can also:

  1. Run rs_data.py to aggregate the price data
  2. Run rs_ranking.py to calculate the relative strength rankings

*** Output ***

  • in the output folder you will find:
    • the list of ranked stocks: rs_stocks.csv
    • the list of ranked industries: rs_industries.csv

Config

Private File

You can create a config_private.yaml next to config.yaml and overwrite some parameters like API_KEY. That way you don't get conflicts when pulling a new version.

Data Sources

Can be switched with the field DATA_SOURCE

Yahoo Finance

(Benchmark: Loads 1500 Stocks in 20m)

  • Is default, no config necessary.
TD Ameritrade

(Benchmark: Loads 1500 Stocks in 18m)

  1. Create TDAmeritrade Developer Account and App
  2. Put in your API_KEY in config.yaml and change DATA_SOURCE.

relative-strength's People

Contributors

skyte avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.