ChillarAnand / stocktrends

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

Key not found error when I pass tail items to Renko #11

Open praneeth1984 opened 4 years ago

praneeth1984 commented 4 years ago

Hello,

I was getting a "Key not found error". On investigating on the source code I understood df.tail(n).loc[0] does not work. I was using this approach as I noticed a performance issue when there were too many items in panda list. Instead of sending the entire list I was sending tail of 50 items to create the Renko chart and it started breaking. I changed in my local loc[0] to iloc[0] and it worked for me.

The code which was breaking and what I did to fix self.cdf.loc[0] = self.df.iloc[0]

Hope this helps.

Praneeth