Commit Graph

1052 Commits

Author SHA1 Message Date
Kamontat Chantrachirathumrong
48210170e7
wrap with is not empty 2021-05-20 11:49:25 +07:00
Kamontat Chantrachirathumrong
082fb11bbe
Avoid having error cannot set a frame with no defined index and a scalar 2021-05-20 01:54:48 +07:00
Matthias
ef4d1c24d7
Merge pull request #4941 from brookmiles/fix-stoploss-above-candle
prevent backtest stoploss trade price being set above candle high
2021-05-19 06:20:35 +02:00
Matthias
7a9853bfe1 Fix "Too many open Files" exception 2021-05-18 20:39:55 +02:00
Matthias
36eba0f110 Don't use "r+" memmap, but "r2 2021-05-17 21:05:48 +02:00
Matthias
6aa574fa2b Convert ROI result to proper json object
closes #4952
2021-05-17 20:58:50 +02:00
Matthias
4f968b4a6f
Merge pull request #4926 from rokups/rk/misc-fixes
Two fixes
2021-05-15 15:11:07 +02:00
Rokas Kupstys
2d5f465f1b Fix protections being loaded multiple times for first strategy when backtesting. 2021-05-15 13:37:03 +03:00
Rokas Kupstys
29fed37df3 Fix exception when few pairs with no data do not result in aborting backtest.
Exception is triggered by backtesting 20210301-20210501 range with BAKE/USDT pair (binance). Pair data starts on 2021-04-30 12:00:00 and after adjusting for startup candles pair dataframe is empty.

Solution: Since there are other pairs with enough data - skip pairs with no data and issue a warning.

Exception:
```
Traceback (most recent call last):
  File "/home/rk/src/freqtrade/freqtrade/main.py", line 37, in main
    return_code = args['func'](args)
  File "/home/rk/src/freqtrade/freqtrade/commands/optimize_commands.py", line 53, in start_backtesting
    backtesting.start()
  File "/home/rk/src/freqtrade/freqtrade/optimize/backtesting.py", line 502, in start
    min_date, max_date = self.backtest_one_strategy(strat, data, timerange)
  File "/home/rk/src/freqtrade/freqtrade/optimize/backtesting.py", line 474, in backtest_one_strategy
    results = self.backtest(
  File "/home/rk/src/freqtrade/freqtrade/optimize/backtesting.py", line 365, in backtest
    data: Dict = self._get_ohlcv_as_lists(processed)
  File "/home/rk/src/freqtrade/freqtrade/optimize/backtesting.py", line 199, in _get_ohlcv_as_lists
    pair_data.loc[:, 'buy'] = 0  # cleanup from previous run
  File "/home/rk/src/freqtrade/venv/lib/python3.9/site-packages/pandas/core/indexing.py", line 692, in __setitem__
    iloc._setitem_with_indexer(indexer, value, self.name)
  File "/home/rk/src/freqtrade/venv/lib/python3.9/site-packages/pandas/core/indexing.py", line 1587, in _setitem_with_indexer
    raise ValueError(
ValueError: cannot set a frame with no defined index and a scalar
```
2021-05-15 13:37:03 +03:00
Brook Miles
2eac23a15f if stoploss price is above the candle high, set it to candle open instead. this can occur if stoploss had previously been reached but the sell was prevented by confirm_trade_exit 2021-05-15 15:38:51 +09:00
Matthias
5e73195b30 Use linux lineseperator at all times 2021-05-15 07:01:32 +02:00
Matthias
ecee42f561 Read pickle file in mmap mode 2021-05-13 20:13:04 +02:00
Matthias
1055862bc0 Extract data-load + dump from hyperopt
(Reduces memory-usage as the dataframes go out of scope)
2021-05-12 21:15:01 +02:00
Matthias
24a1d5a96f Change default hyperopt-name to be shorter 2021-05-12 19:06:13 +02:00
Matthias
3cbe40875d read hyperopt results from pickle or json 2021-05-12 06:06:30 +02:00
Matthias
06bf1aa274 Store epochs as json per line 2021-05-12 05:58:25 +02:00
Matthias
7398ea88e0 Change optimize_reports to convert dates to string earlier 2021-05-11 20:37:49 +02:00
Matthias
92186d89a2 Add some changes to strategytemplate 2021-05-09 09:56:36 +02:00
Rokas Kupstys
8d8c782bd0 Slice dataframe in backtesting, preventing access to rows past current time. 2021-05-08 18:40:49 +03:00
Rokas Kupstys
f1eb653545 Fix strategy protections not being loaded in backtesting. 2021-05-08 10:29:47 +03:00
Rokas Kupstys
1b01ad6f85 Make exchange parameter optional and do not use it as parameter in backtesting. 2021-05-08 10:29:47 +03:00
Matthias
4b6cd69c81 Add test for no-exchange dataprovider 2021-05-08 10:29:47 +03:00
Rokas Kupstys
d344194b36 Fix dataprovider in hyperopt. 2021-05-08 10:29:47 +03:00
Rokas Kupstys
6fb4d83ab3 Fix dataprovider in hyperopt. 2021-05-08 10:29:47 +03:00
Rokas Kupstys
cdfa6adbe5 Store pair datafrmes in dataprovider for backtesting. 2021-05-08 10:29:47 +03:00
Rokas Kupstys
d34da3f981 Revert "Add dataframe parameter to custom_stoploss() and custom_sell() methods."
This reverts commit 595b8735f8.

