From a9f1c871ddb68734ee179598dc08a21dda982f16 Mon Sep 17 00:00:00 2001 From: Matthias Date: Mon, 1 Feb 2021 19:48:29 +0100 Subject: [PATCH] Add path loading snippet to derived strategies closes #4279 --- docs/strategy-advanced.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/strategy-advanced.md b/docs/strategy-advanced.md index ca20d3588..c051e2232 100644 --- a/docs/strategy-advanced.md +++ b/docs/strategy-advanced.md @@ -399,6 +399,17 @@ class MyAwesomeStrategy2(MyAwesomeStrategy): Both attributes and methods may be overridden, altering behavior of the original strategy in a way you need. +!!! Note "Parent-strategy in different files" + If you have the parent-strategy in a different file, you'll need to add the following to the top of your "child"-file to ensure proper loading, otherwise freqtrade may not be able to load the parent strategy correctly. + + ``` python + import sys + from pathlib import Path + sys.path.append(str(Path(__file__).parent)) + + from myawesomestrategy import MyAwesomeStrategy + ``` + ## Embedding Strategies Freqtrade provides you with with an easy way to embed the strategy into your configuration file.