Commit Graph

1227 Commits

Author SHA1 Message Date
Matthias
20a61e03da
Merge pull request #5786 from SimonEbner/clean_up_file_handles
Clean up file handles
2021-10-25 19:49:07 +02:00
Simon Ebner
f7926083ca Clean up unclosed file handles
Close all file handles that are left dangling to avoid warnings such as

```
ResourceWarning: unclosed file <_io.TextIOWrapper
name='...' mode='r' encoding='UTF-8'> params = json_load(filename.open('r'))
```
2021-10-24 23:15:05 +02:00
Simon Ebner
df033d92ef Improve performance of decimalspace.py
decimalspace.py is heavily used in the hyperoptimization. The following
benchmark code runs an optimization which is taken from optimizing a
real strategy (wtc).
The optimized version takes on my machine approx. 11/12s compared to the
original 32s. Results are equivalent in both cases.

```
import freqtrade.optimize.space
import numpy as np
import skopt
import timeit

def init():
    Decimal = freqtrade.optimize.space.decimalspace.SKDecimal
    Integer = skopt.space.space.Integer
    dimensions = [Decimal(low=-1.0,
        high=1.0,
        decimals=4,
        prior='uniform',
        transform='identity')] * 20

    return skopt.Optimizer(
        dimensions,
        base_estimator="ET",
        acq_optimizer="auto",
        n_initial_points=5,
        acq_optimizer_kwargs={'n_jobs': 96},
        random_state=0,
        model_queue_size=10,
    )

def test():
    opt = init()
    actual = opt.ask(n_points=2)
    expected = [[
        0.7515, -0.4723, -0.6941, -0.7988, 0.0448, 0.8605, -0.108, 0.5399,
        0.763, -0.2948, 0.8345, -0.7683, 0.7077, -0.2478, -0.333, 0.8575,
        0.6108, 0.4514, 0.5982, 0.3506
    ], [
        0.5563, 0.7386, -0.6407, 0.9073, -0.5211, -0.8167, -0.3771,
        -0.0318, 0.2861, 0.1176, 0.0943, -0.6077, -0.9317, -0.5372,
        -0.4934, -0.3637, -0.8035, -0.8627, -0.5399, 0.6036
    ]]

    absdiff = np.max(np.abs(np.asarray(expected) - np.asarray(actual)))
    assert absdiff < 1e-5

def time():
    opt = init()
    print('dt', timeit.timeit("opt.ask(n_points=20)", globals=locals()))

if __name__ == "__main__":
    test()
    time()
```
2021-10-24 18:14:24 +02:00
Matthias
96f99699e0
Merge pull request #4606 from rextea/add_days_breakdown_to_backtesting_summary
Add days breakdown table to backtesting
2021-10-21 13:56:30 +02:00
Matthias
e458c9867a Styling fixes 2021-10-21 07:45:15 +02:00
Matthias
7b5346b984 Add test for breakdown-stats 2021-10-21 07:11:39 +02:00
Matthias
fa028c2134 Support day/week/month breakdowns 2021-10-21 06:58:40 +02:00
Matthias
7197f4ce77 Don't show daily % profit (it's wrong) 2021-10-20 20:01:31 +02:00
Matthias
de5497c766 backtest_days cannot be below 1 2021-10-20 19:39:37 +02:00
Matthias
5454460227 Revert initial_points to 30
closes #5760
2021-10-20 07:46:15 +02:00
Matthias
7d8cd736b8 Support days-breakdown also for hyperopt results 2021-10-17 16:49:39 +02:00
Matthias
47bba331c1 Merge branch 'develop' into pr/rextea/4606 2021-10-17 16:29:31 +02:00
Matthias
0e7d903a6f
Merge pull request #5644 from slyons/develop
Add ability to ignore unparameterized spaces
2021-10-14 08:07:07 +02:00
Matthias
aed919a05f Simplify "no-space-configured" error handling by moving it to hyperopt_auto 2021-10-13 19:54:35 +02:00
sid
30bc96cf3f simplify expression 2021-10-09 06:36:23 +05:30
sid
46c320513a use profit_abs 2021-10-07 08:07:07 +05:30
sid
6ba46b38bd fix formatting 2021-10-06 13:46:05 +05:30
sid
c0d01dbc26 add max_drawdown loss 2021-10-06 13:24:27 +05:30
Scott Lyons
df45f467c6
Adding ability to ignore unparameterized spaces 2021-09-30 01:11:02 -07:00
Matthias
5726886b06 Reduce backtest-noise from "pandas slice" warning 2021-09-27 20:52:19 +02:00
Matthias
6319c104fe Fix unreliable backtest-result when using webserver mode 2021-09-26 15:07:48 +02:00
Rokas Kupstys
5dc78a0c66 [SQUASH] Get rid of _initialize() and fix informatives for dynamic pairlists. 2021-09-18 10:48:53 +03:00
Rokas Kupstys
dfa61b7ad2 [SQUASH] Fix informatives for each pair not being created because dataprovider was not available.
Fix not being able to have informative dataframe of a pair in whitelist.
2021-09-18 10:48:53 +03:00
Matthias
853c3a4433
Merge pull request #5587 from raph92/patch-3
Update prepare_trials_columns() return type
2021-09-18 08:08:18 +02:00
raphael
4b2c1a9b8e
Remove trailing whitespace 2021-09-17 14:39:15 -04:00
raphael
e715f2a253
Update formatting
Line 302 was too long
2021-09-17 14:23:26 -04:00
raphael
9525a5b96c
Add type to "trials" parameter 2021-09-17 14:10:37 -04:00
raphael
124e97f3b9
Remove ununsed variables from export_csv_file 2021-09-17 11:57:36 -04:00
raphael
3a98fb72a4
Update prepare_trials_columns() return type
Was returning str, updated to pd.DataFrame
2021-09-17 11:42:33 -04:00
Matthias
994c3c3a4c Add some errorhandling for custom estimator 2021-09-16 07:13:25 +02:00
Matthias
c0811ae896 Add possibility to override estimator from within hyperopt 2021-09-15 21:36:53 +02:00
Matthias
57ea0c322f Rename indicator_space to buy_indicator_space 2021-09-15 20:20:31 +02:00
Matthias
315ea1e116
Merge pull request #5566 from freqtrade/remove_hyperopt
Remove legacy hyperopt
2021-09-14 19:20:58 +02:00
Matthias
a12c3ecc9b Remove credentials whenever dry-run is set from within the exchange 2021-09-13 20:27:32 +02:00
Matthias
fd6bf591f8 Update some tests to remove explicit hyperopt interface 2021-09-12 08:18:13 +02:00
Matthias
dad4a49e81 Remove legacy hyperopt interface from hyperopt.py 2021-09-12 08:18:13 +02:00
Matthias
b0c4f079c2 Merge branch 'develop' into feat/backtest_detail 2021-08-31 20:16:42 +02:00
Matthias
2ce458810b rename default_hyperopt_loss file 2021-08-26 19:39:57 +02:00
Matthias
7fb570cc58 hyperopt Fallback methods should not be used. 2021-08-25 20:28:55 +02:00
Matthias
23d21d8ace Fix wrong message if protection-space is missing
closes #5480
2021-08-25 19:57:10 +02:00
Matthias
fa4ec9f83e Add explicit test for get_sell_trade_entry 2021-08-15 14:52:24 +02:00
Matthias
8405ccc15e Seperate detail data loading from regular backest-data loading 2021-08-14 16:33:01 +02:00
Matthias
88172fab82 Allow "detailed" backtesting timeframe to look into the candle 2021-08-14 16:04:23 +02:00
Matthias
bdbac37be7
Merge pull request #5399 from rokups/rk/fix-buy-tag-backtest
Fix buy_tag not being saved to trade object.
2021-08-12 06:36:33 +02:00
Rokas Kupstys
f6267c7514 Fix buy_tag not being saved to trade object.
Column is mistakenly excluded because advise_buy() creating this column runs after code detecting presence of buy_tag column.
2021-08-11 15:21:23 +03:00
ipqhjjybj
65d025923d add code 2021-08-11 14:35:16 +08:00
Matthias
0b6aedbc4c
Merge pull request #5395 from freqtrade/fix/hyperopt-show
Stream hyperopt-result in small batches
2021-08-10 19:54:02 +02:00
Matthias
039d6384ed Stream hyperopt-result in small batches
Avoiding memory-exhaustion on huge hyperopt results

closes #5305
closes #5149
2021-08-10 10:12:57 +02:00
Matthias
3f160c7144 Cache dataframe before cutting the first candle
This allows providing the "current closed" candle in all cases.
2021-08-10 09:14:29 +02:00
Matthias
5bfb9edf02 Only query date once from list 2021-08-09 15:42:17 +02:00