WIP Adding Benchmarking Capability

This commit is contained in:
2026-01-07 00:52:46 +01:00
parent 1c671f5213
commit aa4b41d7a7
3 changed files with 59 additions and 12 deletions

View File

@@ -146,6 +146,24 @@ def fetch_last_key_from_dict(dict):
last_key = key_list[-1] # select the last entry from the list as it is the most current entry
return last_key
# ADD BENCHMARK-TICKER TO TICKER-DICT
def add_benchmark_ticker(tickers, ticker_benchmarkt):
tickers.append(ticker_benchmarkt)
logging(logging_level="success")
# CREATE BENCHMARK TRADES
def create_benchmark_trades(trades):
try:
benchmark_trades = trades
for trade_id in benchmark_trades:
benchmark_trades[trade_id]['ticker'] = config.ticker_benchmark
logging(logging_level="success")
return benchmark_trades
except Exception as error_message:
logging(logging_level="error")
logging(logging_level="error", message=f"Failed with error: {error_message}")
return False
# -------------------------- #
@@ -695,7 +713,7 @@ def calc_history_per_trade(trades, yf_data):
return False
# CALC THE HISTORY PER TRADE & OVERALL
def calc_history_per_ticker(history_per_trade, tickers, trades):
def calc_history_per_ticker(history_per_trade, tickers):
# ------------------ CREATE JSON OBJECT
# Create the json-dict
@@ -812,8 +830,6 @@ def calc_history_per_ticker(history_per_trade, tickers, trades):
logging(logging_level="error", message=f"Failed with error message: {error_message}")
return False
# --------------------------- #
# HISTORY SELECTION FUNCTIONS #
# --------------------------- #