You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
r = Renko(df)
r.set_brick_size(auto=True, atr_interval=2)
r.build()
r.plot()
But I have this issue:
File "c:/Users/Gabriel/Desktop/Bot/Analizador/test_tacharts.py", line 47, in <module>
r.set_brick_size(auto=True, atr_interval=2)
File "C:\Users\Gabriel\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\TAcharts\indicators\renko.py", line 46, in set_brick_size
self.brick_size = self._optimize_brick_size(auto, brick_size, atr_interval)
File "C:\Users\Gabriel\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\TAcharts\indicators\renko.py", line 53, in _optimize_brick_size
average_true_range = atr(
File "C:\Users\Gabriel\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\TAcharts\indicators\atr.py", line 17, in atr
prev_close = np.insert(close[:-1], 0, 0)
File "<__array_function__ internals>", line 5, in insert
File "C:\Users\Gabriel\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\numpy\lib\function_base.py", line 4601, in insert
return wrap(new)
File "C:\Users\Gabriel\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\pandas\core\generic.py", line 1918, in __array_wrap__
return self._constructor(result, **d).__finalize__(self)
File "C:\Users\Gabriel\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\pandas\core\series.py", line 291, in __init__
raise ValueError(
ValueError: Length of passed values is 500, index implies 499.
The text was updated successfully, but these errors were encountered:
I have been looking through the source code because I am having the same issue, and I have found some stuff that seem to be erroneous in the renko implementation.
In the source code for building the blocks, I have found that in these two lines:
You are referring to a self.close class variable that does not exist. I tried to change it to self.df.close in order to see if that made everything work but another error arises. This one has to do with the atr function, and going through it I saw that in line 23 two true_range are computed(idk if its a normal thing) but only the last one is used.
I am unsure if the things I said are expected to happen. Anyways, hope this helps. If have some time, I might try to do a PR trying to fix the renko implementation.
I am getting OHLCV from binance
My data has this form:
I am using renko code:
But I have this issue:
The text was updated successfully, but these errors were encountered: