The X - Universal EA

The X - Universal EA

13 September 2016, 17:15
Vladislav Andruschenko
2
1 354

Type : Universal Advisor

Grade : Automatic trading robot with integrated strategies

Terminals : MT4 and MT5

Features :

This Expert Advisor includes all the useful functions that have been used in all the Expert Advisors including the function of averaging.

Uses signals from 11 standard indicators included in MetaTrader 4 package.

The function of averaging allows bringing an unprofitable position to profit by creating a grid of positions in the price movement direction. If the price moves against a position, the averager will open additional positions on the basis of your settings, thus it increases the volume and sets a common take profit for all positions by the given symbol.

The martingale function allows using the standard martingale mode.

Trailing stop, break even, trading time, auto lot, closing by total profit/loss. All these function are available in the full version of the Expert Advisor.


References :

Demo MT4      Demo MT5

MT4 FULL        FULL MT5

Discussion

Official page


I want to remind you that you have the opportunity to purchase the open code of our advisor without any restrictions.

After purchasing my product, you can customize it for your strategy, hide unnecessary settings, change the name and sell in the market as your expert.

open source The X MT5: http://www.expforex.com/shop/194/desc/exp-the-x-ea-full-function-opensource

open source The X MT4: http://www.expforex.com/shop/209/desc/exp4-the-x-full-universal-ea-for-mt4-otkrytyj-kod


 


Preferences


SETTING SALES STRATEGIES

  • TypeFilling - fill orders for Type regalmentu broker. Auto - auto-detect the type of fill, fill type orders under the rules of your broker

  • TypeTradeBUYSELL - Select the type of position to open (BUYSELL, OnlyBuy, OnlySell);

  • RoundingDigits - Rounding opening price and stop loss, take profit - for certain characters;

  • SetMinStops - Automatic reduction of the established stops (stop loss, take profit, treylingstop, distance, breakeven) to the lowest possible level on the server;

  • The shift - With a bar to take a 0 - 1 at the current - with closed;

  • IndSigToTrade - Select the type of signal;

  • TF_IndSigToTrade1 - Selecting a timeframe for the signal;

  • The FILTER _ IndSigToTrade2 - Select the type of signal to filter;

  • The TF _ IndSigToTrade2 - Selecting a timeframe for the filter;

  • The FILTER _ IndSigToTrade3 - Select the type of signal to filter;

  • The TF _ IndSigToTrade3 - Selecting a timeframe for the filter;

  • ReverseSignal - to true - Inverting the signal strategy;

  • MinuteToOpenNextPosition - The number of minutes for the opening of the next transaction on the indicator signal.

    This parameter counts the number of minutes elapsed from the last open position. Allows

    filter transactions using ONlyOnePosbySignal = false

    OpenOppositePositionAfterStoploss - opening opposite positions at the close of the current postoplossu. It allows you to open an opposite position immediately after receiving stoploss predyduscheysdelki without using the indicator signals

    MAX_BUY_POSITION MAX_SELL_POSITION - Maximum number of transactions Buy and Sell


MAIN FEATURES OF TRADE

  • VirtualStops - Virtual foot instead of the real true - the broker can not be seen stoploss and take profit of transactions on all functions advisor !!!!;

  • StopOrderUSE - use pending orders;

  • StopOrderDeltaifUSE - distance for pending orders;

  • Game Magic - Magic number;

  • Of StopLoss - Stop-loss, 0 - not used;

  • TakeProfit of - Take Profit, 0 - not used;

  • Slippage - Slippage;

  • MarketWatch The - trade regime for MarketWatch true = first exhibited items / orders, without stops, then are modified - for some brokers;

  • ClosePosifChange - close the position at the opposite signal;

  • ONlyOnePosbySignal - Play alone or buy and / or a sell position 1;

  • OnePosPerDirection - Opening 1 transaction on the 1 line;

  • OnlyOnePositionPerMagic - Opening 1 position in 1 Magick;

  • MaxSpreadToNotTrade - maximum spread at which the advisor can open new transaction;

  • MinSpreadToNotTrade - Minimum spread, in which the advisor can open new transaction;

SETTINGS AND AVTOLOTA Martingale


  • Lots - Fixed lot;

  • DynamicLot - Dynamic Lot;

  • LotBalancePcnt -% of the deposit;

  • MaxLot - Maximum lot in the calculation;

  • By Martin - 1 If it is not used, martin factor to the next deal after losing money;

