diff --git a/crypto/gogo2/main.py b/crypto/gogo2/main.py index e8bb07a..e5c7e02 100644 --- a/crypto/gogo2/main.py +++ b/crypto/gogo2/main.py @@ -429,7 +429,12 @@ class TradingEnvironment: def _update_features(self): """Update technical indicators with new data""" self._initialize_features() # Recalculate all features - + + async def fetch_new_data(env, exchange, symbol="ETH/USDT", timeframe="1m", limit=1000): + """Fetch new data for the environment""" + # Call the environment's fetch_initial_data method + return await env.fetch_initial_data(exchange, symbol, timeframe, limit) + async def fetch_initial_data(self, exchange, symbol="ETH/USDT", timeframe="1m", limit=1000): """Fetch initial historical data for the environment""" try: @@ -2344,6 +2349,7 @@ async def get_latest_candle(exchange, symbol): except Exception as e: logger.error(f"Failed to fetch latest candle: {e}") return None + async def fetch_ohlcv_data(exchange, symbol, timeframe, limit): """Fetch OHLCV data with proper handling for both async and standard CCXT"""