Commit Graph

561 Commits

Author SHA1 Message Date
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
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
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
23a566b478 validate_stake_amount should not be a private method 2021-11-10 06:38:24 +01:00
Matthias
e4cca63163 Align sell_reason assignment location
trade mode sets it after "exit confirmation" - so should backtesting
detected in #5828
2021-11-08 19:32:13 +01:00
Matthias
431b96de98 Merge branch 'develop' into pr/theluxaz/5710 2021-11-03 19:43:36 +01:00
Matthias
d60001e886 Stoploss cannot be below candle low
fix #5816
2021-10-30 16:14:13 +02:00
Matthias
17432b2823 Improve some stylings 2021-10-24 09:15:05 +02:00
theluxaz
0e085298e9 Fixed test failures. 2021-10-21 17:25:38 +03:00
theluxaz
905f3a1a50 Removed exit_tag from Trade objects. 2021-10-20 17:58:50 +03:00
theluxaz
1fdc4425dd Changed exit_tag to be represented as sell_reason 2021-10-20 01:26:15 +03:00
GluTbl
00406ea7d5
Update backtesting.py
Support for custom entry-prices and exit-prices during backtesting.
2021-10-19 17:15:45 +05:30
theluxaz
69a59cdf37 Fixed flake 8, changed sell_tag to exit_tag and fixed telegram functions 2021-10-18 23:56:41 +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
b898f86364 Added sell_tag and buy/sell telegram performance functions 2021-10-13 00:02:28 +03: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
a12c3ecc9b Remove credentials whenever dry-run is set from within the exchange 2021-09-13 20:27:32 +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
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