===========================================================================================================
The X universal automatic Expert Advisor for MetaTrader working on standard indicators.
THE XCUSTOMEA universal trading adviser on custom indicators for MetaTrader
Buy The xCustomEA for MetaTrader 5
Buy The xCustomEA for MetaTrader 4
Download The xCustomEA DEMO+ PDF
Additional and Complete information on our xCustomEA program on the website www.expforex.com
Signal options Additional signal processing unit | |
Show_alert_without_opening_positions | If this option is enabled, the Expert Advisor will not open a new position on the signal, but only notify the user that a new signal has appeared. In this case, all other functions will work in normal mode. But the EA does not make this deal and does not open the position, but only alerts the user about the signal. |
OpenBarControlOnly | The work of an advisor is only in open bars. This mode allows you to simulate the work of the Advisor on opening a bar (as in the strategy tester). |
ControlNewBarforSIGNAL | check the indicator signal only each new bar (without checking on each tick),
Attention: When off, the EA checks signals every new tick! There may be delays in tapping and optimization! |
ControlNewBarforOpenbySignal: | ControlNewBarforOpenbySignal = true: Old mode! Open positions on a signal only every new current bar of the current TimeFrame! The EA opens positions, if there is a signal, only when a new bar of the current TimeFrame arrives! ControlNewBarforOpenbySignal = false: New mode! Open positions on a signal every new bar from the signal Timeframe! The EA opens positions, if there is a signal, immediately upon detection of a signal. This mode is useful for those who use TF_IndSigToTrade1, FILTER_TF_IndSigToTrade1, FILTER_TF_IndSigToTrade2, other than Current. |
ReverseSignal | Flipping the overall strategy signal received from the Main Indicator + filters! |
Opening Filter options Item opening filters | |
TypeTradeBUYSELL | the direction of trade:
|
MinuteToOpenNextPosition | Permission to open the next signal after the last open position if there are no open positions, the adviser considers the time from the last closed position. Time is considered to be of the same type. If the BUY signal is then read from the last open/closed BUY... the number of minutes to open the next deal on the signals of indicators. It allows you to filter deals when using ONlyOnePosbySignal = false. |
DistanceToOpenNextPosition | Minimum Distance to open the next position on the main signal (If ONlyOnePosbySignal = false is set and OnePosPerDirection=false). If DistanceToOpenNextPosition is > 0, then the next position can be opened only when the previous position on the signal has passed DistanceToOpenNextPosition of profit points! If DistanceToOpenNextPosition is < 0, then the next position can be opened only when the previous position on the signal is at a distance DistanceToOpenNextPosition points in both sides of the profit or loss! |
OpenOppositePositionAfterStoploss | open the opposite position when closing the current stoploss. Opens the opposite position immediately after receiving the stoploss of the previous deal without using indicator signals. |
ONlyOnePosbySignal | Trade only 1 current main position in one direction. If the Expert Advisor opens the SELL position, then all other signals on the SELL will be ignored |
OnePosPerDirection | Opening of 1 deal on 1 direction e.g.: if OnePosPerDirection = true and ONlyOnePosbySignal = false then the advisor can open 1 Buy deal on a signal and 1 Sell deal on a signal if OnePosPerDirection = false and ONlyOnePosbySignal = true then the advisor can only open one deal at a signal, either Buy or CELL if OnePosPerDirection = false and ONlyOnePosbySignal = false then the advisor can open any deals for each indicator signal |
OnlyOnePositionPerMagic | Opening of 1 position on 1 magic, The advisor checks whether there are open positions for this magic number in other currency pairs. If there is no position, the advisor will open the deal at the signal, and the remaining advisors will wait for the completion of this deal. If OnePosPerDirection = false, then OnlyOnePositionPerMagic = true works like this: 1 position by magic number is allowed; If OnePosPerDirection = true, then OnlyOnePositionPerMagic = true works as follows: 1 position of each direction is allowed by magic number; |
OnlyAlternateSignals | Allows you to open positions only one by one. If the last closed position was SELL, the next could be opened only BUY! It is necessary to trade the main indicator in No Signal mode |
MAX_BUY_POSITION | limit of the maximum number of BUY deals. The positions opened by signals of indicators are taken into account. The averaging and refilling positions are not taken into account |
MAX_SELL_POSITION | limit of the maximum number of SELL deals. The positions opened by signals of indicators are taken into account. The averaging and refilling positions are not taken into account |
MaxSpreadToNotTrade | The maximum spread at which the advisor can open a position If the current spread at the time of receiving the signal is greater than the specified value, the indicator signal is ignored until the spread is less than the specified value. |
MinSpreadToNotTrade | Minimum spread, in which the advisor can open a position Warning: This filter is for Positions. For pending orders, this filter does not matter. Therefore, the filter works only when you use the Positions. |
Include_Commission_Swap | Take into account the author`s calculation of the commission and the swap when the functions are turned on: Undisturbed (stoploss on the break-even point), Trailingstop, Averaging. The author`s calculation of the commission is based on the formula for calculating the value of 1 point from the open positions for this symbol and the magic, A negative swap and commission participate in the calculation. The function returns the cost of a negative swap and commission in points and takes this into account when working with the Break-even functions (stoploss on the break-even point) and trailing stop. Attention: If you have a floating spread on your broker, the settlement of the commission is executed and set at the moment of the operation of the Break-even functions (stoploss on the break-even point) and trailing stop, but the spread may increase, which will incur additional loss points. This is not a calculation error! Also, it is worth considering that when a swap occurs, the advisor recounts the line Break-even (stoploss on the breakeven point) and establishes new stops if the server allows it. (Restriction to the minimum stop level for your StopLevel broker). If the server does not allow to set a breakeven and returns a minimum stop level error, the EA will not be able to modify the position, and you can receive additional loss points. To avoid receiving a loss when using a commission with a commission and when receiving a negative swap, we recommend that you increase the distance Break-even (stoploss on a breakeven point) or trailing stop. The level of Break-even ( stoploss on the breakeven point) ( LevelWLoss ) can be calculated independently, given the commission. For example Commission for opening and closing a position = 2 dollars (EURUSD) per 1 lot. So, in order to cover the loss on the commission, you need to set LevelWLoss = 2 (points) +1 (control) = 3 points. Thus: the advisor will install a break-even (stop loss at the breakeven point) by +3 points, which in turn will cover the loss on the commission. |
Close options Block of functions for closing positions! | |
ClosePosifChange | Closing the positions when the general indicator signal is reversed. The difference between ClosePosifChange and ClosePositionifChangeOWNSignal is that with ClosePosifChange - a signal change is considered for all filters + the main signal. And when ClosePositionifChangeOWNSignal - the signal change is found only on the main indicator. It also works for pending orders. |
ClosePosition_After_X_Minutes | Closing the position after the set number of minutes. Also, the Expert Advisor checks the included CloseChangeOnlyInProfit parameter: Closing only profitable positions. |
CloseChangeOnlyInProfit | Closing deals on a return signal, only when the current position is in profit. |
Pending orders options The block of work with pending and limit orders. | |
StopOrderUSE | Open pending orders or limit orders instead of positions. You can also enable Virtual pending orders:
Caution: Virtual pending orders Only works in Visualization mode or on real graphics, only when the terminal is switched on. It does not work in optimization mode! |
StopOrderDeltaifUSE | Number of points for a deferred or limit order (Distance of pending orders) |
StopOrderDayToExpiration | StopOrderDayToExpiration = number of days for the order expiration.
|
StopOrderBarToExpiration | The expiration of the pending order in the bars. If StopOrderBarToExpiration = 10 is specified, and TF = M1, then the Pending order will be removed after 10 minutes after installation. Attention: Each broker has its minimum time parameter for expiration. |
ReInstallStopOrdersNewSignalAppears | Reset pending orders if a new signal from the indicators appears. It allows you to take the current BUYSTOP pending order and install a new BUYSTOP at a new level then the indicators showed a new signal. |
Trading options Parameters for trading | |
Magic | The magic number of the positions opened by the advisor. |
Slippage | The level of maximum possible slippage in points when opening and closing positions. The price of opening a position when sending an order to the server = 1.12345 |
MarketWatch | It includes the ability to open positions with stop-loss / take-profit on an account with MARKET execution. The first opens the position, after the successful opening, the levels of StopLoss and TakeProfit are modified. |
CommentToOrder | Additional comments to the opened positions. Notice! For the EA to work correctly, set a comment no longer than 12 characters. eg: Right: ExpforexTheX Not Right: Expforex The X Set # 12345 |
RoundingDigits | The number of decimal places when a position or order is opened.
|
TypeFilling | The type of fill positions and orders.
|
Stops options Parameters of stop orders, StopLoss, TakeProfit | |
VirtualStops | The function of including virtual stoploss / TakeProfit \ trailing stop instead of real. Attention: Virtual stops do not have restrictions and server prohibitions. Therefore, they can be installed at the current price! Then there is an immediate closure. |
SetMinStops | Automatically normalize all parameters of the Expert Advisor to the minimum acceptable stop levels.
|
StopLoss | Stoploss of each position you open in points |
TakeProfit | Takeprofit of each open position in points |
ForcedModifySLTP | Forced modification of positions, established by the stoploss and takeprofit. This means that the advisor will forcibly modify the stop loss and take profit from all its positions. For example: If the broker`s server opened a trade, but did not return its ticket, then the expert will forcibly check all his positions, and if he finds out that the stop loss or take profit of the position is 0, the advisor will force the stoploss and takeprofit. |
TimeToCheckAverageSpread | The algorithm for the function is taken from our automated TickSniper scalper advisor. How to use: If the spread is 20 points, then stop loss at the time of opening will be 2000 points. The parameters available for setting in the spread mode: Distance, DistanceAdditionalOpening, StopOrderDeltaifUSE, StopLoss, TakeProfit,TrailingStop, TakeProfitALL, StopLossALL, LevelWLoss, LevelProfit. The average and current spread, as well as the level of the Auto Spread Low spread, will be displayed in our panel in the section Strategy Info. |
Lots options Parameters for working with lot | |
Lots | A fixed lot to open a position. |
AdditionalLots - An additional lot that will be added to each new deal based on a new signal | |
DynamicLot | A dynamic lot, Autolot for an open position. You are enabling dynamic lot calculation in percent of free margin and other factors. Calculation of our autolot. |
LotBalancePercent | Percent for autolot |
RiskRate | RiskRate - the rate of your currency against the dollar. By default, RiskRate = 0 - means that the Expert Advisor will try to find the correct rate in the Market Review. For Autolot to work adequately with all currency pairs, you need to include the "Show all currency pairs" in the Market Review. |
MaxLot | The maximum lot that an advisor can open when calculating an autolot and martingale for the first main position |
Martin | The standard multiplication of the lot of the last closed position at a loss. If Martin = 1, then the martingale does not turn on. If Martin = 0, then the Expert Advisor can not open the next position If Martin = 2, then the first lot = 0.1, the second lot = 0.2, and so on, 0.4 - 0.8 - 1.6 If Martin = 0.5, then the first lot = 1, the second lot = 0.5, and so on, 0.25 - 0.125 |
Averager options The block of functions for averaging positions, opening positions against the trend | |
UseAverAdditionalOpeningOrderinOne | The number of orders is considered common for both topping and for the averager. Attention! Only for MT4 version |
AverageUSE | Turn on the averaging function. If the Main position is lost at a certain number of points, our adviser opens a position of the same type. Thus, averaging the first position. All the functions of the Expert Advisor (trailing stop, Break-even (Stop-loss on the breakeven point ...) will work already from the middle line of positions, which is calculated from all positions of the same type. For example: If the SELL position is opened with a price of 1,200, and the price goes up. Then, if the price is exceeded by 100 points (for example) 1.300 - the advisor opens another SELL position The average line from these two positions = 1.250 The trailing stop and all other functions will work from the middle line of these two positions. Attention: For different lots of positions, the average price is calculated by the mathematical formula. |
TakeProfitALL | The distance of the total takeprofit at the opening of the averaging deals. This option is useful only when you turn on AverageUSE. Sets the specified takeprofit from the current midline of all positions for ALL positions / deals Works only when the averaging position is opened |
Distance | Distance from the last open position of one type for averaging. The distance between the positions, the grid cell. |
DistanceMartin | the increase factor is the distance from the average for each subsequent deal. You can set 1.5. Then each new averaging position will be opened through 100 +50 (100*1.5) loss points from the last open position. (100,150,225,337,506) |
LotsMartin | Increase the lot for the grid positions. The coefficient of increase of each averaging position. |
LotAdditional | additional lot for averaging a position for an opening against the trend. |
MaxOrdersOpen | The maximum number of averaging positions. If the position grid is MaxOrdersOpen, then the following averaging positions are ignored. |
CloseFirstAfterMaxAverage | CloseFirstAfterMaxAverage - Close the first averaging deal (the very first of the currently open averaging deals),when the advisor has opened the maximum number of deals with the MaxOrdersOpen parameter. CloseFirstAfterMaxAverage = false MaxOrdersOpen = 5: CloseFirstAfterMaxAverage = true MaxOrdersOpen = 5: |
Averaging_FILTER_IndSigToTrade1 Averaging_FILTER_TF_IndSigToTrade1 Averaging_Filter1_Reverse | Signal filtering options for opening additional positions. The Expert Advisor checks the indications of the selected indicator (Filter) and allows or forbids the opening of new positions of an averaging or additional opening on a trend. The following options are available: Selection of the indicator for the filter, Timeframe, Reverse signals |
Additional opening Block of functions for the additional opening of positions on a trend | |
AdditionalOpening | Enabling the opening of additional deals. If the Main position goes into profit by a certain number of deals, our advisor opens a position of the same type. Thus, averaging the first position. This helps to top up with a lucrative signal. All the functions of the Expert Advisor (trailing stop, Break-even (the breakeven point) ...) will work from the middle line of positions, which is calculated from all positions of the same type. For example: If the SELL position is opened with a price of 1,200, and the price goes down. Then, if the price exceeds 100 points (for example) 1.100 - the advisor opens another SELL position The average line from these two positions = 1.150 The trailing stop and all other functions will work from the middle line of these two positions. Attention: For different lots of positions, the average price is calculated by the mathematical formula. |
StopLossALL | The distance of the general stoploss at the opening of additional deals. This option is useful only when you turn on AdditionalOpening. Sets the given stop-loss from the current midline of all positions for ALL positions Works only when the refresh position is opened |
DistanceAdditionalOpening | Distance from the last open position of one type. The distance between the positions, the grid cell. Then each new refill position will be opened after 100 points of profit from the last open position |
LotsMartinAdditionalOpening | Increase the lot for the grid positions. The coefficient of increase of each refill position. |
LotAdditionalOpening | additional lot for an additional position for an additional opening by trend. |
MaxOrdersOpenAdditionalOpening | The maximum number of refilling positions. If the grid positions are equal to MaxOrdersOpen, then the following refill positions are ignored |
CloseFirstAfterMaxAdd | CloseFirstAfterMaxAdd - Close the first additional opening deal along the trend (the very first of the current open deals),when the EA opened the maximum number of deals with the MaxOrdersOpenAdditionalOpening parameter. Same as CloseFirstAfterMaxAverage Paramter. |
Additional_FILTER_IndSigToTrade1 Additional_FILTER_TF_IndSigToTrade1 Additional_Filter1_Reverse | Signal filtering options for opening additional positions. The Expert Advisor checks the indications of the selected indicator (Filter) and allows or forbids the opening of new positions of an averaging or additional opening on a trend. The following options are available: Selection of the indicator for the filter, Timeframe, Reverse signals |
Time Trade options The block of work with the time of trade, the time limit. | |
TradeStartStopbyTime | The function of work on time.
|
SeveralTimeWork | You can also specify several time slots for trading in the SeveralTimeWork parameter. Recording format: HH: MM-HH: MM; where: Start trading hour: Minute start trading - Part stop trading: Minute of stop trading. |
OpenHour OpenMinute | The Expert Advisor checks the trading time according to the parameters: OpenHour: OpenMinute - the beginning of the trade and CloseHour: CloseMinute - the end of the trade for 1 day. For example: OpenHour = 5 and OpenMinute = 0, and also CloseHour = 18 and CloseMinute = 59, then the EA will trade every day from 5:00 to 18:59. |
ClosePeriod_Minute | If you want to specify the trading period from the start time, you can set the parameter ClosePeriod_Minute - the period in minutes. For example, OpenHour = 6 and OpenMinute = 0 and ClosePeriod_Minute = 180, then the advisor sets the trading time from 6:00 to 9:00 (6 + 180 minutes = 9 hours). |
CloseAllTradesByOutOfTime | Also you can close all open trades and pending orders during non-business hours, CloseAllTradesByOutOfTime = true.
|
TradeByDays | In our block of work on time YOU can specify Trading days for trade: TradeByDays For example, TradeByDays = true Days = 1,2,3 - in this case, the advisor will trade only on Monday, Tuesday, and Wednesday according to the time set above. Or trade around the clock for these 3 days, if time is not set. If YOU specified Days = 1,2,3,4,5 but the parameter TradeStartStopbyTimeFriday = false, the Expert Advisor will not trade on Friday. |
DayForOptimization | Also, you can set 1 day for optimization in the parameter DayForOptimization. This option is useful to determine which days on the optimization were the most profitable. For example, DayForOptimization = 3, then the EA will only trade on Wednesdays. |
TradeStartbyTimeMonday | The Expert Advisor starts working on Monday, if set by TradeStartbyTimeMonday = true by the time OpenHourMonday: OpenMinuteMonday For example, OpenHourMonday = 3 and OpenMinuteMonday = 40, then the EA starts trading on Monday at 03:40 on server time (the time of your broker, as indicated in the market review). |
TradeStartStopbyTimeFriday | TradeStartStopbyTimeFriday - Trading time for Friday. In our advisor, YOU can set the time for a trading advisor on Friday. Time options for Friday: OpenHourFriday: OpenMinuteFriday - CloseHourFriday: CloseMinuteFriday For example, you need the advisor not to open new deals on Friday after 18:00, then YOU establish: OpenHourFriday = 0: OpenMinuteFriday = 0 - CloseHourFriday = 18: CloseMinuteFriday = 0 In this case, the advisor will not open new deals after 18:00 |
CloseFriday | Also you can close all open trades and pending orders on Friday at the set time of 18:00, CloseFriday = true. |
BreakEven WithoutLOSS options Block of work with breakeven (Set stoploss to break-even at a specific moment) | |
MovingInWLUSE | Enable the Undisturbed function (stop loss at the breakeven point) to open positions. Attention: If the averaging or refilling function is enabled, when the 2 or more positions are opened, the Expert Advisor turns on the Break-Even function (stoploss on the break-even point) from the middle line, and not from the opening price of positions |
LevelWLoss | The level of profit in points on which the Stop Loss is set when this function is enabled. Distance from the opening price to the profitable stoploss 1 = 1 point of profit 0 = Automatic minimum profit mode. The number of points of profit for the Break-even (stoploss on the breakeven point) = Spread of the current currency pair. |
LevelProfit | The number of profit points gained by the position for setting a stoploss in the LevelWLoss of profit points |
Standard Trailing options Standard trailing stop (Escorting positions, by modifying Stoploss into profit!) | |
TrailingStopUSE | Enabling the standard trailing stop function. Note: If the averaging or refilling function is enabled, if you open 2 or more positions, the Expert Advisor turns on the trailing stop function from the middle line, and not from the open position price |
IfProfTrail |
In other words: IfProfTrail = false, then the trailing stop starts working immediately after the position is in profit |
TrailingStop | Distance trailing stop in points |
TrailingStep | Step of stop loss at a trailing point in points |
SaveTPafterTrailingStop | When enabled, the takeprofit of the modified positions will remain in place. For example: SaveTPafterTrailingStop = false: When executing a trailing stop, the takeprofit of the modified position will be deleted; SaveTPafterTrailingStop = true: When the trailing stop is executed, the takeprofit of the modified position will be saved. |
TrailingStop by SAR Parabolic Trailer Stop block (installing and modifying stoploss on the Parabolic SAR indicator points) | |
TrailingStopSAR | Enable trailing stop function on the Parabolic SAR indicator. Attention, if the indicator is at a loss for the position, the advisor waits until the parabolic point is in profit for the position. If we have 2 or more positions of the average, then the Break-even (stoploss on the breakeven point) is considered from the mid-line of the aggregate positions. |
TrailingStopSAR_TimeFrame | Timeframe for indicator |
maximum | Indicator settings |
CloseALL when Profit or LOSS options Block of closing on the total profit or loss | |
TypeofClose | Closing on the total profit or loss,
The block allows you to close all positions on this symbol if the total profit or loss of all positions is equal to the set value. |
SeparateBuySell | Separate calculation and closing of positions in two different directions, BUY and SELL. This function separately closes two directions for total profit or loss. Actual, If ONlyOnePosbySignal = false and OnePosPerDirection = false. Or any settings that allow you to open more than one direction and more than one position in the direction. |
CloseProfit | Close positions with a total profit.
|
prifitessss | The number of units (dollars (deposit currency), points, percent) for closing. If the total profit on the positions of the currency pair is greater than or equal to the value of prifitessss, then all positions will be closed. |
CloseLoss | Close positions at a common loss.
|
lossss | The number of units (dollars (deposit currency), points, percent) for closing. |
TrailOptions | Include trailing the total profit when exceeding prifitessss units. This option means the distance from the prifitessss parameter to include profit trailing. For example prifitessss = $ 100 (deposit currency) TrailOptions = $ 10 then, when the position gains a profit of $ 100, the adviser will not close these positions, but will establish a profit level of $ 90. Further, if the profit increases by 1 dollar and becomes 101 dollars, the profit level will be fixed at 91 dollars. If the profit goes down and reaches 91 dollars - all positions will close at this level. |
TrailOptionsStep | The step of increasing the fixed profit level |
BalanceStart | The starting balance, from which the percentage of the balance will be calculated. If 0 =, then the current account balance is set. |
ForcedClose | Forced closure of all positions after receiving a total profit or loss |
MailSend | Send mail when closing |
Orderdelete | Delete pending orders when closing positions |
OFFAfterClosePROF | Disable the advisor after closing on the total profit |
OFFAfterCloseLOSS | Disconnect the Expert Advisor after closing for a total loss |
CloseTerminalAfterClosePROF | Closing the terminal after closing on the total profit |
CloseTerminalAfterCloseLOSS | Close the terminal after closing for a total loss |
Limiting losses and profits Limitation of losses and profits for a certain period | |
LimitFor | Limit loss and profit for 1 day \ Week \ Month In the Limiting losses and profits block, a new type NOTIME was added to the LimitFor parameter, when using this type, the adviser checks the |
DrawDown options The block for controlling the opening of positions in the drawdown | |
DrawDown_Level | DrawDown_Level - turn on the drawdown control block Type_DrawDownHR - the type of drawdown calculation based on deals in history and current deals DrawDown_Level_One - the first level of drawdown in percent double Type_Deal_Level_One - action when passing the first level of drawdown (disable new signals \ disable averaging of deals or additional opening \ disconnect all deals \ display message) DrawDown_Level_Two - the second level of drawdown in percent double Type_Deal_Level_Two - action when passing the second level of drawdown (close all profitable positions \ close all loss-making positions \ close all \ display message) For example: DrawDown_Level = true, DrawDown_Level_One = 50, Type_Deal_Level_One = No_NewDeal, DrawDown_Level_Two = 90, Type_Deal_Level_Two = Close_All. With these settings, as soon as the current drawdown of deals in history and current deals exceeds the level of 50% of the current deposit, EA can not open new deals on new signals. At the same time, the averaging functions will work. When the drawdown exceeds 90%, EA immediately closes all deals. |
Withdrawal Virtual withdrawal tool in strategy tester for simulating the work with a deposit | |
OnTester_Custom_max | In the Tester block, the variable OnTester_Custom_max is added, in which you can write down your criterion of genetic For example :
It is mandatory to specify the names of variables, as in the reference book! |
You can set the minimum values at which the optimization will take into account the result during genetic enumeration! In other words: You can set a condition: "the minimum number of deals" (or other parameters), If during selection the advisor opens fewer deals than specified in the settings, then this run of the optimizer will not be counted as a result! --Attention! For advanced users only.
| |
Withdrawal | Added a virtual withdrawal of funds in the tester: Withdrawal - Enable virtual withdrawal of funds when testing in the strategy tester; Withdrawal_mode - withdrawal mode, in the deposit currency, as a percentage of the current balance (currency/percentage); Withdrawal_amount - Number of withdrawal tools; Withdrawal_periodicity_days - Frequency of withdrawal in days; Withdrawal_Max - Maximum withdrawal amount; Withdrawal_EndOfTest - Withdrawal after the end of testing; |