added imports to doc code blocks.

This commit is contained in:
Jonathan Raviotta 2019-08-09 17:06:19 -04:00
parent 3cc772c8e9
commit dd35ba5e81
2 changed files with 6 additions and 5 deletions

View File

@ -9,6 +9,7 @@ You can analyze the results of backtests and trading history easily using Jupyte
### Load backtest results into a pandas dataframe
```python
from freqtrade.data.btanalysis import load_backtest_data
# Load backtest results
df = load_backtest_data("user_data/backtest_data/backtest-result.json")
@ -19,6 +20,8 @@ df.groupby("pair")["sell_reason"].value_counts()
### Load live trading results into a pandas dataframe
``` python
from freqtrade.data.btanalysis import load_trades_from_db
# Fetch trades from database
df = load_trades_from_db("sqlite:///tradesv3.sqlite")
@ -38,13 +41,11 @@ from pathlib import Path
import os
from freqtrade.data.history import load_pair_history
from freqtrade.resolvers import StrategyResolver
from freqtrade.data.btanalysis import load_backtest_data
from freqtrade.data.btanalysis import load_trades_from_db
# Define some constants
ticker_interval = "1m"
ticker_interval = "5m"
# Name of the strategy class
strategy_name = 'NewStrategy'
strategy_name = 'AwesomeStrategy'
# Path to user data
user_data_dir = 'user_data'
# Location of the strategy

View File

@ -116,7 +116,7 @@
"# Define some constants\n",
"ticker_interval = \"5m\"\n",
"# Name of the strategy class\n",
"strategy_name = 'NewStrategy'\n",
"strategy_name = 'AwesomeStrategy'\n",
"# Path to user data\n",
"user_data_dir = 'user_data'\n",
"# Location of the strategy\n",