SETTING TIME WORK


  • - TradeStartStopbyTime- = on, off on it if:

  • OpenHourMonday - hour opening of trading on Monday;

  • OpenMinuteMonday - minute opening trading session on Monday;

  • OpenHour - opening hour of trading;

  • OpenMinute - minute opening;

  • CloseHour - Hour of the close of trading;

  • CloseMinute - Minute of the close of trading;

  • The Days - (Choice of trading days), separated by commas;

  • TradeStartStop - on, off;

  • TradeStartStopFriday - on, off (if on - then, according to Trade Friday and CloseFriday, if off then according TradeStartStopHour, if in 5 Days is if);

  • OpenHourFriday - hour opening of trading Friday;

  • OpenMinuteFriday - Minute of the opening of trading Friday;

  • CloseHourFriday - Hour of the close of trading Friday;

  • CloseMinuteFriday - Minute of the close of trading Friday;

  • CloseFriday - on, off (if on the closing regardless of status (profit or loss) (if off the open positions are closed according to the algorithm);


TREYLINGSTOP


  • TrailingStopUSE - Use treylingstop;

  • IfProfTrail - Use only of profitable positions - bezubytka mode;

  • TrailingStop - Distance trailing = 0 - the minimum allowed;

  • TrailingStep - Step distance;


TREYLINGSTOP FOR PARABOLIC


  • TrailingStopSAR - Use treylingstop;

  • Step - increment of the stop level, usually 0.02;

  • Maximum - maximum stop level, usually 0.2;


CLOSING OF THE GENERAL profit and loss account


  • TypeofClose - type of closing for profit;

  • CloseProfit - Close if +;

  • Prifitessss - Number of units (depending on TypeofClose choice) to close the profit;

  • CloseLoss - if close -;

  • Lossss - Number of units (depending on the choice of TypeofClose) to cover losses;

SETTINGS bezubytka


  • MovingInWLUSE - Transferring the position to breakeven;

  • LevelWLoss - We transfer stoploss at + LevelWLoss points;

  • LevelProfit - When the deal went into LevelProfit plus points;


Averaging


  • UseAverDolivkaOrderinOne - to true number of orders is considered common and topping up and equalization;

  • AverageUSE - Use averaging the opening of additional orders against the trend;

  • The Distance - Distance net open positions;

  • LotsMartin - Increasing the bid for a grid position;

  • MaxOrdersOpen - Maximum number of elbows 0 - unlimited;


REFILLING the trend


  • Dolivka - Use the discovery of additional orders with the trend;

  • DistanceDolivka - distance open positions Net topping the trend;

  • LotsMartinDolivka - Increasing the bid for a grid position;

  • MaxOrdersOpenDolivka - Maximum number of elbows 0 - unlimited;




Limiting losses and profit for 1 day \ week \ Month


  • Limiting LimitFor - Restriction type day \ week \ month

  • LimitForLosses - for profit limit

  • LimitForProfits - at a loss limit


 

The list of indicators and filters

Expert Settings IndSigToTrade..FILTER_IndSigToTrade2, FILTER_IndSigToTrade3.


Moving Average (MA) (Signal 1)


The signal is calculated by the relative position of two moving averages, one of which should have a shorter period (fast MA), and the other, respectively, larger (slow MA). These parameters can be specified in the variables.


BUY signal is issued when the fast MA is above the slow and SELL signal when slow up fast. The state "no signal" is not used.


Moving Average Convergence / Divergence (MACD) (Signal 2)


It operates on four variables. Signals are also simple: BUY - the main line above the signal, SELL - the main line below the signal. "No signal" is used.


Stochastic Oscillator (signal 3)


The oscillator consists of two lines - the main and the signal.BUY signal - the main line above the LEVEL, SELL signal - the main line below the LEVEL.


The RSI (Signal 4)

Similar to CCI and DeMarker'u. Signals are output from the overbought zone (RSIHighLevel) and oversold (RSILowLevel). So rare BUY signals correspond to the intersection of the upper level from the top down, and signals SELL - the intersection of the lower layer from the bottom up. The main condition - "no signal". The period indicator can be set in RSIPeriod parameter and calculate the price - in RSIPrice parameter.


Commodity Channel Index (CCI) (Signal 5)


all three signals are also used, but the main condition is still "no signal". The rare occurrence of trading signals corresponds to the intersection of the upper level from top to bottom (BUY) and the intersection of the lower layer from the bottom up (SELL).The upper and lower levels are determined by the value of the external parameters and CCIHighLevel CCILowLevel. Period and price calculation of the indicator values ​​are determined and CCIPeriod CCIPrice.


Williams Percent Range (WPR) (signal 6)


It should be on a par with RSI, CCI and DeMarker. BUY signal - the intersection of the overbought level (WPRHighLevel) from top to bottom, SELL signal - the intersection of oversold (WPRLowLevel) level upwards. Everything else - the "no signal". Change the setting from the outside can only display period - WPRPeriod.


Bollinger Bands (Bollinger Bands) (signal 7)


There are all three types of signals: BUY - the closing price of the previous candle below the lower line, the SELL - the closing price of the previous candle above the top line, "no signal" - the closing price of the candle between the lines.


Indicator Envelopes (signal 8)


Since the appearance and nature of the indicator - the channel signals are similar to the signals in the channel during operation.The BUY - the closing price of the candle below the lower line, SELL - the closing price of the candle above the top line and "no signal" - the closing price between the lines.


Alligator (signal 9)


Also, for all lines use the same method of averaging (AlligatorMethod) and the calculation of the price (AlligatorPrice). A feature of the indicator is that all lines have a positive shift to the right. This allows you to safely read the value of the indicator on the current bar as they are already precisely formed and may not be changed.


BUY signal - lip line above the line of the teeth, and the teeth line up the jaw line, the SELL signal - line the lips below the tooth line and below the line of the teeth of the jaws. In all other cases there is no signal.


Moving Average of Oscillator (OsMA) (Signal 10)


The signals are considered to be a little bit different: BUY - the value of the histogram is above zero, SELL - the value of the histogram is below zero. The state "No Signal" is only in the rare cases when OsMA value will be zero.


Awesome Oscillator (AO) (Signal 11)


It does not options available to the user. One of the principles of work with indicators is to find the "saucers". "Saucer," Bill Williams calls the two increases the value of the bars in the positive area, between which there is a bar with a lower value.Accordingly, the "inverted saucer" - it reduces the value of two bars in the negative area, between which there is a bar with a large value. Thus, to identify the "saucers' require three last generated candles (code - four). BUY signal - "saucer", the SELL signal - "inverted saucer", "no signal" - all the other cases.

Parameters and description


IndSigToTrade Select an indicator and a signal to open the first and main position. 

More than 15 indicators and signals. 

No Signal 

When selected, the Expert Advisor ignores the main signal and trades on 

filters. 

When using the main indicator, the signal is generated as is! on the 

current bar.! 

This means that the signal for opening appears as a fact of the 

signal. If the signal is present and the filter is not allowed to open the position, 

then the signal is ignored. 

When using NoSignal, you can ignore the fact of making the 

main signal and work on filters. 

When using filters, the signal is the current position of the 

indicators. 

TF_IndSigToTrade1 Timeframe for 1 main indicator. You can select the Time Frame by which the indicator will receive signals. 

Period_Current - the current Timeframe

Signal_Reverse Flip the signals of this indicator. This option reverses the signals of the main indicator only. 

ClosePositionifChangeOWNSignal Enable / Disable the closing of positions by the main indicator's return signal, without the participation of other filters and other parameters

OWNSIGNAL_shift The bar number for the signal that the indicator will generate, 

1 = the last closed bar, the signals on that bar are considered complete. 

0 = Current open bar, signals on this bar are considered drawing. 

More about this parameter:  Detailed article on signal bars

FILTER_IndSigToTrade Select an indicator and signal to filter signals from the main indicator 

More than 15 indicators and filters. 

Warning: Some indicators and filters are not compatible with each other. Therefore, by including a filter, you can wait a long time to open positions! Be attentive and check your settings on the strategy tester

FILTER_TF_IndSigToTrade Timeframe for the filter. You can select the Time Frame by which the indicator will receive the filter signals. 

Period_Current - the current timeframe. 

For example: When using MA as the main signal with TF = M30, you can enable filtering on the older MA with TF = H4

Filter_Reverse Flip the signals of this filter. This option reverses the signals of only this filter. 

For example: The MA main indicator shows BUY but the older MA indicator shows SELL, when using this function we turn over the signals of the older MA and get the aggregate signal BUY 

FILTERSIGNAL_shift The bar number for the signal that the indicator will generate, 

1 = the last closed bar, the signals on that bar are considered complete. 

0 = Current open bar, signals on this bar are considered drawing. 

More about this parameter:  Detailed article on signal bars

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 the normal mode. 

Allows the user to open a position on their own if the advisor has issued a signal. 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 on open bars. This mode allows you to simulate the work of the Advisor on opening a bar (as in the strategy tester). 

When this mode is enabled, the Expert Advisor will trade exactly as in OpenPriceOnly testing mode. 

All! Advisor functions will be executed 1 !! times at the opening of a new bar (in Dependence on TF), including Modification, Trailingstop, Averaging, opening of signals, etc.

TypeTradeBUYSELL Direction of trade:  

Buy and Sell  

Only Buy  

Only Sell  

In this case: If you use pending orders and work only in 1 direction: every time a new signal is issued, the old pending order will be deleted and put up for a new price.

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 that time from the last open / closed BUY .... the  

number of minutes to open the next transaction on the signals of the indicators. 

Allows you to filter transactions when using ONlyOnePosbySignal = false. 

ReverseSignal Flipping the overall strategy signal received from the Main Indicator + filters!

OpenOppositePositionAfterStoploss open the opposite position when closing the current stop-loss. Opens the opposite position immediately after receiving the stop-loss of the previous transaction without using indicator signals. 

If the last position was closed by stop-loss, the adviser will immediately open the opposite position 

ONlyOnePosbySignal Trade only 1 current main position of one direction. 

If the Expert Advisor opens the SELL position, then all other signals on the SELL will be ignored

OnePosPerDirection Opening of 1 transaction for 1 direction  

for example:  

if OnePosPerDirection = true and ONlyOnePosbySignal = false  

then the EA can open 1 Bai transaction on signal and 1 

SELL transaction on signal  if OnePosPerDirection = false and ONlyOnePosbySignal = true  

then the EA can open only 1 transaction on signal or Bai or CELL  

if OnePosPerDirection = false and ONlyOnePosbySignal = false  

then the Expert Advisor can open any transactions for each indicator signal 

OnlyOnePositionPerMagic Opening of 1 position on 1 magician, the Expert  

Advisor checks whether there are open positions on this magic from other currency pairs. If there is no position, the advisor will open the transaction at the signal, and the remaining advisers will wait for the completion of this transaction. 

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 OnlyAlternateSignals  

Allows you to open positions only one at a time. 

If the last closed position was SELL, the next can open 

only BUY! 

It is necessary to trade the main indicator in No Signal mode

MAX_BUY_POSITION limit of the maximum number of BUY transactions. The positions opened by signals of indicators are taken into account. The averaging and refilling positions are not taken into account

MAX_SELL_POSITION the parameter for limiting the maximum number of SELL transactions. The positions opened by signals of indicators are taken into account. The averaging and refilling positions are not taken into account

MaxSpreadToNotTrade Maximum spread at which the Expert Advisor can open the 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 Minimal spread, at which the Expert Advisor can open the position.  

Warning: This filter is only used! to open positions by signal, averaging, refilling. All other functions work in the normal mode.

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 considered only on the main indicator. 

It also works for pending orders.

CloseChangeOnlyInProfit Closing deals on a return signal only when the current position is in profit. 

StopOrderUSE Open pending orders or limit orders instead of positions. 

Allows you to set a pending or limit order for the received signal at a distance StopOrderDeltaifUSE points. Thus, we recheck the signal for profitability. 

If the signal is opened in the right direction of price movement, then the pending order will work through StopOrderDeltaifUSE points. 

StopOrderDeltaifUSE Number of items for a deferred or limit order

StopOrderDayToExpiration StopOrderDayToExpiration = number of days for the order expiration. 

0 - ORDER_TIME_GTC The order will be in the queue until 

1 is removed.  - ORDER_TIME_DAY The order will be valid only during the current trading day.  

2 ... X - ORDER_TIME_SPECIFIED The order will remain valid until the expiration date.  

If the pending order does not work within the specified days , it is automatically deleted.

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 own 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.

Magic The magic number of the positions opened by the adviser. 

Slippage The level of maximum possible slippage in points when opening and closing positions. 


Example: 

Slippage = 1

Maximum deviation when opening a position = Opening price + -1 point. 

Slippage = 100

Maximum deviation when opening a position = Opening price + -100 point. 

For example: The price of opening a position when sending an order to the server = 1.12345 

But, if during the time of sending and opening a position the price has changed within 100 points, then the position will open with a slip in the range of 1.12245 - 1.12445 

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 comment to the opened positions. 

You can specify here an additional comment that will be added to the opened position to differentiate the settings for example. 

VirtualStops The function of including virtual stoploss / TakeProfit \ trailing stop instead of real. 

 Inclusion of virtual (invisible) levels stoploss \ takeprofit \ trailingstop \ breakeven  

Completely redesigned the algorithm of virtual stoploss \ takeprofit \ trailingstop \ breakeven. 

Now all virtual stops are displayed on the chart and are the key when closing positions on these levels. 

Data is written in the form of lines and global variables. 

Note : If you delete a stop line on the chart and global variables - Virtual closing on this line will not work. 

Attention : Check your experts and indicators to remove lines from the chart and global variables! 

Attention: Virtual levels are triggered at the current price, after which the closing occurs. 

During closing, there may be slippage in a couple of points! 

Attention МТ4: In optimization mode, the virtual stoploss / takeprofit does not work. 

Attention : When you enable VirtualStops, the testing speed is significantly lower. 

SetMinStops Automatically normalize all parameters of the Expert Advisor to the minimum acceptable stop levels. 

With virtual stops - this parameter has no effect. 

With AutoSetMinLevel, stop levels will be brought to the lowest possible levels allowed on the server; 

With ManualSet, the user will receive a message stating that the levels of stops in the Expert Advisor are less than the minimum and the Expert Advisor will stop trading.

StopLoss Stoploss of each position you open in points

TakeProfit Take-profit of each open position in points

Lots A fixed lot to open a position. 

DynamicLot Dynamic lot, Autolot for an open position. 

Enabling dynamic lot calculation in percent of free margin and other factors. 

Calculation of our autolot.

LotBalancePcnt 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. 

In order 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

UseAverAdditionalOpeningOrderinOne true The number of orders is considered common for both the top-up and the averager.

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, lossless ...) 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 adviser opens another SELL position. 

