THE X AND XCUSTOMEA DESCRIPTIONS OF SETTINGS AND EXTERNAL VARIABLES

THE X AND XCUSTOMEA DESCRIPTIONS OF SETTINGS AND EXTERNAL VARIABLES

7 August 2021, 18:37
Vladislav Andruschenko
1
2 357
🧩 The xCustomEA Settings Guide

How to configure custom indicator signals, filters, buffers, trading rules, money management and protection blocks in The xCustomEA for MetaTrader 4 and MetaTrader 5.

The xCustomEA is a universal Expert Advisor for traders who want to automate strategies based on custom indicators through iCustom logic. This guide explains the most important settings in a practical way, so you can understand what each block does and how to build your own trading system correctly.



💎 Buy The xCustomEA MT5 💎 Buy The xCustomEA MT4
⬇ Download The xCustomEA DEMO + PDF 📘 Full xCustomEA Instruction
⚙ Settings Documentation 🛒 All Expforex Products


🏠 Main 🎓 Documentation ⚙ Settings
❓ FAQ ⭐ Reviews 💬 Comments


🚀 What Is The xCustomEA?

The xCustomEA is a universal Expert Advisor for MetaTrader 4 and MetaTrader 5 that can trade using custom indicators.

The main idea is simple: instead of ordering a separate Expert Advisor for every new indicator, you can connect your indicator to The xCustomEA, specify signal buffers, define BUY / SELL logic, add filters, configure trading rules, and test the strategy in MetaTrader.

The xCustomEA is based on the same powerful foundation as The X Universal EA, but with one important difference: The X works mainly with standard MetaTrader indicators, while The xCustomEA is designed for custom iCustom indicators.

🧩 Custom Indicator Logic

Connect custom indicators from the Internet, MQL5 Market or your own MQL code.

🎯 Signal Buffers

Read BUY / SELL signals from indicator buffers, arrows or non-empty buffer values.

🔎 Filters

Use custom indicator filters to confirm or block trading signals.

⚙ Full EA Framework

Use stops, trailing, breakeven, autolot, averaging, limits, time filters and drawdown protection.


✅ Main idea: The xCustomEA lets you test and automate many custom-indicator strategies without programming a separate Expert Advisor for each indicator.


🧩 The xCustomEA for MT4 and MT5

The xCustomEA for MetaTrader 5 The xCustomEA for MetaTrader 4

One universal Expert Advisor concept for both terminals: connect custom indicator signals, configure filters and build automated trading logic.


🆚 The X vs The xCustomEA

The X and The xCustomEA share the same general Expert Advisor framework, but they are designed for different tasks.

The X The xCustomEA
Works with standard MetaTrader indicators. Works with custom indicators through iCustom logic.
Better for traders who want built-in standard indicator strategies. Better for traders who want to connect their own indicators, arrow indicators or Market indicators.
No custom indicator buffer setup is needed. You must understand indicator buffers, arrows or signal output values.
Good choice if you do not want to study programming or buffers. Good choice if you want flexibility and are ready to configure signal logic more deeply.


Simple choice: if you want standard MetaTrader indicators, use The X. If you want to trade by your own custom indicator, use The xCustomEA.


🧠 How xCustomEA Reads Indicator Signals

The xCustomEA can receive signals from a custom indicator in several ways. The most common method is reading indicator buffers.

Many custom indicators draw arrows on the chart. These arrows usually come from indicator buffers. If the buffer has a non-empty value, the Expert Advisor can treat this as a signal.

Signal Type How It Works
xCustomEA Works with the special indicator template where you can program your own strategy and return signals to the EA.
xArrow Works directly with a custom indicator that has arrow-type buffers or non-empty buffer values for BUY / SELL signals.
Standard The X Signals Allows using built-in standard indicator logic inherited from The X framework.

