You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/advanced-hyperopt.md
+29
Original file line number
Diff line number
Diff line change
@@ -78,6 +78,8 @@ This function needs to return a floating point number (`float`). Smaller numbers
78
78
To override a pre-defined space (`roi_space`, `generate_roi_table`, `stoploss_space`, `trailing_space`), define a nested class called Hyperopt and define the required spaces as follows:
79
79
80
80
```python
81
+
from freqtrade.optimize.space import Categorical, Dimension, Integer, SKDecimal
82
+
81
83
classMyAwesomeStrategy(IStrategy):
82
84
classHyperOpt:
83
85
# Define a custom stoploss space.
@@ -94,6 +96,33 @@ class MyAwesomeStrategy(IStrategy):
Copy file name to clipboardexpand all lines: docs/backtesting.md
+4-4
Original file line number
Diff line number
Diff line change
@@ -522,13 +522,13 @@ Since backtesting lacks some detailed information about what happens within a ca
522
522
- ROI
523
523
- exits are compared to high - but the ROI value is used (e.g. ROI = 2%, high=5% - so the exit will be at 2%)
524
524
- exits are never "below the candle", so a ROI of 2% may result in a exit at 2.4% if low was at 2.4% profit
525
-
-Forceexits caused by `<N>=-1` ROI entries use low as exit value, unless N falls on the candle open (e.g. `120: -1` for 1h candles)
525
+
-Force-exits caused by `<N>=-1` ROI entries use low as exit value, unless N falls on the candle open (e.g. `120: -1` for 1h candles)
526
526
- Stoploss exits happen exactly at stoploss price, even if low was lower, but the loss will be `2 * fees` higher than the stoploss price
527
527
- Stoploss is evaluated before ROI within one candle. So you can often see more trades with the `stoploss` exit reason comparing to the results obtained with the same strategy in the Dry Run/Live Trade modes
528
528
- Low happens before high for stoploss, protecting capital first
529
529
- Trailing stoploss
530
530
- Trailing Stoploss is only adjusted if it's below the candle's low (otherwise it would be triggered)
531
-
- On trade entry candles that trigger trailing stoploss, the "minimum offset" (`stop_positive_offset`) is assumed (instead of high) - and the stop is calculated from this point
531
+
- On trade entry candles that trigger trailing stoploss, the "minimum offset" (`stop_positive_offset`) is assumed (instead of high) - and the stop is calculated from this point. This rule is NOT applicable to custom-stoploss scenarios, since there's no information about the stoploss logic available.
532
532
- High happens first - adjusting stoploss
533
533
- Low uses the adjusted stoploss (so exits with large high-low difference are backtested correctly)
534
534
- ROI applies before trailing-stop, ensuring profits are "top-capped" at ROI if both ROI and trailing stop applies
@@ -546,8 +546,8 @@ In addition to the above assumptions, strategy authors should carefully read the
546
546
547
547
### Trading limits in backtesting
548
548
549
-
Exchanges have certain trading limits, like minimum base currency, or minimum stake (quote) currency.
550
-
These limits are usually listed in the exchange documentation as "trading rules" or similar.
549
+
Exchanges have certain trading limits, like minimum (and maximum) base currency, or minimum/maximum stake (quote) currency.
550
+
These limits are usually listed in the exchange documentation as "trading rules" or similar and can be quite different between different pairs.
551
551
552
552
Backtesting (as well as live and dry-run) does honor these limits, and will ensure that a stoploss can be placed below this value - so the value will be slightly higher than what the exchange specifies.
553
553
Freqtrade has however no information about historic limits.
Copy file name to clipboardexpand all lines: docs/faq.md
+6
Original file line number
Diff line number
Diff line change
@@ -102,6 +102,12 @@ If this happens for all pairs in the pairlist, this might indicate a recent exch
102
102
103
103
Irrespectively of the reason, Freqtrade will fill up these candles with "empty" candles, where open, high, low and close are set to the previous candle close - and volume is empty. In a chart, this will look like a `_` - and is aligned with how exchanges usually represent 0 volume candles.
104
104
105
+
### I'm getting "Price jump between 2 candles detected"
106
+
107
+
This message is a warning that the candles had a price jump of > 30%.
108
+
This might be a sign that the pair stopped trading, and some token exchange took place (e.g. COCOS in 2021 - where price jumped from 0.0000154 to 0.01621).
109
+
This message is often accompanied by ["Missing data fillup"](#im-getting-missing-data-fillup-messages-in-the-log) - as trading on such pairs is often stopped for some time.
110
+
105
111
### I'm getting "Outdated history for pair xxx" in the log
106
112
107
113
The bot is trying to tell you that it got an outdated last candle (not the last complete candle).
To consider the population of *historical predictions* for creating the dynamic target instead of information from the training as discussed above, you would set `fit_live_prediction_candles` in the config to the number of historical prediction candles you wish to use to generate target statistics.
192
+
To consider the population of *historical predictions* for creating the dynamic target instead of information from the training as discussed above, you would set `fit_live_predictions_candles` in the config to the number of historical prediction candles you wish to use to generate target statistics.
Copy file name to clipboardexpand all lines: docs/freqai-feature-engineering.md
+19-19
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,10 @@
2
2
3
3
## Defining the features
4
4
5
-
Low level feature engineering is performed in the user strategy within a function called `populate_any_indicators()`. That function sets the `base features` such as, `RSI`, `MFI`, `EMA`, `SMA`, time of day, volume, etc. The `base features` can be custom indicators or they can be imported from any technical-analysis library that you can find. One important syntax rule is that all `base features` string names are prepended with `%`, while labels/targets are prepended with `&`.
5
+
Low level feature engineering is performed in the user strategy within a function called `populate_any_indicators()`. That function sets the `base features` such as, `RSI`, `MFI`, `EMA`, `SMA`, time of day, volume, etc. The `base features` can be custom indicators or they can be imported from any technical-analysis library that you can find. One important syntax rule is that all `base features` string names are prepended with `%-{pair}`, while labels/targets are prepended with `&`.
6
+
7
+
!!! Note
8
+
Adding the full pair string, e.g. XYZ/USD, in the feature name enables improved performance for dataframe caching on the backend. If you decide *not* to add the full pair string in the feature string, FreqAI will operate in a reduced performance mode.
6
9
7
10
Meanwhile, high level feature engineering is handled within `"feature_parameters":{}` in the FreqAI config. Within this file, it is possible to decide large scale feature expansions on top of the `base_features` such as "including correlated pairs" or "including informative timeframes" or even "including recent candles."
8
11
@@ -15,45 +18,42 @@ It is advisable to start from the template `populate_any_indicators()` in the so
15
18
"""
16
19
Function designed to automatically generate, name, and merge features
17
20
from user-indicated timeframes in the configuration file. The user controls the indicators
18
-
passed to the training/prediction by prepending indicators with `'%-' + coin `
21
+
passed to the training/prediction by prepending indicators with `'%-' + pair `
19
22
(see convention below). I.e., the user should not prepend any supporting metrics
20
23
(e.g., bb_lowerband below) with % unless they explicitly want to pass that metric to the
21
24
model.
22
25
:param pair: pair to be used as informative
23
26
:param df: strategy dataframe which will receive merges from informatives
24
27
:param tf: timeframe of the dataframe which will modify the feature names
25
28
:param informative: the dataframe associated with the informative pair
26
-
:param coin: the name of the coin which will modify the feature names.
27
29
"""
28
30
29
-
coin = pair.split('/')[0]
30
-
31
31
if informative isNone:
32
32
informative =self.dp.get_pair_dataframe(pair, tf)
33
33
34
34
# first loop is automatically duplicating indicators for time periods
35
35
for t inself.freqai_info["feature_parameters"]["indicator_periods_candles"]:
Copy file name to clipboardexpand all lines: docs/freqai-running.md
+6-2
Original file line number
Diff line number
Diff line change
@@ -173,9 +173,13 @@ You can indicate to the bot that it should not train models, but instead should
173
173
174
174
```json
175
175
"freqai": {
176
+
"enabled": true,
176
177
"follow_mode": true,
177
-
"identifier": "example"
178
+
"identifier": "example",
179
+
"feature_parameters": {
180
+
// leader bots feature_parameters inserted here
181
+
},
178
182
}
179
183
```
180
184
181
-
In this example, the user has a leader bot with the `"identifier": "example"`. The leader bot is already running or is launched simultaneously with the follower. The follower will load models created by the leader and inference them to obtain predictions instead of training its own models.
185
+
In this example, the user has a leader bot with the `"identifier": "example"`. The leader bot is already running or is launched simultaneously with the follower. The follower will load models created by the leader and inference them to obtain predictions instead of training its own models. The user will also need to duplicate the `feature_parameters` parameters from from the leaders freqai configuration file into the freqai section of the followers config.
0 commit comments