diff --git a/user_data/notebooks/strategy_analysis_example.ipynb b/user_data/notebooks/strategy_analysis_example.ipynb index 730f3fd75..13dbf8267 100644 --- a/user_data/notebooks/strategy_analysis_example.ipynb +++ b/user_data/notebooks/strategy_analysis_example.ipynb @@ -35,14 +35,14 @@ "\n", "# Modify this cell to insure that the output shows the correct path.\n", "project_root = \"somedir/freqtrade\"\n", - "i=0\n", + "i = 0\n", "try:\n", " os.chdirdir(project_root)\n", " assert Path('LICENSE').is_file()\n", "except:\n", - " while i<4 and (not Path('LICENSE').is_file()):\n", + " while i < 4 and (not Path('LICENSE').is_file()):\n", " os.chdir(Path(Path.cwd(), '../'))\n", - " i+=1\n", + " i += 1\n", " project_root = Path.cwd()\n", "print(Path.cwd())" ] @@ -89,8 +89,8 @@ "# Specify values for use in this script\n", "############### Customize to match your needs. ##################\n", "config_files = [\n", - " Path('user_data', 'user_repo', 'config.json'),\n", - " Path(Path.home(), '.freqtrade', 'exchange-config.json')\n", + " Path('user_data', 'config.json'),\n", + " Path(Path.home(), '.freqtrade', 'config.json')\n", "]\n", "# Create config object\n", "config = Configuration.from_files(config_files)\n", @@ -103,15 +103,15 @@ "# Location of the ticker data\n", "datadir = Path(user_data_dir, 'data/binance')\n", "# Name of the strategy class\n", - "strategy_name = 'NewStrategy'\n", + "strategy_name = 'DefaultStrategy'\n", "# Location of the strategy\n", - "strategy_path = Path(user_data_dir, 'user_repo/strategies')\n", + "strategy_path = Path(user_data_dir, 'strategies')\n", "# Specify backtest results to load\n", "trade_source = 'file'\n", "exportfilename = Path(user_data_dir, 'backtest_results/backtest-result.json')\n", "db_url = 'sqlite://'\n", "# Specify timerange to test\n", - "timerange = '-1000'\n", + "timerange = '-100'\n", "# Pair to analyze - Only use one pair here\n", "pair = \"ETH/BTC\"" ] @@ -231,9 +231,8 @@ "# Collect trades if a backtest has been completed\n", "try:\n", " trades = load_trades(source=trade_source,\n", - " db_url=db_url,\n", - " exportfilename=exportfilename\n", - " )\n", + " db_url=db_url,\n", + " exportfilename=exportfilename)\n", " trades = trades.loc[trades['pair'] == pair]\n", " trades = extract_trades_of_period(data, trades)\n", "except:\n", @@ -243,11 +242,12 @@ "# Specify the indicators to plot as lists\n", "# indicators1 is a list of indicators to overlay on the price chart\n", "# indicators2 is a list of indicators to plot below the price chart\n", - "fig = generate_candlestick_graph(pair=pair,\n", - " data=data,\n", - " trades=trades,\n", - " indicators1=['ema20', 'ema50', 'ema100', 'ha_open', 'ha_close'],\n", - " indicators2=['macd', 'macdsignal','ao'])\n", + "fig = generate_candlestick_graph(\n", + " pair=pair,\n", + " data=data,\n", + " trades=trades,\n", + " indicators1=['ema20', 'ema50', 'ema100'],\n", + " indicators2=['macd', 'macdsignal'])\n", "\n", "fig.show()\n", "display(data.tail())" @@ -258,7 +258,7 @@ "metadata": {}, "source": [ "### Run Backtest\n", - "Once you are happy with your strategy signals, run a backtest." + "Once you are happy with your strategy signals, run a backtest then plot again." ] }, {