Example Logic

  • BUY buffer has a value above zero → the EA receives a BUY signal.
  • SELL buffer has a value above zero → the EA receives a SELL signal.
  • Filter buffer confirms BUY → BUY trades are allowed.
  • Filter buffer blocks SELL → SELL trades are ignored.
Important: The xCustomEA cannot guess your indicator logic automatically. You must correctly identify the indicator name, signal type and buffer numbers.


🎯 OWN Signal Options

The OWN Signal Options block defines where the main entry signal comes from.

This is the first block you should understand because it controls whether the EA receives a BUY or SELL signal from your indicator.

Setting Practical Meaning
SignalNameIndicator Name of the custom indicator that gives the main signal for opening positions.
SignalTypeIndicator Defines how the EA should read the signal: xCustomEA, xArrow or standard strategy logic.
BUY / SELL Buffer Numbers Buffer indexes where the indicator writes BUY or SELL values.
Signal Shift Defines whether signal is read from the current bar or from a closed bar.
ReverseSignal Flips the final strategy signal. BUY becomes SELL, SELL becomes BUY.

Recommended Signal Setup Workflow

  1. Install the custom indicator into the correct Indicators folder.
  2. Open the indicator on the chart and check where it draws signals.
  3. Find BUY and SELL buffer numbers.
  4. Enter the indicator name into SignalNameIndicator.
  5. Select the correct SignalTypeIndicator.
  6. Set the BUY and SELL buffers.
  7. Start testing in Strategy Tester with visual mode.
Practical recommendation: first configure only the main signal without filters, averaging, martingale or additional modules. Check that the EA opens BUY and SELL correctly. Only after that add filters and management blocks.


🔎 Filter Options

The Filter Options block lets you add confirmation logic before opening a trade.

A signal answers the question: Should we trade?

A filter answers the question: Is this signal allowed now?

Setting Practical Meaning
FilterNameIndicator Name of the custom indicator used as a filter.
FilterTypeIndicator Defines how the filter should be read: xCustomEA or xArrow.
Filter BUY / SELL Buffers Buffers used to allow or block BUY / SELL signals.
Filter TimeFrame Allows reading the filter from another timeframe.
Filter Reverse Reverses the filter logic if needed.

Example

The main signal comes from an arrow indicator on M15. The filter comes from a trend indicator on H1.

  • If M15 gives BUY and H1 filter also allows BUY → the EA may open BUY.
  • If M15 gives BUY but H1 filter does not allow BUY → the EA ignores the signal.


⚙ Signal Processing Options

The signal processing block controls how often the EA checks signals and how it opens positions after a signal appears.

Setting Why It Matters
Show_alert_without_opening_positions The EA does not open trades, only shows alerts when signals appear. Useful for semi-automatic trading and checking indicator logic.
OpenBarControlOnly All EA functions run once at the opening of a new bar. Useful for strategies that should behave like Open Price testing.
ControlNewBarforSIGNAL Checks indicator signals only on a new bar instead of every tick. Can speed up optimization and reduce noisy recalculations.
ControlNewBarforSIGNALType Defines whether signal control uses the smallest selected signal timeframe, the current chart timeframe, or no new-bar control.
ControlNewBarforOpenbySignal Controls whether position opening happens on the current chart’s new bar or immediately after signal detection from the signal timeframe.


Performance note: checking signals on every tick can be slower, especially with heavy custom indicators. New-bar control can make optimization faster and more stable.


🚦 Opening Filters and Trade Permissions

This block controls how many positions the EA can open, in which direction, after what delay, and under what spread conditions.