The middle 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 take-profit at the opening of the averaging transactions. 

This option is useful only when you turn on AverageUSE. 

Sets the specified take-profit from the current center line of all positions for ALL positions 

Only works 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. 

You can set 100 points, then each new averaging position will be opened after 100 points of loss from the last open position

DistanceMartin the increase factor is the distance from the average for each subsequent transaction. 

You can set 50 points, then each new averaging position will be opened through 100 +50 loss points from the last open position. (100,150,200,250,300)

LotsMartin Increase the lot for the grid positions. The coefficient of increase of each averaging position. 

For example: 

Starting lot of the main position = 0.1 

LotsMartin = 2, Then the

next lot of the opened averaging position will be 0.2, 0.4, 0.8 and so on. 

Attention: The middle line will be calculated using the formula using lots. 

Allows you to bring the break-even level (middle line) closer to the current price. 

But martingale can be dangerous to your account. Please, calculate this parameter so that your deposit will withstand such a load 

MaxOrdersOpen The maximum number of averaging positions. If the position grid is MaxOrdersOpen, then the following averaging items are ignored.

AdditionalOpening Enabling the opening of additional items. 

If the Main position goes into profit by a certain number of items, our adviser 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, lossless ...) 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 down. Then, if the price is exceeded by 100 points (for example) 1.100 - the adviser opens another SELL position. 

