docs: fix unrendered LaTeX math blocks in indicator docs

Blank lines were missing around $$ fences (bold labels or list items
glued directly to $$, and stacked $$ blocks with no separator),
causing GitHub to merge them into the surrounding paragraph and
misread underscores as italic markers instead of rendering math.
This commit is contained in:
Miha Kralj
2026-09-27 19:43:22 -07:00
parent 6e9235919c
commit c6ffb9f487
12 changed files with 44 additions and 0 deletions
+7
View File
@@ -40,16 +40,21 @@ $$
2. **Pre-warped Frequency**: $W_c = \tan(\frac{\omega_c}{2})$
3. **Ripple Factor**: $\epsilon = \sqrt{10^{R/10} - 1}$
4. **Transformation**:
$$
\mu = \frac{1}{2} \sinh^{-1}(\frac{1}{\epsilon}) \\
\sigma = -\sinh(\mu) W_c \\
\omega_d = \cosh(\mu) W_c
$$
5. **Intermediate Variables**:
$$
K = \sigma^2 + \omega_d^2
$$
6. **S-Plane to Z-Plane Map (Bilinear Transform)**:
$$
b_0' = K \\
b_1' = 2K \\
@@ -58,7 +63,9 @@ $$
a_1' = 2K - 2 \\
a_2' = 1 + 2\sigma + K
$$
7. **Coefficients**:
$$
b_0 = \frac{b_0'}{a_0'}, \quad b_1 = \frac{b_1'}{a_0'}, \quad b_2 = \frac{b_2'}{a_0'} \\
a_1 = \frac{a_1'}{a_0'}, \quad a_2 = \frac{a_2'}{a_0'}
+3
View File
@@ -63,11 +63,13 @@ This is an IIR filter - each output depends on all previous outputs, creating in
The truncated version limits memory to exactly $L$ bars by recomputing the IIR recursion from scratch each bar:
**Step 1:** Initialize the tail:
$$
T_{L+2} = 0, \qquad T_{L+1} = 0
$$
**Step 2:** Run the recursion forward from oldest to newest:
$$
T_k = a_0(P_{k-1} - P_{k+1}) + a_1 \cdot T_{k+1} + a_2 \cdot T_{k+2}, \qquad k = L, L{-}1, \ldots, 1
$$
@@ -75,6 +77,7 @@ $$
where $P_k$ denotes the close price $k$ bars ago.
**Step 3:** Output:
$$
\text{TBF}_t = T_1
$$
+5
View File
@@ -76,21 +76,25 @@ where $x$ is the input series and $w_k$ are the window weights.
### Window Coefficient Formulas
**Hanning:**
$$
w_k = 0.5 - 0.5 \cos\left(\frac{2\pi k}{P}\right)
$$
**Hamming:**
$$
w_k = 0.54 - 0.46 \cos\left(\frac{2\pi k}{P}\right)
$$
**Blackman:**
$$
w_k = 0.42 - 0.5 \cos\left(\frac{2\pi k}{P}\right) + 0.08 \cos\left(\frac{4\pi k}{P}\right)
$$
**Blackman-Harris:**
$$
w_k = 0.35875 - 0.48829 \cos\left(\frac{2\pi k}{P}\right) + 0.14128 \cos\left(\frac{4\pi k}{P}\right) - 0.01168 \cos\left(\frac{6\pi k}{P}\right)
$$
@@ -118,6 +122,7 @@ $$
Fitted value at lag $i$: $\hat{x}_i = \text{intercept} + \text{slope} \cdot i$
Final LS output:
$$
\text{AFIRMA}_{LS} = \frac{1}{P} \left( \sum_{i=0}^{n-1} \hat{x}_i + \sum_{i=n}^{P-1} x_{t-i} \right)
$$
+3
View File
@@ -35,16 +35,19 @@ Key identities:
### Logarithm Rules
**Product Rule:**
$$
\ln(a \cdot b) = \ln(a) + \ln(b)
$$
**Quotient Rule:**
$$
\ln\left(\frac{a}{b}\right) = \ln(a) - \ln(b)
$$
**Power Rule:**
$$
\ln(a^n) = n \cdot \ln(a)
$$
+3
View File
@@ -78,16 +78,19 @@ $$
Where $MA$ is one of:
**SMA:**
$$
ADR_t = \frac{1}{N} \sum_{i=0}^{N-1} DR_{t-i}
$$
**EMA:**
$$
ADR_t = \alpha \cdot DR_t + (1 - \alpha) \cdot ADR_{t-1}, \quad \alpha = \frac{2}{N+1}
$$
**WMA:**
$$
ADR_t = \frac{\sum_{i=0}^{N-1} (N-i) \cdot DR_{t-i}}{\sum_{i=0}^{N-1} (N-i)}
$$
+2
View File
@@ -63,6 +63,7 @@ $$
$$
Using Welford's running algorithm:
$$
\sigma = \sqrt{\frac{\sum x^2}{n} - \left(\frac{\sum x}{n}\right)^2}
$$
@@ -70,6 +71,7 @@ $$
### Percentile Rank Formula
For a value $v$ in a dataset of $N$ values:
$$
\text{Percentile} = \frac{\text{count of values} < v}{N}
$$
+5
View File
@@ -79,6 +79,7 @@ This smoothed deviation represents the "raw" volatility reading that feeds into
The core innovation: instead of exponential smoothing, JVOLTY maintains a 128-sample circular buffer of raw volatility readings. On each bar, the buffer is sorted and a trimmed mean is computed:
**Full buffer (128 samples):**
$$
\hat{V}_t = \frac{1}{65} \sum_{i=32}^{96} \text{sorted}[i]
$$
@@ -86,12 +87,15 @@ $$
The middle 65 values (indices 32-96) represent approximately the 25th-75th percentile. Extreme values on both tails are discarded.
**Partial buffer (16-127 samples):**
$$
s = \max(5, \text{round}(0.5 \times \text{count}))
$$
$$
k = \lfloor(\text{count} - s) / 2\rfloor
$$
$$
\hat{V}_t = \frac{1}{s} \sum_{i=k}^{k+s-1} \text{sorted}[i]
$$
@@ -133,6 +137,7 @@ $$
$$
where:
$$
\text{sqrtDivider} = \frac{\sqrt{L} \times \text{logParam}}{\sqrt{L} \times \text{logParam} + 1}
$$
+4
View File
@@ -81,6 +81,7 @@ Given period $N$:
1. **Parameters**: $\alpha = \frac{1}{N}$, $\text{decay} = 1 - \alpha$
2. **True Range**:
$$
TR_t = \begin{cases}
H_t - L_t & \text{if } t = 0 \\
@@ -89,16 +90,19 @@ H_t - L_t & \text{if } t = 0 \\
$$
3. **RMA with FMA optimization**:
$$
ATR_{raw,t} = \text{FMA}(ATR_{raw,t-1}, \text{decay}, \alpha \cdot TR_t)
$$
4. **Warmup compensation**:
$$
ATR_t = \frac{ATR_{raw,t}}{1 - e_t}
$$
5. **Normalization**:
$$
NATR_t = \frac{ATR_t}{C_t} \times 100
$$
+2
View File
@@ -57,11 +57,13 @@ $$
where $\alpha = 1/\text{period}$.
**Bias compensator:**
$$
e_t = (1 - \alpha)^t
$$
**Corrected ATR:**
$$
ATR_t = \frac{\text{RMA}_{raw,t}}{1 - e_t}
$$
+6
View File
@@ -67,16 +67,19 @@ where $n$ is the smoothing period. For typical values:
### 3. Daily Variance Components
**Overnight variance:**
$$
\sigma_o^2 = r_o^2
$$
**Open-to-close variance:**
$$
\sigma_c^2 = r_c^2
$$
**Rogers-Satchell variance (drift-independent intraday measure):**
$$
\sigma_{RS}^2 = r_h \cdot (r_h - r_c) + r_l \cdot (r_l - r_c)
$$
@@ -108,11 +111,13 @@ $$
where $\alpha = 1/n$.
**Bias compensator:**
$$
e_t = (1 - \alpha)^t
$$
**Corrected output:**
$$
\text{RMA}_{corrected} = \frac{\text{RMA}_{raw}}{1 - e_t}
$$
@@ -127,6 +132,7 @@ The Rogers-Satchell component has elegant properties:
- **Non-negativity**: Always ≥ 0 when calculated correctly
The formula $r_h(r_h - r_c) + r_l(r_l - r_c)$ can be rewritten as:
$$
\sigma_{RS}^2 = r_h \cdot r_l - r_l \cdot r_c - r_h \cdot r_c + r_h^2 + r_l^2 - r_l^2
$$
+2
View File
@@ -83,11 +83,13 @@ where:
### Smoothed Force Index
Standard EMA form:
$$
EFI_t = \alpha \times F_t + (1 - \alpha) \times EFI_{t-1}
$$
Using FMA optimization:
$$
EFI_t = \text{FMA}(\alpha, F_t - EFI_{t-1}, EFI_{t-1})
$$
+2
View File
@@ -39,11 +39,13 @@ $$
### 2. Rate of Change Calculation
**Percentage Mode** (default):
$$
\text{VROC}_t = \frac{V_t - V_{t-n}}{V_{t-n}} \times 100
$$
**Point Mode**:
$$
\text{VROC}_t = V_t - V_{t-n}
$$