Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RMA similar to TV RMA #189

Closed
wants to merge 3 commits into from
Closed

RMA similar to TV RMA #189

wants to merge 3 commits into from

Conversation

seannowotny
Copy link
Contributor

RMA which behaves similarly to the RMA found in TV (inbuilt function)

@seannowotny seannowotny mentioned this pull request May 9, 2021
Comment on lines +1281 to +1284
for i in range(1, series.size):
series.iloc[i] = series.iloc[i] * alpha + (1 - alpha) * (
series.iloc[i - 1] if not isna(series.iloc[i - 1]) else 0
)
Copy link
Member

Choose a reason for hiding this comment

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

uh - that'll be ... VERY slow in backtesting (it's a loop ...).

Are you sure there isn't a vectorized method to mirror this behaviour?

this will be ok for small timeranges - but when you have 10.000 candles in a backtest, it'll become very difficult to run.

At the very least (if it can't be vectorized) - please add a comment to the docstring noting that it'll be slow.

@C0D3D3V
Copy link

C0D3D3V commented Jan 17, 2022

#141 (comment) In my comment I have a vectorized version of RMA, it would need to be tweaked so that it is ready to use as a function (we might also want to optimize the initial SMA).

I just wanted to leave this here as a note, maybe I'll make it a PR sometime.

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.

3 participants