8000 vbt.MA doesn't match Series.mean · Issue #786 · polakowo/vectorbt · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
vbt.MA doesn't match Series.mean #786
Open
@4ilin

Description

@4ilin

I'm likely overlooking something obvious; otherwise, it seems like a bug.

from pandas import Series
import numpy as np
import vectorbt as vbt

series = Series(range(0, 40))

assert np.isclose(
    vbt.MA.run(series, 20, "MA20").ma.dropna().iloc[0], # MA for the first window
    series.head(20).mean(), # Same here
    rtol=1e-6), f"MA calculated with VBT and Pandas.Series do not match"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0