- aligned macd_fdd

- fixed params

git-svn-id: http://moon:8086/svn/projects/Stock@332 fda53097-d464-4ada-af97-ba876c37ca34
This commit is contained in:
2019-12-25 21:58:00 +00:00
parent 8a01150261
commit fe706dead2
2 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -137,7 +137,7 @@ figNum = 1
if len(show_symbols) > 0: if len(show_symbols) > 0:
for symbol in show_symbols: for symbol in show_symbols:
if symbol in symbols: if symbol in symbols:
title = Stock(symbol, symbols[symbol]) title = Stock(params, symbol, symbols[symbol])
title.fetch() title.fetch()
title.statistics() title.statistics()
ind = title.analyze(buy_callback, range_days=params['show_range_days']) ind = title.analyze(buy_callback, range_days=params['show_range_days'])
+3 -2
View File
@@ -100,10 +100,11 @@ class Stock(object):
spl = UnivariateSpline(x=x_r, y=y_r, k=5) spl = UnivariateSpline(x=x_r, y=y_r, k=5)
spl.set_smoothing_factor(0.25) spl.set_smoothing_factor(0.25)
spl_d = spl.derivative() spl_d = spl.derivative()
spl_dd = spl_d.derivative() spl_dd = spl.derivative().derivative()
yf = spl(x_r) yf = spl(x_r)
yf_d = spl_d(x_r) yf_d = spl_d(x_r)
yf_dd = spl_dd(x_r) x_r2 = np.linspace(-1, N-1, N)
yf_dd = spl_dd(x_r2)
self.data['macd_f'] = np.transpose(yf) self.data['macd_f'] = np.transpose(yf)
self.data['macd_fd'] = np.transpose(yf_d) self.data['macd_fd'] = np.transpose(yf_d)