kieran-mackle / AutoTrader

A Python-based development platform for automated trading systems - from backtesting to optimisation to livetrading.
https://kieran-mackle.github.io/AutoTrader/
GNU General Public License v3.0
945 stars 217 forks source link

autodetect_divergence can not be plot #32

Closed kitkimwong closed 2 years ago

kitkimwong commented 2 years ago

Describe the bug ValueError: You are trying to merge on datetime64[ns, UTC] and int64 columns. If you wish to proceed you should use pd.concat

To Reproduce

from finta import TA from autotrader.autodata import GetData from autotrader.autoplot import AutoPlot from autotrader.indicators import crossover, cross_values from autotrader import indicators

get_data = GetData()

instrument = 'EURUSD=X' data = get_data.yahoo(instrument, '1d', start_time='2021-01-01', end_time='2021-04-01') ema50 = TA.EMA(data, 50) rsi =TA.RSI(data,12)

rsi_divergence = indicators.autodetect_divergence(data, rsi)

indicator_dict = { 'EMA (50)': {'type': 'MA', 'data': ema50}, 'RSI (14)': {'type': 'RSI', 'data': rsi}, 'Bullish divergence': {'type': 'below', 'data': rsi_divergence['regularBull']}, }

ap = AutoPlot(data) ap.plot(indicators=indicator_dict, instrument=instrument)

Screenshots image

Version of AutoTrader being used master

kitkimwong commented 2 years ago

@kieran-mackle

kieran-mackle commented 2 years ago

Fixed this in 504d6df.