-
Notifications
You must be signed in to change notification settings - Fork 6
Description
Hello, I try to use the package but I obtain this issue.. Do you have an idea how to fix it?
Traceback (most recent call last):
File "C:\Users\nicol\anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 3343, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "", line 9, in
model.fit(init_pop)
File "C:\Users\nicol\anaconda3\lib\site-packages\tagenalgo\tagenalgo.py", line 310, in fit
pop_fit = self._fitness_evaluation(pop)
File "C:\Users\nicol\anaconda3\lib\site-packages\tagenalgo\tagenalgo.py", line 246, in _fitness_evaluation
fit_vals_lst.append(self._fitness_cal(ind)[0])
File "C:\Users\nicol\anaconda3\lib\site-packages\tagenalgo\tagenalgo.py", line 201, in _fitness_cal
idc = rsi_signal(self.price, rsi=rsi, buy_sig=buy_sig, sell_sig=sell_sig, error_tol=sig_tol)
TypeError: expected dtype object, got 'numpy.dtype[int64]'
Data:
Timestamp,Close
2016-01-04 14:15:00,2.3552
2016-01-04 14:30:00,2.34595
2016-01-04 14:45:00,2.34105
2016-01-04 15:00:00,2.32945
X_train, X_test = train_test_split(np.array(data['Close'].tolist()), shuffle=False)
# Input the required parameters and name of strategy.
model = TAGenAlgo(price=X_train, generations=3, population_size=100, crossover_prob=0.9, mutation_prob=0,method='single', strategy='rsi')
# Initialize the model by setting the range of indicators.
_, init_pop = model.ta_initialize(indicator_set={'rsi': {'window': [5, 180], 'down_thres': [5, 50], 'up_thres': [51, 90]}})
model.fit(init_pop)
model.predict(X_test)