Summary
TechnicalAnalysis currently has SMA and a stateless RSI. A real trading platform needs a broader set of indicators, and RSI must use Wilder's smoothing (stateful) to match values produced by TradingView and most exchanges.
Indicators to add
| Indicator |
Notes |
| EMA |
Exponential Moving Average |
| MACD |
EMA(12) - EMA(26) + Signal EMA(9) |
| Bollinger Bands |
SMA ± 2σ, return Upper/Mid/Lower |
| VWAP |
Cumulative since session open |
| ATR |
Average True Range (Wilder's) |
| Stochastic |
%K and %D |
Stateful RSI fix
- Current implementation recalculates full window every tick —
O(n) each frame
- Replace with Wilder's smoothing:
AvgGain = (PrevAvgGain × 13 + Gain) / 14
- Add a
RsiState struct to carry state across ticks
Acceptance criteria
References
src/Omnijure.Core/Shared/Lib/Math/TechnicalAnalysis.cs
src/Omnijure.Core/Shared/Lib/Math/SimdOps.cs
Summary
TechnicalAnalysiscurrently has SMA and a stateless RSI. A real trading platform needs a broader set of indicators, and RSI must use Wilder's smoothing (stateful) to match values produced by TradingView and most exchanges.Indicators to add
Stateful RSI fix
O(n)each frameAvgGain = (PrevAvgGain × 13 + Gain) / 14RsiStatestruct to carry state across ticksAcceptance criteria
Span<float>where possible)References
src/Omnijure.Core/Shared/Lib/Math/TechnicalAnalysis.cssrc/Omnijure.Core/Shared/Lib/Math/SimdOps.cs