Remove unused metrics collection code
This commit is contained in:
parent
663d4e13a3
commit
3926429751
@ -22,13 +22,6 @@ MARKET_OPEN = '09:35:00'
|
|||||||
OPTION_DATA_DIRECTORY = os.getenv('OPTION_DATA_DIRECTORY')
|
OPTION_DATA_DIRECTORY = os.getenv('OPTION_DATA_DIRECTORY')
|
||||||
STRIKE_MULTIPLE = 5.0
|
STRIKE_MULTIPLE = 5.0
|
||||||
|
|
||||||
# Metrics
|
|
||||||
dates = []
|
|
||||||
max_drawdowns = []
|
|
||||||
max_profits = []
|
|
||||||
wins = []
|
|
||||||
exit_times = []
|
|
||||||
|
|
||||||
def get_spread_history_credit(historical_option_data: pd.DataFrame, option_strat: CreditTargetStrategy) -> pd.DataFrame:
|
def get_spread_history_credit(historical_option_data: pd.DataFrame, option_strat: CreditTargetStrategy) -> pd.DataFrame:
|
||||||
current_date = historical_option_data.iloc[0]['quote_datetime'][:10]
|
current_date = historical_option_data.iloc[0]['quote_datetime'][:10]
|
||||||
opening_quotes = historical_option_data[(historical_option_data['quote_datetime'] == (current_date + ' ' + option_strat.trade_entry_time))].copy()
|
opening_quotes = historical_option_data[(historical_option_data['quote_datetime'] == (current_date + ' ' + option_strat.trade_entry_time))].copy()
|
||||||
@ -246,12 +239,6 @@ def _backtest_iron_condor(
|
|||||||
commissions = 4 * number_of_contracts
|
commissions = 4 * number_of_contracts
|
||||||
premium_received = (premium_received * number_of_contracts * 100) - (fees + commissions) - stop_out_fees
|
premium_received = (premium_received * number_of_contracts * 100) - (fees + commissions) - stop_out_fees
|
||||||
|
|
||||||
dates.append(current_date)
|
|
||||||
max_drawdowns.append(max_drawdown)
|
|
||||||
max_profits.append(max_profit)
|
|
||||||
wins.append(True if premium_received > 0 else False)
|
|
||||||
exit_times.append(exit_time)
|
|
||||||
|
|
||||||
result = BacktestResult(
|
result = BacktestResult(
|
||||||
date = current_date,
|
date = current_date,
|
||||||
entry_time = f'{current_date} {entry_time}',
|
entry_time = f'{current_date} {entry_time}',
|
||||||
|
Loading…
Reference in New Issue
Block a user