Setting Practical Meaning
TypeTradeBUYSELL Allows Buy and Sell, Only Buy, or Only Sell trading.
MinuteToOpenNextPosition Minimum time before opening the next signal after the previous position.
DistanceToOpenNextPosition Minimum distance required before the next signal position can be opened.
OpenOppositePositionAfterStoploss Opens an opposite position after the previous trade closes by Stop Loss.
ONlyOnePosbySignal Allows only one current main position by signal direction.
OnePosPerDirection Allows one BUY and one SELL position depending on direction rules.
OnlyOnePositionPerMagic Limits trading to one position by Magic number across symbols.
OnlyAlternateSignals Forces alternating signals: after SELL, next can only be BUY, and vice versa.
MAX_BUY_POSITION / MAX_SELL_POSITION Limits the number of BUY or SELL positions opened by signals.
MaxSpreadToNotTrade / MinSpreadToNotTrade Blocks new signal positions if spread is outside your allowed conditions.


🛑 Close Options

The close options block controls how the EA closes positions when the signal changes or when a trade remains open too long.

Setting How It Works
ClosePosifChange Closes positions when the combined signal from main indicator and filters reverses.
ClosePosition_After_X_Minutes Closes a position after the selected number of minutes.
CloseChangeOnlyInProfit Allows closing by reverse signal only if the current position is profitable.


📌 Pending Orders Options

The xCustomEA can open pending orders instead of immediate market positions.

This is useful when you want the market to confirm the signal by moving a selected distance after the signal appears.

Setting Practical Meaning
StopOrderUSE Opens pending or limit orders instead of market positions.
StopOrderDeltaifUSE Distance in points for pending or limit orders.
StopOrderDayToExpiration Expiration time in days for pending orders.
StopOrderBarToExpiration Expiration in bars. For example, 10 bars on M1 means about 10 minutes.
ReInstallStopOrdersNewSignalAppears Deletes and replaces pending orders when a new signal appears.
Virtual Stop / Limit Orders Uses virtual pending levels on a live chart or visual testing. Not suitable for optimization mode.


⚙ Trading Options

This block controls the technical execution of orders: Magic number, slippage, filling mode, comments and price rounding.

Setting Practical Meaning
Magic Magic number used to identify positions opened by this EA.
Slippage Maximum allowed price deviation in points when opening or closing positions.
MarketWatch For market execution accounts: opens the position first, then modifies SL/TP after successful opening.
CommentToOrder Additional order comment. Use short comments, ideally no longer than 12 characters.
RoundingDigits Rounds prices when opening or modifying orders. Useful for symbols with special price accuracy.
TypeFilling MT5 filling mode. If error 10030 TRADE_RETCODE_INVALID_FILL appears, set the correct mode: FillOrKill, ImmediateOrCancel or Return.


🛡 Stops Options: Stop Loss, Take Profit and Virtual Stops

The stops block controls Stop Loss, Take Profit, virtual levels and server minimum stop restrictions.

Setting Practical Meaning
VirtualStops Uses virtual Stop Loss, Take Profit and trailing levels instead of server-side levels.
SetMinStops Automatically adjusts stop parameters to broker minimum stop levels when possible.
StopLoss Stop Loss for each opened position in points.
TakeProfit Take Profit for each opened position in points.
ForcedModifySLTP Forces SL/TP modification if the position was opened but levels were not installed correctly.
TimeToCheckAverageSpread Time window used to calculate average spread for spread-based stop values.
AutoCheckLowSpread Automatically detects very low spread conditions and protects spread-based calculations.

Spread-Based Parameters

Some settings can be calculated from the average spread if you use a negative value.

Example:

  • StopLoss = 2000 means fixed Stop Loss of 2000 points.
  • StopLoss = -100 means Stop Loss = 100 × average spread.

This logic can be useful for symbols where spread changes frequently.

Virtual stops warning: virtual levels work only while the terminal and EA are running. If the terminal is closed, virtual Stop Loss and Take Profit cannot protect the position.


📊 Lots Options: Fixed Lot, Autolot and Martingale

The lots block controls position volume and risk model.

