Move backtest result dataclass to its own file
This commit is contained in:
parent
2c4fd834bb
commit
31c60d10e3
@ -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
|
||||
|
@ -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 = []
|
||||
|
14
backtesting/backtest_result.py
Normal file
14
backtesting/backtest_result.py
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user