Comments (1)
even i am facing this issue while plotting MACD, i am unable to resolve error
i have written the code in this
file.py
indicator are define here
from autotrader import autoplot, indicators, autodata, AutoTrader, AutoData
import pandas as pd
import datetime
import yfinance as yf
import finta as ta
import datetime as dt
data fetching using yfinance
data_yf = yf.download(tickers='AAPL', start=pd.date_range(
end=datetime.datetime.today(), periods=360)[0], interval='1d')
data for generating plots
rsi = ta.TA.RSI(data_yf)
obv = ta.TA.OBV(data_yf)
mfi = ta.TA.MFI(data_yf)
cmf = ta.TA.CHAIKIN(data_yf)
ema = ta.TA.EMA(data_yf)
macd = ta.TA.MACD(data_yf)
macd_co = crossover(macd.MACD, macd.SIGNAL)
macd_co_val = cross_values(macd.MACD, macd.SIGNAL, macd_co)
rsi_divergence = indicators.autodetect_divergence(
data_yf, rsi, tolerance=15, method=0)
obv_divergence = indicators.autodetect_divergence(
data_yf, obv, tolerance=10, method=1)
indicator_dict = {'RSI (14)': {'type': 'RSI', 'data': rsi},
'obv': {'type': 'below', 'data': obv},
'mfi': {'type': 'below', 'data': mfi},
'cmf': {'type': 'below', 'data': cmf},
'diveregence_Bull': {'type': 'below', 'data': rsi_divergence['regularBull']},
'diveregence_bear': {'type': 'below', 'data': rsi_divergence['regularBear']},
'MACD': {'type': 'MACD',
'macd': macd.MACD,
'signal': macd.SIGNAL,
'histogram': macd.MACD-macd.SIGNAL,
'crossvals': macd_co_val
},
}
plotting data
ap = autoplot.AutoPlot(data=data_yf)
ap.configure(max_indis_below=10, max_indis_over=10)
ap.plot(instrument='AAPL', indicators=indicator_dict),
from autotrader.
Related Issues (20)
- Add Tox support HOT 1
- unexpected keyword argument 'strategy_filename' HOT 1
- Rithmic API
- TypeError: find_swings()
- plotting error HOT 3
- AutoData docs HOT 2
- Can we please get an exact Step-by-Step tutorial of how to set it up with Crypto Exchange? HOT 1
- Crash raise ValueError("No objects to concatenate") HOT 2
- Crash: IndexError: only integers, slices (`:`), ellipsis (`...`),
- Taking profits and leaving runners concept
- Range exception index -1 in indicator method unroll_signal_list
- Not clear how to login, needing simple example template HOT 2
- multi-time frame data not working
- \
- help with issue HOT 1
- 'Index' object has no attribute 'tzinfo', and so on ~ HOT 1
- Running paper trade mode in Oanda
- Display statistics in backtesting mode
- Peer closed connection. clientId 3 already in use?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from autotrader.