finlab-python / finlab_crypto

Documentation
https://finlab-python.github.io/finlab_crypto/index.html
GNU General Public License v3.0
267 stars 98 forks source link

TypeError: add_yaxis() in utility.py:171 #20

Closed AmandaRossimandi closed 2 years ago

AmandaRossimandi commented 2 years ago
167 figures['entries & exits'] = pd.DataFrame(
168     {'entries':entries.squeeze(), 'exits': exits.squeeze()})
169 figures['performance'] = portfolio.cumulative_returns()

--> 171 c, info = chart.chart(ohlcv, overlaps=overlaps, 172 figures=figures, markerlines=mark_lines, 173 start_date=ohlcv.index[-min(1000, len(ohlcv))], end_date=ohlcv.index[-1], k_colors=k_colors) 174 c.load_javascript() 175 if html is not None: ... 161 # indicators 162 ################# 164 def is_item(item):

TypeError: add_yaxis() got an unexpected keyword argument 'yaxis_data'

seems due to pyecharts library, you need to update your utility.py file to the new pyecharts version that receive '_yaxis' instead of '_yaxisdata'

EugenioBarattini commented 2 years ago

yeah! the same problem, I confirm. I solved with a downgrade to old versione listed in requirements: pyecharts==1.7.1

but now I've issue about figure values defined in the @Strategy code:

_figure = { 'figures': { str(rsi_strategy.timeperiod) + 'rsi': rsi } }

no more render the RSI curve, but in the old versione of finlab-crypto, one year ago, it work.

AmandaRossimandi commented 2 years ago

me too, I've tested just now and no more render the RSI curve on graph. I've used the same strategy (rsi.py) in the strategies folder.

rsiNOTfigure

koreal6803 commented 2 years ago

Thank you for the feedback! latest working example is here (finlab_crypto==0.2.21): https://colab.research.google.com/drive/1kfKDgGTGhRvu0Bu2OkIHdKnabCdZa-pe?usp=sharing