force_restart_if_retries_exhausted

This commit is contained in:
Nicolás Sánchez 2024-11-30 13:42:08 -03:00
parent f802ddccc7
commit a0c6f8c584
4 changed files with 35 additions and 26 deletions

View File

@ -1,3 +1,7 @@
2024.11.30:
. Added "forced_restart_if_retries_exhasted" option to the config file of a trader. If set to true, the trader will always restart if the first order of the deal
does not fill. Default behavior is one restart only.
2024.11.26: 2024.11.26:
. Implemented deals cache to reduce db load until the new database service is implemented. . Implemented deals cache to reduce db load until the new database service is implemented.
. Added a new API endpoint: /get_deals_cache. . Added a new API endpoint: /get_deals_cache.

View File

@ -16,6 +16,7 @@
"is_short": true, #Signals the trader mode (true if short, false if long) "is_short": true, #Signals the trader mode (true if short, false if long)
"autoswitch": true, #If the trader is operating in short mode, switches to long mode if certain conditions are met. (check strategy documentation for more details) "autoswitch": true, #If the trader is operating in short mode, switches to long mode if certain conditions are met. (check strategy documentation for more details)
"attempt_restart": true, #Attempts to restart the trader if there is an error. "attempt_restart": true, #Attempts to restart the trader if there is an error.
"forced_restart_if_retries_exhasted": false, #Forces restart every time the initial order does not get filled. Default behavior is only one restart.
"check_old_long_price": true, #Compares the current price with the old_long price. (check strategy documentation for more details) "check_old_long_price": true, #Compares the current price with the old_long price. (check strategy documentation for more details)
"dynamic_so_deviance": true, #Uses a non-linear safety order deviance algorithm. (check strategy documentation for more details) "dynamic_so_deviance": true, #Uses a non-linear safety order deviance algorithm. (check strategy documentation for more details)
"dsd_range": 1, #Range of the dynamic deviance algorithm. (check strategy documentation for more details) "dsd_range": 1, #Range of the dynamic deviance algorithm. (check strategy documentation for more details)

View File

@ -22,7 +22,7 @@ In case the permissions of the certificate changes, reset them this way:
# ll /etc/letsencrypt/ # ll /etc/letsencrypt/
''' '''
version = "2024.11.26" version = "2024.11.30"
''' '''
Color definitions. If you want to change them, check the reference at https://en.wikipedia.org/wiki/ANSI_escape_code#Colors Color definitions. If you want to change them, check the reference at https://en.wikipedia.org/wiki/ANSI_escape_code#Colors

View File

@ -101,6 +101,10 @@ class trader:
elif start_result==1: #If initialization fails elif start_result==1: #If initialization fails
self.quit = True self.quit = True
elif start_result==2: #Retries exceeded elif start_result==2: #Retries exceeded
if "force_restart_if_retries_exhausted" in self.config_dict and self.config_dict["force_restart_if_retries_exhausted"]:
self.pause = False
self.restart = True
else:
self.quit = True self.quit = True
elif start_result==3: #Not enough liquidity elif start_result==3: #Not enough liquidity
self.pause = False self.pause = False