Setting Practical Meaning
Lots Fixed lot for opening positions.
AdditionalLots Additional lot added to each new signal position when multiple signal positions are allowed.
CoeficienteLots Lot coefficient used to multiply each new signal position.
DynamicLot Enables automatic lot calculation using balance, free margin and risk parameters.
LotBalancePercent Risk percent used in autolot calculation.
RiskRate Currency conversion rate for correct autolot calculation. Market Watch should show all required symbols.
MaxLot Maximum lot allowed for autolot and martingale calculations.
Martin Lot multiplier after a losing trade. Martin = 1 disables martingale. Martin = 2 doubles lot after loss.


Risk warning: martingale and lot multiplication can increase drawdown very quickly. Use MaxLot and realistic risk limits before enabling aggressive lot logic.


🔁 Averaging Options

Averaging opens additional positions when the first position goes into drawdown.

This can move the average price closer to the current market, but it also increases exposure and risk.

Setting Practical Meaning
AverageUSE Enables averaging positions against price movement.
TakeProfitALL Total Take Profit from the average price of all positions in the same direction.
Distance Distance from the last position for opening the next averaging position.
DistanceMartin Multiplier for increasing the distance between averaging positions.
LotsMartin Lot multiplier for each new averaging position.
LotAdditional Additional lot added to averaging positions.
MaxOrdersOpen Maximum number of averaging positions.
CloseFirstAfterMaxAverage Closes the oldest averaging position when the maximum number is reached and a new one must be opened.
Averaging Filter Additional indicator filter used to allow or block new averaging positions.


📈 Additional Opening by Trend

Additional Opening is the opposite idea of averaging.

Instead of opening more positions when the market moves against the first trade, this block adds positions when the trade moves into profit. It is used for trend continuation and pyramiding logic.

Setting Practical Meaning
AdditionalOpening Enables additional positions in the direction of profitable movement.
StopLossALL Total Stop Loss from the average price of all additional positions.
DistanceAdditionalOpening Distance from the last position before opening the next trend-addition position.
LotsMartinAdditionalOpening Lot multiplier for additional positions by trend.
LotAdditionalOpening Additional lot added to each trend-addition position.
MaxOrdersOpenAdditionalOpening Maximum number of additional positions by trend.
CloseFirstAfterMaxAdd Closes the oldest additional position when the maximum number is reached and a new one must be opened.
Additional Filter Indicator filter used to allow or block additional openings by trend.


🕒 Time Trade Options

The time block controls when the EA may open new trades and when it should stop trading or close positions.

Setting Practical Meaning
TradeStartStopbyTime Enables trading only during selected hours.
SeveralTimeWork Allows several trading time sessions in the format HH:MM-HH:MM.
OpenHour / OpenMinute Start time for trading during the day.
CloseHour / CloseMinute End time for trading during the day.
ClosePeriod_Minute Defines trading duration from start time in minutes.
CloseAllTradesByOutOfTime Can close positions and/or pending orders when trading time ends.
TradeByDays Allows trading only on selected weekdays.
TradeStartbyTimeMonday Controls when the EA starts trading on Monday.
TradeStartStopbyTimeFriday Controls Friday trading schedule.
CloseFriday Closes all open trades and orders on Friday at selected time.


🟢 Breakeven Without Loss

The breakeven block moves Stop Loss into a profitable or break-even area after the position moves in your favor.

Setting Practical Meaning
MovingInWLUSE Enables breakeven logic for open positions.
LevelWLoss Profit level where Stop Loss will be placed after breakeven activation.
LevelProfit Required profit distance before breakeven modification starts.
Include_Commission_Swap Includes negative swap and commission in breakeven / trailing calculations.


Example: if commission and spread create extra costs, set LevelWLoss higher than zero so breakeven covers trading costs instead of closing at a small loss.


📉 Standard Trailing Stop and Parabolic SAR Trailing

Trailing stop modifies Stop Loss as the position moves into profit.

The xCustomEA includes both standard trailing stop and Parabolic SAR trailing stop.

