Skip to content

Some functions have look ahead bias #5

@esquire900

Description

@esquire900

Hi firmai,

Thanks for creating deltapy! I just wanted to point out that not all functions are look ahead safe: their values change if new data is appended to the dataframe, making them hard to use in real life. For example:

a = transform.instantaneous_phases(df, ["close"]).iloc[
    -2
]
b = transform.instantaneous_phases(df.iloc[:-1], ["close"]).iloc[-1]
pd.testing.assert_series_equal(a,b) # -> this fails

I havent tested all, but this applies atleast to the transform.bkb and transform.instantaneous_phases functions.

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