Atomic Advanced EA
- Experts
- Lucas Bremer Moinhos Dos Santos
- Versione: 42.9
- Aggiornato: 26 agosto 2025
- Attivazioni: 5
Welcome to Atomic, the most versatile and powerful trading automaton for MetaTrader 5. I designed this Expert Advisor not just as a single tool, but as a complete trading framework. It's a multi-strategy, multi-symbol powerhouse built on a foundation of sophisticated trade and risk management. Whether you're a trend-follower, a scalper, or a grid trader, Atomic provides the features and flexibility to build, test, and deploy virtually any automated strategy you can conceive.
Let's dive into every feature, so you can unlock its full potential.
General SettingsThis is the control center for the EA's core identity and operational scope.
-
input string SymbolsToTrade
-
What it does: Defines the list of symbols the EA will monitor and trade. Symbols must be separated by commas.
-
Functional Example: Setting this to "EURUSD,USDJPY,BTCUSD" will make the EA run its logic on these three instruments simultaneously.
-
Suggestion: Start with 2-3 symbols you are familiar with. Ensure the symbol names match your broker's exact naming convention (e.g., EURUSD vs. EURUSD.pro ).
-
-
input ENUM_TIMEFRAMES TimeframeToTrade
-
What it does: Sets the single timeframe on which all indicator calculations and signal generation will be based for all symbols.
-
Functional Example: If set to PERIOD_H1 , the MA Crossover strategy will look for crosses on the 1-hour chart for every symbol in your list.
-
Suggestion: Mid-to-high timeframes like PERIOD_H1 , PERIOD_H2 , or PERIOD_H4 are generally more reliable for trend-based strategies and less susceptible to market noise.
-
-
input int BaseMagicNumber
-
What it does: A unique ID for the EA. The EA assigns a unique magic number to each symbol manager starting from this base number ( BaseMagicNumber , BaseMagicNumber + 1 , etc.). This is crucial for ensuring the EA only manages its own trades and doesn't interfere with other EAs or manual trades.
-
Suggestion: Pick a random 5-digit number that you don't use for any other EA, like 54881 .
-
-
input ENUM_TRADING_STRATEGY MainStrategy
-
What it does: This is the heart of the EA. You select the primary strategy that will generate the initial buy or sell signals.
-
Functional Example: Selecting STRATEGY_MA_CROSSOVER tells the EA to use the Moving Average Crossover logic as the trigger for all trades. All other active "Filter" indicators will then be used to confirm this signal.
-
Suggestion: Begin with a classic strategy you understand well, such as STRATEGY_MA_CROSSOVER or STRATEGY_MACD_CROSS .
-
-
input bool ForceNettingLogic
-
What it does: If true , the EA will only allow one position per symbol, even if you are on a Hedging account. It simulates a Netting account's behavior.
-
Suggestion: Keep this false unless you have a specific strategy that requires strictly one position per instrument and your broker account is Hedging.
-
-
input ENUM_ALLOWED_ACCOUNT_MODE AllowedAccountMode
-
What it does: A safety feature to prevent you from accidentally running the EA on an unintended account type.
-
Suggestion: Set this to ALLOW_DEMO_ONLY while testing and optimizing. When you are confident and ready to go live, change it to ALLOW_REAL_ONLY or ALLOW_ALL .
-
These settings define how and when the EA acts on a signal.
-
input bool ExecuteSignalOnTick
-
What it does: If true , the EA checks for signals and can execute a trade on every incoming price tick. If false , it will only check for and execute trades at the opening of a new bar on the TimeframeToTrade .
-
Functional Example: A 15-minute MA Crossover occurs mid-bar. With ExecuteSignalOnTick = true , a trade opens immediately. With false , the EA waits for the current 15-minute bar to close and the next one to open before placing the trade.
-
Suggestion: For backtesting consistency and to avoid over-trading on market noise, false (trade on new bar) is the standard and recommended approach.
-
-
input ENUM_ORDER_EXECUTION_TYPE OrderExecutionType
-
What it does: Choose between entering the market instantly ( EXECUTION_MARKET ) or placing a pending order and waiting for the price to come to you ( EXECUTION_PENDING_LIMIT ).
-
Suggestion: EXECUTION_MARKET is best for momentum and breakout strategies. EXECUTION_PENDING_LIMIT is excellent for reversal strategies, as it aims to get a better entry price on a pullback.
-
-
input int MaxOpenPositions & input int MaxOpenOrders
-
What they do: Control the maximum number of open trades and pending orders allowed per symbol.
-
Suggestion: For most strategies, set MaxOpenPositions to 1 to avoid multiple compounding trades on a single instrument. This is a key risk management control.
-
-
input ENUM_REVERSAL_MODE ReversalMode
-
What it does: Dictates how the EA handles a new signal that is opposite to an existing open trade on the same symbol.
-
REVERSAL_NO_ACTION : Ignores the new signal and leaves the existing trade open.
-
REVERSAL_CLOSE_ONLY : Closes the existing trade but does not open a new one.
-
REVERSAL_CLOSE_AND_REVERT : Closes the existing trade and immediately opens a new trade in the direction of the new signal.
-
-
Suggestion: REVERSAL_CLOSE_ONLY is a conservative and effective way to exit a trade when the market has turned against you.
-
This is arguably the most important section. Proper risk management is the key to long-term success.
Lot Sizing-
input bool UseDynamicLots
-
What it does: When true , the EA automatically calculates the lot size for each trade based on your RiskPerTradePercent and the stop loss distance. This is the cornerstone of modern risk management. If false , it uses the LotSize value.
-
Functional Example: With RiskPerTradePercent = 1.0 , on a $10,000 account, the EA will risk $100 per trade. It will adjust the lot size so that if the stop loss is hit, the loss is approximately $100.
-
Suggestion: Always use this. Set UseDynamicLots = true and RiskPerTradePercent to a sensible value like 1.0 or 2.0 . Never risk more than a small percentage of your account on a single trade.
-
-
input bool UseLossRecoveryLots
-
What it does: A Martingale-style feature. If true , after a losing trade, the EA will increase the lot size of the next trade to try and recover the recent loss in addition to making the normal profit.
-
Suggestion: This is a high-risk feature. Use with extreme caution. It's recommended to keep this false unless you have thoroughly backtested and understand the drawdown implications.
-
-
input ENUM_SL_MODE StopLossMode & input ENUM_TP_MODE TakeProfitMode
-
What they do: Define how the Stop Loss (SL) and Take Profit (TP) levels are calculated.
-
POINTS : A fixed distance in points (e.g., 2000 points SL, 4000 points TP).
-
ATR : A dynamic distance based on the Average True Range (ATR) indicator, which measures volatility. The distance is the current ATR value multiplied by a multiplier ( AtrMultiplierSL or AtrMultiplierTP ).
-
PERCENT : A distance based on a percentage of the entry price.
-
-
Suggestion: Using SL_MODE_ATR and TP_MODE_ATR is highly recommended. It allows your SL/TP levels to adapt to the market's current volatility. A volatile market gets a wider stop, and a quiet market gets a tighter stop, which is logical and effective.
-
-
Partial Take Profit Settings ( PartialTP_Enable_1 , _2 , _3 )
-
What it does: Allows you to scale out of a winning position at up to three predefined levels. When a level is hit, a specified percentage of the position is closed, locking in profits.
-
Functional Example: You open a 1.0 lot buy. PartialTP_Enable_1 is true , PartialTP_Points_1 is 500 , and PartialTP_ClosePercent_1 is 50.0 . When the trade is 500 points in profit, the EA will close 0.50 lots.
-
Suggestion: Using partial take profits is a professional trading technique. A great starting setup is to close 50% at the first target ( PartialTP_Enable_1 = true ) and let the rest run.
-
-
input ENUM_BREAKEVEN_MODE BreakevenMode
-
What it does: Automatically moves your stop loss to your entry price (plus an optional buffer) once a trade reaches a certain profit level, making the trade risk-free.
-
Functional Example: With Breakeven_Points = 500 and Breakeven_Buffer_Points = 50 , once your trade is 500 points in profit, the SL will be moved to the entry price + 50 points.
-
Suggestion: BREAKEVEN_ON_PTP1 is an excellent choice. It secures the trade immediately after you've already taken some profit off the table.
-
-
input ENUM_TRAILING_STOP_TYPE TrailingStopType
-
What it does: Automatically "trails" the stop loss behind the price as a trade moves into profit, locking in gains.
-
Types:
-
TRAILING_STOP_POINTS : A simple fixed distance from the current price.
-
TRAILING_STOP_SAR : Uses the Parabolic SAR indicator value as the SL.
-
TRAILING_STOP_MA : Uses a Moving Average as the SL.
-
TRAILING_STOP_KIJUN : Uses the Ichimoku Kijun-Sen line as the SL.
-
-
Suggestion: TRAILING_STOP_MA with a short-period EMA (e.g., TS_MA_Period = 9 ) is a robust way to let winners run during strong trends.
-
Atomic comes packed with 27 distinct trading strategies. You select one as your MainStrategy , and can use others as confirmation filters.
| Strategy Name | Logic in Brief | Common Use Case |
| STRATEGY_ICHIMOKU | Generates signals based on the full Ichimoku Kinko Hyo system rules. | Comprehensive trend-following. |
| STRATEGY_SINGLE_MA_PRICE | Signals on price crossing a single Moving Average. | Simple trend filter. |
| STRATEGY_MA_CROSSOVER | Classic fast MA crossing a slow MA. | The quintessential trend strategy. |
| STRATEGY_ADX_DI_CROSS | Signals when +DI and -DI lines cross, filtered by ADX strength. | Trend entry confirmation. |
| STRATEGY_RSI_MA_CROSS | Signals when the RSI line crosses its own moving average. | Momentum shift detection. |
| STRATEGY_MFI_MA_CROSS | Similar to RSI, but uses the Money Flow Index. | Volume-weighted momentum. |
| STRATEGY_BOLLINGER_BANDS | Signals on price breakouts or reversals from the bands. | Volatility and mean-reversion. |
| STRATEGY_MACD_CROSS | Signals on MACD line crossing the signal line or MACD/Price divergence. | Momentum and trend reversals. |
| STRATEGY_STOCHASTIC | Signals on %K/%D line crosses in overbought/oversold zones. | Reversal and pullback entries. |
| STRATEGY_OBV_CROSS | Signals when On-Balance Volume crosses its moving average. | Volume pressure confirmation. |
| STRATEGY_PRICE_ACTION | Detects candlestick patterns like Engulfing, Pin Bars, Stars, etc. | Pure price-based entries. |
| STRATEGY_CCI_CROSS | Signals when CCI crosses above/below a set level (e.g., +100/-100). | Extreme momentum breakouts. |
| STRATEGY_RVI_CROSS | Relative Vigor Index line crossing its signal line. | Trend strength confirmation. |
| STRATEGY_FIBO_CHANNEL | Breakout strategy using daily Fibonacci Pivot levels. | Day-trading support/resistance breaks. |
| STRATEGY_FRACTALS | Signals on price breaking the most recent up or down Fractal. | Bill Williams breakout system. |
| STRATEGY_OSMA | Signals on OsMA crossing the zero line or its signal MA. | MACD histogram momentum. |
| STRATEGY_MOMENTUM | Signals when the Momentum indicator crosses the 100 level. | Simple rate-of-change strategy. |
| STRATEGY_AC | Bill Williams' Accelerator Oscillator zero-cross. | Early momentum change detection. |
| STRATEGY_AO | Bill Williams' Awesome Oscillator zero-cross. | Confirmation of trend momentum. |
| STRATEGY_ALLIGATOR | Signals when the Alligator's lines are open and trending. | Trend identification and filtering. |
| STRATEGY_BULLSBEARS | Bulls Power crossing above zero (buy) or Bears Power below (sell). | Market strength indication. |
| STRATEGY_DEMARKER | DeMarker indicator exiting overbought/oversold zones. | Exhaustion and reversal signals. |
| STRATEGY_ENVELOPES | Price breaking out of the Moving Average Envelopes. | Trend channel breakout. |
| STRATEGY_FORCEINDEX | Force Index crossing the zero line. | Measures the power behind a move. |
| STRATEGY_TRIX | TRIX line crossing its signal line. | Smoothed momentum oscillator. |
| STRATEGY_WPR | Williams' Percent Range exiting overbought/oversold zones. | Larry Williams' reversal setup. |
| STRATEGY_GRID | Not a signal, but enables the full Grid trading module. | Automated range or trend trading. |
A powerful feature that allows you to combine indicators. A trade is only triggered if the MainStrategy gives a signal AND all active filters agree with the direction.
-
How it works: You select your MainStrategy (e.g., STRATEGY_MA_CROSSOVER ). Then you can enable one or more filters. For instance, if you also set UseADX_Filter = true , a buy signal from the MA Crossover will only be executed if the ADX indicator is also showing a strong trend ( ADX > ADX_Min_Strength ).
-
Suggestion: This is how you build a robust trading system. A great combination is a trend-following MainStrategy like STRATEGY_MA_CROSSOVER combined with a trend-strength filter like UseADX_Filter = true and a volatility filter like UseVolatilityFilter = true .
When you set MainStrategy = STRATEGY_GRID and Grid_Enable = true , Atomic switches to a sophisticated grid trading mode.
-
input ENUM_GRID_MODE Grid_Mode
-
What it does: Defines the grid's logic.
-
GRID_MODE_SYMMETRIC : Places buy stops above and sell stops below the price. Best for ranging markets or news straddling.
-
GRID_MODE_TREND_FOLLOW : Uses a long-term MA ( Grid_Trend_MA_Period ) to determine the trend. Only places buy stops in an uptrend, or sell stops in a downtrend.
-
GRID_MODE_COUNTER_TREND : The opposite of trend-follow. Places sell limits in an uptrend (fading the move) and buy limits in a downtrend.
-
-
-
Key Grid Parameters:
-
Grid_Levels : The number of pending orders to place.
-
Grid_Dynamic_Spacing : If true , spaces the grid levels based on ATR (volatility). If false , uses fixed Grid_Spacing_Points .
-
Grid_Close_All_Profit_USD / Grid_Close_All_Loss_USD : The most important grid settings. Define a total basket profit or loss (in your account currency) at which the EA will close ALL grid positions and orders. This is your primary exit strategy for the grid.
-
-
Suggestion: The Grid strategy is powerful but advanced. Use GRID_MODE_TREND_FOLLOW with Grid_Dynamic_Spacing = true as a starting point. Always define your Grid_Close_All_Profit_USD and Grid_Close_All_Loss_USD targets and test extensively on a demo account.
These are your global safety nets and operational schedule settings.
-
MaxDailyProfitPercent & MaxDailyLossPercent
-
What they do: Account-level circuit breakers. If your total profit or loss for the day from this EA exceeds the set percentage of your account balance, the EA stops opening new trades until the next day.
-
Suggestion: These are essential. Set MaxDailyLossPercent to a value like 3.0 and MaxDailyProfitPercent to 5.0 . This protects your capital from black swan events and locks in good days.
-
-
LimitCorrelatedExposure & CorrelatedSets
-
What it does: Prevents you from taking on too much risk in highly correlated pairs.
-
Functional Example: If CorrelatedSets includes "EURUSD,GBPUSD" , and you have an open EURUSD trade, the EA will not open a new GBPUSD trade until the first one is closed.
-
Suggestion: Enable this if you trade many pairs within the same currency family (e.g., multiple USD or JPY pairs).
-
-
Operational Schedule
-
What it does: Allows you to define the exact days ( TradeMonday , etc.) and server time hours ( StartHour , EndHour ) the EA is permitted to trade.
-
Suggestion: Use this to avoid trading during low-liquidity periods or high-impact news events. For example, you could set EndHour to 21 on Fridays to avoid holding trades over the weekend.
-
Final touches and critical safety features to protect your account.
-
input bool CloseIfSLSkipped
-
What it does: If a weekend or news-driven price gap jumps completely over your stop loss level, this feature will close the position at the first available market price, preventing a potentially much larger loss.
-
Suggestion: Keep this true . It's a non-negotiable safety feature.
-
-
input double EmergencyClosureMarginLevel
-
What it does: A last-resort account protector. If your account's Margin Level percentage drops to this value, the EA will immediately close all its open trades to prevent a margin call.
-
Suggestion: Set this to a value safely above your broker's stop-out level, for example, 150.0 . A setting of 0 disables it.
-
-
input bool CloseOnDisconnect
-
What it does: If the EA detects it has lost connection to the trade server, it can automatically close all open positions and orders. This prevents having "unmanaged" trades if your internet or VPS goes down.
-
Suggestion: Set to true for peace of mind, especially if your connection can be unreliable.
