Matthias
4d558879e9
Merge branch 'feat/short' into pr/samgermain/5378
2021-09-17 19:33:35 +02:00
Sam Germain
5225bd4a5b
Merge branch 'develop' into feat/short
2021-09-13 14:02:23 -06:00
Matthias
a12c3ecc9b
Remove credentials whenever dry-run is set from within the exchange
2021-09-13 20:27:32 +02:00
Sam Germain
695a8fc73b
comment updates, formatting, TODOs
2021-09-08 03:09:39 -06:00
Matthias
68b75af08e
Fix bug with inversed sell signals in backtesting
2021-09-05 08:59:18 +02:00
Matthias
ca44d2e092
Merge branch 'feat/short' into pr/samgermain/5378
2021-09-04 19:54:34 +02:00
Matthias
5184cc7749
Merge branch 'develop' into feat/short
2021-09-02 07:03:14 +02:00
Matthias
cb4889398b
Fix backtesting bug
2021-08-25 07:03:48 +02:00
Matthias
6524edbb4e
Simplify should_exit interface
2021-08-24 20:47:54 +02:00
Matthias
b40f985b13
Add short-exit logic to backtesting
2021-08-24 20:02:40 +02:00
Matthias
eb71ee847c
Rename backtest index constants
2021-08-24 06:56:06 +02:00
Matthias
11bd8e912e
Fix some tests
2021-08-24 06:52:28 +02:00
Matthias
7a977a8eaf
Merge branch 'feat/short' into pr/samgermain/5378
2021-08-24 06:28:16 +02:00
Matthias
957551ea97
Merge branch 'develop' into feat/short
2021-08-24 06:25:06 +02:00
Matthias
7373b39015
Initial support for backtesting with short
2021-08-23 21:16:26 +02:00
Matthias
3e8164bfca
Use proper exchange name in backtesting
2021-08-23 21:13:47 +02:00
Sam Germain
a5be535cc9
strategy interface: removed some changes
2021-08-21 17:06:04 -06:00
Sam Germain
e2d5299116
Name changes for strategy
2021-08-18 13:22:54 -06: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
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
Matthias
895b912c71
Fix recently introduced lookahead bias in backtesting
...
closes #5388
2021-08-09 14:54:47 +02:00
Matthias
a5f796bc97
refactor ohlcvdata_to_dataframe to advise_all_indicators
2021-08-09 14:53:18 +02:00
Matthias
f17942b68f
Fix random test failure
2021-08-09 11:18:18 +02:00
Matthias
800b2eeaf0
Load protections as part of backtest()
...
this enables different values in hyperopt per epoch
2021-08-04 06:50:14 +02:00
Matthias
056bc93bc6
backtesting needs startup_candle_count
...
fixes informative-pair loading being different between --strategy-list and
--strategy.
2021-08-01 19:17:52 +02:00
Matthias
1ccc89d1e9
Store fully analyzed dataframe
2021-07-31 10:00:24 +02:00
Matthias
b1cbc75e93
Properly cache pair dataframe in backtesting (without startup-range).
2021-07-31 08:45:04 +02:00
Matthias
138b126d03
Merge pull request #5299 from kevinjulian/feat/kevinjulian/add-buy-signal-name
...
Add buy signal name
2021-07-30 08:23:11 +02:00
kevinjulian
aea5da0c73
changes testcase
2021-07-23 11:42:43 +07:00
kevinjulian
f5a660f845
caps BUY_TAG_IDX
2021-07-21 20:19:56 +07:00
kevinjulian
49886874aa
rename to buy_tag
2021-07-21 20:05:35 +07:00
kevinjulian
5d04d6ffa7
fix edge testcase
2021-07-20 23:40:32 +07:00
kevinjulian
cbfedf8b29
fix backtest testcase
2021-07-20 23:25:00 +07:00
Kevin Julian
edf9c08f06
Merge branch 'develop' into feat/kevinjulian/add-buy-signal-name
2021-07-20 19:19:46 +07:00
kevinjulian
ed30c023cd
fix some testcase
2021-07-20 19:08:14 +07:00
kevinjulian
9e63bdbac9
feat: add buy signal name
2021-07-20 04:58:20 +07:00
Matthias
365479f5e0
Remove startup-candles after populating buy/sell signals
...
closes #5242
2021-07-18 11:06:41 +02:00
Matthias
7b7d9c02d7
Merge pull request #5243 from freqtrade/feat/webservermode_progress
...
Introduce webserver mode subcommand
2021-07-18 10:48:55 +02:00
Matthias
7ea0a74c53
Default to proposed stake
2021-07-11 14:11:41 +02:00
Rokas Kupstys
0e4466ca1e
Implement strategy-controlled stake sizes. Expose self.wallet
to a strategy.
2021-07-11 12:38:58 +03:00
Matthias
2f33b97b95
Validate startup candles for backtesting correctly
...
closes #5250
2021-07-09 07:20:43 +02:00
Matthias
005da97183
extract backtesting abort functionality
2021-07-06 19:48:28 +02:00
Matthias
830b2548bc
Add backtest stopping
2021-07-06 19:48:28 +02:00
Matthias
134c61126e
Properly track bt progress ...
2021-07-06 19:48:28 +02:00
Matthias
048008756f
Add progress tracking for backtesting
2021-07-06 19:48:28 +02:00
Matthias
800e314bfd
Store backtesting results in backtest instance
2021-07-06 19:48:28 +02:00
Matthias
fbd91cd3f8
Improve formatting to avoid backslash newlines
2021-07-03 08:22:21 +02:00
Rokas Kupstys
bc0742ae67
Fix extremely optimistic results when using a combination of custom_stoploss and trailing_stop.
2021-06-30 09:10:50 +03:00
aayush-jain18
a46f60bd94
spell corrections
2021-06-25 22:10:04 +05:30
Matthias
e1010ff592
Don't load protections from config if strategy defines a property
2021-06-18 19:55:53 +02:00
Matthias
b38ab84a13
Add documentation mention about new behaviour
2021-06-17 06:48:41 +02:00
Rokas Kupstys
6d5fc96714
Implement most pessimistic handling of trailing stoploss.
2021-06-15 09:05:36 +03:00
Matthias
cf7394d01c
Export backtesting results by default
...
closes #4977
2021-06-14 19:57:24 +02:00
Matthias
d16a619489
Move SellType Enum to it's own module
2021-06-08 21:04:34 +02:00
Matthias
a39860e0de
Add tests for rejected signals
2021-05-23 14:15:02 +02:00
Matthias
7f125315b0
Track Rejected Trades
...
closes #3423
2021-05-23 09:42:05 +02:00
Matthias
f398888865
Refactor preprocessed trimming to seperate method
2021-05-21 08:26:19 +02:00
Kamontat Chantrachirathumrong
c2b9da68e1
fix indent
2021-05-20 11:56:11 +07:00
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
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
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
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
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
f2e182002d
Simplify calling backtesting by returning the proper result
2021-05-02 09:46:27 +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
Rokas Kupstys
98f6fce2ec
Use correct sell reason in case of custom sell reason.
2021-04-25 09:48:40 +03:00
Rokas Kupstys
595b8735f8
Add dataframe parameter to custom_stoploss() and custom_sell() methods.
2021-04-25 09:48:40 +03:00
Rokas Kupstys
1aad128d85
Support returning a string from custom_sell() and have it recorded as custom sell reason.
2021-04-25 09:48:40 +03:00
Matthias
88f26971fa
Use defaultdict for backtesting
2021-04-24 19:15:09 +02:00
Matthias
f12e002686
Merge pull request #4775 from freqtrade/fix_wallet_unlimited
...
Fix wallet unlimited
2021-04-24 15:54:06 +02:00
Matthias
df16fbd742
Add "dataload complete" message to backtest + hyperopt
2021-04-23 19:22:41 +02:00
Matthias
d8c8a8d8c2
Remvoe pointless arguments from get_trade_stake_amount
2021-04-21 20:01:10 +02:00
Matthias
cfa9315e2a
Prevent out of candle ROI sells
2021-04-20 20:29:53 +02:00
Matthias
89bbfd2324
Remove candle_count from dataframe before backtesting
...
closes #3754
2021-03-29 20:26:54 +02:00
Matthias
292ea8c1d0
Update backtesting.py
2021-03-25 09:34:33 +01:00
rextea
0ca95aa0c2
Change rate to acctual close rate
2021-03-25 10:25:25 +02:00
Matthias
ec15610bff
Fix isort issue
2021-03-24 19:21:07 +01:00
rextea
f51f4b1817
Add confirm_trade_exit and confirm_trade_entry to backtesting
2021-03-23 10:35:46 +02:00
rextea
dc4ea604dd
Add confirm_trade_exit and confirm_trade_entry to backtesting
2021-03-23 10:19:16 +02:00
rextea
eb5d69dcd4
Add confirm_trade_exit and confirm_trade_entry to backtesting
2021-03-23 10:12:08 +02:00
rextea
6856963aef
Add confirm_trade_exit and confirm_trade_entry to backtesting
2021-03-23 10:09:41 +02:00
Matthias
b57c150654
Final balance should include forcesold pairs
2021-03-14 09:48:40 +01:00
Matthias
d1acc8092c
Improve backtest performance
2021-03-13 10:17:14 +01:00
Matthias
0db5c9746f
Merge pull request #4454 from freqtrade/backtest_compound_speed
...
Backtest compound, wallet, ...
2021-03-10 10:07:40 +01:00
Matthias
4b550dab17
Always reset fake-databases
...
Otherwise results may stick around for the next strategy
2021-03-08 19:40:29 +01:00
Matthias
0b81b58d28
Use pandas.values.tolist instead of itertuples
...
speeds up backtesting
closes #4494
2021-03-07 11:28:54 +01:00
Matthias
2083cf6ddf
Fix mypy errors introduced by Arrow update
2021-03-01 08:57:57 +01:00
Matthias
b2e9295d7f
Small stylistic fixes
2021-02-27 19:57:42 +01:00
Matthias
324b9dbdff
Simplify wallet code
2021-02-27 10:33:25 +01:00
Matthias
98f3142b30
Improve handling of backtesting params
2021-02-27 09:33:00 +01:00
Matthias
fc256749af
Add test for backtesting _enter_trade
2021-02-27 09:33:00 +01:00
Matthias
53a57f2c81
Change some types
...
Fix types of new model object
2021-02-27 09:33:00 +01:00
Matthias
03eb23a4ce
2 levels of Trade models, one with and one without sqlalchemy
...
Fixes a performance issue when backtesting with sqlalchemy, as that
uses descriptors for all properties.
2021-02-27 09:33:00 +01:00
Matthias
394a6bbf2a
Fix some type errors
2021-02-27 09:33:00 +01:00
Matthias
52acacbed5
Check min-trade-stake in backtesting
2021-02-27 09:33:00 +01:00
Matthias
7913166453
Improve performance by updating wallets only when necessary
2021-02-27 09:33:00 +01:00
Matthias
74fc4bdab5
Shorten debug log
2021-02-27 09:32:59 +01:00
Matthias
8d61a26382
Allow dynamic stake for backtesting and hyperopt
2021-02-27 09:32:59 +01:00
Matthias
e4abe902fc
Enable compounding for backtesting
2021-02-27 09:32:59 +01:00
Matthias
0faa6f84dc
Improve Wallet logging disabling for backtesting
2021-02-27 09:32:59 +01:00
Matthias
081b9be45c
use get_all_locks to get locks for backtest result
2021-02-27 09:32:59 +01:00
Matthias
712d503e6c
Use sell-reason value in backtesting, not the enum object
2021-02-27 09:32:59 +01:00
Matthias
9361aa1c95
Add wallets to backtesting
2021-02-27 09:32:59 +01:00
Matthias
789a980a30
Fix tests for new export format
2021-01-24 19:42:32 +01:00
Matthias
deb8432d33
Streamline trade to dataframe conversion
2021-01-24 08:58:41 +01:00
Matthias
8ee264bc59
Don't use profit_percent for backtesting results anymore
2021-01-24 08:58:41 +01:00
Matthias
48977493bb
Backtesting does not need to convert to BacktestResult object
2021-01-24 08:58:41 +01:00
Matthias
0b65fe6afe
Capture backtest start / end time
2021-01-14 19:09:25 +01:00
Matthias
9147106259
call bot_loop_start() in backtesting to allow setup-code to run
2021-01-14 19:09:25 +01:00
Matthias
baa1142afa
Use preprocessed to get min/max date in hyperopt
2021-01-14 19:09:21 +01:00
Matthias
9d4cdcad10
Extract backtesting of one strategy
2021-01-14 19:04:42 +01:00
Matthias
f3de0dd3eb
Fix support for protections in hyperopt
...
closes #4208
2021-01-14 06:53:40 +01:00
Matthias
f11fd2fee1
Sort imports
2020-12-23 17:00:02 +01:00
Matthias
67193bca3d
Move pairlists to be a plugin submodule
2020-12-23 16:54:35 +01:00
Matthias
266031a6be
Disallow PerformanceFilter for backtesting
...
closes #4072
2020-12-16 19:24:47 +01:00
Matthias
f047297995
Improve wording, fix bug
2020-12-07 15:48:06 +01:00
Matthias
5849d07497
Export locks as part of backtesting
2020-12-07 11:39:01 +01:00
Matthias
bb51da8297
Fix slow backtest due to protections
2020-12-07 11:39:01 +01:00
Matthias
75a5161650
Support multis-strategy backtests with protections
2020-12-07 11:39:01 +01:00
Matthias
a3f9cd2c26
Only load protections when necessary
2020-12-07 11:39:01 +01:00
Matthias
e2d15f4082
Add parameter to enable protections for backtesting
2020-12-07 11:39:01 +01:00
Matthias
32189d27c8
Disable output from plugins in backtesting
2020-12-07 11:39:01 +01:00
Matthias
9f34aebdaa
Allow closing trades without message
2020-12-07 11:39:01 +01:00
Matthias
b606936eb7
Make changes to backtesting to incorporate protections
2020-12-07 11:39:01 +01:00
Matthias
e73203acb8
FIx bug with dmmp
2020-11-01 10:51:07 +01:00
Matthias
cf2ae788d7
Convert backtesting rows to Tuples for performance gains
2020-10-18 17:16:57 +02:00
Matthias
5d3a67d324
Don't debug-log during backtesting.
...
Even though log-messages are surpressed, calling "debug" will always
have to do something.
2020-10-18 16:38:16 +02:00
Matthias
b80a219d03
Improve typehints for backtesting
2020-10-18 16:35:23 +02:00
Matthias
2591a34db4
Don't use arrow objects for backtesting
2020-10-18 16:18:52 +02:00
Matthias
23278e52db
remove obsolete logging statements
2020-10-08 20:22:59 +02:00
Matthias
e8f2c09f08
Extract handling of left open trades to seperate method
2020-10-08 20:11:45 +02:00
Matthias
52502193c4
Backtesting should not double-loop for sell signals
2020-10-07 20:59:05 +02:00