下載美股和加密貨幣的歷史數據並透過自己的策略去找到強勢標的
The purpose of this project is to download historical data for US stocks and cryptocurrencies, and use different strategies to identify strong performing assets.
pip3 install -r requirements.txt
API keys are needed for Tiingo and Stocksymbol (Not a requirement for Crypto usage)
- Crypto relative strength
Identify strong performing assets by comparing them with SMA-30, SMA-45 and SMA-60 (Default time frame = 15m, total days = 7)
python3 crypto_relative_strength.py
python3 crypto_relative_strength.py -t "1h" -d 60
-t
Time frame (3m, 5m, 15m, 30m, 1h, 2h, 4h)-d
Calculation duration in days (max: 1440 bars), e.g. 1440 / (24 bars per day in 1h) = 60- Change CURRENT_TIMEZONE in the file if timezone is essential to you.[Refer]
- US stock trend template
Utilize Mark Minervini's trend template to filter out strong performing stocks.
python3 stock_trend_template.py
Both scripts will generate a TXT file that can be imported into TradingView's watchlist.
To import crypto or stock downloader for your own usage, simply include the following line in your Python code:
from src.downloader import StockDownloader
from src.downloader import CryptoDownloader
When devising your own strategy, feel free to refer to the existing strategies for guidance and inspiration. The stock data is downloaded from Tiingo and Yahoo Finance, and the cryptocurrency data is obtained from Binance.