Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/braheezy/spy-analysis
Quick analysis of SPY ETF behavior when near all-time highs
https://github.com/braheezy/spy-analysis
Last synced: 2 days ago
JSON representation
Quick analysis of SPY ETF behavior when near all-time highs
- Host: GitHub
- URL: https://github.com/braheezy/spy-analysis
- Owner: braheezy
- Created: 2022-08-19T05:04:47.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-08-19T05:04:52.000Z (over 2 years ago)
- Last Synced: 2024-11-10T13:35:26.260Z (2 months ago)
- Language: Python
- Homepage:
- Size: 159 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Background
SPY is usually near all-time highs. Is this alpha?This program seeks to answer the following questions:
1. What does "near all-time highs" mean?
- When SPY is within ALL_TIME_HIGH_THRESHOLD percent of the current all time high.
2. How often is SPY near all-time highs?
3. When SPY is not near all-time highs, how far does it typically deviate?
4. When SPY is not near all-time highs, how long does it typically take to get back to all-time highs?# Method
Obtain historical data from Yahoo Finance.Run Python script to run analysis.
- Use `Close Price`
# Trading Strategy
Go long on SPY when it's not at all-time highs1. Buy 100 shares when X percent away
2. Set stop loss at Y percent away
3. Sell:
- After N days?
- After N percent profit?
- After SPY is within Z percent of all-time high?## Usage
In install the prerequisites:
```console
$ python -m pip install -r requirements.txt
```Run the program
```console
python ./spy_analysis.py
```Tweak `ALL_TIME_HIGH_THRESHOLD` in the script for different behavior.