Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions octobot_script/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
#
# You should have received a copy of the GNU General Public
# License along with OctoBot-Script. If not, see <https://www.gnu.org/licenses/>.
import os


ADDITIONAL_IMPORT_PATH = "imports"
CONFIG_PATH = "config"

PROFILES_PATH = os.getenv("PROFILES_PATH")
2 changes: 1 addition & 1 deletion octobot_script/internal/octobot_mocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def get_activated_social_services(forced_tentacles_by_topic=None, profile_id=Non
def _get_tentacles_config_path(profile_id=None):
if profile_id:
profile = commons_profiles.Profile.load_profile(
os.path.join(get_module_appdir_path(), commons_constants.USER_PROFILES_FOLDER),
constants.PROFILES_PATH or os.path.join(get_module_appdir_path(), commons_constants.USER_PROFILES_FOLDER),
profile_id,
)
return profile.get_tentacles_config_path()
Expand Down
10 changes: 7 additions & 3 deletions octobot_script/model/backtest_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,13 @@ async def fill(self, template_file=None):
template_name = template_file or self.DEFAULT_TEMPLATE
template_data = await self._get_template_data()
report_dir = os.path.dirname(os.path.abspath(self.report_file))
shutil.copy2(
resources.get_report_resource_path(template_name), self.report_file
)
try:
shutil.copy2(
resources.get_report_resource_path(template_name), self.report_file
)
except FileNotFoundError:
if not os.path.exists(resources.get_report_resource_path(template_name)):
raise FileNotFoundError(f"Missing report template. Please generate report templates.")
meta = template_data["meta"]
with open(
os.path.join(report_dir, self.REPORT_DATA_FILENAME), "w", encoding="utf-8"
Expand Down
1 change: 1 addition & 0 deletions profile_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ async def start_profile():
"1d",
start_timestamp=1505606400,
profile_id=profile_id,
social_services=[] # disable social data fetching
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

)
# Run a backtest using the above data, strategy and configuration.
res = await obs.run(data, config, profile_id=profile_id)
Expand Down