Commit Graph

1315 Commits

Author SHA1 Message Date
Italo
5f1235a031
Safer exit_tag is not None check
the comparison using `is not None` fails if the column  `exit_tag` is stored with the more efficient dtype `Sparse[string]`. The reason is that none values are stored as np.nan which is a float. This would raise an error when `len` is called at the next condition.

```
2022-01-18 15:18:22,548 - freqtrade - ERROR - Fatal exception!
joblib.externals.loky.process_executor._RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/home/ftuser/.local/lib/python3.9/site-packages/joblib/externals/loky/process_executor.py", line 436, in _process_worker
    r = call_item()
  File "/home/ftuser/.local/lib/python3.9/site-packages/joblib/externals/loky/process_executor.py", line 288, in __call__
    return self.fn(*self.args, **self.kwargs)
  File "/home/ftuser/.local/lib/python3.9/site-packages/joblib/_parallel_backends.py", line 595, in __call__
    return self.func(*args, **kwargs)
  File "/home/ftuser/.local/lib/python3.9/site-packages/joblib/parallel.py", line 262, in __call__
    return [func(*args, **kwargs)
  File "/home/ftuser/.local/lib/python3.9/site-packages/joblib/parallel.py", line 262, in <listcomp>
    return [func(*args, **kwargs)
  File "/home/ftuser/.local/lib/python3.9/site-packages/joblib/externals/loky/cloudpickle_wrapper.py", line 38, in __call__
    return self._obj(*args, **kwargs)
  File "/freqtrade/freqtrade/optimize/hyperopt.py", line 317, in generate_optimizer
    bt_results = self.backtesting.backtest(
  File "/freqtrade/freqtrade/optimize/backtesting.py", line 658, in backtest
    trade_entry = self._get_sell_trade_entry(trade, row)
  File "/freqtrade/freqtrade/optimize/backtesting.py", line 461, in _get_sell_trade_entry
    return self._get_sell_trade_entry_for_candle(trade, sell_row)
  File "/freqtrade/freqtrade/optimize/backtesting.py", line 426, in _get_sell_trade_entry_for_candle
    and len(sell_row[EXIT_TAG_IDX]) > 0
TypeError: object of type 'float' has no len()
"""

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

Traceback (most recent call last):
  File "/freqtrade/freqtrade/main.py", line 37, in main
    return_code = args['func'](args)
  File "/freqtrade/freqtrade/commands/optimize_commands.py", line 103, in start_hyperopt
    hyperopt.start()
  File "/freqtrade/freqtrade/optimize/hyperopt.py", line 482, in start
    f_val = self.run_optimizer_parallel(parallel, asked, i)
  File "/freqtrade/freqtrade/optimize/hyperopt.py", line 396, in run_optimizer_parallel
    return parallel(delayed(
  File "/home/ftuser/.local/lib/python3.9/site-packages/joblib/parallel.py", line 1056, in __call__
    self.retrieve()
  File "/home/ftuser/.local/lib/python3.9/site-packages/joblib/parallel.py", line 935, in retrieve
    self._output.extend(job.get(timeout=self.timeout))
  File "/home/ftuser/.local/lib/python3.9/site-packages/joblib/_parallel_backends.py", line 542, in wrap_future_result
    return future.result(timeout=timeout)
  File "/usr/local/lib/python3.9/concurrent/futures/_base.py", line 445, in result
    return self.__get_result()
  File "/usr/local/lib/python3.9/concurrent/futures/_base.py", line 390, in __get_result
    raise self._exception
TypeError: object of type 'float' has no len()
ERROR: 1
```
2022-01-18 15:29:59 +00:00
Matthias
2bcfc0c90c Add warning about cache problems 2022-01-16 18:01:05 +01:00
Rokas Kupstys
062d00e8f2 Fix @informative decorator failing with edge. 2022-01-15 17:31:16 +02:00
Rokas Kupstys
2b7405470a Fix timerange check. 2022-01-15 17:30:40 +02:00
Rokas Kupstys
16861db653 Implement previous backtest result reuse when config and strategy did not change. 2022-01-15 17:30:40 +02:00
Reigo Reinmets
13bc5c5d8f Fine, this does look better. 2022-01-13 20:24:21 +02:00
Reigo Reinmets
678be0b773 Slightly move code. 2022-01-13 20:16:45 +02:00
Reigo Reinmets
3b7167ab07 Fix backtesting missing filled amounts in orders. 2022-01-10 20:30:40 +02:00
Reigo Reinmets
0bca07a32a Added min_stake, max_stake. Removed pair as its included in trade. 2022-01-08 17:20:02 +02:00
Reigo Reinmets
8e424f7c73
Merge branch 'freqtrade:develop' into dca 2022-01-08 14:57:15 +02:00
Matthias
04976658da Fix crash when using backtesting-show on a old backtestresult 2022-01-07 17:34:47 +01:00
Rokas Kupstys
11ace0f867 Instead of clearing processed dict, store df_analyzed (one with buy/sell signals) dataframe in it.
It still saves memory because this dataframe is kept by DataProvider.
Fixes #6179.
Amends #6133 (a715083fc0).
2022-01-07 12:07:49 +02:00
Matthias
e540959c27 Remove btdata from generate_strategy_stats 2022-01-07 09:27:07 +01:00
Matthias
1203d08d1e generate_pair_metrics does not need processed dict 2022-01-07 09:27:07 +01:00
Matthias
addba6597a
Merge pull request #6165 from freqtrade/drawdown_fixes
Improved drawdown calculation
2022-01-06 09:56:05 +01:00
Matthias
2a2392fd73 Update parameter name in docstring 2022-01-06 09:15:30 +01:00
Matthias
a9a6cf13f8 Add exit_tag to detail-sells
closes #6159
2022-01-06 08:22:15 +01:00
Matthias
6abd6bceb9 Avoid recalculating statistics for comparison line 2022-01-05 20:16:48 +01:00
Matthias
8373a4e713 Small Adjustments to improve compatibility 2022-01-04 19:17:08 +01:00
Matthias
4d9b4ddc28 Update hyperopt-tools to use account drawdown 2022-01-04 17:43:39 +01:00
Matthias
09fae25c94 Fix some tests after drawdown calculation change 2022-01-04 17:07:31 +01:00
Matthias
7a2b50ce8b Update drawdown calculation to account drawdown 2022-01-04 17:07:31 +01:00
Matthias
42579c0268 Drop hyperopt results legacy mode 2022-01-04 17:06:40 +01:00
Matthias
711a6a6dbc Merge branch 'develop' into pr/xataxxx/6079 2022-01-02 22:21:41 +01:00
Matthias
209ecc8732 Fix typo in bt_progress 2022-01-02 19:38:03 +01:00
Matthias
670aed06bf Remove loop for hyperopt. 2021-12-31 17:35:08 +01:00
Rokas Kupstys
a715083fc0 Reduce memory usage by not holding on to no longer needed data. 2021-12-31 12:10:01 +02:00
Reigo Reinmets
817a65b656 This is not needed since backtesting does not have open orders. 2021-12-26 20:01:48 +02:00
Reigo Reinmets
de79d25caf Refactoring to use strategy based configuration 2021-12-24 12:38:43 +02:00
Reigo Reinmets
db2f0660fa Some more compatibility fixes. 2021-12-18 11:15:59 +02:00
Reigo Reinmets
30673f84f9 Flake8 compatibility 2021-12-18 11:00:25 +02:00
Reigo Reinmets
d10fb95fce Fix typo 2021-12-17 22:27:10 +02:00
Reigo Reinmets
f11a40f144 Improve documentation on adjust_trade_position and position_adjustment_enable 2021-12-11 17:14:04 +02:00
Reigo Reinmets
f97662e816 Add position_adjustment_enable config keyword to enable it. 2021-12-11 00:28:12 +02:00
Reigo Reinmets
1e3fc5e984 Slight code touchup 2021-12-10 22:48:00 +02:00
Reigo Reinmets
c179951cca Expect stake_amount, not actual amount of pair from strategy for DCA. 2021-12-10 20:42:24 +02:00
Reigo Reinmets
b2c2852f86 Initial backtesting support. This does make it rather slow. 2021-12-09 23:21:35 +02:00
Matthias
c981cc335d Remove wrong comment 2021-12-04 14:51:55 +01:00
Matthias
68ac8008ec Call custom_exit_price only for sell_signal and custom_sell 2021-12-04 14:14:22 +01:00
Matthias
86910b58dc Bracket entry/exit prices to low/high of the candle 2021-12-03 17:44:53 +01:00
Matthias
d1209fe415 Merge branch 'develop' into pr/GluTbl/5756 2021-12-03 17:37:44 +01:00
Matthias
6ca6f62509 Remove duplicate code in optimize_reports 2021-11-27 09:39:10 +01:00
Matthias
450293878f
Merge pull request #5964 from stash86/fix-docs
Add more words on VolumePairlist backtest error message
2021-11-26 07:48:24 +01:00
Matthias
897788de17 Reformulate exception to be "nicer" 2021-11-26 07:02:50 +01:00
Stefano Ariestasia
5307d2bf3b Trimming the sentence 2021-11-25 17:04:04 +09:00
Stefano Ariestasia
0d1e84cf55 Add more words
Because apparently, we get at least 1 question about this everyday in Discord
2021-11-25 16:00:10 +09:00
Rokas Kupstys
78a00f2518 Use market data to get base and quote currencies in @informative() decorator. 2021-11-22 09:27:45 +02:00
Matthias
e0fd880c11 Improve some more pct formattings 2021-11-11 16:12:23 +01:00
Matthias
4eb9038358 Some more fixes to % formatting 2021-11-11 15:06:16 +01:00
Matthias
23a566b478 validate_stake_amount should not be a private method 2021-11-10 06:38:24 +01:00