Setting Practical Meaning
TrailingStopUSE Enables standard trailing stop.
IfProfTrail If true, trailing starts only after breakeven plus trailing distance. If false, it can start when the trade becomes profitable.
TrailingStop Trailing distance in points.
TrailingStep Minimum step for the next Stop Loss modification.
SaveTPafterTrailingStop Controls whether Take Profit remains after trailing stop modifies Stop Loss.
TrailingStopSAR Enables trailing stop based on Parabolic SAR indicator points.
TrailingStopSAR_TimeFrame Timeframe used for Parabolic SAR trailing calculation.


💰 Close All by Total Profit or Loss

This block can close all positions when total profit or total loss reaches a selected value.

Setting Practical Meaning
TypeofClose Type of total profit/loss calculation: money, points, balance percent or equity percent.
SeparateBuySell Calculates BUY and SELL totals separately.
CloseProfit / prifitessss Closes positions when total profit reaches selected value.
CloseLoss / lossss Closes positions when total loss reaches selected value.
TrailOptions Uses profit trailing after total profit reaches the selected value.
ForcedClose Forces closure after total profit or loss condition is reached.
OFFAfterClosePROF / OFFAfterCloseLOSS Disables the EA after closing by total profit or total loss.
CloseTerminalAfterClosePROF / LOSS Can close the terminal after closing by total profit or loss.


🚧 Limiting Losses and Profits

The limits block controls profit and loss for a selected period: day, week, month or custom period after the last limit close.

Setting Practical Meaning
LimitFor Limit period: day, week, month or NOTIME.
LimitForProfits Profit limit for the selected period.
LimitForLosses Loss limit for the selected period.
LimitType Limit type: money, points or balance percent.
ClosebyLIMITING Closes EA positions when the limit is exceeded.
UseCurrentProfit Includes current floating profit/loss in limit calculation.


📉 Drawdown Control

The drawdown block is designed to protect the account when risk becomes too high.

It can disable new signals, disable averaging, close profitable or losing positions, close all positions or show a warning depending on selected drawdown levels.

Setting Practical Meaning
DrawDown_Level Enables drawdown control block.
Type_DrawDownHR Defines how drawdown is calculated from history and current positions.
DrawDown_Level_One First drawdown level in percent.
Type_Deal_Level_One Action after first drawdown level: disable new deals, disable averaging, show message, etc.
DrawDown_Level_Two Second drawdown level in percent.
Type_Deal_Level_Two Action after second drawdown level: close profit positions, close loss positions, close all, or show message.


Example: DrawDown_Level_One = 50 can disable new signals, while DrawDown_Level_Two = 90 can close all positions. Use this carefully and test before live trading.


🧪 Tester and Optimization Tools

The xCustomEA includes advanced tester tools for users who optimize strategies seriously.

Setting Practical Meaning
OnTester_Custom_max Custom formula for genetic optimization criterion.
OnTester_Min_Trades Minimum number of trades required for optimization result to be accepted.
OnTester_Min_Profit Minimum profit required for optimization result.
OnTester_Min_ProfitFactor Minimum profit factor required for optimization result.
OnTester_Max_Balance_DD / Equity_DD Maximum allowed drawdown for optimization result.
Withdrawal Virtual withdrawal simulation in Strategy Tester.
Withdrawal_mode / amount / periodicity Controls withdrawal type, size and frequency during testing.

Custom Optimization Formula Example

STAT_PROFIT * STAT_TRADES / STAT_EQUITY_DD

This kind of formula can help optimize not only by profit, but also by trade count and drawdown relationship.


🛠 Recommended Setup Order

Because xCustomEA is very flexible, the best approach is to configure it step by step.

Step Action
1 Install your custom indicator into the MetaTrader Indicators folder.
2 Find BUY and SELL buffer numbers.
3 Configure SignalNameIndicator and SignalTypeIndicator.
4 Test only the main signal first.
5 Add filters only after the main signal works correctly.
6 Configure Stop Loss, Take Profit and trade direction.
7 Add breakeven and trailing stop if needed.
8 Enable autolot only after fixed-lot testing is stable.
9 Use averaging or trend additions only after you understand drawdown behavior.
10 Forward test on demo or small real account before using serious risk.


