AUTOMATION · 7 MIN READ

How a trading bot actually works

A rule-based trading bot runs the same loop on a fixed interval: manage what is open, run a chain of checks that can refuse the trade, collect signals, pick one, place it and attach protection. Nearly all of the risk management lives in the order of those steps.

The loop a trading bot runs

  1. Connect to the platform and confirm the symbol, contract size and minimum volume.
  2. On a fixed interval (ours is two seconds), manage anything already open: check for closed positions and record the result.
  3. Run the gate chain for each symbol. Any gate that returns false ends the scan for that symbol.
  4. If every gate passes, collect candidate signals from every eligible strategy.
  5. Score the candidates, deduplicate by strategy type, and execute exactly one.
  6. Attach protection to the new position, and close the position if that fails.

Step one catches more than it sounds like. On an Exness Standard account gold is `XAUUSDm`, and on Pro, Raw Spread and Zero accounts it is `XAUUSD`, so a bot hard-coded to one name finds no symbol on the other account type. Ours now trades whichever name the account has (version 1.0.204).

The one-signal rule in step five matters. A bot that executes every signal that fires turns several strategies agreeing into several positions, which is one bigger bet dressed up as diversification.

The gate chain is where the risk management is

Ours starts with the daily lockdown, then moves through the per-symbol cooldown, session hours, the spread limit and the concurrent-trade cap, and checks the multi-timeframe bias last before it picks a signal. More checks follow the pick. Each one is a refusal, and each ends the scan the moment it says no.

The order matters for more than speed. Cheap checks that reject most scans go first. The one tied to account state, the lockdown, goes before anything that needs market data, because it is the check that must never be skipped. In the default profile the three gold clock rules run outside this chain: they still trade on a locked day, they do not check the spread, and one of their stop-losses costs about $94 to $100 at 0.02 lot.

How one signal is picked: the tournament

Candidates are scored on the Wilson lower bound of each strategy's measured win rate, plus a base priority and a timeframe bonus. Using the lower bound instead of the raw rate stops a strategy that won its only two trades from outranking one with a long record.

Signals are deduplicated by strategy type before scoring. Doing that is how we found that several strategies in the original set, with different names, were catching the same setups. See strategy tournament.

Execution, and the Exness quirk

Orders go out with no stop or target attached, because ECN brokers often reject orders that carry them. Protection is attached straight after the fill as a separate modification. Exness is the strict case; the Exness trading bot page lists the four broker specifics our bot handles there.

If that modification fails, usually because of the broker's stop level, the bot force-closes the position. An unintended flat position is recoverable; an unmonitored leveraged one is not. See position opens without SL or TP.

Keep reading

See the gold bot →Free tools

Educational information only, not financial advice. Trading leveraged products carries substantial risk of loss. Last updated 2026-11-11.