timestamps fix
This commit is contained in:
parent
c3be184dbf
commit
9771f76dd4
|
|
@ -1,3 +1,5 @@
|
|||
2024.11.13: Fixed bug handling timestamps.
|
||||
|
||||
2024.11.11:
|
||||
. Refactored boost check to optimize CPU usage.
|
||||
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ class broker:
|
|||
try:
|
||||
database_connection = sqlite3.connect("profits/profits_database.db")
|
||||
database_cursor = database_connection.cursor()
|
||||
database_cursor.execute(f"SELECT * FROM profits_table WHERE timestamp >= {time.time()-timespan} ORDER BY timestamp DESC")
|
||||
database_cursor.execute(f"SELECT * FROM profits_table WHERE timestamp >= {time.time()-timespan} ORDER BY timestamp")
|
||||
rows = database_cursor.fetchall()
|
||||
return [item[0] for item in rows if item[1]==pair]
|
||||
except Exception as e:
|
||||
|
|
|
|||
2
main.py
2
main.py
|
|
@ -22,7 +22,7 @@ In case the permissions of the certificate changes, reset them this way:
|
|||
# ll /etc/letsencrypt/
|
||||
'''
|
||||
|
||||
version = "2024.11.11"
|
||||
version = "2024.11.13"
|
||||
|
||||
'''
|
||||
Color definitions. If you want to change them, check the reference at https://en.wikipedia.org/wiki/ANSI_escape_code#Colors
|
||||
|
|
|
|||
|
|
@ -1227,8 +1227,7 @@ class trader:
|
|||
The last n deals must be within the last t seconds
|
||||
'''
|
||||
|
||||
return len(self.deals_timestamps)>=self.boosted_deals_range and self.deals_timestamps[-1]-self.boosted_time_range<=self.deals_timestamps[-4]
|
||||
|
||||
return len(self.deals_timestamps)>=self.boosted_deals_range and time.time()-self.boosted_time_range<=self.deals_timestamps[-self.boosted_deals_range]
|
||||
|
||||
|
||||
def get_tp_level(self, order_index: int = 0) -> float:
|
||||
|
|
|
|||
Loading…
Reference in New Issue