Skip to content

Commit

Permalink
Merge pull request #414 from btagliani/add_dna_name_log
Browse files Browse the repository at this point in the history
Add DNA name to stats
  • Loading branch information
saleh-mir authored Nov 12, 2023
2 parents b8a4c9d + b8a5d15 commit ac1f7f5
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions jesse/services/metrics.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
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
from quantstats import stats

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:
Expand Down Expand Up @@ -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]
Expand Down

0 comments on commit ac1f7f5

Please sign in to comment.