Commit Graph

7243 Commits

Author SHA1 Message Date
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 22dd2ca003 Fix mypy type errors 2021-10-24 15:18:29 +02:00
Matthias 17432b2823 Improve some stylings 2021-10-24 09:15:05 +02:00
Matthias dffb4c5d53 Merge branch 'develop' into pr/TreborNamor/5607 2021-10-24 08:55:10 +02:00
Sam Germain 60478cb213 Add fill_leverage_brackets and get_max_leverage back in 2021-10-23 22:16:51 -06:00
Sam Germain d99e0dac7b Added name for futures market property 2021-10-23 21:59:47 -06:00
Sam Germain 3eda9455b9 Added dry run capability to funding-fee 2021-10-23 21:59:47 -06:00
Sam Germain 2533d3b420 Added get_funding_rate_history method to exchange 2021-10-23 21:59:41 -06:00
Sam Germain ef8b617eb2 gateio, ftx and binance all use same funding fee formula 2021-10-23 21:59:03 -06:00
Sam Germain badc0fa445 Adjusted _get_funding_fee_method 2021-10-23 21:58:57 -06:00
Sam Germain cba0a8cee6 adjusted funding fee formula binance 2021-10-23 21:58:17 -06:00
Sam Germain 2a26c6fbed Added backtesting methods back in 2021-10-23 21:33:37 -06:00
Sam Germain ed91516f90 Changed future to swap 2021-10-23 14:10:09 -06:00
Simon Ebner fde10f5395 Use pathlib.stem instead of str(x).ends_with 2021-10-23 12:26:07 +02:00
Sam Germain 167f9aa8d9 Added gateio futures support, and added gatio to test_exchange exchanges variable 2021-10-22 11:52:05 -06:00
Sam Germain aed22f7dad Merge branch 'develop' into feat/short 2021-10-22 11:45:27 -06:00
Sam Germain f07555fc84 removed binance constructor, added fill_leverage_brackets call to exchange constructor 2021-10-22 06:37:56 -06:00
Matthias 78724e304e Merge branch 'develop' into pr/theluxaz/5710 2021-10-21 17:46:39 +02:00
theluxaz 0e085298e9 Fixed test failures. 2021-10-21 17:25:38 +03: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 1267374c8a Small fixes to tests 2021-10-20 19:21:38 +02:00
theluxaz 905f3a1a50 Removed exit_tag from Trade objects. 2021-10-20 17:58:50 +03:00
Sam Germain 0329da1a57 updated get_max_leverage to use new ccxt unified property 2021-10-20 08:36:48 -06:00
Sam Germain 3fffc315ac Merge branch 'develop' into feat/short 2021-10-20 08:11:53 -06:00
Matthias 5454460227 Revert initial_points to 30
closes #5760
2021-10-20 07:46:15 +02:00
theluxaz 1fdc4425dd Changed exit_tag to be represented as sell_reason 2021-10-20 01:26:15 +03:00
Matthias 55b0216180 Allow StaticPairlist in non-first position
closes #5754
2021-10-19 19:48:56 +02:00
Matthias 42a4dfed28 Reallow bitstamp
revert #1984, related to #1983
2021-10-19 19:12:35 +02:00
theluxaz 5ecdd1d112 Merge branch 'develop' into freqtrade-development 2021-10-19 00:00:15 +03:00
theluxaz 69a59cdf37 Fixed flake 8, changed sell_tag to exit_tag and fixed telegram functions 2021-10-18 23:56:41 +03:00
Sam Germain 57d7009fd9 Added trading mode and collateral to constants.py 2021-10-18 01:21:41 -06:00
Sam Germain faaa3ae9b1 Removed exit_short rpcmessagetype 2021-10-18 01:08:12 -06:00
Sam Germain 053aecf111 reformatted check_handle_timedout 2021-10-18 01:01:29 -06:00
Sam Germain e4682b78c5 updates suggested on github 2021-10-18 00:28:32 -06: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 d4d57f0002 Document expansion of `--pairs`, add download-inactive 2021-10-17 16:09:56 +02:00
Matthias 9bb2dd1851
Merge pull request #5694 from freqtrade/dependabot/pip/develop/fastapi-0.70.0
Bump fastapi from 0.68.1 to 0.70.0
2021-10-17 15:01:28 +02:00
Matthias e23eb99abf Disable ability to use lookahead-biased vwap
closes #5782
2021-10-17 11:23:58 +02:00
Matthias 198f3c5238 Merge branch 'feat/short' into pr/samgermain/5567 2021-10-17 10:41:03 +02:00
Matthias 69fdb8edfa Merge branch 'develop' into feat/short 2021-10-17 10:40:08 +02:00
Matthias fb2c8f7621 Rollback after each request
This closes the transaction and avoids "sticking" transactions.
2021-10-17 10:30:06 +02:00
Matthias bc10b451fe Revert wrong condition 2021-10-17 09:46:39 +02:00
Matthias 5ba1d66be7 Make sure transactions are reset
closes #5719
2021-10-16 17:57:51 +02:00
Matthias 794862a35a
Merge pull request #5670 from sergeykhliustin/develop
Added min_profit param to PerformanceFilter
2021-10-14 19:57:36 +02:00
Matthias c02a538187 Add documentation and log to PerformanceFilter 2021-10-14 19:36:34 +02:00
Sam Germain 5fbe76cd7e isolated conditionals in interface stoploss method 2021-10-14 05:10:28 -06:00
Matthias 0e7d903a6f
Merge pull request #5644 from slyons/develop
Add ability to ignore unparameterized spaces
2021-10-14 08:07:07 +02:00
Sam Germain bcbe8f229c Merge branch 'feat/short' into lev-freqtradebot 2021-10-13 19:02:57 -06:00
Sam Germain bd488cc086 Merge branch 'develop' into feat/short 2021-10-13 17:56:40 -06:00
theluxaz 0bb7ea10ab Fixed minor header for backtesting 2021-10-14 01:34:30 +03:00
theluxaz ed39b8dab0 fixed profit total calculation 2021-10-14 01:18:16 +03:00
theluxaz d341d85079 Refixed some files for the pull request 2021-10-14 01:13:28 +03:00
theluxaz 96cab22a8c Fixed some bugs for live sell_tags. 2021-10-14 01:03:15 +03:00
Matthias 3279ea568c Add new parameter to hyperopt docs 2021-10-13 19:57:42 +02:00
Matthias aed919a05f Simplify "no-space-configured" error handling by moving it to hyperopt_auto 2021-10-13 19:54:35 +02:00
Matthias 2c6290a100 Small updates to prevent random test failures 2021-10-13 07:04:21 +02:00
Sam Germain 0dbad19b40 trading_mode default null in models.Trade 2021-10-12 20:34:19 -06:00
theluxaz 0f670189eb quick typo fix 2021-10-13 02:14:07 +03:00
theluxaz b151cf032b Merge branch 'develop' of https://github.com/theluxaz/freqtrade into main
# Conflicts:
#	freqtrade/freqtradebot.py
#	freqtrade/optimize/backtesting.py
2021-10-13 02:01:26 +03:00
theluxaz 02243b1a2b minifix 2021-10-13 01:34:29 +03:00
theluxaz 80b71790bc Added some bigfixes for sell_tag 2021-10-13 01:22:53 +03:00
theluxaz b898f86364 Added sell_tag and buy/sell telegram performance functions 2021-10-13 00:02:28 +03:00
Matthias 532a9341d2 Fix migration issue 2021-10-12 20:41:48 +02:00
Matthias f290ff5c9a Re-add schedule.run_pending 2021-10-12 19:10:38 +02:00
Sam Germain 86cbd0039f Fixed bugs 2021-10-12 02:24:35 -06:00
Matthias ce9debe9fd Add version argument to freqUI installer 2021-10-12 06:44:07 +02:00
Matthias 70000b5843 Use scheduler as Object, not the automatic Singleton 2021-10-11 20:28:23 +02:00
Sam Germain bdad604fab Added persistence futures tests 2021-10-11 07:48:31 -06:00
Sam Germain ae3688a18a Updated LocalTrade.calc_close_trade_value formula for shorting futures 2021-10-11 05:56:27 -06:00
Sam Germain d5a1385fdc Changes described on github 2021-10-11 04:14:59 -06:00
Sam Germain 855b26f846 Parametrized more time machine tests in test_update_funding_fees 2021-10-11 01:31:21 -06:00
Sam Germain 3b962433fb Switched shcedule to perform every 15 minutes 2021-10-10 02:55:04 -06:00
Sam Germain 81cf4653a9 Fixed failing test_process_trade_creation, test_order_book_depth_of_market, test_handle_stoploss_on_exchange_trailing 2021-10-09 17:35:57 -06:00
Sam Germain 94f0be1fa9 Added is_short=(signal == SignalDirection.SHORT) inside freqtradebot.create_trade 2021-10-09 16:32:22 -06:00
Sam Germain 85e86ec09d Fixed failing test_check_handle_timedout_buy_usercustom 2021-10-09 15:14:33 -06:00
Sam Germain 729957572b updated strategy stop_loss_reached to work for shorts 2021-10-09 14:39:11 -06:00
Sam Germain 95be5121ec Added bibox and hitbtc funding fee times 2021-10-09 13:14:41 -06:00
Sam Germain b83933a10a Added gateio and kucoin funding fee times 2021-10-09 13:09:11 -06:00
Sam Germain 057b048f31 Started added timezone offset stuff 2021-10-09 12:27:40 -06:00
Sam Germain 795d51b68c Switched scheduler to get funding fees every hour for any exchange 2021-10-09 11:27:26 -06:00
Sam Germain 39be675f1f Adjusted time to utc in schedule 2021-10-09 10:52:07 -06:00
Matthias cae8ff5949
Merge pull request #5623 from froggleston/rest_sysinfo
Add CPU,RAM sysinfo support to the REST API to help with bot system m…
2021-10-09 15:17:21 +02:00
Matthias 91ceaef02f
Merge pull request #5678 from sidml/develop
Hyperopt loss function using max drawdown
2021-10-09 10:26:40 +02:00
sid 30bc96cf3f simplify expression 2021-10-09 06:36:23 +05:30
Matthias 11ec1d9b06 Revert previous commit 2021-10-08 20:22:07 +02:00
Matthias 482f4418c6 Clarify "required candle" message 2021-10-08 14:36:52 +02:00
Robert Davey f07eeddda0
Update api_schemas.py
Fix api schema for cpu_pct float List.
2021-10-07 12:04:42 +01:00
Sam Germain 7f7f377a90 updated a test, put in TODO-lev 2021-10-07 05:03:38 -06:00
Sam Germain e367f84b06 Added more update_funding_fee tests, set exchange of default conf 2021-10-07 04:20:53 -06:00
Matthias 45b7a0c837 Add Test and docs for MaxDrawDownHyperOptLoss 2021-10-07 07:12:45 +02:00
Matthias 29863ad2bf Fix error when ask_last_balance is not set
closes #5181
2021-10-07 06:51:29 +02:00
sid 46c320513a use profit_abs 2021-10-07 08:07:07 +05:30
sid 93e4cf4006 Merge remote-tracking branch 'upstream/develop' into develop 2021-10-07 08:04:40 +05:30
Matthias 526bdaa2dc Recommend using 0.0.0.0 as listen address for docker 2021-10-06 20:14:59 +02:00
Matthias 57ef25789e Fix style errors 2021-10-06 19:36:41 +02:00
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
Sam Germain 29e582c6d9 Fixed time format for schedule and update_funding_fees conf is mocked better 2021-10-05 01:42:46 -06:00
froggleston 0db5c07314 Fix issues with sysinfo rpc/API code, add SysInfo api_schema 2021-10-05 00:10:39 +01:00
Matthias 92f8f231af Remove ratelimit from kucoin template 2021-10-04 20:22:41 +02:00
Matthias 7f4baab420 Remove explicit rateLimits, improve docs 2021-10-04 20:14:22 +02:00
Matthias f15922a168 Fix custom_stoploss in strategy template
closes #5658
2021-10-04 19:11:35 +02:00
Sergey Khliustin 07750518c3 Added min_profit param to PerformanceFilter 2021-10-04 18:49:57 +03:00
Sam Germain 928c4edace removed side from execute_trade_exit 2021-10-03 23:22:51 -06:00
Sam Germain 9046caa27c fixed test_update_trade_state_sell 2021-10-03 23:13:34 -06:00
Sam Germain 2a2b759419 patch_get_signal test updates 2021-10-03 17:41:01 -06:00
Matthias 1c63d01cec Prevent using market-orders on gateio
GateIo does not support market orders on spot markets
2021-10-03 14:14:16 +02:00
Sam Germain 70db228f24 Merge branch 'feat/short' into funding-fee 2021-10-03 02:15:54 -06:00
Sam Germain 09ef0781a1 switching limit_buy_order_usdt and limit_sell_order_usdt to limit_order(enter_side[is_short]) and limit_order(exit_side[is_short]) 2021-10-03 01:52:58 -06:00
Matthias f5e5203388 Use "round" to 12 digits for TickSize mode
Avoids float rounding problems, fix #5652
2021-10-03 09:49:55 +02:00
Sam Germain 3823ca4162 Merge branch 'test-freqtradebot-usdt' into lev-freqtradebot 2021-10-02 20:26:52 -06:00
Sam Germain 87ff65d31e Fixed failing test_handle_protections 2021-10-02 04:06:22 -06:00
Sam Germain b3656ddfc9 Merge branch 'feat/short' into lev-freqtradebot 2021-10-02 03:36:32 -06:00
Sam Germain e8b4cf6eaa Merge branch 'develop' into feat/short 2021-10-02 03:15:12 -06:00
Sam Germain 9ea2dd05d8 Removed space in retrier 2021-10-01 21:21:59 -06:00
Matthias f69cb39a17 Fix missing comma in kucoin template
closes #5646
2021-10-01 19:26:51 +02:00
Matthias 99e3450d30
Merge pull request #5642 from freqtrade/add_trade_conversion_command
Add trade conversion command
2021-10-01 06:38:42 +02:00
Sam Germain 77d3a8b457 Added bybit funding-fee times 2021-09-30 20:18:56 -06:00
Scott Lyons df45f467c6
Adding ability to ignore unparameterized spaces 2021-09-30 01:11:02 -07:00
Scott Lyons 95227376b6
Adding IUS to optimize args 2021-09-30 00:53:46 -07:00
Scott Lyons 08fcd1a0d4
Adding ignore space errors to Hyperopt CLI 2021-09-30 00:46:56 -07:00
Scott Lyons 5dd1088d8d
Adding ignore unparameterized spaces flag 2021-09-30 00:44:26 -07:00
Matthias 5f23af5802 Rename update_open_trades to clarify it's only called at startup 2021-09-30 07:24:16 +02:00
Sam Germain 157223f6ab datetime.utc -> datetime.now(timezone.utc) 2021-09-29 22:32:02 -06:00
Sam Germain af6afd0ac2 Revert "Replace datetime.utcnow with datetime.now(timezone.utc)"
This reverts commit c4ac876183.
2021-09-29 22:27:21 -06:00
Sam Germain 993dc672b4 timestamp * 1000 in get_funding_fees_from_exchange 2021-09-29 22:18:15 -06:00
Sam Germain c4ac876183 Replace datetime.utcnow with datetime.now(timezone.utc) 2021-09-29 22:16:44 -06:00
Matthias 178db516bf Add documentation for trade-to-ohlcv 2021-09-29 20:00:14 +02:00
Matthias 248c61bb26 Add test for trades-to-ohlcv 2021-09-29 19:39:29 +02:00
Matthias fc511aac44 don't use %default when no default is defined 2021-09-29 19:21:54 +02:00
Matthias 656526c007 Add trades-to-ohlcv command to simplify adding new timeframes 2021-09-29 16:50:05 +02:00
Robert Roman ca973c05d1
Merge branch 'freqtrade:develop' into develop 2021-09-28 10:16:36 -05:00
Sam Germain 545b62d746 Merge branch 'feat/short' into funding-fee 2021-09-27 23:34:09 -06:00
Sam Germain 1a132758d0 merged with feat/short 2021-09-27 23:26:20 -06:00
Robert Roman 626a40252d
resolved mypy error
error: Signature of "hyperopt_loss_function" incompatible with supertype "IHyperOptLoss"
2021-09-27 17:33:29 -05:00
Robert Roman c3414c3b78
resolved mypy error
error: Signature of "hyperopt_loss_function" incompatible with supertype "IHyperOptLoss"
2021-09-27 17:32:49 -05:00
Matthias 5726886b06 Reduce backtest-noise from "pandas slice" warning 2021-09-27 20:52:19 +02:00
Matthias d7ce9b9f6d Rename sample short strategy 2021-09-27 19:17:19 +02:00
Robert Roman 67e9626da1
fixed isort issue 2021-09-27 12:16:57 -05:00
Robert Roman a1566fe5d7
updated to latest constant.py file 2021-09-27 11:47:03 -05:00
Robert Roman 193b22475d
Merge branch 'freqtrade:develop' into develop 2021-09-27 11:35:34 -05:00
Matthias 3fbf716f85 Fix "sticking" timerange in webserver mode 2021-09-27 17:52:00 +02:00
Matthias 5b7a1f8642 Validate config also in webserver mode 2021-09-27 07:12:40 +02:00
Matthias 6fb0d14f80 changed naming for signal variable 2021-09-27 07:07:49 +02:00