ensure the prediction is reset in the pair_dict after any trade exit, not just custom_exit
This commit is contained in:
parent
fe36b08fce
commit
0aa7162055
@ -269,8 +269,17 @@ class FreqaiExampleStrategy(IStrategy):
|
|||||||
else:
|
else:
|
||||||
roi_decay += self.linear_roi_offset.value
|
roi_decay += self.linear_roi_offset.value
|
||||||
|
|
||||||
if current_profit > roi_price: # roi_decay:
|
if current_profit > roi_price:
|
||||||
with self.model.bridge.lock:
|
|
||||||
self.model.bridge.data_drawer.pair_dict[pair]['prediction' + entry_tag] = 0
|
|
||||||
self.model.bridge.data_drawer.save_drawer_to_disk()
|
|
||||||
return 'roi_custom_win'
|
return 'roi_custom_win'
|
||||||
|
|
||||||
|
def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,
|
||||||
|
rate: float, time_in_force: str, exit_reason: str,
|
||||||
|
current_time, **kwargs) -> bool:
|
||||||
|
|
||||||
|
entry_tag = trade.enter_tag
|
||||||
|
|
||||||
|
with self.model.bridge.lock:
|
||||||
|
self.model.bridge.data_drawer.pair_dict[pair]['prediction' + entry_tag] = 0
|
||||||
|
self.model.bridge.data_drawer.save_drawer_to_disk()
|
||||||
|
|
||||||
|
return True
|
||||||
|
Loading…
Reference in New Issue
Block a user