Skip to content

Commit

Permalink
Merge pull request hummingbot#7192 from hummingbot/fix/controllers_sc…
Browse files Browse the repository at this point in the history
…ript

Fix/controllers script (staging)
  • Loading branch information
nikspz authored Aug 27, 2024
2 parents cc70f1f + b545bad commit 2f83e02
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion hummingbot/connector/exchange/okx/okx_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
NO_LIMIT = sys.maxsize

RATE_LIMITS = [
RateLimit(WS_CONNECTION_LIMIT_ID, limit=1, time_interval=1),
RateLimit(WS_CONNECTION_LIMIT_ID, limit=3, time_interval=1),
RateLimit(WS_REQUEST_LIMIT_ID, limit=100, time_interval=10),
RateLimit(WS_SUBSCRIPTION_LIMIT_ID, limit=240, time_interval=60 * 60),
RateLimit(WS_LOGIN_LIMIT_ID, limit=1, time_interval=15),
Expand Down
2 changes: 1 addition & 1 deletion hummingbot/core/data_type/in_flight_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ async def get_exchange_order_id(self):

def cumulative_fee_paid(self, token: str, exchange: Optional['ExchangeBase'] = None) -> Decimal:
"""
Returns the total amount of fee paid for each traid update, expressed in the specified token
Returns the total amount of fee paid for each trade update, expressed in the specified token
:param token: The token all partial fills' fees should be transformed to before summing them
:param exchange: The exchange being used. If specified the logic will try to use the order book to get the rate
:return: the cumulative fee paid for all partial fills in the specified token
Expand Down
4 changes: 2 additions & 2 deletions scripts/v2_with_controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def control_max_drawdown(self):

def check_max_controller_drawdown(self):
for controller_id, controller in self.controllers.items():
controller_pnl = self.performance_reports[controller_id].global_pnl_quote
controller_pnl = self.performance_reports[controller_id]["global_pnl_quote"]
last_max_pnl = self.max_pnl_by_controller[controller_id]
if controller_pnl > last_max_pnl:
self.max_pnl_by_controller[controller_id] = controller_pnl
Expand All @@ -105,7 +105,7 @@ def check_max_controller_drawdown(self):
self.drawdown_exited_controllers.append(controller_id)

def check_max_global_drawdown(self):
current_global_pnl = sum([report.global_pnl_quote for report in self.performance_reports.values()])
current_global_pnl = sum([report["global_pnl_quote"] for report in self.performance_reports.values()])
if current_global_pnl > self.max_global_pnl:
self.max_global_pnl = current_global_pnl
else:
Expand Down

0 comments on commit 2f83e02

Please sign in to comment.