fix bug with database url during backtesting. comment out example trade db analysis.
This commit is contained in:
parent
95d3009a95
commit
eae82d0222
@ -85,7 +85,8 @@ class FreqaiDataKitchen:
|
||||
config["freqai"]["backtest_period_days"],
|
||||
)
|
||||
|
||||
db_url = self.config.get('db_url', None)
|
||||
if self.live:
|
||||
db_url = self.config.get('db_url', 'sqlite://')
|
||||
self.database_path = '' if db_url == 'sqlite://' else str(db_url).split('///')[1]
|
||||
self.trade_database_df: DataFrame = pd.DataFrame()
|
||||
|
||||
|
@ -615,11 +615,11 @@ class IFreqaiModel(ABC):
|
||||
they will format themselves into the dataframe as an additional column in the user
|
||||
strategy. User has access to the current trade database in dk.trade_database_df.
|
||||
"""
|
||||
if dk.trade_database_df.empty:
|
||||
logger.warning(f'No trades found for {pair} to analyze DB')
|
||||
return
|
||||
# if dk.trade_database_df.empty:
|
||||
# logger.warning(f'No trades found for {pair} to analyze DB')
|
||||
# return
|
||||
|
||||
total_profit = dk.trade_database_df['close_profit_abs'].sum()
|
||||
dk.data['extra_returns_per_train']['total_profit'] = total_profit
|
||||
# total_profit = dk.trade_database_df['close_profit_abs'].sum()
|
||||
# dk.data['extra_returns_per_train']['total_profit'] = total_profit
|
||||
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user