|
12 | 12 | from typing import Dict, List, Any, Optional, Tuple |
13 | 13 | from datetime import datetime |
14 | 14 | import json |
15 | | -from decimal import Decimal, ROUND_DOWN, ROUND_UP |
16 | 15 | import pandas as pd |
17 | 16 | import numpy as np |
18 | 17 |
|
@@ -4829,7 +4828,6 @@ def _persist_browser_notification( |
4829 | 4828 | ) -> None: |
4830 | 4829 | """Persist a best-effort browser notification row for the frontend panel.""" |
4831 | 4830 | try: |
4832 | | - now = int(time.time()) |
4833 | 4831 | # Get user_id from strategy if not provided |
4834 | 4832 | if user_id is None: |
4835 | 4833 | try: |
@@ -5715,10 +5713,9 @@ def _run_cross_sectional_strategy_loop( |
5715 | 5713 | timeframe = trading_config.get('timeframe', '1H') |
5716 | 5714 | rebalance_frequency = trading_config.get('rebalance_frequency', 'daily') |
5717 | 5715 | tick_interval_sec = int(trading_config.get('decide_interval', 300)) |
5718 | | - |
| 5716 | + |
5719 | 5717 | last_tick_time = 0 |
5720 | | - last_rebalance_time = 0 |
5721 | | - |
| 5718 | + |
5722 | 5719 | while True: |
5723 | 5720 | try: |
5724 | 5721 | if not self._is_strategy_running(strategy_id): |
@@ -5746,7 +5743,7 @@ def _run_cross_sectional_strategy_loop( |
5746 | 5743 | ) |
5747 | 5744 |
|
5748 | 5745 | if not result: |
5749 | | - logger.warning(f"Cross-sectional indicator returned no result") |
| 5746 | + logger.warning("Cross-sectional indicator returned no result") |
5750 | 5747 | continue |
5751 | 5748 |
|
5752 | 5749 | signals = self._generate_cross_sectional_signals( |
@@ -5803,8 +5800,7 @@ def _run_cross_sectional_strategy_loop( |
5803 | 5800 | logger.error(f"Failed to execute signal {signal['symbol']} {signal['type']}: {e}") |
5804 | 5801 |
|
5805 | 5802 | self._update_last_rebalance(strategy_id) |
5806 | | - last_rebalance_time = current_time |
5807 | | - |
| 5803 | + |
5808 | 5804 | except Exception as e: |
5809 | 5805 | logger.error(f"Cross-sectional strategy loop error: {e}") |
5810 | 5806 | logger.error(traceback.format_exc()) |
|
0 commit comments