Open TsaiJinhang opened 4 years ago
Hi Team, getting same error
Traceback (most recent call last):
File "/Users/vkumaraguruparan/Projects/algo/SwingTrade/p_ta/offline.py", line 46, in <module>
qf.iplot(asFigure=True),
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/cufflinks/quant_figure.py", line 1235, in iplot
study_fig=self._get_study_figure(k,**kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/cufflinks/quant_figure.py", line 1073, in _get_study_figure
fig=df.ta_figure(study=kind,**params)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/cufflinks/plotlytools.py", line 1485, in _ta_figure
return self.ta_plot(**kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/cufflinks/plotlytools.py", line 1631, in _ta_plot
figure=get_study(self,ta_func,iplot_kwargs,iplot_study_kwargs,include=include,
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/cufflinks/plotlytools.py", line 1606, in get_study
df_ta=func(df,column=column,include=False,str=str,**study_kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/cufflinks/ta.py", line 375, in ptps
__df=pd.concat([_ptps(df,periods=y,high=high,low=low,include=False,str=str,detail=detail) for y in periods],axis=1)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/cufflinks/ta.py", line 375, in <listcomp>
__df=pd.concat([_ptps(df,periods=y,high=high,low=low,include=False,str=str,detail=detail) for y in periods],axis=1)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/cufflinks/ta.py", line 293, in _ptps
if _df['T_SAR'][_-1]>=df[low][_]:
TypeError: '<=' not supported between instances of 'float' and 'NoneType'
Getting the same error, but commenting the line 293 does not solve the underlying problem. just postpone it. After, it triggers the following:
File "C:\Users\geral\repos\TradingPatterns\venv\lib\site-packages\cufflinks\ta.py", line 376, in ptps
__df=pd.concat([_ptps(df,periods=y,high=high,low=low,include=False,str=str,detail=detail) for y in periods],axis=1)
File "C:\Users\geral\repos\TradingPatterns\venv\lib\site-packages\cufflinks\ta.py", line 376, in
I can confirm this error.
this is the code:
the error:
My solution: delete _df.loc[0,'T_SAR']=None (in line 286 of ta.py)