The middle 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 centerline of all positions to ALL positions. 

Works only when the refresh position is opened

DistanceAdditionalOpening Distance from the last open position of one type for refills. The distance between the positions, the grid cell. 

You can set 100 points, 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. 

For example: 

Starting lot of the main position = 0.1 

LotsMartin = 2, Then the

next lot of the opened refill position will be 0.2, 0.4, 0.8 and so on. 

Attention: The middle line will be calculated using the formula using lots. 

Allows you to bring the break-even level (middle line) closer to the current price. 

But martingale can be dangerous to your account. Please, calculate this parameter so that your deposit will withstand such a load 

MaxOrdersOpenAdditionalOpening Maximum number of refilling positions. If the grid positions are equal to MaxOrdersOpen, then the following refill positions are ignored

TradeStartStopbyTime Function of work on time. 

If TradeStartStopbyTime = false, then the Expert Advisor trades around the clock. 

If TradeStartStopbyTime = true, then the trading time is enabled: 

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. 

For example, SeveralTimeWork = 3: 00-5: 00; 7: 30-8: 50; 12: 00-15: 00; 

then the adviser will trade 3 pieces of time. from 3 hours to 5 hours, from 7:30 to 8:50 and from 12:00 to 15:00. All the rest of the time the counselor will not open new deals. 

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. 

