TrueScalper AI
- Uzmanlar
- Sürüm: 1.0
- Etkinleştirmeler: 10
TrueScalper AI is a fast intraday Expert Advisor for volatile markets, developed and tested on XAUUSD M30. It reads the structure of the last two closed candles and trades only while volatility is expanding. A higher low gives a buy, a lower high gives a sell. Inside and outside candles are skipped. The stop goes beyond the two candles and the target is a multiple of the stop. A stop loss on every trade, no grid, no martingale, no averaging.
An optional AI confirmation layer can review each setup in live trading: the rules find the trade, the AI can only approve or reject it. In the Strategy Tester, and whenever no provider answers, the rules trade on their own, so what you see in a backtest is what the rules do.
HOW IT WORKS
On every new candle the EA compares the last two closed candles. When the low of the last candle is higher than the low of the one before, buyers are defending higher prices and the setup is a buy. When the high of the last candle is lower than the high of the one before, sellers are pressing lower and the setup is a sell. When both are true (an inside candle) or neither is true (an outside candle) there is no clear structure and nothing happens.
A setup is taken only when the market is moving. The volatility filter compares the current ATR with the average true range of the last 96 bars. At the default ratio of 1.0 the EA trades only when volatility is at or above its own recent average, and quiet hours are skipped.
The higher timeframe filter keeps trades in the direction of the larger trend: on M30 it reads the EMA 8 and 21 on H4, on M5 and M15 the timeframe above. The Tolerance entry mode then enters only if, within Signal Valid Minutes after the candle closes, price is close to or beyond the edge of the last candle, so the trade follows the move instead of anticipating it.
Each setup receives a confidence from 7 to 10: one point more when volatility is at least 1.5 times the baseline, one more at 2 times, one more when the EMAs and the higher timeframe agree. With Scale Size By Confidence the strongest setups use the full risk and the weakest half of it.
The stop goes beyond the far extreme of the two candles plus 0.15 ATR, with a minimum distance of 0.5 ATR. The target is 1.5 times the stop. Break even at 1R protects 0.2R, the trailing stop starts at 1.2R with a distance of 0.5R. All levels are measured in R, the distance of the trade's own stop, so they adapt to every market condition.
RISK AND PROTECTION
Position size comes from the risk percent and the stop distance, including spread and commission. Lot, margin and minimum lot guards prevent oversized trades. The EA counts daily trades, pauses after a series of losses, can lock one direction after consecutive losses while the other stays available, and limits correlated positions when it runs on several charts with the same Magic Number.
Prop firm protection follows the daily loss, the total loss, the drawdown from the equity peak, a trailing drawdown and a daily giveback stop that protects profit already made in the day. The state is saved across restarts and shared by the charts with the same Magic Number. Ready made profiles are included: 5% daily and 10% total, 5% daily and 12% total, 3% daily and 6% trailing.
AI CONFIRMATION (OPTIONAL, LIVE ONLY)
With the signal source Structure With AI Confirmation, each setup is sent with the market data of the symbol to an AI provider, which answers approve or reject with a confidence and a short reason. A chain of up to four providers is supported, with retries, cooldowns and automatic fallback. When no provider answers, When The AI Does Not Answer decides whether the trade is taken or skipped. MetaTrader allows web requests only in live trading, so the Strategy Tester always runs without AI. Add the address of each provider you use in Tools, Options, Expert Advisors, Allow WebRequest for listed URL: api.anthropic.com, api.openai.com, generativelanguage.googleapis.com, api.deepseek.com, api.x.ai, api.mistral.ai, api.groq.com, api.perplexity.ai, each with https at the start. API keys are your own and the provider charges you directly.
GETTING STARTED
Attach the EA to an XAUUSD M30 chart and allow algo trading. Keep the default values for the first tests. Check in the journal that the server time is recognised: most brokers use the New York close clock, GMT+2 in winter and GMT+3 in summer, and Auto detects it. If your broker uses another clock, set Server Time Mode to Fixed Offset with its UTC offset, because the session filter uses UTC hours.
Run a backtest with the 1 minute OHLC model first, then confirm with every tick based on real ticks. Forward test on a demo account before trading real money.
SETTING EXAMPLES
Default, XAUUSD M30: two candle structure, volatility ratio 1.0, Tolerance entry, higher timeframe filter on, stop 0.15 ATR beyond the candles, target 1.5R, risk 0.5% scaled by confidence, session 7 to 17 UTC.
More selective: set Min ATR To Baseline Ratio to 1.2 and turn on Require EMA 8 And 21 Alignment. Fewer trades, taken only in stronger moves.
Prop firm challenge: choose the Prop Firm Profile of your challenge, or set Daily Max Loss Percent and Total Max Loss Percent to its limits with a margin of safety. Keep Risk Per Trade Percent between 0.25 and 0.5 and turn on Use Daily Giveback Stop to protect a good day.
News: add the release times to News Blackout Windows, for example 1225-1245,1430-1445 in UTC, or in your own time zone with Blackout Entered In Hours From UTC.
FREQUENTLY ASKED QUESTIONS
Which symbols and timeframes? The default values were developed on XAUUSD M30. The logic works on any symbol because every distance is measured in ATR and R, but each symbol and timeframe should be tested and optimized on your broker's data first. On M5 the same rules gave weaker results in our tests, because noise and spread weigh more on small candles.
Does it need the AI? No. The rules work alone and the backtests use no AI. The AI is an optional live filter.
Why so few trades on some days? Quiet markets are skipped on purpose, and inside or outside candles give no setup. On XAUUSD M30 the EA trades a few times a week, mostly during the New York session.
Can I run it on several charts? Yes, one chart per symbol. With the same Magic Number the charts share the daily trade count, the loss pause and the drawdown state.
Hedging or netting? Both. On netting accounts the EA keeps one position per symbol.
PARAMETERS
Signal Source
Signal Source: Two Candle Structure (default), Structure With AI Confirmation, Five Criteria Scorer or Standard Breakout. The scorer rates spread against ATR, ADX and DI, EMA alignment, RSI and breakout proximity every scan; the standard breakout trades the break of the previous candle with EMA and RSI checks.
Min Confidence 1 To 10: setups below this confidence are ignored.
Scorer Scan Interval Minutes: how often the Five Criteria Scorer runs.
Two Candle Structure
Volatility Baseline Bars: bars used for the average true range baseline.
Min ATR To Baseline Ratio, 0 Off: the current ATR must be at least this multiple of the baseline.
Require EMA 8 And 21 Alignment: buys only with EMA 8 above EMA 21, sells only below.
Stop Placement: beyond the two candles, or from the Exit settings.
Stop Buffer Beyond Candles, ATR Fraction: distance of the stop beyond the candles.
Min Stop Distance, ATR Fraction: the stop is never closer than this.
Target In R Of The Stop: take profit as a multiple of the stop distance.
AI Confirmation, Live Trading Only
When The AI Does Not Answer: take the trade or skip it.
AI Provider, AI Api Key, AI Model: the first provider; an empty model uses the default one.
Fallback, Third Fallback and Fourth Fallback Provider, Api Key and Model: the providers tried after the first.
Failures Before Fallback, Provider Cooldown Minutes, AI Retry Attempts: when a provider is set aside and for how long.
Reasoning Effort: for reasoning models.
AI Timeout Seconds: maximum wait for an answer.
General
Magic Number: identifies the trades of the EA; charts with the same number share the account protections.
Volume Lots, Fixed Sizing: used only when Use Risk Per Trade Percent is off.
Max Positions Per Direction: open positions per direction on the symbol.
Require Separation For Extra Positions, Extra Position Min Favourable R, Extra Position Min Minutes: a second position needs time and profit on the first.
Track Cumulative Stats, Cumulative Min Trades, Cumulative Cut Below PF, Reset Cumulative Stats: statistics by symbol and direction across sessions, printed in the journal.
Trade Cooldown Seconds: minimum time between two entries.
Suppress Repeat Log Minutes: hides repeated messages in the journal.
Enable Trading: off to only manage open positions.
Show Dashboard, Enable Notifications: chart panel and push notifications.
Pip Size In Points, 0 Auto: pip size used by the pip based settings.
Server Time
Server Time Mode: Auto, NY Close or Fixed Offset.
Fixed Server Utc Offset Hours: broker offset from UTC for Fixed Offset.
Filters
Max Spread Pips, 0 Off and Max Spread Percent Of ATR, 0 Off: spread limits.
Entry Mode: Breakout (price beyond the last candle), Tolerance (close to or beyond it) or Immediate.
Entry Tolerance Pips: distance allowed by Tolerance.
Require Candle Direction: the last candle must close in the direction of the trade.
Min ADX For Entry, Require DI Separation, Min DI Gap: regime filters of the Five Criteria Scorer.
Higher Timeframe Confirmation: trades only with the higher timeframe EMA trend.
One Trade Per Signal, Signal Valid Minutes: each setup opens at most one trade within its validity.
Max Entry Slippage Pips, Close On Slippage Breach: slippage control.
Session Start Hour UTC, Session End Hour UTC: trading hours in UTC.
News Blackout Windows, Blackout Entered In Hours From UTC: times without new entries.
Max Daily Trades: limit per day.
Max Consecutive Losses, Loss Cooldown Minutes, Loss Streak Window Minutes: pause after a series of losses.
Use Correlation Filter, Max Correlated Positions: limit of positions in the same direction on correlated symbols.
Directional Lockout
Use Directional Lockout, Lockout After Losses, Lockout Minutes, Lockout Loss Window Minutes, Remember Lockout After Restart: after consecutive losses in one direction that direction pauses, the other stays available.
Exit
Exit Type: Pips, ATR, or ATR And Close Winners On New Bar; used when Stop Placement is set to the Exit settings and by the other signal sources.
ATR Period, ATR SL Multiplier, ATR TP Multiplier, SL Pips Fixed, TP Pips Fixed: stop and target of the Exit settings.
Min SL Spread Multiple, Min SL Pips Floor, Skip If Stop Too Tight, Skip Only Below Percent Of Minimum: minimum stop against the spread.
Use Time Exit, Max Minutes In Trade, Time Exit Only If Flat, Flat Threshold Pips, Time Exit Reentry Pause Minutes: closes trades that go nowhere.
Stop Exit Reentry Pause Minutes: pause after a trailed stop closes in profit.
Position Management
Min Stop Distance Spread Mult: a moved stop stays at least this many spreads from price.
Stop Scaling: Risk Anchored In R (default), Percent Of Target or Fixed Pips.
BE Trigger In R, BE Protect In R, TS Start In R, TS Distance In R: break even and trailing in R.
BE and TS Percent Of TP, BE and TS Pips: the same levels for the other scaling modes.
Use Break Even, Use Trailing Stop: on or off.
Use Scale Out, Scale Out At Pips, Scale Out Percent Close: partial close at the break even trigger.
Risk
Use Risk Per Trade Percent, Risk Per Trade Percent: size from the risk and the stop distance.
Include Costs In Risk, Commission Per Lot Round Turn, Commission Percent Of Notional, Percent Commission Symbols: costs inside the risk.
Max Risk Multiple At Minimum Lot, Max Volume Lots, Max Margin Percent: size guards.
Scale Size By Confidence, Size Factor At Min Confidence: smaller size for weaker setups.
Prop Firm
Prop Firm Profile: None, three ready profiles, or Custom.
Enable Drawdown Protection, Daily Max Loss Percent: daily loss from the day start equity, reset each day.
Total Max Loss Percent, 0 Off, Max Equity DD Percent From Peak, 0 Off, Use Trailing Max DD, Trailing DD Percent From Peak: when reached, positions are closed and the EA stops until it is restarted.
Use Daily Giveback Stop, Giveback Percent Of Peak, Arm Giveback Above Percent, Giveback Minimum Amount Percent, Giveback Entry Guard Percent Of Limit, Giveback On Closed Trades Only: closes the day after giving back part of its profit.
Persist State Across Restarts, Reset State On Start: saved drawdown state.
About Algotrend: Algotrend is an independent developer of trading algorithms. Every product is designed, tested and supported by the same developer. For questions and settings, write in the comments of this page or send a private message on MQL5.
Trading involves risk. Results in the Strategy Tester do not guarantee future results.
