Skip to content

Half trend #7

@bibinvargheset

Description

@bibinvargheset

The half trend code is not working as it should very different from TV

import ta_py as tapy
import pandas as pd
import pandas_ta as ta

df = pd.read_csv('/mnt/f/python/stocks/neo/data/bn_5min.csv')
# %%
df = df[:5000]
df.date = pd.to_datetime(df.date)
df.ta.ha(append=True)
data = df[['HA_high', 'HA_close', 'HA_low']].values.tolist()
[df2.csv](https://github.com/Bitvested/ta.py/files/9432276/df2.csv)

datahs = tapy.halftrend(data, 100, 2, 2)
df1 = pd.DataFrame(datahs, columns=['atrHigh', 'HalfTrend', 'atrLow', 'HS'])
df1.index=(df1.index+(len(df)-len(df1)))
df2 = pd.merge(df, df1, left_index=True, right_index=True)

Attaching the ouptu file

please check on tv by symbol BANKNIFTY 5 min HS(2,2)

The values and signals are very different

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions