mirror of
https://github.com/NicolasBohn/NexQuant.git
synced 2026-07-27 23:47:46 +00:00
fix: fix type annotation, remove unused parameter, improve import_class errors
This commit is contained in:
@@ -166,7 +166,7 @@ class ResultsDatabase:
|
||||
self.conn.commit()
|
||||
return c.lastrowid
|
||||
|
||||
def add_loop(self, loop_idx: int, success: int, fail: int, best_ic: float = None, status: str = "completed") -> int:
|
||||
def add_loop(self, loop_idx: int, success: int, fail: int, best_ic: float | None = None, status: str = "completed") -> int:
|
||||
c = self.conn.cursor()
|
||||
rate = success / (success + fail) if (success + fail) > 0 else 0
|
||||
c.execute("""INSERT INTO loop_results (loop_index, factors_success, factors_fail, success_rate, best_ic, status)
|
||||
|
||||
@@ -67,7 +67,6 @@ def _cross_check_with_vbt(
|
||||
close: pd.Series,
|
||||
position: pd.Series,
|
||||
txn_cost: float,
|
||||
manual_total_return: float,
|
||||
freq: str,
|
||||
) -> float | None:
|
||||
"""Run a vectorbt simulation and return its total_return for comparison."""
|
||||
@@ -264,7 +263,6 @@ def backtest_signal(
|
||||
close=close,
|
||||
position=position,
|
||||
txn_cost=txn_cost,
|
||||
manual_total_return=total_return,
|
||||
freq=freq,
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user