2025.10.12
This commit is contained in:
parent
18506dbaf3
commit
b69b0d2f15
|
|
@ -1,3 +1,6 @@
|
|||
2025.10.12:
|
||||
. do_cleanup relocated after generating the safety orders' prices.
|
||||
|
||||
2025.10.11:
|
||||
. Minor simplification in do_cleanup.
|
||||
. Removed a couple of (no longer needed?) pauses.
|
||||
|
|
|
|||
3
main.py
3
main.py
|
|
@ -18,7 +18,7 @@ import exchange_wrapper
|
|||
import trader
|
||||
|
||||
|
||||
version = "2025.10.11"
|
||||
version = "2025.10.12"
|
||||
|
||||
'''
|
||||
Color definitions. If you want to change them, check the reference at https://en.wikipedia.org/wiki/ANSI_escape_code#Colors
|
||||
|
|
@ -2280,6 +2280,7 @@ def unwrapped_toggle_autoswitch(base,quote):
|
|||
broker.logger.log_this(f"Exception while toggling autoswitch: {e}",1,symbol)
|
||||
return jsonify({"Error": "Halp"})
|
||||
|
||||
|
||||
def unwrapped_toggle_liquidate_after_switch(base,quote):
|
||||
'''
|
||||
Signals a trader to enable or disable quitting after switching from short to long.
|
||||
|
|
|
|||
|
|
@ -277,15 +277,15 @@ class trader:
|
|||
self.broker.logger.log_this("Error sending take profit order. Aborting.",1,self.status.get_pair())
|
||||
return 1
|
||||
|
||||
# Generate the safety prices table
|
||||
self.status.set_start_price(self.broker.price_to_precision(self.status.get_pair(),self.status.get_quote_spent()/self.status.get_base_bought()))
|
||||
self.status.set_safety_price_table(self.calculate_safety_prices(self.status.get_start_price(),self.status.get_no_of_safety_orders(),self.config.get_safety_order_deviance()))
|
||||
|
||||
# Send cleanup order (if cleanup)
|
||||
self.status.set_pause_reason("start_trader - doing cleanup (if needed)")
|
||||
if self.config.get_cleanup() and not self.config.get_is_short(): #Short traders do not need cleanup.
|
||||
self.do_cleanup()
|
||||
|
||||
# Generate the safety prices table
|
||||
self.status.set_start_price(self.broker.price_to_precision(self.status.get_pair(),self.status.get_quote_spent()/self.status.get_base_bought()))
|
||||
self.status.set_safety_price_table(self.calculate_safety_prices(self.status.get_start_price(),self.status.get_no_of_safety_orders(),self.config.get_safety_order_deviance()))
|
||||
|
||||
# Send the initial batch of safety orders
|
||||
self.status.set_pause_reason("start_trader - sending safety orders")
|
||||
self.broker.logger.log_this("Sending safety orders...",2,self.status.get_pair())
|
||||
|
|
|
|||
Loading…
Reference in New Issue