ranaroussi / qtpylib

QTPyLib, Pythonic Algorithmic Trading
http://qtpylib.io
Apache License 2.0
2.16k stars 513 forks source link

fixed error with changing "or" to "|" #170

Open mablue opened 3 years ago

mablue commented 3 years ago

when I run this qtpylib.crossed(DFIND, DFCRS)

i get this error: 2021-05-09 13:03:54,424 - freqtrade - ERROR - Fatal exception! joblib.externals.loky.process_executor._RemoteTraceback: """ Traceback (most recent call last): File "/home/mab/freqtrade/.env/lib/python3.8/site-packages/joblib/externals/loky/process_executor.py", line 431, in _process_worker r = call_item() File "/home/mab/freqtrade/.env/lib/python3.8/site-packages/joblib/externals/loky/process_executor.py", line 285, in call return self.fn(*self.args, self.kwargs) File "/home/mab/freqtrade/.env/lib/python3.8/site-packages/joblib/_parallel_backends.py", line 595, in call return self.func(*args, *kwargs) File "/home/mab/freqtrade/.env/lib/python3.8/site-packages/joblib/parallel.py", line 262, in call return [func(args, kwargs) File "/home/mab/freqtrade/.env/lib/python3.8/site-packages/joblib/parallel.py", line 262, in return [func(*args, *kwargs) File "/home/mab/freqtrade/.env/lib/python3.8/site-packages/joblib/externals/loky/cloudpickle_wrapper.py", line 38, in call return self._obj(args, **kwargs) File "/home/mab/freqtrade/freqtrade/optimize/hyperopt.py", line 274, in generate_optimizer bt_results = self.backtesting.backtest( File "/home/mab/freqtrade/freqtrade/optimize/backtesting.py", line 354, in backtest data: Dict = self._get_ohlcv_as_lists(processed) File "/home/mab/freqtrade/freqtrade/optimize/backtesting.py", line 196, in _get_ohlcv_as_lists self.strategy.advise_buy(pair_data, {'pair': pair}), {'pair': pair})[headers].copy() File "/home/mab/freqtrade/user_data/hyperopts/GodStraHo.py", line 122, in populate_buy_trend File "/home/mab/freqtrade/freqtrade/vendor/qtpylib/indicators.py", line 238, in crossed return above or below File "/home/mab/freqtrade/.env/lib/python3.8/site-packages/pandas/core/generic.py", line 1442, in nonzero raise ValueError( ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all(). """

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/home/mab/freqtrade/freqtrade/main.py", line 37, in main return_code = args'func' File "/home/mab/freqtrade/freqtrade/commands/optimize_commands.py", line 86, in start_hyperopt hyperopt.start() File "/home/mab/freqtrade/freqtrade/optimize/hyperopt.py", line 426, in start f_val = self.run_optimizer_parallel(parallel, asked, i) File "/home/mab/freqtrade/freqtrade/optimize/hyperopt.py", line 341, in run_optimizer_parallel return parallel(delayed( File "/home/mab/freqtrade/.env/lib/python3.8/site-packages/joblib/parallel.py", line 1054, in call self.retrieve() File "/home/mab/freqtrade/.env/lib/python3.8/site-packages/joblib/parallel.py", line 933, in retrieve self._output.extend(job.get(timeout=self.timeout)) File "/home/mab/freqtrade/.env/lib/python3.8/site-packages/joblib/_parallel_backends.py", line 542, in wrap_future_result return future.result(timeout=timeout) File "/usr/lib/python3.8/concurrent/futures/_base.py", line 439, in result return self.get_result() File "/usr/lib/python3.8/concurrent/futures/_base.py", line 388, in get_result raise self._exception ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().