From b8a5d15b9612d877efdeddc226873da56eebd405 Mon Sep 17 00:00:00 2001 From: Bruno Tagliani <bruno.tagliani@gmail.com> Date: Tue, 31 Oct 2023 15:01:57 -0300 Subject: [PATCH] Add DNA name to stats --- jesse/services/metrics.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/jesse/services/metrics.py b/jesse/services/metrics.py index 696132ba2..cdcabe058 100644 --- a/jesse/services/metrics.py +++ b/jesse/services/metrics.py @@ -1,5 +1,5 @@ from datetime import datetime, timedelta -from typing import List, Any, Union +from typing import Any, List, Union import numpy as np import pandas as pd @@ -7,8 +7,8 @@ import jesse.helpers as jh from jesse.models import ClosedTrade -from jesse.store import store from jesse.services import selectors +from jesse.store import store def candles_info(candles_array: np.ndarray) -> dict: @@ -188,9 +188,13 @@ def trades(trades_list: List[ClosedTrade], daily_balance: list, final: bool = Tr def hyperparameters(routes_arr: list) -> list: if routes_arr[0].strategy.hp is None: return [] - - hp = [] # only for the first route + hp = [] + + # add DNA + hp.append(['DNA', routes_arr[0].strategy.dna()]) + + # add hyperparameters for key in routes_arr[0].strategy.hp: hp.append([ key, routes_arr[0].strategy.hp[key]