Skip to content

feat: add RMA (Running Moving Average / Wilder's Smoothing) indicator#743

Open
mac-agent wants to merge 1 commit intofreqtrade:mainfrom
mac-agent:feature/add-rma-indicator
Open

feat: add RMA (Running Moving Average / Wilder's Smoothing) indicator#743
mac-agent wants to merge 1 commit intofreqtrade:mainfrom
mac-agent:feature/add-rma-indicator

Conversation

@mac-agent
Copy link
Copy Markdown

Summary

Adds the RMA (Running Moving Average) indicator, implementing the equivalent of TradingView Pine Script ta.rma().

Fixes #141.

What is RMA?

RMA is also known as Wilder's Smoothing Average. It's used extensively in technical analysis — most notably in RSI calculations, ADX, and other Wilder-derived indicators.

Formula: RMA is equivalent to an EMA with alpha = 1/period:

  • First value: SMA of first N values
  • Subsequent: RMA = (prev_RMA * (period - 1) + current) / period

Implementation

  • Uses pandas ewm(alpha=1/period, adjust=False, min_periods=period).mean() for efficient vectorized computation
  • Follows existing function signature pattern (dataframe, period, field)
  • Added to overlap_studies.py alongside other moving averages
  • Exported via existing wildcard imports

Testing

Added test_rma with 3 assertions:

  • Produces non-null values after warmup period
  • All values positive for BTC price data
  • Less volatile than raw prices (smoothing property)

Implements TradingView Pine Script ta.rma() equivalent.

RMA is also known as Wilder's Moving Average and is equivalent to an
EMA with alpha = 1/period. This is a commonly requested indicator
used in RSI calculations and other technical analysis.

Fixes freqtrade#141
Copy link
Copy Markdown
Member

@xmatthias xmatthias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd want to have a test in test_indicators_generic for this, too.

That test ensures the interface is aligned with the others. You'll have to refresh the snapshots - but that's no issue, really.

We'll also want to add it to the index / docs page - otherwise it'll be code that nobody knows about.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Please add tradingview RMA indicator

2 participants