From 2dd52e806375d293f1fa12e6f6df57b7b0e1de44 Mon Sep 17 00:00:00 2001 From: Vittus Mikiassen Date: Tue, 16 Jun 2026 13:49:32 +0200 Subject: [PATCH] Update mt5-xau-lstm-ppo-stoch-adx-bot.py --- mt5-xau-lstm-ppo-stoch-adx-bot.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/mt5-xau-lstm-ppo-stoch-adx-bot.py b/mt5-xau-lstm-ppo-stoch-adx-bot.py index f630ffa..321bc0b 100644 --- a/mt5-xau-lstm-ppo-stoch-adx-bot.py +++ b/mt5-xau-lstm-ppo-stoch-adx-bot.py @@ -1532,6 +1532,19 @@ def test_bot(symbol="XAUUSD"): while True: + now = datetime.now() + + seconds_until_next_5m = ( + (5 - now.minte % 5) * 60 + - now.second + - now.microsecond / 1_000_000 + ) + + if seconds_until_next_5m <= 0: + seconds_until_next_5m += 300 + + time.sleep(seconds_until_next_5m) + tick = mt5.symbol_info_tick(symbol) # SL_PIPS = round(tick.bid * 0.00125 * 10, 0) SL_PIPS = 50 @@ -1708,19 +1721,6 @@ def test_bot(symbol="XAUUSD"): # f"[{symbol}] PPO HOLD" # ) - now = datetime.now() - - seconds_until_next_5m = ( - (5 - now.minte % 5) * 60 - - now.second - - now.microsecond / 1_000_000 - ) - - if seconds_until_next_5m <= 0: - seconds_until_next_5m += 300 - - time.sleep(seconds_until_next_5m) - def main(): train_bot("XAUUSD")