# Conflicts:
#	freqtrade/optimize/backtesting.py
#	freqtrade/strategy/interface.py
2021-05-08 10:29:47 +03:00
Matthias
513be11fd9 Fix hyperopt output
closes #4892
2021-05-07 20:23:11 +02:00
Matthias
554f5f14b6 Raise exception if no data is left 2021-05-07 06:41:15 +02:00
Matthias
4f529fe424 Don't use Arrow to get min/max backtest dates 2021-05-06 19:43:14 +02:00
Matthias
da574e4e69 Small style fixes 2021-05-03 06:30:41 +02:00
Matthias
fc110ea418 Support csv export for new and old versions 2021-05-02 20:41:45 +02:00
Matthias
287b43e999 Output strategy results including non-optimized parameters 2021-05-02 11:30:53 +02:00
Matthias
d069ad43d8 Small reformatting in hyperopt 2021-05-02 11:01:26 +02:00
Matthias
8ee0b0d8e8 Store not optimized parameters (if applicable) 2021-05-02 10:46:04 +02:00
Matthias
46f0f66039 Keep dimensions stored in hyperopt class
There is no point in regenerating them and it will cause some
overhead as all space classes will be recreated for every epoch.
2021-05-02 09:48:37 +02:00
Matthias
ced5cc7ce2 Don't recalculate min/max date - they won't change between epochs 2021-05-02 09:46:27 +02:00
Matthias
ecdfb6e5ed Fix output of % for new format 2021-05-02 09:46:27 +02:00
Matthias
881cba336a Show backtesting result in hyperopt-show 2021-05-02 09:46:27 +02:00
Matthias
420e75af65 Extract show_backtest_result for one strategy 2021-05-02 09:46:27 +02:00
Matthias
97478abb9d Move format explanation string to HyperoptTools 2021-05-02 09:46:27 +02:00
Matthias
f2e182002d Simplify calling backtesting by returning the proper result 2021-05-02 09:46:27 +02:00
Matthias
e2e1d34828 Extract stake_currency param from hyperopt-explanationstring 2021-05-02 09:46:27 +02:00
Matthias
6aaaad29d7 Use backtesting output for hyperopt results 2021-05-02 09:46:27 +02:00
Matthias
545cba7fd8 Refactor optimize_report
we should not calculate non-daily statistics in the daily stats method
2021-05-02 09:46:27 +02:00
Matthias
9994fce577 Extract generation of report for one strategy to it's own method 2021-05-02 09:46:27 +02:00
Matthias
b125c975c7 Rename strategy_comparison method 2021-05-02 09:46:27 +02:00
Matthias
ac2e1eb3d7 Don't import joblib for regular strategies 2021-05-02 08:44:16 +02:00
Matthias
e381df9098 extract has_space to Hyperopt-Tools 2021-05-01 16:36:35 +02:00
Matthias
7c8a367442 Update docs to not promote stoploss / take-profit 2021-04-28 20:36:06 +02:00
Matthias
2061162d79 Convert trade-opendate to python datetime 2021-04-26 20:01:13 +02:00