diff --git a/_dev/dev_notes.md b/_dev/dev_notes.md index 19d00d4..f80e873 100644 --- a/_dev/dev_notes.md +++ b/_dev/dev_notes.md @@ -84,4 +84,7 @@ use existing checkpoint manager if it;s not too bloated as well. otherwise re-im we should load the models in a way that we do a back propagation and other model specificic training at realtime as training examples emerge from the realtime data we process. we will save only the best examples (the realtime data dumps we feed to the models) so we can cold start other models if we change the architecture. if it's not working, perform a cleanup of all traininn and trainer code to make it easer to work withm to streamline latest changes and to simplify and refactor it -let's also work on the transformer model - we will add a candlestick tokenizer that will use 8 dimentional vectors to represent candlesticks: 5 dim for OHLCV data, 1 for the timestamp, timeframe and symbol \ No newline at end of file +let's also work on the transformer model - we will add a candlestick tokenizer that will use 8 dimentional vectors to represent candlesticks: 5 dim for OHLCV data, 1 for the timestamp, timeframe and symbol + + + diff --git a/core/trading_executor.py b/core/trading_executor.py index 153462d..55ea67f 100644 --- a/core/trading_executor.py +++ b/core/trading_executor.py @@ -335,6 +335,12 @@ class TradingExecutor: # Calculate position size position_value = self._calculate_position_size(confidence, current_price) + + # CRITICAL: Check for zero price to prevent division by zero + if current_price <= 0: + logger.error(f"Invalid price {current_price} for {symbol} - cannot calculate quantity") + return False + quantity = position_value / current_price logger.info(f"Executing BUY: {quantity:.6f} {symbol} at ${current_price:.2f} " @@ -570,6 +576,12 @@ class TradingExecutor: # Calculate position size position_value = self._calculate_position_size(confidence, current_price) + + # CRITICAL: Check for zero price to prevent division by zero + if current_price <= 0: + logger.error(f"Invalid price {current_price} for {symbol} - cannot calculate quantity") + return False + quantity = position_value / current_price logger.info(f"Executing SHORT: {quantity:.6f} {symbol} at ${current_price:.2f} " diff --git a/web/clean_dashboard.py b/web/clean_dashboard.py index 4abe800..d626618 100644 --- a/web/clean_dashboard.py +++ b/web/clean_dashboard.py @@ -6965,7 +6965,9 @@ class CleanTradingDashboard: logger.info("Enhanced training system initialized for model predictions") except ImportError: - logger.warning("Enhanced training system not available - using mock predictions") + # CRITICAL: NO MOCK/SYNTHETIC DATA - System runs without predictions if not available + logger.error("CRITICAL: Enhanced training system not available - predictions disabled. NEVER use mock data.") + logger.error("See: reports/REAL_MARKET_DATA_POLICY.md") self.training_system = None except Exception as e: logger.error(f"Error initializing enhanced training system: {e}")