Skip to content

Commit 2710226

Browse files
committed
Update documentation to use subcommands
1 parent 381b0d3 commit 2710226

10 files changed

+198
-71
lines changed

docs/backtesting.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ freqtrade backtesting --datadir user_data/data/bittrex-20180101
4545
#### With a (custom) strategy file
4646

4747
```bash
48-
freqtrade -s SampleStrategy backtesting
48+
freqtrade backtesting -s SampleStrategy
4949
```
5050

5151
Where `-s SampleStrategy` refers to the class name within the strategy file `sample_strategy.py` found in the `freqtrade/user_data/strategies` directory.

docs/bot-usage.md

+137-51
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,47 @@ This page explains the different parameters of the bot and how to run it.
55
!!! Note
66
If you've used `setup.sh`, don't forget to activate your virtual environment (`source .env/bin/activate`) before running freqtrade commands.
77

8-
98
## Bot commands
109

1110
```
12-
usage: freqtrade [-h] [-v] [--logfile FILE] [-V] [-c PATH] [-d PATH]
13-
[--userdir PATH] [-s NAME] [--strategy-path PATH]
14-
[--db-url PATH] [--sd-notify]
15-
{backtesting,edge,hyperopt,create-userdir,list-exchanges} ...
11+
usage: freqtrade [-h] [-V]
12+
{trade,backtesting,edge,hyperopt,create-userdir,list-exchanges,download-data,plot-dataframe,plot-profit}
13+
...
1614
1715
Free, open source crypto trading bot
1816
1917
positional arguments:
20-
{backtesting,edge,hyperopt,create-userdir,list-exchanges}
18+
{trade,backtesting,edge,hyperopt,create-userdir,list-exchanges,download-data,plot-dataframe,plot-profit}
19+
trade Trade module.
2120
backtesting Backtesting module.
2221
edge Edge module.
2322
hyperopt Hyperopt module.
2423
create-userdir Create user-data directory.
2524
list-exchanges Print available exchanges.
25+
download-data Download backtesting data.
26+
plot-dataframe Plot candles with indicators.
27+
plot-profit Generate plot showing profits.
28+
29+
optional arguments:
30+
-h, --help show this help message and exit
31+
-V, --version show program's version number and exit
32+
```
33+
34+
### Bot trading commands
35+
36+
```
37+
usage: freqtrade trade [-h] [-v] [--logfile FILE] [-V] [-c PATH] [-d PATH]
38+
[--userdir PATH] [-s NAME] [--strategy-path PATH]
39+
[--db-url PATH] [--sd-notify]
2640
2741
optional arguments:
2842
-h, --help show this help message and exit
43+
--db-url PATH Override trades database URL, this is useful in custom
44+
deployments (default: `sqlite:///tradesv3.sqlite` for
45+
Live Run mode, `sqlite://` for Dry Run).
46+
--sd-notify Notify systemd service manager.
47+
48+
Common arguments:
2949
-v, --verbose Verbose mode (-vv for more, -vvv to get all messages).
3050
--logfile FILE Log to the file specified.
3151
-V, --version show program's version number and exit
@@ -37,14 +57,12 @@ optional arguments:
3757
Path to directory with historical backtesting data.
3858
--userdir PATH, --user-data-dir PATH
3959
Path to userdata directory.
60+
61+
Strategy arguments:
4062
-s NAME, --strategy NAME
4163
Specify strategy class name (default:
4264
`DefaultStrategy`).
4365
--strategy-path PATH Specify additional strategy lookup path.
44-
--db-url PATH Override trades database URL, this is useful in custom
45-
deployments (default: `sqlite:///tradesv3.sqlite` for
46-
Live Run mode, `sqlite://` for Dry Run).
47-
--sd-notify Notify systemd service manager.
4866
4967
```
5068

@@ -128,7 +146,7 @@ In `user_data/strategies` you have a file `my_awesome_strategy.py` which has
128146
a strategy class called `AwesomeStrategy` to load it:
129147

130148
```bash
131-
freqtrade --strategy AwesomeStrategy
149+
freqtrade trade --strategy AwesomeStrategy
132150
```
133151

134152
If the bot does not find your strategy file, it will display in an error
@@ -143,7 +161,7 @@ This parameter allows you to add an additional strategy lookup path, which gets
143161
checked before the default locations (The passed path must be a directory!):
144162

145163
```bash
146-
freqtrade --strategy AwesomeStrategy --strategy-path /some/directory
164+
freqtrade trade --strategy AwesomeStrategy --strategy-path /some/directory
147165
```
148166

149167
#### How to install a strategy?
@@ -167,20 +185,22 @@ freqtrade -c config.json --db-url sqlite:///tradesv3.dry_run.sqlite
167185
Backtesting also uses the config specified via `-c/--config`.
168186

169187
```
170-
usage: freqtrade backtesting [-h] [-i TICKER_INTERVAL] [--timerange TIMERANGE]
171-
[--max_open_trades MAX_OPEN_TRADES]
172-
[--stake_amount STAKE_AMOUNT] [-r] [--eps] [--dmmp]
173-
[-l]
174-
[--strategy-list STRATEGY_LIST [STRATEGY_LIST ...]]
175-
[--export EXPORT] [--export-filename PATH]
188+
usage: freqtrade backtesting [-h] [-v] [--logfile FILE] [-V] [-c PATH]
189+
[-d PATH] [--userdir PATH] [-s NAME]
190+
[--strategy-path PATH] [-i TICKER_INTERVAL]
191+
[--timerange TIMERANGE] [--max_open_trades INT]
192+
[--stake_amount STAKE_AMOUNT] [--eps] [--dmmp]
193+
[--strategy-list STRATEGY_LIST [STRATEGY_LIST ...]]
194+
[--export EXPORT] [--export-filename PATH]
176195
177196
optional arguments:
178197
-h, --help show this help message and exit
179198
-i TICKER_INTERVAL, --ticker-interval TICKER_INTERVAL
180-
Specify ticker interval (1m, 5m, 30m, 1h, 1d).
199+
Specify ticker interval (`1m`, `5m`, `30m`, `1h`,
200+
`1d`).
181201
--timerange TIMERANGE
182202
Specify what timerange of data to use.
183-
--max_open_trades MAX_OPEN_TRADES
203+
--max_open_trades INT
184204
Specify max_open_trades to use.
185205
--stake_amount STAKE_AMOUNT
186206
Specify stake_amount.
@@ -193,42 +213,65 @@ optional arguments:
193213
number).
194214
--strategy-list STRATEGY_LIST [STRATEGY_LIST ...]
195215
Provide a space-separated list of strategies to
196-
backtest Please note that ticker-interval needs to be
216+
backtest. Please note that ticker-interval needs to be
197217
set either in config or via command line. When using
198-
this together with --export trades, the strategy-name
199-
is injected into the filename (so backtest-data.json
200-
becomes backtest-data-DefaultStrategy.json
201-
--export EXPORT Export backtest results, argument are: trades. Example
202-
--export=trades
218+
this together with `--export trades`, the strategy-
219+
name is injected into the filename (so `backtest-
220+
data.json` becomes `backtest-data-
221+
DefaultStrategy.json`
222+
--export EXPORT Export backtest results, argument are: trades.
223+
Example: `--export=trades`
203224
--export-filename PATH
204-
Save backtest results to this filename requires
205-
--export to be set as well Example --export-
206-
filename=user_data/backtest_results/backtest_today.json
207-
(default: user_data/backtest_results/backtest-
208-
result.json)
225+
Save backtest results to the file with this filename
226+
(default: `user_data/backtest_results/backtest-
227+
result.json`). Requires `--export` to be set as well.
228+
Example: `--export-filename=user_data/backtest_results
229+
/backtest_today.json`
230+
231+
Common arguments:
232+
-v, --verbose Verbose mode (-vv for more, -vvv to get all messages).
233+
--logfile FILE Log to the file specified.
234+
-V, --version show program's version number and exit
235+
-c PATH, --config PATH
236+
Specify configuration file (default: `config.json`).
237+
Multiple --config options may be used. Can be set to
238+
`-` to read config from stdin.
239+
-d PATH, --datadir PATH
240+
Path to directory with historical backtesting data.
241+
--userdir PATH, --user-data-dir PATH
242+
Path to userdata directory.
243+
244+
Strategy arguments:
245+
-s NAME, --strategy NAME
246+
Specify strategy class name (default:
247+
`DefaultStrategy`).
248+
--strategy-path PATH Specify additional strategy lookup path.
249+
209250
```
210251

211252
### Getting historic data for backtesting
212253

213254
The first time your run Backtesting, you will need to download some historic data first.
214255
This can be accomplished by using `freqtrade download-data`.
215-
Check the corresponding [help page section](backtesting.md#Getting-data-for-backtesting-and-hyperopt) for more details
256+
Check the corresponding [Data Downloading](data-download.md) section for more details
216257

217258
## Hyperopt commands
218259

219260
To optimize your strategy, you can use hyperopt parameter hyperoptimization
220261
to find optimal parameter values for your stategy.
221262

222263
```
223-
usage: freqtrade hyperopt [-h] [-i TICKER_INTERVAL] [--timerange TIMERANGE]
264+
usage: freqtrade hyperopt [-h] [-v] [--logfile FILE] [-V] [-c PATH] [-d PATH]
265+
[--userdir PATH] [-s NAME] [--strategy-path PATH]
266+
[-i TICKER_INTERVAL] [--timerange TIMERANGE]
224267
[--max_open_trades INT]
225-
[--stake_amount STAKE_AMOUNT] [-r]
268+
[--stake_amount STAKE_AMOUNT]
226269
[--customhyperopt NAME] [--hyperopt-path PATH]
227270
[--eps] [-e INT]
228-
[-s {all,buy,sell,roi,stoploss} [{all,buy,sell,roi,stoploss} ...]]
229-
[--dmmp] [--print-all] [--no-color] [-j JOBS]
230-
[--random-state INT] [--min-trades INT] [--continue]
231-
[--hyperopt-loss NAME]
271+
[--spaces {all,buy,sell,roi,stoploss} [{all,buy,sell,roi,stoploss} ...]]
272+
[--dmmp] [--print-all] [--no-color] [--print-json]
273+
[-j JOBS] [--random-state INT] [--min-trades INT]
274+
[--continue] [--hyperopt-loss NAME]
232275
233276
optional arguments:
234277
-h, --help show this help message and exit
@@ -250,7 +293,7 @@ optional arguments:
250293
Allow buying the same pair multiple times (position
251294
stacking).
252295
-e INT, --epochs INT Specify number of epochs (default: 100).
253-
-s {all,buy,sell,roi,stoploss} [{all,buy,sell,roi,stoploss} ...], --spaces {all,buy,sell,roi,stoploss} [{all,buy,sell,roi,stoploss} ...]
296+
--spaces {all,buy,sell,roi,stoploss} [{all,buy,sell,roi,stoploss} ...]
254297
Specify which parameters to hyperopt. Space-separated
255298
list. Default: `all`.
256299
--dmmp, --disable-max-market-positions
@@ -260,6 +303,7 @@ optional arguments:
260303
--print-all Print all results, not only the best ones.
261304
--no-color Disable colorization of hyperopt results. May be
262305
useful if you are redirecting output to a file.
306+
--print-json Print best result detailization in JSON format.
263307
-j JOBS, --job-workers JOBS
264308
The number of concurrently running jobs for
265309
hyperoptimization (hyperopt worker processes). If -1
@@ -278,35 +322,77 @@ optional arguments:
278322
generate completely different results, since the
279323
target for optimization is different. Built-in
280324
Hyperopt-loss-functions are: DefaultHyperOptLoss,
281-
OnlyProfitHyperOptLoss, SharpeHyperOptLoss.
282-
(default: `DefaultHyperOptLoss`).
325+
OnlyProfitHyperOptLoss, SharpeHyperOptLoss.(default:
326+
`DefaultHyperOptLoss`).
327+
328+
Common arguments:
329+
-v, --verbose Verbose mode (-vv for more, -vvv to get all messages).
330+
--logfile FILE Log to the file specified.
331+
-V, --version show program's version number and exit
332+
-c PATH, --config PATH
333+
Specify configuration file (default: `config.json`).
334+
Multiple --config options may be used. Can be set to
335+
`-` to read config from stdin.
336+
-d PATH, --datadir PATH
337+
Path to directory with historical backtesting data.
338+
--userdir PATH, --user-data-dir PATH
339+
Path to userdata directory.
340+
341+
Strategy arguments:
342+
-s NAME, --strategy NAME
343+
Specify strategy class name (default:
344+
`DefaultStrategy`).
345+
--strategy-path PATH Specify additional strategy lookup path.
346+
283347
```
284348

285349
## Edge commands
286350

287351
To know your trade expectancy and winrate against historical data, you can use Edge.
288352

289353
```
290-
usage: freqtrade edge [-h] [-i TICKER_INTERVAL] [--timerange TIMERANGE]
291-
[--max_open_trades MAX_OPEN_TRADES]
292-
[--stake_amount STAKE_AMOUNT] [-r]
293-
[--stoplosses STOPLOSS_RANGE]
354+
usage: freqtrade edge [-h] [-v] [--logfile FILE] [-V] [-c PATH] [-d PATH]
355+
[--userdir PATH] [-s NAME] [--strategy-path PATH]
356+
[-i TICKER_INTERVAL] [--timerange TIMERANGE]
357+
[--max_open_trades INT] [--stake_amount STAKE_AMOUNT]
358+
[--stoplosses STOPLOSS_RANGE]
294359
295360
optional arguments:
296361
-h, --help show this help message and exit
297362
-i TICKER_INTERVAL, --ticker-interval TICKER_INTERVAL
298-
Specify ticker interval (1m, 5m, 30m, 1h, 1d).
363+
Specify ticker interval (`1m`, `5m`, `30m`, `1h`,
364+
`1d`).
299365
--timerange TIMERANGE
300366
Specify what timerange of data to use.
301-
--max_open_trades MAX_OPEN_TRADES
367+
--max_open_trades INT
302368
Specify max_open_trades to use.
303369
--stake_amount STAKE_AMOUNT
304370
Specify stake_amount.
305371
--stoplosses STOPLOSS_RANGE
306-
Defines a range of stoploss against which edge will
307-
assess the strategy the format is "min,max,step"
308-
(without any space).example:
309-
--stoplosses=-0.01,-0.1,-0.001
372+
Defines a range of stoploss values against which edge
373+
will assess the strategy. The format is "min,max,step"
374+
(without any space). Example:
375+
`--stoplosses=-0.01,-0.1,-0.001`
376+
377+
Common arguments:
378+
-v, --verbose Verbose mode (-vv for more, -vvv to get all messages).
379+
--logfile FILE Log to the file specified.
380+
-V, --version show program's version number and exit
381+
-c PATH, --config PATH
382+
Specify configuration file (default: `config.json`).
383+
Multiple --config options may be used. Can be set to
384+
`-` to read config from stdin.
385+
-d PATH, --datadir PATH
386+
Path to directory with historical backtesting data.
387+
--userdir PATH, --user-data-dir PATH
388+
Path to userdata directory.
389+
390+
Strategy arguments:
391+
-s NAME, --strategy NAME
392+
Specify strategy class name (default:
393+
`DefaultStrategy`).
394+
--strategy-path PATH Specify additional strategy lookup path.
395+
310396
```
311397

312398
To understand edge and how to read the results, please read the [edge documentation](edge.md).

docs/docker.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ docker run -d \
160160
-v ~/.freqtrade/config.json:/freqtrade/config.json \
161161
-v ~/.freqtrade/user_data/:/freqtrade/user_data \
162162
-v ~/.freqtrade/tradesv3.sqlite:/freqtrade/tradesv3.sqlite \
163-
freqtrade --db-url sqlite:///tradesv3.sqlite --strategy MyAwesomeStrategy
163+
freqtrade trade --db-url sqlite:///tradesv3.sqlite --strategy MyAwesomeStrategy
164164
```
165165

166166
!!! Note
@@ -199,7 +199,7 @@ docker run -d \
199199
-v ~/.freqtrade/config.json:/freqtrade/config.json \
200200
-v ~/.freqtrade/tradesv3.sqlite:/freqtrade/tradesv3.sqlite \
201201
-v ~/.freqtrade/user_data/:/freqtrade/user_data/ \
202-
freqtrade --strategy AwsomelyProfitableStrategy backtesting
202+
freqtrade backtesting --strategy AwsomelyProfitableStrategy
203203
```
204204

205205
Head over to the [Backtesting Documentation](backtesting.md) for more details.

docs/edge.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ An example of its output:
235235
### Update cached pairs with the latest data
236236

237237
Edge requires historic data the same way as backtesting does.
238-
Please refer to the [download section](backtesting.md#Getting-data-for-backtesting-and-hyperopt) of the documentation for details.
238+
Please refer to the [Data Downloading](data-download.md) section of the documentation for details.
239239

240240
### Precising stoploss range
241241

docs/faq.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
### The bot does not start
66

7-
Running the bot with `freqtrade --config config.json` does show the output `freqtrade: command not found`.
7+
Running the bot with `freqtrade trade --config config.json` does show the output `freqtrade: command not found`.
88

99
This could have the following reasons:
1010

0 commit comments

Comments
 (0)