Summary
GeometricMovingAverage is RTTA's streaming geometric mean of recent prices:
the exponential of an SMA of log-prices. Prices must be strictly positive and
finite; invalid samples return NaN without advancing a usable log mean.
Update API
value = rtta.GeometricMovingAverage(window=14, fillna=True).update(price)
The nested log-SMA inherits fillna. Non-positive or non-finite price values
return NaN for that call.
Theory Of Operation
The geometric mean of positive prices \(x_1,\ldots,x_n\) is
This is the natural smoother for multiplicative (return-like) processes: equal percentage moves affect the geometric mean symmetrically, whereas an arithmetic SMA weights absolute points equally. RTTA implements the identity \(\operatorname{GMA} = \exp(\operatorname{SMA}(\log price))\).
Recurrence
Let \(x_t\) be the input price and \(n\) be window (default \(14\)).
If \(x_t \le 0\) or \(x_t\) is not finite, return NaN. Otherwise:
If the nested SMA returns NaN (warmup with fillna=False), the output is
NaN.
Implementation Notes
The recurrence is implemented in src/rtta/indicator.cpp in
class GeometricMovingAverage. The member logs_ is an SMA fed with
std::log(price).
