Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
gnyuan committed Nov 11, 2024
1 parent abcef57 commit 6705506
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions backtest/bar_analysis/daily_backtest_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,7 @@ def simple_strategy(self, strategy_param, is_plot=False):
indicator_df['nv'] = indicator_df['close'] - indicator_df['pre_close']
else: # price
indicator_df['nv'] = indicator_df['close'] - indicator_df['pre_close']
<<<<<<< HEAD
indicator_df.fillna({'nv': 0}, inplace=True)
=======
indicator_df['nv'] = indicator_df['nv'].fillna(0)
>>>>>>> 356a7cdc439fe3eb025657ebbdd479cfd38594e1
## 特殊处理 如果切券了,则当天nv为0
indicator_df['nv'] = np.where(indicator_df['name'] != indicator_df['pre_name'], 0,
indicator_df['nv'])
Expand Down Expand Up @@ -155,11 +151,7 @@ def simple_strategy(self, strategy_param, is_plot=False):
subfig.show()
fig_file_title = f'backtest-{self.strategy}-{dt.datetime.now().strftime("%Y%m%d-%H%M%S")}.html'
subfig.write_html(fig_file_title)
<<<<<<< HEAD
return {'md': md, 'r': r, 'cr': cr, 'sr': sr, 'calmar': calmar}
=======
return {'md': md, 'r': r, 'sh': sh}
>>>>>>> 356a7cdc439fe3eb025657ebbdd479cfd38594e1

def find_best_param(self, signal_func, strategy_params={}, signal_params={}):
params = strategy_params
Expand Down

0 comments on commit 6705506

Please sign in to comment.