Add bot basics documentation
This commit is contained in:
parent
8b186dbe0e
commit
e5f7610b5d
58
docs/bot-basics.md
Normal file
58
docs/bot-basics.md
Normal file
@ -0,0 +1,58 @@
|
||||
# Freqtrade basics
|
||||
|
||||
This page will try to teach you some basic concepts on how freqtrade works and operates.
|
||||
|
||||
## Freqtrade terminology
|
||||
|
||||
* Trade: Open position
|
||||
* Open Order: Order which is currently placed on the exchange, and is not yet complete.
|
||||
* Pair: Tradable pair, usually in the format of Quote/Base (e.g. XRP/USDT).
|
||||
* Timeframe: Candle length to use (e.g. `"5m"`, `"1h"`, ...).
|
||||
* Indicators: Technical indicators (SMA, EMA, RSI, ...).
|
||||
* Limit order: Limit orders which execute at the defined limit price or better.
|
||||
* Market order: Guaranteed to fill, may move price depending on the order size.
|
||||
|
||||
## Fee handling
|
||||
|
||||
All profit calculations of Freqtrade include fees. For Backtesting / Hyperopt / Dry-run modes, the exchange default fee is used (lowest tier on the exchange). For live operations, fees are used as applied by the exchange (this includes BNB rebates etc.).
|
||||
|
||||
## Bot execution logic
|
||||
|
||||
Starting freqtrade in dry-run or live mode (using `freqtrade trade`) will start the bot and start the bot iteration loop.
|
||||
By default, loop runs every few seconds (`internals.process_throttle_secs`) and does roughly the following in the following sequence:
|
||||
|
||||
* Fetch open trades from persistence.
|
||||
* Calculate current list of tradable pairs.
|
||||
* Download ohlcv data for the pairlist including all [informative pairs](strategy-customization.md#get-data-for-non-tradeable-pairs)
|
||||
This step is only executed once per Candle to avoid unnecessary network traffic.
|
||||
* Call `bot_loop_start()` strategy callback.
|
||||
* Analyze strategy per pair.
|
||||
* Call `populate_indicators()`
|
||||
* Call `populate_buy_trend()`
|
||||
* Call `populate_sell_trend()`
|
||||
* Check timeouts for open orders.
|
||||
* Calls `check_buy_timeout()` strategy callback for open buy orders.
|
||||
* Calls `check_sell_timeout()` strategy callback for open sell orders.
|
||||
* Verifies existing positions and eventually places sell orders.
|
||||
* Considers stoploss, ROI and sell-signal.
|
||||
* Determine sell-price based on `ask_strategy` configuration setting.
|
||||
* Before a sell order is placed, `confirm_trade_exit()` strategy callback is called.
|
||||
* Check if trade-slots are still available (if `max_open_trades` is reached).
|
||||
* Verifies buy signal trying to enter new positions.
|
||||
* Determine buy-price based on `bid_strategy` configuration setting.
|
||||
* Before a buy order is placed, `confirm_trade_entry()` strategy callback is called.
|
||||
|
||||
This loop will be repeated again and again until the bot is stopped.
|
||||
|
||||
## Backtesting / Hyperopt execution logic
|
||||
|
||||
[backtesting](backtesting.md) or [hyperopt](hyperopt.md) do only part of the above logic, since most of the trading operations are fully simulated.
|
||||
|
||||
* Load historic data for configured pairlist.
|
||||
* Calculate indicators (calls `populate_indicators()`).
|
||||
* Calls `populate_buy_trend()` and `populate_sell_trend()`
|
||||
* Loops per candle simulating entry and exit points.
|
||||
* Generate backtest report output
|
||||
|
||||
!!! Note
|
||||
Both Backtesting and Hyperopt include exchange default Fees in the calculation. Custom fees can be passed to backtesting / hyperopt by specifying the `--fee` argument.
|
@ -498,8 +498,3 @@ After you run Hyperopt for the desired amount of epochs, you can later list all
|
||||
Once the optimized strategy has been implemented into your strategy, you should backtest this strategy to make sure everything is working as expected.
|
||||
|
||||
To achieve same results (number of trades, their durations, profit, etc.) than during Hyperopt, please use same set of arguments `--dmmp`/`--disable-max-market-positions` and `--eps`/`--enable-position-stacking` for Backtesting.
|
||||
|
||||
## Next Step
|
||||
|
||||
Now you have a perfect bot and want to control it from Telegram. Your
|
||||
next step is to learn the [Telegram usage](telegram-usage.md).
|
||||
|
@ -1,7 +1,9 @@
|
||||
# Advanced Strategies
|
||||
|
||||
This page explains some advanced concepts available for strategies.
|
||||
If you're just getting started, please be familiar with the methods described in the [Strategy Customization](strategy-customization.md) documentation first.
|
||||
If you're just getting started, please be familiar with the methods described in the [Strategy Customization](strategy-customization.md) documentation and with the [Freqtrade basics](bot-basics.md) first.
|
||||
|
||||
[Freqtrade basics](bot-basics.md) describes in which sequence each method defined below is called, which can be helpful to understand which method to use.
|
||||
|
||||
!!! Note
|
||||
All callback methods described below should only be implemented in a strategy if they are also actively used.
|
||||
|
@ -1,6 +1,8 @@
|
||||
# Strategy Customization
|
||||
|
||||
This page explains where to customize your strategies, and add new indicators.
|
||||
This page explains how to customize your strategies, and add new indicators.
|
||||
|
||||
Please familiarize yourself with [Freqtrade basics](bot-basics.md) first.
|
||||
|
||||
## Install a custom strategy file
|
||||
|
||||
@ -385,6 +387,7 @@ if self.dp:
|
||||
```
|
||||
|
||||
#### *current_whitelist()*
|
||||
|
||||
Imagine you've developed a strategy that trades the `5m` timeframe using signals generated from a `1d` timeframe on the top 10 volume pairs by volume.
|
||||
|
||||
The strategy might look something like this:
|
||||
|
@ -3,6 +3,7 @@ nav:
|
||||
- Home: index.md
|
||||
- Installation Docker: docker.md
|
||||
- Installation: installation.md
|
||||
- Freqtrade Basics: bot-basics.md
|
||||
- Configuration: configuration.md
|
||||
- Strategy Customization: strategy-customization.md
|
||||
- Stoploss: stoploss.md
|
||||
|
Loading…
Reference in New Issue
Block a user