You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi Daniel, thank you for taking over the maintainance of mpl-finance. I agree with you about the new mission statement. Here is a feature request for you to consider. The tulipy project already implemented lots of technical indicators. It would be nice to be able to use them in mpl_finance. Here is a short piece showing how I would like to be able to pass my chosen technical indicators as arguments to candlestick_ohlc():
#!/usr/bin/python3
import numpy as np
import tulipy as ti
from datetime import datetime
def candlestick_ohlc(quotes, ti_array):
close_prices = quotes['Close'].copy(order='C')
for ti in ti_array:
f = ti['f']
del ti['f']
print(f.full_name, f(close_prices, **ti))
# of course in real code it should be plotting here.
dt = [float] * 6
dt[0] = 'datetime64[D]'
convertfunc = lambda x: datetime.strptime(x.decode('utf8'), '%m/%d/%Y')
daily = np.genfromtxt('SP500_NOV2019_Hist.csv',
delimiter=',', autostrip=True, names=True, dtype=dt,
converters = {'Date': convertfunc}
)
candlestick_ohlc(daily, [
{'f':ti.sma, 'period':5},
{'f':ti.sma, 'period':10},
{'f':ti.macd, 'short_period':2, 'long_period':5, 'signal_period':9}
] )
Maybe we also need room for options telling candlestick_ohlc what colors and line width, etc. to use for each indicator line. And/or whether some of them should be displayed as solid bar and/or on a separate pane (so that volume can be processed using exactly this same interface without requiring a distinctive/separate interface). I don't have a very good suggestion yet as to how best to design that part of the interface.
The text was updated successfully, but these errors were encountered:
Chao-Kuei, Thank you so much for the idea. I had never heard of tulipy, and I like this idea very much. I will try in the next few weeks to make some time to experiment with the code you have provided, and with tulipy in general, and see if I can prototype something for you to play with.
Regarding your other ideas, Volume is already available via the same interface and on a separate pane, and the ability to customize more of the plot is also on my list of things to do. Again, thanks so much for the idea regardy tulipy. I will definitely be looking into it.
Hi Daniel, thank you for taking over the maintainance of mpl-finance. I agree with you about the new mission statement. Here is a feature request for you to consider. The tulipy project already implemented lots of technical indicators. It would be nice to be able to use them in mpl_finance. Here is a short piece showing how I would like to be able to pass my chosen technical indicators as arguments to candlestick_ohlc():
Maybe we also need room for options telling candlestick_ohlc what colors and line width, etc. to use for each indicator line. And/or whether some of them should be displayed as solid bar and/or on a separate pane (so that volume can be processed using exactly this same interface without requiring a distinctive/separate interface). I don't have a very good suggestion yet as to how best to design that part of the interface.
The text was updated successfully, but these errors were encountered: