freqtrade_origin/en/2019.7/bot-usage/index.html

1275 lines
36 KiB
HTML

<!doctype html>
<html lang="en" class="no-js">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="prev" href="../stoploss/">
<link rel="next" href="../telegram-usage/">
<link rel="icon" href="../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.6.0, mkdocs-material-9.5.30">
<title>Start the bot - Freqtrade</title>
<link rel="stylesheet" href="../assets/stylesheets/main.3cba04c6.min.css">
<link rel="stylesheet" href="../assets/stylesheets/palette.06af60db.min.css">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&display=fallback">
<style>:root{--md-text-font:"Roboto";--md-code-font:"Roboto Mono"}</style>
<script>__md_scope=new URL("..",location),__md_hash=e=>[...e].reduce((e,_)=>(e<<5)-e+_.charCodeAt(0),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
</head>
<body dir="ltr" data-md-color-scheme="default" data-md-color-primary="blue-grey" data-md-color-accent="tear">
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" for="__drawer"></label>
<div data-md-component="skip">
<a href="#start-the-bot" class="md-skip">
Skip to content
</a>
</div>
<div data-md-component="announce">
</div>
<div data-md-color-scheme="default" data-md-component="outdated" hidden>
</div>
<header class="md-header md-header--shadow" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
<a href=".." title="Freqtrade" class="md-header__button md-logo" aria-label="Freqtrade" data-md-component="logo">
<img src="../images/logo.png" alt="logo">
</a>
<label class="md-header__button md-icon" for="__drawer">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2Z"/></svg>
</label>
<div class="md-header__title" data-md-component="header-title">
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
Freqtrade
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
<span class="md-ellipsis">
Start the bot
</span>
</div>
</div>
</div>
<label class="md-header__button md-icon" for="__search">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5Z"/></svg>
</label>
<div class="md-search" data-md-component="search" role="dialog">
<label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search">
<form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" required>
<label class="md-search__icon md-icon" for="__search">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5Z"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12Z"/></svg>
</label>
<nav class="md-search__options" aria-label="Search">
<button type="reset" class="md-search__icon md-icon" title="Clear" aria-label="Clear" tabindex="-1">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41Z"/></svg>
</button>
</nav>
</form>
<div class="md-search__output">
<div class="md-search__scrollwrap" tabindex="0" data-md-scrollfix>
<div class="md-search-result" data-md-component="search-result">
<div class="md-search-result__meta">
Initializing search
</div>
<ol class="md-search-result__list" role="presentation"></ol>
</div>
</div>
</div>
</div>
</div>
</nav>
</header>
<div class="md-container" data-md-component="container">
<main class="md-main" data-md-component="main">
<div class="md-main__inner md-grid">
<div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
<a href=".." title="Freqtrade" class="md-nav__button md-logo" aria-label="Freqtrade" data-md-component="logo">
<img src="../images/logo.png" alt="logo">
</a>
Freqtrade
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href=".." class="md-nav__link">
<span class="md-ellipsis">
About
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../installation/" class="md-nav__link">
<span class="md-ellipsis">
Installation
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../docker/" class="md-nav__link">
<span class="md-ellipsis">
Installation Docker
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../configuration/" class="md-nav__link">
<span class="md-ellipsis">
Configuration
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../strategy-customization/" class="md-nav__link">
<span class="md-ellipsis">
Strategy Customization
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../stoploss/" class="md-nav__link">
<span class="md-ellipsis">
Stoploss
</span>
</a>
</li>
<li class="md-nav__item md-nav__item--active">
<input class="md-nav__toggle md-toggle" type="checkbox" id="__toc">
<label class="md-nav__link md-nav__link--active" for="__toc">
<span class="md-ellipsis">
Start the bot
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<a href="./" class="md-nav__link md-nav__link--active">
<span class="md-ellipsis">
Start the bot
</span>
</a>
<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
<label class="md-nav__title" for="__toc">
<span class="md-nav__icon md-icon"></span>
Table of contents
</label>
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
<li class="md-nav__item">
<a href="#bot-commands" class="md-nav__link">
<span class="md-ellipsis">
Bot commands
</span>
</a>
<nav class="md-nav" aria-label="Bot commands">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#how-to-use-a-different-configuration-file" class="md-nav__link">
<span class="md-ellipsis">
How to use a different configuration file?
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#how-to-use-multiple-configuration-files" class="md-nav__link">
<span class="md-ellipsis">
How to use multiple configuration files?
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#how-to-use-strategy" class="md-nav__link">
<span class="md-ellipsis">
How to use --strategy?
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#how-to-use-strategy-path" class="md-nav__link">
<span class="md-ellipsis">
How to use --strategy-path?
</span>
</a>
<nav class="md-nav" aria-label="How to use --strategy-path?">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#how-to-install-a-strategy" class="md-nav__link">
<span class="md-ellipsis">
How to install a strategy?
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#how-to-use-db-url" class="md-nav__link">
<span class="md-ellipsis">
How to use --db-url?
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#backtesting-commands" class="md-nav__link">
<span class="md-ellipsis">
Backtesting commands
</span>
</a>
<nav class="md-nav" aria-label="Backtesting commands">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#how-to-use-refresh-pairs-cached-parameter" class="md-nav__link">
<span class="md-ellipsis">
How to use --refresh-pairs-cached parameter?
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#hyperopt-commands" class="md-nav__link">
<span class="md-ellipsis">
Hyperopt commands
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#edge-commands" class="md-nav__link">
<span class="md-ellipsis">
Edge commands
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#next-step" class="md-nav__link">
<span class="md-ellipsis">
Next step
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_8" >
<label class="md-nav__link" for="__nav_8" id="__nav_8_label" tabindex="0">
<span class="md-ellipsis">
Control the bot
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_8_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_8">
<span class="md-nav__icon md-icon"></span>
Control the bot
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../telegram-usage/" class="md-nav__link">
<span class="md-ellipsis">
Telegram
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../webhook-config/" class="md-nav__link">
<span class="md-ellipsis">
Web Hook
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../rest-api/" class="md-nav__link">
<span class="md-ellipsis">
REST API
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="../backtesting/" class="md-nav__link">
<span class="md-ellipsis">
Backtesting
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../hyperopt/" class="md-nav__link">
<span class="md-ellipsis">
Hyperopt
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../edge/" class="md-nav__link">
<span class="md-ellipsis">
Edge positioning
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../plotting/" class="md-nav__link">
<span class="md-ellipsis">
Plotting
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../deprecated/" class="md-nav__link">
<span class="md-ellipsis">
Deprecated features
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../faq/" class="md-nav__link">
<span class="md-ellipsis">
FAQ
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../data-analysis/" class="md-nav__link">
<span class="md-ellipsis">
Data Analysis
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../sql_cheatsheet/" class="md-nav__link">
<span class="md-ellipsis">
SQL Cheatsheet
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../sandbox-testing/" class="md-nav__link">
<span class="md-ellipsis">
Sandbox testing
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../developer/" class="md-nav__link">
<span class="md-ellipsis">
Contributors guide
</span>
</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
<label class="md-nav__title" for="__toc">
<span class="md-nav__icon md-icon"></span>
Table of contents
</label>
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
<li class="md-nav__item">
<a href="#bot-commands" class="md-nav__link">
<span class="md-ellipsis">
Bot commands
</span>
</a>
<nav class="md-nav" aria-label="Bot commands">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#how-to-use-a-different-configuration-file" class="md-nav__link">
<span class="md-ellipsis">
How to use a different configuration file?
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#how-to-use-multiple-configuration-files" class="md-nav__link">
<span class="md-ellipsis">
How to use multiple configuration files?
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#how-to-use-strategy" class="md-nav__link">
<span class="md-ellipsis">
How to use --strategy?
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#how-to-use-strategy-path" class="md-nav__link">
<span class="md-ellipsis">
How to use --strategy-path?
</span>
</a>
<nav class="md-nav" aria-label="How to use --strategy-path?">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#how-to-install-a-strategy" class="md-nav__link">
<span class="md-ellipsis">
How to install a strategy?
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#how-to-use-db-url" class="md-nav__link">
<span class="md-ellipsis">
How to use --db-url?
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#backtesting-commands" class="md-nav__link">
<span class="md-ellipsis">
Backtesting commands
</span>
</a>
<nav class="md-nav" aria-label="Backtesting commands">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#how-to-use-refresh-pairs-cached-parameter" class="md-nav__link">
<span class="md-ellipsis">
How to use --refresh-pairs-cached parameter?
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#hyperopt-commands" class="md-nav__link">
<span class="md-ellipsis">
Hyperopt commands
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#edge-commands" class="md-nav__link">
<span class="md-ellipsis">
Edge commands
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#next-step" class="md-nav__link">
<span class="md-ellipsis">
Next step
</span>
</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-content" data-md-component="content">
<article class="md-content__inner md-typeset">
<h1 id="start-the-bot">Start the bot<a class="headerlink" href="#start-the-bot" title="Permanent link">&para;</a></h1>
<p>This page explains the different parameters of the bot and how to run it.</p>
<p>!Note:
If you've used <code>setup.sh</code>, don't forget to activate your virtual environment (<code>source .env/bin/activate</code>) before running freqtrade commands.</p>
<h2 id="bot-commands">Bot commands<a class="headerlink" href="#bot-commands" title="Permanent link">&para;</a></h2>
<div class="highlight"><pre><span></span><code>usage: freqtrade [-h] [-v] [--logfile FILE] [--version] [-c PATH] [-d PATH]
[-s NAME] [--strategy-path PATH] [--db-url PATH]
[--sd-notify]
{backtesting,edge,hyperopt} ...
Free, open source crypto trading bot
positional arguments:
{backtesting,edge,hyperopt}
backtesting Backtesting module.
edge Edge module.
hyperopt Hyperopt module.
optional arguments:
-h, --help show this help message and exit
-v, --verbose Verbose mode (-vv for more, -vvv to get all messages).
--logfile FILE Log to the file specified
-V, --version show program&#39;s version number and exit
-c PATH, --config PATH
Specify configuration file (default: None). Multiple
--config options may be used. Can be set to &#39;-&#39; to
read config from stdin.
-d PATH, --datadir PATH
Path to backtest data.
-s NAME, --strategy NAME
Specify strategy class name (default:
DefaultStrategy).
--strategy-path PATH Specify additional strategy lookup path.
--db-url PATH Override trades database URL, this is useful if
dry_run is enabled or in custom deployments (default:
None).
--sd-notify Notify systemd service manager.
</code></pre></div>
<h3 id="how-to-use-a-different-configuration-file">How to use a different configuration file?<a class="headerlink" href="#how-to-use-a-different-configuration-file" title="Permanent link">&para;</a></h3>
<p>The bot allows you to select which configuration file you want to use. Per
default, the bot will load the file <code>./config.json</code></p>
<div class="highlight"><pre><span></span><code>freqtrade<span class="w"> </span>-c<span class="w"> </span>path/far/far/away/config.json
</code></pre></div>
<h3 id="how-to-use-multiple-configuration-files">How to use multiple configuration files?<a class="headerlink" href="#how-to-use-multiple-configuration-files" title="Permanent link">&para;</a></h3>
<p>The bot allows you to use multiple configuration files by specifying multiple
<code>-c/--config</code> configuration options in the command line. Configuration parameters
defined in the last configuration file override parameters with the same name
defined in the previous configuration file specified in the command line.</p>
<p>For example, you can make a separate configuration file with your key and secrete
for the Exchange you use for trading, specify default configuration file with
empty key and secrete values while running in the Dry Mode (which does not actually
require them):</p>
<div class="highlight"><pre><span></span><code>freqtrade<span class="w"> </span>-c<span class="w"> </span>./config.json
</code></pre></div>
<p>and specify both configuration files when running in the normal Live Trade Mode:</p>
<div class="highlight"><pre><span></span><code>freqtrade<span class="w"> </span>-c<span class="w"> </span>./config.json<span class="w"> </span>-c<span class="w"> </span>path/to/secrets/keys.config.json
</code></pre></div>
<p>This could help you hide your private Exchange key and Exchange secrete on you local machine
by setting appropriate file permissions for the file which contains actual secrets and, additionally,
prevent unintended disclosure of sensitive private data when you publish examples
of your configuration in the project issues or in the Internet.</p>
<p>See more details on this technique with examples in the documentation page on
<a href="../configuration/">configuration</a>.</p>
<h3 id="how-to-use-strategy">How to use <strong>--strategy</strong>?<a class="headerlink" href="#how-to-use-strategy" title="Permanent link">&para;</a></h3>
<p>This parameter will allow you to load your custom strategy class.
Per default without <code>--strategy</code> or <code>-s</code> the bot will load the
<code>DefaultStrategy</code> included with the bot (<code>freqtrade/strategy/default_strategy.py</code>).</p>
<p>The bot will search your strategy file within <code>user_data/strategies</code> and <code>freqtrade/strategy</code>.</p>
<p>To load a strategy, simply pass the class name (e.g.: <code>CustomStrategy</code>) in this parameter.</p>
<p><strong>Example:</strong>
In <code>user_data/strategies</code> you have a file <code>my_awesome_strategy.py</code> which has
a strategy class called <code>AwesomeStrategy</code> to load it:</p>
<div class="highlight"><pre><span></span><code>freqtrade<span class="w"> </span>--strategy<span class="w"> </span>AwesomeStrategy
</code></pre></div>
<p>If the bot does not find your strategy file, it will display in an error
message the reason (File not found, or errors in your code).</p>
<p>Learn more about strategy file in
<a href="../strategy-customization/">Strategy Customization</a>.</p>
<h3 id="how-to-use-strategy-path">How to use <strong>--strategy-path</strong>?<a class="headerlink" href="#how-to-use-strategy-path" title="Permanent link">&para;</a></h3>
<p>This parameter allows you to add an additional strategy lookup path, which gets
checked before the default locations (The passed path must be a directory!):
<div class="highlight"><pre><span></span><code>freqtrade<span class="w"> </span>--strategy<span class="w"> </span>AwesomeStrategy<span class="w"> </span>--strategy-path<span class="w"> </span>/some/directory
</code></pre></div></p>
<h4 id="how-to-install-a-strategy">How to install a strategy?<a class="headerlink" href="#how-to-install-a-strategy" title="Permanent link">&para;</a></h4>
<p>This is very simple. Copy paste your strategy file into the directory
<code>user_data/strategies</code> or use <code>--strategy-path</code>. And voila, the bot is ready to use it.</p>
<h3 id="how-to-use-db-url">How to use <strong>--db-url</strong>?<a class="headerlink" href="#how-to-use-db-url" title="Permanent link">&para;</a></h3>
<p>When you run the bot in Dry-run mode, per default no transactions are
stored in a database. If you want to store your bot actions in a DB
using <code>--db-url</code>. This can also be used to specify a custom database
in production mode. Example command:</p>
<div class="highlight"><pre><span></span><code>freqtrade<span class="w"> </span>-c<span class="w"> </span>config.json<span class="w"> </span>--db-url<span class="w"> </span>sqlite:///tradesv3.dry_run.sqlite
</code></pre></div>
<h2 id="backtesting-commands">Backtesting commands<a class="headerlink" href="#backtesting-commands" title="Permanent link">&para;</a></h2>
<p>Backtesting also uses the config specified via <code>-c/--config</code>.</p>
<div class="highlight"><pre><span></span><code>usage: freqtrade backtesting [-h] [-i TICKER_INTERVAL] [--timerange TIMERANGE]
[--max_open_trades MAX_OPEN_TRADES]
[--stake_amount STAKE_AMOUNT] [-r] [--eps] [--dmmp]
[-l]
[--strategy-list STRATEGY_LIST [STRATEGY_LIST ...]]
[--export EXPORT] [--export-filename PATH]
optional arguments:
-h, --help show this help message and exit
-i TICKER_INTERVAL, --ticker-interval TICKER_INTERVAL
Specify ticker interval (1m, 5m, 30m, 1h, 1d).
--timerange TIMERANGE
Specify what timerange of data to use.
--max_open_trades MAX_OPEN_TRADES
Specify max_open_trades to use.
--stake_amount STAKE_AMOUNT
Specify stake_amount.
-r, --refresh-pairs-cached
Refresh the pairs files in tests/testdata with the
latest data from the exchange. Use it if you want to
run your optimization commands with up-to-date data.
--eps, --enable-position-stacking
Allow buying the same pair multiple times (position
stacking).
--dmmp, --disable-max-market-positions
Disable applying `max_open_trades` during backtest
(same as setting `max_open_trades` to a very high
number).
-l, --live Use live data.
--strategy-list STRATEGY_LIST [STRATEGY_LIST ...]
Provide a commaseparated list of strategies to
backtest Please note that ticker-interval needs to be
set either in config or via command line. When using
this together with --export trades, the strategy-name
is injected into the filename (so backtest-data.json
becomes backtest-data-DefaultStrategy.json
--export EXPORT Export backtest results, argument are: trades. Example
--export=trades
--export-filename PATH
Save backtest results to this filename requires
--export to be set as well Example --export-
filename=user_data/backtest_data/backtest_today.json
(default: user_data/backtest_data/backtest-
result.json)
</code></pre></div>
<h3 id="how-to-use-refresh-pairs-cached-parameter">How to use <strong>--refresh-pairs-cached</strong> parameter?<a class="headerlink" href="#how-to-use-refresh-pairs-cached-parameter" title="Permanent link">&para;</a></h3>
<p>The first time your run Backtesting, it will take the pairs you have
set in your config file and download data from the Exchange.</p>
<p>If for any reason you want to update your data set, you use
<code>--refresh-pairs-cached</code> to force Backtesting to update the data it has.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Use it only if you want to update your data set. You will not be able to come back to the previous version.</p>
</div>
<p>To test your strategy with latest data, we recommend continuing using
the parameter <code>-l</code> or <code>--live</code>.</p>
<h2 id="hyperopt-commands">Hyperopt commands<a class="headerlink" href="#hyperopt-commands" title="Permanent link">&para;</a></h2>
<p>To optimize your strategy, you can use hyperopt parameter hyperoptimization
to find optimal parameter values for your stategy.</p>
<div class="highlight"><pre><span></span><code>usage: freqtrade hyperopt [-h] [-i TICKER_INTERVAL] [--timerange TIMERANGE]
[--max_open_trades INT]
[--stake_amount STAKE_AMOUNT] [-r]
[--customhyperopt NAME] [--hyperopt-path PATH]
[--eps] [-e INT]
[-s {all,buy,sell,roi,stoploss} [{all,buy,sell,roi,stoploss} ...]]
[--dmmp] [--print-all] [-j JOBS]
[--random-state INT] [--min-trades INT] [--continue]
[--hyperopt-loss NAME]
optional arguments:
-h, --help show this help message and exit
-i TICKER_INTERVAL, --ticker-interval TICKER_INTERVAL
Specify ticker interval (`1m`, `5m`, `30m`, `1h`,
`1d`).
--timerange TIMERANGE
Specify what timerange of data to use.
--max_open_trades INT
Specify max_open_trades to use.
--stake_amount STAKE_AMOUNT
Specify stake_amount.
-r, --refresh-pairs-cached
Refresh the pairs files in tests/testdata with the
latest data from the exchange. Use it if you want to
run your optimization commands with up-to-date data.
--customhyperopt NAME
Specify hyperopt class name (default:
`DefaultHyperOpts`).
--hyperopt-path PATH Specify additional lookup path for Hyperopts and
Hyperopt Loss functions.
--eps, --enable-position-stacking
Allow buying the same pair multiple times (position
stacking).
-e INT, --epochs INT Specify number of epochs (default: 100).
-s {all,buy,sell,roi,stoploss} [{all,buy,sell,roi,stoploss} ...], --spaces {all,buy,sell,roi,stoploss} [{all,buy,sell,roi,stoploss} ...]
Specify which parameters to hyperopt. Space-separated
list. Default: `all`.
--dmmp, --disable-max-market-positions
Disable applying `max_open_trades` during backtest
(same as setting `max_open_trades` to a very high
number).
--print-all Print all results, not only the best ones.
-j JOBS, --job-workers JOBS
The number of concurrently running jobs for
hyperoptimization (hyperopt worker processes). If -1
(default), all CPUs are used, for -2, all CPUs but one
are used, etc. If 1 is given, no parallel computing
code is used at all.
--random-state INT Set random state to some positive integer for
reproducible hyperopt results.
--min-trades INT Set minimal desired number of trades for evaluations
in the hyperopt optimization path (default: 1).
--continue Continue hyperopt from previous runs. By default,
temporary files will be removed and hyperopt will
start from scratch.
--hyperopt-loss NAME
Specify the class name of the hyperopt loss function
class (IHyperOptLoss). Different functions can
generate completely different results, since the
target for optimization is different. (default:
`DefaultHyperOptLoss`).
</code></pre></div>
<h2 id="edge-commands">Edge commands<a class="headerlink" href="#edge-commands" title="Permanent link">&para;</a></h2>
<p>To know your trade expectacny and winrate against historical data, you can use Edge.</p>
<div class="highlight"><pre><span></span><code>usage: freqtrade edge [-h] [-i TICKER_INTERVAL] [--timerange TIMERANGE]
[--max_open_trades MAX_OPEN_TRADES]
[--stake_amount STAKE_AMOUNT] [-r]
[--stoplosses STOPLOSS_RANGE]
optional arguments:
-h, --help show this help message and exit
-i TICKER_INTERVAL, --ticker-interval TICKER_INTERVAL
Specify ticker interval (1m, 5m, 30m, 1h, 1d).
--timerange TIMERANGE
Specify what timerange of data to use.
--max_open_trades MAX_OPEN_TRADES
Specify max_open_trades to use.
--stake_amount STAKE_AMOUNT
Specify stake_amount.
-r, --refresh-pairs-cached
Refresh the pairs files in tests/testdata with the
latest data from the exchange. Use it if you want to
run your optimization commands with up-to-date data.
--stoplosses STOPLOSS_RANGE
Defines a range of stoploss against which edge will
assess the strategy the format is &quot;min,max,step&quot;
(without any space).example:
--stoplosses=-0.01,-0.1,-0.001
</code></pre></div>
<p>To understand edge and how to read the results, please read the <a href="../edge/">edge documentation</a>.</p>
<h2 id="next-step">Next step<a class="headerlink" href="#next-step" title="Permanent link">&para;</a></h2>
<p>The optimal strategy of the bot will change with time depending of the market trends. The next step is to
<a href="../strategy-customization/">Strategy Customization</a>.</p>
</article>
</div>
<script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script>
</div>
</main>
<footer class="md-footer">
<div class="md-footer-meta md-typeset">
<div class="md-footer-meta__inner md-grid">
<div class="md-copyright">
Made with
<a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs
</a>
</div>
</div>
</div>
</footer>
</div>
<div class="md-dialog" data-md-component="dialog">
<div class="md-dialog__inner md-typeset"></div>
</div>
<script id="__config" type="application/json">{"base": "..", "features": [], "search": "../assets/javascripts/workers/search.b8dbb3d2.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": {"provider": "mike"}}</script>
<script src="../assets/javascripts/bundle.fe8b6f2b.min.js"></script>
</body>
</html>