ChillarAnand / stocktrends

A python package to calculate trends in stocks, derivates(Futures & Options) using Renko, PnF, LineBreak etc
GNU General Public License v3.0
233 stars 74 forks source link

getting repetitive value of date and time column in renko #14

Closed joerusell9362 closed 3 years ago

joerusell9362 commented 3 years ago

Hi @ChillarAnand, I am trying to get renko data using following code:

from stocktrends import indicators
import pandas as pd

df = pd.read_csv('EUR-USD-RENKO-DATA.csv')

renko = indicators.Renko(df)

print('\n\nRenko box calcuation based on periodic close')
renko.brick_size = 0.0001
renko.chart_type = indicators.Renko.PERIOD_CLOSE
data = renko.get_ohlc_data()

data.to_csv('renko.csv')

And I am having follwing issues: 1) it tries to round off the value to brick size 2) date value is repetitive

I don't know if my code is wrong. Can you please guide me if I have to make any changes to the code? I have attach the zip file for data and my output and also a screenshot highlighting repetition.

Thanks

files.zip

Screenshot

ChillarAnand commented 3 years ago

@joerusell9362 Renko is based on brick calculation. So, it automatically round-off the values to brick size. This is expected.

Date values will be repetitive when there is more than 1 brick movement in price for that date. Since there is huge move in those duration, there are multiple entries.

ChillarAnand commented 3 years ago

Closing this issue for now. Feel free to re-open the issue if you need any help.