diff --git a/backtesting/__init__.py b/backtesting/__init__.py index a27f14a..ad75b4f 100644 --- a/backtesting/__init__.py +++ b/backtesting/__init__.py @@ -1,5 +1,6 @@ from .available_entry_times import available_entry_times from .backtest_iron_condor import backtest_iron_condor +from .backtest_result import BacktestResult from .best_entry_times import best_entry_times from .credit_targeting import CreditTargetStrategy from .delta_targeting import DeltaTargetStrategy diff --git a/backtesting/backtest_iron_condor.py b/backtesting/backtest_iron_condor.py index 33e8c41..9dd9812 100644 --- a/backtesting/backtest_iron_condor.py +++ b/backtesting/backtest_iron_condor.py @@ -3,10 +3,10 @@ import os import pandas as pd from concurrent.futures import ProcessPoolExecutor -from dataclasses import dataclass from datetime import datetime from dotenv import load_dotenv +from .backtest_result import BacktestResult from .credit_targeting import CreditTargetStrategy from .delta_targeting import DeltaTargetStrategy from .option_spread_strategy import OptionSpreadStrategy @@ -22,19 +22,6 @@ MARKET_OPEN = '09:35:00' OPTION_DATA_DIRECTORY = os.getenv('OPTION_DATA_DIRECTORY') STRIKE_MULTIPLE = 5.0 -@dataclass -class BacktestResult: - date: str - entry_time: str - exit_time: str - spreads: list - trade_entered: bool - trade_pnl: float - profit: float - credit: float - mfe: float - mae: float - # Metrics dates = [] max_drawdowns = [] diff --git a/backtesting/backtest_result.py b/backtesting/backtest_result.py new file mode 100644 index 0000000..ff1807d --- /dev/null +++ b/backtesting/backtest_result.py @@ -0,0 +1,14 @@ +from dataclasses import dataclass + +@dataclass +class BacktestResult: + date: str + entry_time: str + exit_time: str + spreads: list + trade_entered: bool + trade_pnl: float + profit: float + credit: float + mfe: float + mae: float \ No newline at end of file