set pause flag while sending safety orders

This commit is contained in:
Nicolás Sánchez 2025-08-28 20:01:25 -03:00
parent 0dd3077eb5
commit 406067497e
2 changed files with 4 additions and 4 deletions

View File

@ -7,8 +7,8 @@ Mandatory:
3. API documentation. 3. API documentation.
4. Implement api key hashing. 4. Implement api key hashing.
5. Dockerize. 5. Dockerize.
6. Inspect orderbook liquidity prior to changing mode from short to long (big sell market order needs to have liquidity). 6. When autoswitching to long, instead of using a big market order, the last safety order should be a sell order of all the available funds.
7. When autoswitching to long, instead of using a big market order, the last safety order should be a sell order of all the available funds. 7. Earn should be integrated into the instance, in order to be able to invest the idle funds from the short traders.
Would be nice to have: Would be nice to have:
@ -20,8 +20,6 @@ Would be nice to have:
from a pre-populated list (the trading pairs can be selected by using Yang-Zhang, Parkinson or another volatility indicator) from a pre-populated list (the trading pairs can be selected by using Yang-Zhang, Parkinson or another volatility indicator)
This could be very benefitial, since it limits the long time commitment to a small list of trading pairs, enabling the instance to react to market trends very This could be very benefitial, since it limits the long time commitment to a small list of trading pairs, enabling the instance to react to market trends very
rapidly. rapidly.
4. Earn should also use funds from short traders.
4b. Should Earn be integrated to the instance?
Maybe it's a good idea?: Maybe it's a good idea?:

View File

@ -1166,7 +1166,9 @@ class trader:
if condition_a and condition_b: if condition_a and condition_b:
amount_to_send = max_concurrent_safety_orders-len(self.status.get_safety_orders()) amount_to_send = max_concurrent_safety_orders-len(self.status.get_safety_orders())
self.pause = True
self.send_new_safety_order_batch(amount_to_send) self.send_new_safety_order_batch(amount_to_send)
self.pause = False
self.update_status(True) self.update_status(True)
#Check for autoswitch (long->short) #Check for autoswitch (long->short)