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)
- ' Broker' object has no attribute '_allow_dancing_bears '
- Question about divergence indicator HOT 3
- config["API"] using Oanda not found HOT 1
- Questions regarding AutoTrader
- Add Support for Partially and Canceled order callback functions
- Cannot find GetData function HOT 1
- How to properly close a position in a strategy
- 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?
- Integrate existing indicator library HOT 2
- Custom xml plot path
- Help beginners run the project locally HOT 5
- Divergencies not plot again HOT 1
- Can't use crypto exchange as feed?
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.