better defaults
This commit is contained in:
parent
b3bc9fff5d
commit
e9d4bfadb7
@ -35,14 +35,14 @@
|
|||||||
"\n",
|
"\n",
|
||||||
"# Modify this cell to insure that the output shows the correct path.\n",
|
"# Modify this cell to insure that the output shows the correct path.\n",
|
||||||
"project_root = \"somedir/freqtrade\"\n",
|
"project_root = \"somedir/freqtrade\"\n",
|
||||||
"i=0\n",
|
"i = 0\n",
|
||||||
"try:\n",
|
"try:\n",
|
||||||
" os.chdirdir(project_root)\n",
|
" os.chdirdir(project_root)\n",
|
||||||
" assert Path('LICENSE').is_file()\n",
|
" assert Path('LICENSE').is_file()\n",
|
||||||
"except:\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",
|
" os.chdir(Path(Path.cwd(), '../'))\n",
|
||||||
" i+=1\n",
|
" i += 1\n",
|
||||||
" project_root = Path.cwd()\n",
|
" project_root = Path.cwd()\n",
|
||||||
"print(Path.cwd())"
|
"print(Path.cwd())"
|
||||||
]
|
]
|
||||||
@ -89,8 +89,8 @@
|
|||||||
"# Specify values for use in this script\n",
|
"# Specify values for use in this script\n",
|
||||||
"############### Customize to match your needs. ##################\n",
|
"############### Customize to match your needs. ##################\n",
|
||||||
"config_files = [\n",
|
"config_files = [\n",
|
||||||
" Path('user_data', 'user_repo', 'config.json'),\n",
|
" Path('user_data', 'config.json'),\n",
|
||||||
" Path(Path.home(), '.freqtrade', 'exchange-config.json')\n",
|
" Path(Path.home(), '.freqtrade', 'config.json')\n",
|
||||||
"]\n",
|
"]\n",
|
||||||
"# Create config object\n",
|
"# Create config object\n",
|
||||||
"config = Configuration.from_files(config_files)\n",
|
"config = Configuration.from_files(config_files)\n",
|
||||||
@ -103,15 +103,15 @@
|
|||||||
"# Location of the ticker data\n",
|
"# Location of the ticker data\n",
|
||||||
"datadir = Path(user_data_dir, 'data/binance')\n",
|
"datadir = Path(user_data_dir, 'data/binance')\n",
|
||||||
"# Name of the strategy class\n",
|
"# Name of the strategy class\n",
|
||||||
"strategy_name = 'NewStrategy'\n",
|
"strategy_name = 'DefaultStrategy'\n",
|
||||||
"# Location of the strategy\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",
|
"# Specify backtest results to load\n",
|
||||||
"trade_source = 'file'\n",
|
"trade_source = 'file'\n",
|
||||||
"exportfilename = Path(user_data_dir, 'backtest_results/backtest-result.json')\n",
|
"exportfilename = Path(user_data_dir, 'backtest_results/backtest-result.json')\n",
|
||||||
"db_url = 'sqlite://'\n",
|
"db_url = 'sqlite://'\n",
|
||||||
"# Specify timerange to test\n",
|
"# Specify timerange to test\n",
|
||||||
"timerange = '-1000'\n",
|
"timerange = '-100'\n",
|
||||||
"# Pair to analyze - Only use one pair here\n",
|
"# Pair to analyze - Only use one pair here\n",
|
||||||
"pair = \"ETH/BTC\""
|
"pair = \"ETH/BTC\""
|
||||||
]
|
]
|
||||||
@ -231,9 +231,8 @@
|
|||||||
"# Collect trades if a backtest has been completed\n",
|
"# Collect trades if a backtest has been completed\n",
|
||||||
"try:\n",
|
"try:\n",
|
||||||
" trades = load_trades(source=trade_source,\n",
|
" trades = load_trades(source=trade_source,\n",
|
||||||
" db_url=db_url,\n",
|
" db_url=db_url,\n",
|
||||||
" exportfilename=exportfilename\n",
|
" exportfilename=exportfilename)\n",
|
||||||
" )\n",
|
|
||||||
" trades = trades.loc[trades['pair'] == pair]\n",
|
" trades = trades.loc[trades['pair'] == pair]\n",
|
||||||
" trades = extract_trades_of_period(data, trades)\n",
|
" trades = extract_trades_of_period(data, trades)\n",
|
||||||
"except:\n",
|
"except:\n",
|
||||||
@ -243,11 +242,12 @@
|
|||||||
"# Specify the indicators to plot as lists\n",
|
"# Specify the indicators to plot as lists\n",
|
||||||
"# indicators1 is a list of indicators to overlay on the price chart\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",
|
"# indicators2 is a list of indicators to plot below the price chart\n",
|
||||||
"fig = generate_candlestick_graph(pair=pair,\n",
|
"fig = generate_candlestick_graph(\n",
|
||||||
" data=data,\n",
|
" pair=pair,\n",
|
||||||
" trades=trades,\n",
|
" data=data,\n",
|
||||||
" indicators1=['ema20', 'ema50', 'ema100', 'ha_open', 'ha_close'],\n",
|
" trades=trades,\n",
|
||||||
" indicators2=['macd', 'macdsignal','ao'])\n",
|
" indicators1=['ema20', 'ema50', 'ema100'],\n",
|
||||||
|
" indicators2=['macd', 'macdsignal'])\n",
|
||||||
"\n",
|
"\n",
|
||||||
"fig.show()\n",
|
"fig.show()\n",
|
||||||
"display(data.tail())"
|
"display(data.tail())"
|
||||||
@ -258,7 +258,7 @@
|
|||||||
"metadata": {},
|
"metadata": {},
|
||||||
"source": [
|
"source": [
|
||||||
"### Run Backtest\n",
|
"### 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."
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user