In this case, the adviser will trade at the time specified above, and when the trading time is over, the adviser will close all open positions and orders. 

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 adviser 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 in order 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 TradeStartbyTimeMonday = true is specified by the time OpenHourMonday: OpenMinuteMonday  

For example, OpenHourMonday = 3 and OpenMinuteMonday = 40, then the advisor starts trading on Monday at 03:40 by the server time  

(your broker's time, specified in the market review). 

TradeStartStopbyTimeFriday TradeStartStopbyTimeFriday - Trading time for Friday. 

In our adviser YOU can set the time for trading adviser on Friday. 

Friday OpenHourFriday: OpenMinuteFriday - CloseHourFriday: CloseMinuteFriday  

For example, you need the EA not to open new deals on Friday after 18:00, then you install:  

OpenHourFriday = 0: OpenMinuteFriday = 0 - CloseHourFriday = 18: CloseMinuteFriday = 0  

In In this case, the adviser 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. 

MovingInWLUSE Enable the breakless function for open positions. 

Attention: If the averaging or refilling function is turned on, when the 2 or more positions are opened, the advisor includes a lossless function 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

LevelProfit The number of profit items gained by the position for setting a stop-loss at  LevelWLoss points of 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 - when the Expert Advisor starts modifying only from the moment the position is exited to the lossless + TrailingStop of profit items. at false - the trawling stop starts to work right after the position is positioned and the position is put into profit and pulls it after the price

TrailingStop Distance trailing stop in points

TrailingStep Step of stop loss at trailing point in points

SaveTPafterTrailingStop When enabled, the take-profit of the modified positions will remain in place. 

For example:  

SaveTPafterTrailingStop = false: When executing a trailing stop, the take-profit of the modified position will be deleted; 

SaveTPafterTrailingStop = true: When the trailing stop is executed, the take-profit of the modified position will be saved. 

TrailingStopSAR Enable trailing stop function on the Parabolic SAR indicator. 

Attention, if the indicator indicator is at a loss for the position, the advisor waits until the parabolic point is in profit for the position. 

If at us 2 or more positions of the averageizer are opened, the breakeven is considered from an average line of cumulative positions.

TrailingStopSAR_TimeFrame Timeframe for indicator

maximum Indicator settings

TypeofClose Type of closing for total profit or loss, in dollars, points, percent of balance, percent equity

CloseProfit Closing positions with the total profit

prifitessss The number of units (dollars, points, percent) for closing

CloseLoss Close positions at a common loss

lossss The number of units (dollars, 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 TrailOptions = $ 10 then ,

when the position of dial profit of $ 100, the adviser will not close these positions and establish the level of profit of 90 dollars. 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

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 adviser 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

LimitFor Restriction of losses and profit for 1 day \ Week \ Month  

Limiting LimitFor - Restriction type day \ week \ month  

LimitForLosses - Limit on profit  

LimitForProfits- loss  

limitation LimitType - Limit type by Dollars, Points, Interest from deposit  

ClosebyLIMITING - Close adviser's transactions when exceeding limit  

UseCurrentProfit - Take into account, when calculating the limit, the current profit \ loss  


This function is able to disable the advisor job, if the advisor to get a certain profit \ loss of the deposit currency for the day \ month \ week. The next work of the Expert Advisor will be the next day \ week \ month  

For example LimitFor = DAY LimitForProfits = 1 Total profit closing = 10 dollars 

Also you can select LimitType limit type for calculations. In dollars, points, percentages of the account balance. 

If you need to close and delete all transactions for this Expert Advisor, if you exceed the limits, you can put ClosebyLIMITING = true  

The UseCurrentProfit parameter disables or allows you to take into account the current floating profit / loss for this Expert Advisor 

 

DrawDown_Level

DrawDown_Level - turn on the drawdown control block 

Type_DrawDownHR - drawdown calculation type based on trades in the history and current transactions   

DrawDown_Level_One - the first level of drawdown in percent    

Type_Deal_Level_One - the action when passing the first level of drawdown (disable new signals / deactivate the averaging of transactions or additional opening / deactivate all transactions \ display a message)    

DrawDown_Level_Two - second level drawdown percentage    

Type_Deal_Level_Two - action during the passage of the second level drawdown (close all profitable positions \ close all unprofitable positions \ close all \ you esti 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 transactions in history and current transactions exceeds the level of 50% of the current deposit, EA can not open new transactions on new signals. At the same time, the averaging functions will work. When the drawdown exceeds 90%, EA immediately closes all transactions. 

 

Withdrawal Added the Virtual withdrawal of funds in the tester:  

testerwd = "========= Tester Withdrawal ========="; 

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; 

TypeFilling The type of fill positions and orders. 

Used for MT5 terminal. 

In AUTO mode, the Expert Advisor tries to determine the fill type automatically. But, in some situations, you need to set the fill type yourself. 

If at the opening of the position you receive an error  


10030 TRADE_RETCODE_INVALID_FILL 

Specified 

unsupported type of execution of the order for the balance.  

Set the type of filling that your broker indicates. 


Example: 

 FillOrKill 

This execution policy means that the order can be executed only in the specified amount. If the market currently does not have a sufficient amount of a financial instrument, then the order will not be executed. The required volume can be made up of several offers available at the moment in the market. 



ImmediateOrCancel  

Means consent to make a deal on the maximum available volume on the market within the limits specified in the order. In case of impossibility of full execution, the order will be executed for an accessible volume, and the executed order volume will be canceled. 



Return 

This mode is used for market, limit and stop-limit orders, and only in the modes "Market Execution" and "Stock Execution". In case of partial execution, a market or limit order with a residual volume is not withdrawn, but continues to operate. 

For stop-limit orders, the corresponding limit order with the execution type Return will be created upon activation.

RoundingDigits The number of decimal places when a position or order is opened. 

Choices:  

Without rounding 

To 1 digit 

To 2 digits

ForcedModifySLTP Forced modification of positions, established by the stbolosom and takeprofit. FOR MT5

PAIR1 - PAIR12 The ability to install several currency pairs at once for testing in MT5 terminal strategy tester

   

   

   

     

Question Answer on the Exp - The X program

What are the values ​​in the parameters in points or pips? 

In points! The item is taken from the value of the Point () variable 

If you have a 5 \ 3 digit broker, then 1 point = 0.00001 \ 0.001 

If you have a 4 \ 2 digit broker, then 1 point = 0.0001 \ 0.01 

Do you have the kits and settings for this Expert Advisor? 

No, I created the Expert Advisor as a designer. This EA requires your optimization. According to your strategy, and according to your capabilities, but using our functions. 


Why are the test results in mt4 and mt5 terminals different? 

Because they are different terminals, with different history of quotations, with different principles of the strategy tester. 


What settings do you use on your signal? 

Default settings. I only test the correctness of the functions, and not the profitability of this advisor. 


Why? 

Because this advisor was created as a designer. Each user must find their own strategy. 

Want my strategy? TickSniper already set up automatic trading robot


I want you to make several changes to the Expert Advisor.

I take new functions very carefully only when these functions are useful to most users of the system. Unfortunately, I can not program each function separately for each user. You can buy the open code of the system's advisor - and program everything you want. 

I can add a couple of functions only when I see a sense in these functions. Excuse me. 


Can you add a few custom indicators to the Expert Advisor? 

No, this advisor was created only for standard indicators. I can not add all the Internet indicators to this Expert Advisor. You can buy the open code of the system's advisor - and program everything you want. 


When will you add more indicators? 

I add only those indicators I think are necessary. Unfortunately, I can not add all the indicators to the Expert Advisor. The Expert Advisor is so full of external parameters 


. This function does not work for me! 

I can help you only when you provide a full report on errors 

Share it with friends: