Compare commits
No commits in common. "10cc047975fa212434e8ce7ecbf1de136bb2d0c3" and "07b9824b69c08f18f402c62bd86e55ab2039039b" have entirely different histories.
10cc047975
...
07b9824b69
@ -14,19 +14,6 @@ The `Analysis` module includes classes for calculating common technical indicato
|
|||||||
Found in `cycles/Analysis/rsi.py`.
|
Found in `cycles/Analysis/rsi.py`.
|
||||||
|
|
||||||
Calculates the Relative Strength Index.
|
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)`
|
### `__init__(self, period: int = 14)`
|
||||||
|
|
||||||
@ -46,21 +33,7 @@ Calculates the Relative Strength Index.
|
|||||||
|
|
||||||
Found in `cycles/Analysis/boillinger_band.py`.
|
Found in `cycles/Analysis/boillinger_band.py`.
|
||||||
|
|
||||||
## **Bollinger Bands**
|
Calculates Bollinger Bands for given financial data.
|
||||||
### 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)`
|
### `__init__(self, period: int = 20, std_dev_multiplier: float = 2.0)`
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user