Skip to content

Commit

Permalink
Add DNA name to stats
Browse files Browse the repository at this point in the history
  • Loading branch information
btagliani committed Oct 31, 2023
1 parent 409d16f commit b8a5d15
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 b8a5d15

Please sign in to comment.