Compare commits
2 Commits
07b9824b69
...
10cc047975
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
10cc047975 | ||
|
|
955a340d02 |
@ -14,6 +14,19 @@ The `Analysis` module includes classes for calculating common technical indicato
|
||||
Found in `cycles/Analysis/rsi.py`.
|
||||
|
||||
Calculates the Relative Strength Index.
|
||||
### Mathematical Model
|
||||
1. **Average Gain (AvgU)** and **Average Loss (AvgD)** over 14 periods:
|
||||
$$
|
||||
\text{AvgU} = \frac{\sum \text{Upward Price Changes}}{14}, \quad \text{AvgD} = \frac{\sum \text{Downward Price Changes}}{14}
|
||||
$$
|
||||
2. **Relative Strength (RS)**:
|
||||
$$
|
||||
RS = \frac{\text{AvgU}}{\text{AvgD}}
|
||||
$$
|
||||
3. **RSI**:
|
||||
$$
|
||||
RSI = 100 - \frac{100}{1 + RS}
|
||||
$$
|
||||
|
||||
### `__init__(self, period: int = 14)`
|
||||
|
||||
@ -33,7 +46,21 @@ Calculates the Relative Strength Index.
|
||||
|
||||
Found in `cycles/Analysis/boillinger_band.py`.
|
||||
|
||||
Calculates Bollinger Bands for given financial data.
|
||||
## **Bollinger Bands**
|
||||
### Mathematical Model
|
||||
1. **Middle Band**: 20-day Simple Moving Average (SMA)
|
||||
$$
|
||||
\text{Middle Band} = \frac{1}{20} \sum_{i=1}^{20} \text{Close}_{t-i}
|
||||
$$
|
||||
2. **Upper Band**: Middle Band + 2 × 20-day Standard Deviation (σ)
|
||||
$$
|
||||
\text{Upper Band} = \text{Middle Band} + 2 \times \sigma_{20}
|
||||
$$
|
||||
3. **Lower Band**: Middle Band − 2 × 20-day Standard Deviation (σ)
|
||||
$$
|
||||
\text{Lower Band} = \text{Middle Band} - 2 \times \sigma_{20}
|
||||
$$
|
||||
|
||||
|
||||
### `__init__(self, period: int = 20, std_dev_multiplier: float = 2.0)`
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user