📌 Practical Recommendations

  • Do not enable all modules at once.
  • First prove that your indicator buffers are configured correctly.
  • Use Visual Mode in Strategy Tester to check where signals appear.
  • Use fixed lot before enabling DynamicLot or martingale.
  • Use closed-bar signals for more stable testing if your indicator repaints on the current bar.
  • Do not trust an indicator only because it draws good arrows on history.
  • Check whether the indicator repaints before using it on a live account.
  • Use filters only when they improve logic, not just because they exist.
  • Always check spread, stop level, lot step and broker execution.
  • Use drawdown limits if you enable averaging, martingale or additional openings.


❓ Practical FAQ

Can xCustomEA work with any custom indicator?

It can work with custom indicators that provide readable signal data, usually through buffers, arrow buffers or values that the EA can interpret.

Do I need programming knowledge?

Basic use with arrow buffers may not require programming. But for advanced custom logic, understanding indicator buffers and MQL structure is very useful.

Can I test an indicator before buying it?

In many cases, you can test Market indicators in Strategy Tester first. The practical idea is to test the indicator logic before buying and using it on a live account.

Why does the EA not open trades?

Common reasons: wrong indicator name, wrong buffer numbers, no signal on the selected bar, filter blocks the signal, spread filter blocks trading, AutoTrading is disabled, or the custom indicator does not provide readable buffer values.

What is the difference between signal and filter?

A signal creates the trading idea. A filter confirms or blocks that idea. For example, an arrow indicator can give the entry signal, while a trend indicator can allow only trades in the main trend direction.

Can xCustomEA trade standard indicators too?

Yes, it includes standard strategy logic from The X framework, but its main value is custom indicator automation.


⚠ Risk Warning

Trading Forex and CFDs involves risk. The xCustomEA is a powerful automation framework, but it does not make an indicator profitable by itself. Results depend on the indicator logic, buffer correctness, repainting behavior, broker conditions, spread, slippage, lot size, stop settings, optimization quality and risk management. Averaging, martingale, virtual stops and dynamic lot can increase risk. Always test carefully before live trading.


🏁 Final Thoughts

The xCustomEA is one of the most flexible tools for traders who want to automate custom indicators in MetaTrader.

It can read custom indicator signals, use filters, open market or pending orders, manage Stop Loss and Take Profit, apply trailing stop and breakeven, use autolot, control time sessions, manage total profit/loss, apply drawdown protection and simulate advanced testing scenarios.

The most important part is not to configure everything at once. Start with the signal, verify buffers, test the logic, then add protection and management blocks one by one.

🚀 Build Your Own Custom Indicator Strategy

Download the demo, connect your indicator, configure signal buffers, test the strategy in Visual Mode and use The xCustomEA as a professional bridge between your custom indicator and automated MetaTrader trading.

📘 Full Instruction ⚙ Settings Documentation
💎 Buy The xCustomEA MT5 💎 Buy The xCustomEA MT4
⬇ Download DEMO + PDF 🛒 All Expforex Products



SEO Tags

The xCustomEA, Exp The xCustomEA, xCustomEA settings, MetaTrader custom indicator Expert Advisor, iCustom Expert Advisor, MT4 iCustom EA, MT5 iCustom EA, custom indicator trading robot, custom indicator automation, arrow indicator Expert Advisor, buffer indicator EA, MetaTrader signal buffers, xArrow, xCustomEA signal settings, xCustomEA filter settings, custom indicator filters, Forex strategy builder, Expert Advisor for custom indicators, automate custom indicator, MQL5 Market indicator EA, PipFinite Trend Pro EA, MetaTrader trading automation, EA with trailing stop, EA with breakeven, EA with autolot, EA with averaging, EA with martingale, EA with drawdown protection, virtual stops EA, Expforex xCustomEA, MQL5 Market Expert Advisor