diff --git a/pandas_eval.py b/pandas_eval.py index 5ea4964..e4f3827 100644 --- a/pandas_eval.py +++ b/pandas_eval.py @@ -20,10 +20,11 @@ import os # https://ntguardian.wordpress.com/2016/09/19/introduction-stock-market-data-python-1 key = '0UO7Z2MVZ2YSQSVE' -thresh_macd = 2.0 +thresh_macd = 1.0 show_range_days = 20 -show_title = ['QCOM', 'CSCO'] +show_title = ['SIE.DE'] k_euro = 1 / 1.11 +N_poly = 7 titles = [ 'AAPL', @@ -188,6 +189,7 @@ class Symbol(object): today = dt.date.today() try: hdf = pd.HDFStore(filename, 'r') + hdf.close() except: fetch = True @@ -207,6 +209,7 @@ class Symbol(object): hdf = pd.HDFStore(filename) hdf[self.name] = data + self.data_full = hdf[self.name]*k_euro hdf.close() @@ -236,7 +239,7 @@ class Symbol(object): self._macd_data = self.data_full['macd'][len(self.data_full) - show_range_days:] x_r = list(range(0, len(self._macd_data))) y_r = self._macd_data.to_numpy() - poly = np.polyfit(x_r, y_r, 5) + poly = np.polyfit(x_r, y_r, N_poly) poly_d = np.polyder(poly) yf = np.polyval(poly, x_r)