In the past I've used pyplot's fill_between() to shade the area between upper and lower Bollinger Bands for example.
Can this be done now with mpf?
Not available yet. Definitely on the list of things to do.
For example, see Point 4 here: https://github.com/matplotlib/mplfinance/issues/49#issuecomment-596872429
The fill_between is also useful if you could create the IKH cloud (fill between senkou span a & b).
# Tenkan Sen
d9_high = stock_data['high'].rolling(window=9).max()
d9_low = stock_data['low'].rolling(window=9).min()
stock_data['tenkan_sen'] = ((d9_high + d9_low) / 2).round(2)
#kijun_sen
d26_high = stock_data['high'].rolling(window=26).max()
d26_low = stock_data['low'].rolling(window=26).min()
stock_data['kijun_sen'] = (d26_high + d26_low) / 2
#senkou_span_a
stock_data['senkou_span_a'] = ((stock_data['tenkan_sen'] - stock_data['kijun_sen']) / 2).round(2)
#senkou_span_b
d52_high = stock_data['high'].rolling(window=52).max()
d52_low = stock_data['low'].rolling(window=52).min()
stock_data['senkou_span_b'] = ((d52_high - d52_low ) / 2).round(2)
@fxhuhn
Markus, Thanks. WIll look into that. I am not familiar with it. Would you say that this http://education.trackntrade.com/live/live-user-manual/advanced-indicators/ichimoku-kinko-hyo.htm is a good reference?
Hi @DanielGoldfarb ,
yes that look fine. In general there a a lot more buy and sell trigger. I personally like the Tenkan Sen (Red Line) for a short time trigger and the color/size of the cloud. Small cloud means sideways with false signals.
I could not really make friends with the following line (Chikou)
PS: I just see that I forgot the offset in my code.
I've got fill_between working locally. In process of cleaning up a few other enhancements all being released together, and hoping to enter PR for this and those later this week, or early next week.
new version 0.12.5 just released to Pypi
See this notebook for some examples using kwarg fill_between
Most helpful comment
I've got fill_between working locally. In process of cleaning up a few other enhancements all being released together, and hoping to enter PR for this and those later this week, or early next week.