Главная
Каталог статей
English instructions and articles

Для того, чтобы использовать все возможности сайта, мы рекомендуем Вам person_add Зарегистрироваться или person Войти

starРейтинг: 5.0/33

date_range Posted: 11.10.2018

date_range Updated: 25.04.2020

remove_red_eyeReviews: 3601

dashboardCategory: English instructions and articles

historyHistory versions

merge_typeType: Universal trading advisor, strategy advisors, indicator advisor.

computerTerminal: МТ4 и МТ5

cloudindicators., Universal, xCustomEA, Trading, Exp, advisor, The, on, Custom


Read about Exp - The xCustomEA Universal trading advisor on custom indicators. Advisor on the indicator!

Description

Exp - The xCustomEA Universal trading advisor on custom indicators.

Our new advisor The xCustomEA is based on the advisor The X - Universal EA

The functionality of the universal trading advisor The xCustomEA exactly repeats all the parameters of our advisor The X except for one thing:

The xCustomEA works on a custom indicator and can program its trading strategy for the MT5 and MT4 terminals.

In other words: The xCustomEA has a connection with custom indicators that can be downloaded from the Internet or the mql5 market.

Any custom indicator from the internet!

Foreword

When programming advisors to order, we were not surprised that 90% of orders are based on strategies for indicators.

Therefore, our primary work was to embed a custom indicator in our template for writing an advisor.

But the cost of such work + template for writing + open-source of such a template is too high. And not all traders agree to write a trading advisor for one custom indicator.

After all, if your indicator is not profitable enough, then you will have to order a new advisor on a new indicator for the same money.

We found a way out of this situation and developed a new universal trade advisor The xCustomEA

This advisor does not have a pre-set strategy. It can trade on signals from other indicators. You can program your custom indicator and our advisor. The xCustomEA will open positions on signals.

By purchasing Our Universal Trading Advisor The xCustomEA, you can program advisors on indicators every day!

Attention : You are not required to buy an indicator to test Expert advisor in the strategy tester.

You can download the indicator in the strategy tester and check our advisor on this indicator in the strategy tester.

Only after getting profitable results in the strategy tester, you can buy a custom indicator and run an advisor on this indicator on a real or demo account!

Article : Optimization and testing! Search for advisor settings!

The difference between The X and The xCustomEA?

These two EA are built on the same basis (MQL CODE and functions) and differ only in the fact that:

The X = Universal EA , This adviser who works for standard indicators of terminal MetaTrader (about 20 standard strategies of standard indicators).

The xCustomEA = This Universal Advisor who works for custom indicators.

  1. This advisor no has built-in strategies. You can set custom indicators in this EA.
  2. This means that you can choose a custom indicator, which shows the signals with arrows and trade on it.
  3. Also in this EA you can program your strategy on any indicators that are on the Internet!
  4. You can download ready-made strategies that have been programmed for this advisor. This list is updated whenever possible.
  5. You can download all signals from the strategy The X - and use your custom changes to the strategies!

If you do not know how and do not want to learn programming and you enough of standard indicators, your choice =The the X .

If you know how to program, and you have an interest in the study of other indicators, your choice =The xCustomEA .

Functions of these advisors = Equal!

Basic Functions and Parameter Description

We will not dwell on the detailed description of the main parameters of the advisor because 99% of the settings correspond to our system The X.

A full description of all the basic parameters and functions is described in the instructions for The X. Parameter Description Exp The xCustomEA

In The xCustomEA, there are such functions as:

  1. Autolot (calculation of the lot from the current balance), money management;
  2. Fixed lot;
  3. Work on time (limiting the work of an adviser on trading time);
  4. Trailing stop (standard, with the "Only profitable" algorithm);
  5. Parabolic SAR trailing stop
  6. Error handling functions for real accounts;
  7. Block closing on total profit and loss with the ability to disable the adviser on the account;
  8. Breakeven (set stop loss to break-even point) (set stop loss to zero);
  9. Martingale (increase in the next lot after a losing position);
  10. Work solely on indicator signals (Signal - opening, Signal - closing an opposite order - opening);
  11. Closing the opposite signal when changing the signal;
  12. The function "REVERSE", flipping the signals of your strategy;
  13. Function averaging unprofitable position.
  14. The function of the additional opening of positions on the trend and against the trend.
  15. Virtual stop loss, take profit and trailing stop functions.
  16. Work positions, pending orders, limit orders.
  17. Work with drawdown;
  18. Work with a limit on profit and loss;
  19. Work with test results;
  20. Work in the semi-automatic mode without opening a position with the notice that the strategy received a signal to open. The ALERT is displayed on the screen;

A full description of all the basic parameters and functions is described in the instructions for The X. Parameter Description Exp The xCustomEA

 

Signal and Filter Definition

Signal

  1. Signal - occurs when there are all conditions for the signal, for example, the fact of crossing the MA lines. Or the appearance of a new point ZigZag.
  2. For example, The intersection of level 70 for the RSI indicator is a signal. And if the RSI is above level 70, then this is already a filter.
  3. The signal - this is what appears at the moment of receipt of quotations, is fixed on the bar. Advisor accepts the fact of making a signal.
  4. For example: Turned on the light. This is a signal because the light has just turned on. When you turn on the light, the man woke up. This is a signal.
  5. Opening positions occurs after the signal is made, the lines are crossed, then the position is opened. If the lines were crossed before, this is not a signal. The signal has passed.

Filter :

  1. Filter - This is the current position of the indicator, for example, the current position of the MA lines relative to each other. Or current last vertex ZIGZAG
  2. The filter is what the indicator is currently showing. This is not a signal fact. This is the current position of the indicator.
  3. For example, the light was burning. This is a filter because the light has already been turned on, and it is already on. When the light is on, the person is no longer asleep. This is a filter.
  4. The signals are filtered by the current value of the indicator. If Fast MA is above a slow MA, then this is a filter that only BUY should open.

 

Easy installation of the custom indicator in signals and filters

There are two types of work advisor:

xCustomEA - Advisor's work on our indicator, in which you program your strategy.

If you need to program the work of the advisor on the indicator, go to the next section: Programming your strategy

xArrow - The EA works directly with a custom indicator that has Arrow type buffers that can be used for the EA.

For example: Buffer with indicator signals to BUY and Buffer with indicator signals to SELL

Such buffers must be of the Arrow type.

Our Expert Advisor determines the signal by type: The buffer value is not equal to an empty value and above 0 .:

 // --- we check the conditions and set the value for sig
 if (xCustom_SIGNAL_BUY_buffer [OWNSIGNAL_shift]! = EMPTY_VALUE && xCustom_SIGNAL_BUY_buffer [OWNSIGNAL_shift]> 0)
 sig = 1;
 else
 if (xCustom_SIGNAL_SELL_buffer [OWNSIGNAL_shift]! = EMPTY_VALUE && xCustom_SIGNAL_SELL_buffer [OWNSIGNAL_shift]> 0)
 sig = -1; 

If you do not want to program your strategy and your custom indicator allows you to work directly with the advisor, you can specify the name of the indicator and set buffers for its work on the signals on BUY and SELL

for example :

1. Indicate the name of the custom indicator! If this indicator was downloaded from the MQL5 market, then you need to specify from the Market folder:

Market\\PipFinite Trend PRO

Be sure to write a double backslash \\

2. Specify the type of xArrow signals.

3. Specify the number of signal buffer for opening BUY (in this example, buffer number 8)

4. Specify the number of signal buffer for opening SELL (in this example, buffer number 9)

for example

Thus, we do not need to program our indicator for the work of the advisor.

Our example of a custom indicator contains buffers for the work of the advisor, and we can directly interact with it!

In our section The xCustomEA Strategy Examples, we will post examples of programming strategies and advisers on indicators known in the market!

An example of advisor on the indicator PipFinite Trend PRO

 

PipFinite

 

FAQ

Which indicator should I use?

Which filter will match my indicator?

Where can I find a good indicator?

Can you create a strategy?

Do you program to order?

Hello.

I will try to respond to your comment in more detail:

12 years ago I started doing custom programming. Customers sent me terms of reference and I programmed an Expert Advisor for this job.

I have carried out a lot of programming orders.

A lot of orders were similar to each other.

With the same work functions.

And then I was tired of programming because each task is similar to the previous one.

So I made this xCustomEA Expert Advisor so that users could customize it themselves.

And the most important rule here is that the EA has no trading strategy. It is pure.

And its main function is to trade on your indicators. It trades on your strategy.

I do not have any specific indicators-filters, which will filter "all indicators from the market".

Why do I say "ALL"?

Because it is a universal Expert Advisor. It has no strategy. It trades on the signals of your indicator, the one you will write in its settings.

I gave up programming because I don't have any more power to program to order.

Now I only program my tools and make my own programs for trading.

If your indicator, which gives signals, is not profitable enough?

So, you need to look for those indicators, which will be profitable and will give your profit, which will please you.

I do not have such indicators.

This advisor is a universal trading advisor, which trades on your indicators.

This is a template for a robot.

In the video, I tried to explain the most important thing, why I created this program.

I will answer your questions and try to help you with programming your indicators.

For this purpose, I have created a section on my forum: https://www.expforex.com/forum/69.

In which I create a strategy based on interesting indicators that users have offered.

But, please, do not ask me a question about which filter indicator to use for your signal.

I don't know what filter to use for your signal.

These are your signals.

I can tell you about the functions of my Expert Advisor. .

I can try to help you program your strategy.

But if you want to know my signals, it is better to use my strategy TickSniper - Fully Automatic trading robot.

 

Block connecting a custom indicator (custom strategy) to our advisor

A new block of work with a custom strategy/indicator has been included in our new advisor.

Parameter Description
OWN Signal options
SignalNameIndicator

The name of the custom indicator from which the main signals for opening positions will be received.

Default: " Ind - The xCustomEA "

This is a standard empty indicator, into which you can program your strategy according to our example!

We also created an example of a custom indicator based on The X signals.

"Ind - The xCustomEA Example The X"

You can use our example to receive signals using standard indicators.

Description of The X Standard Strategies

The xCustomEA Strategy Examples

SignalTypeIndicator

The type of indicator for signals.

There are two types of work advisor:

  1. xCustomEA - Advisor's work on our indicator, in which you program your strategy.
  2. xArrow - The EA works directly with a custom indicator that has Arrow type buffers that can be used for the EA.

For example: Buffer with indicator signals to BUY and Buffer with indicator signals to SELL

Such buffers must be of the Arrow type.

Our Expert Advisor determines the signal by type: The buffer value is not equal to an empty value and above 0 .:


 // --- we check the conditions and set the value for sig
 if (xCustom_SIGNAL_BUY_buffer [OWNSIGNAL_shift]! = EMPTY_VALUE && xCustom_SIGNAL_BUY_buffer [OWNSIGNAL_shift]> 0)
 sig = 1;
 else
 if (xCustom_SIGNAL_SELL_buffer [OWNSIGNAL_shift]! = EMPTY_VALUE && xCustom_SIGNAL_SELL_buffer [OWNSIGNAL_shift]> 0)
 sig = -1; 
IndSigToTrade

Selection of the indicator and signal for opening the first and main positions.
Strategy number from custom indicator SignalNameIndicator

If the specified strategy is not found in the indicator, the Expert Advisor will be unloaded from the chart with an error!

If 0 is specified, then strategy signals are not used, but filters are used!

TF_IndSigToTrade1 Timeframe for 1 main indicator. You can select the timeframe by which the indicator will receive signals.
Period_Current - current Timeframe
SIGNALStrategyInputs

External parameters for custom indicator, in SignalTypeIndicator = xArrow mode

You can specify the external variables of the indicator as they are written in the settings table, separated by commas!

Important: You must respect the order of variables and the type of variables.

Variable type Record Important Example
int x  

1

10

777

double xx Be sure to specify through the point.

0.2

1.10

string "x"

In MT5: Be sure to specify the string (not numbers). You can write as "X"

In MT4: Attention! In the version for MetaTrader4, it is forbidden to transfer string parameters! When passing string parameters, the indicator may not load correctly!

 

"XXX"

"TEST SAME"

datetime D'year.month.day ' Mandatory indication of D and single quotes

D'2018.11.08 '

D'2015.01.01 '

color C'red / green / blue ' Mandatory indication of C and single quotes. Color enumeration through slash /

C'0 / 128/128 '

C'0 / 256/0 '

enum (list, enumeration) x (digit)

If your indicator has a list (selecting a parameter from the list), i.e. In the settings you need to write a number! 

An example of how to do this:  https://www.expforex.com/forum/69-965-25469-16-1587798560 

1

eg

int InpCCIPeriod = 1;
double InpCCIPeriod2 = 2.0;
color InpCCIPeriod3 = clrGreen;
string InpCCIPeriod6 = "text";
datetime InpCCIPeriod4 = 2018.11.08;
bool InpCCIPeriod5 = false;

written as:

SIGNALStrategyInputs = 1,2.0, C'0 / 128/0 ', " text ", D'2018.11.08', false

 

 

Example:

Signal_Reverse Reverse signals from this indicator. This option reverses the signals of the main indicator only.
ClosePositionifChangeOWNSignal Enable \ Disable closing of positions on the opposite signal of the main indicator, without the participation of other filters and other parameters
OWNSIGNAL_shift The bar number for the signal that the indicator will generate,
  1. 1 = Last closed bar, signals on such a bar are considered complete.
  2. 0 = Current open bar, signals on such bar are considered to be drawing.
More about this parameter: Detailed article about signal bars

SignalBuferforBUY

SignalBuferforSELL

Buffer number in the custom indicator, for receiving a signal to BUY and SELL

Do not change for Ind - The xCustomEA and Ind - The xCustomEA Example TheX

Close options  
  This block allows you to close open positions by signals of a custom indicator.
It is used if a custom indicator provides signals for closing positions (separately from the signals for opening a new position).
If you need to tell the advisor signals to close positions, then you need to specify: the indicator name (may be identical with the indicator name for closing positions), a set of parameters (If they differ from the default indicator parameters), TimeFrame, Bar Shift, and number buffers to receive signals for closing. Separately for BUY and SELL positions.
Attention: If you want to close a position when receiving the opposite signals, then you do not need to use this block.
CloseNameIndicator

The name of the custom indicator from which the main signals for closing positions will be received.

CloseTypeIndicator

The type of indicator for signals.

There are two types of work advisor:

  1. xCustomEA - Advisor's work on our indicator, in which you program your strategy.
  2. xArrow - The EA works directly with a custom indicator that has Arrow type buffers that can be used for the EA.

For example: Buffer with indicator signals for closing BUY and Buffer with indicator signals for closing SELL

Such buffers must be of the Arrow type.

Our Expert Advisor determines the signal by type: The buffer value is not equal to an empty value and above 0 .:


 // --- we check the conditions and set the value for sig
 if (xCustom_SIGNAL_BUY_buffer [OWNSIGNAL_shift]! = EMPTY_VALUE && xCustom_SIGNAL_BUY_buffer [OWNSIGNAL_shift]> 0)
 sig = 1;
 else
 if (xCustom_SIGNAL_SELL_buffer [OWNSIGNAL_shift]! = EMPTY_VALUE && xCustom_SIGNAL_SELL_buffer [OWNSIGNAL_shift]> 0)
 sig = -1; 
CloseTimeFrame  
Close_shift  
CloseStrategyInputs  
CloseBuferforBUY  
CloseBuferforSELL  
Close_IndSigToClose  
   
Filter options
FilterNameIndicator

The name of the custom indicator from which the filters will be obtained when opening positions.

Default: " Ind - The xCustomEA "

This is a standard empty indicator, into which you can program your strategy according to our example!

We also created an example of a custom indicator by filters. The X

"Ind - The xCustomEA Example The X"

You can use our example to get filters by standard indicators.

Description of The X Standard Strategies

The xCustomEA Strategy Examples

FilterTypeIndicator

The type of indicator for the filter.

There are two types of work advisor:

  1. xCustomEA - Advisor's work on our indicator, in which you program your filter strategy.
  2. xArrow - Expert Advisor working directly with a custom indicator that has Arrow type buffers (Arrow) or a non-empty buffer value that can be used for the advisor.

For example: Buffer with indicator filter on BUY and Buffer with indicator filter on SELL

Such buffers must be of the Arrow type.

Our Expert Advisor defines a filter by type: The buffer value is not equal to an empty value and above 0 .:


 // --- we check the conditions and set the value for sig
 if (xCustom_FILTER_BUY_buffer [shift]! = EMPTY_VALUE && xCustom_FILTER_BUY_buffer [shift]> 0)
 sig = 1;
 else
 if (xCustom_FILTER_SELL_buffer [shift]! = EMPTY_VALUE && xCustom_FILTER_SELL_buffer [shift]> 0)
 sig = -1; 
FILTER_IndSigToTrade

Selecting the indicator and filter to filter the main signal.
Strategy number from custom indicator FilterNameIndicator

If the specified strategy is not found in the indicator, the Expert Advisor will be unloaded from the chart with an error!

If IndSigToTrade is set to 0, then the advisor will work on filters!

FILTER_TF_IndSigToTrade The timeframe for the filter. You can choose the timeframe according to which the indicator will receive filter signals.
Period_Current - current timeframe.
For example: When using MA as the primary signal with TF = M30, you can turn on filtering by older MA with TF = H4
Filter_Reverse Reverse the signals of this filter. This option reverses the signals of this filter only.
For example, The main indicator of MA shows BUY, but the main indicator of MA shows SELL. Using this function, we turn over the signals of the main MA and get the cumulative signal BUY
FILTERSIGNAL_shift The bar number for the signal that the indicator will generate,
  1. 1 = Last closed bar, signals on such a bar are considered complete.
  2. 0 = Current open bar, signals on such a bar are considered to be drawing.
More about this parameter: Detailed article about signal bars

FilterBuferforBUY

FilterBuferforSELL

Buffer number in the custom indicator, to get the filter on BUY and SELL

Do not change for Ind - The xCustomEA and Ind - The xCustomEA Example TheX

SLTP options  
 

This block allows you to set a stop loss or take profit when opening positions on the signal, which can be taken from the values of the custom indicator buffers.
If the Custom Indicator has separate buffers for getting Stop Loss or Take Profit, you can use these values when opening a new position.

Attention: Stoploss or take profit is set only when a new position is opened using a new signal.

The functions of averaging, additional opening use the parameters of stop loss and take profit from past variables. Stoploss and takeprofit obtained from the custom indicator in Averaging and additional opening are not accepted.
Stoploss and takeprofit from a custom indicator are also set when using the ForcedModifySLTP function.

If you need to tell the advisor the stoploss and takeprofit values from the custom indicator, then you need to specify: the indicator name
(may be identical with the name of the indicator for opening/closing positions), a set of parameters (If they differ from the settings of the indicator by
default), TimeFrame, Shift bar, and the number of buffers to get values. Separately for BUY and SELL positions and separately for StopLoss and TakeProfit.

SLTPNameIndicator

The name of the custom indicator from which StopLoss and TakeProfit will be obtained.

SLTPTypeIndicator

Type of indicator.

  1. xPrice - Price value that will be passed to the corresponding variable (StopLoss, TakeProfit)
SLTPTimeFrame  
SLTP_shift  
SLTPStrategyInputs  
SLTPBuferforBUY_StopLoss

The buffer number to get the StopLoss value for BUY,

-1 means that this option does not work.

SLTPBuferforSELL_StopLoss

The buffer number to get the StopLoss value for SELL positions,

-1 means that this option does not work.

SLTPBuferforBUY_TakeProfit

The buffer number to get the TakeProfit value for BUY,

-1 means that this option does not work.

SLTPBuferforSELL_TakeProfit

The buffer number to get the TakeProfit value for SELL positions,

-1 means that this option does not work.

 

Indicator template file

For ease of use advisor:

When you first start the advisor, an indicator template file will be created in the folder of your terminal Files

This file can be used as a template for writing an indicator strategy.

To find a file, click in your terminal menu File-Open data directory

Open this file with your MQL editor

In the file, you will see examples of the use and steps of programming a strategy.

After creating an indicator strategy, save this file in your terminal folder - Indicators/

After that, specify this file in the settings of the SignalNameIndicator advisor

 

 

Programming your strategy

You should know the minimum programming rules to write your strategy.

Or add a ready-made strategy on indicators from a ready-made file (indicators from the Internet, for example)

Programming advisors for MetaTrader 5 is more complicated than programming for MetaTrader 4.

But the MT5 terminal allows you to create more powerful strategies, and also has a more advanced strategy tester.

For ease of programming

  1. Open our indicator source code Ind - The xCustomEA or Ind - The xCustomEA Example TheX;
  2. Press the key combination Ctrl + F, and you will see the search bar;
  3. Enter the name Step - For this word, in our source code, you can navigate and quickly write your strategy.
  4. Each step is commented on and contains an example.
  5. To learn how to program your strategy, you can gradually uncomment the lines with an asterisk // *

We will analyze each step in detail!

Function and Parameters

All Parameters you can see on The X Guide

 
Parameter Description
 
Signal options Additional signal processing unit
Show_alert_without_opening_positions

Alert

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

Send_Push_without_opening_positions

Push Notification

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.
It 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 in 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 !! once at the opening of a new bar (depending on TF, which TF you have installed, such timeframe will be used), including Modification, Trailingstop, Averaging, the opening of signals, etc.
ControlNewBarforSIGNAL

check the indicator signal only each new bar (without checking on each tick),
Works only when OWNSIGNAL_shift> = 1 and IndSigToTrade! = NoSignal (with NoSignal, the Expert Advisor checks the values of the filters are each tick)
When ControlNewBarforSIGNAL = true, the optimization speed is increased by 1.5 times!

Added values:
ControlNewBarforSIGNALType = 1 = True smallest TF of the settings: New mode!
The EA selects the smallest TimeFrame, which was set by the parameters TF_IndSigToTrade1, FILTER_TF_IndSigToTrade1, FILTER_TF_IndSigToTrade2 ....
In this mode, the EA does not check the signal on the currently set TimeFrame, but on the TimeFrame for receiving a signal from indicators!
This mode is useful for those who use TF_IndSigToTrade1, FILTER_TF_IndSigToTrade1, FILTER_TF_IndSigToTrade2, other than Current.
ControlNewBarforSIGNALType = 2 = True current bar of the current TF: Old mode!
In this mode, the EA checks signal every new bar of the current TimeFrame!
If you use TF_IndSigToTrade1, FILTER_TF_IndSigToTrade1, FILTER_TF_IndSigToTrade2 other than Current, the results on each TimeFrame may be
different.
We advise you to install the adviser on the TimeFrame M1!
ControlNewBarforSIGNALType = 0 = False: Do not use the control of the new bar to determine the signal!
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:
  1. Buy and Sell
  2. Only Buy
  3. Only Sell
In this case: If you use pending orders and work only in 1 direction: every time a new signal is received, the old pending order will be deleted and set to 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 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 above 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 below 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

opens 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.
If the last position were closed by stoploss, the Expert Advisor would immediately open the opposite position

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.:
  1. if OnePosPerDirection = true and ONlyOnePosbySignal = false then the advisor can open 1 Buy deal on a signal and 1 Sell deal on a signal;
  2. if OnePosPerDirection = false and ONlyOnePosbySignal = true then the advisor can only open one deal at a signal, either Buy or SELL;
  3. 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.
  1. If OnePosPerDirection = false, then OnlyOnePositionPerMagic = true works like this: 1 position by magic number is allowed;
  2. 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

the parameter for limiting 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 only used! To open positions by signal, averaging, refilling. All other functions work in the normal mode.

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 primary signal.
And when ClosePositionifChangeOWNSignal - the signal change is considered only on the primary 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 option The block of work with pending and limit orders.
StopOrderUSE

Open pending orders or limit orders instead of positions.
It 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.

  1. Use Virtual Stop Orders: Exposes a virtual pending stop order at a distance StopOrderDeltaifUSE points;
  2. Use Virtual Limit Orders: Exposes a virtual pending limit order at a distance StopOrderDeltaifUSE points;

Caution: Only works in Visualization mode or on live graphics, only when the terminal is switched on.
It does not work in optimization mode!

StopOrderDeltaifUSE Number of points for a stop or limit order. Distance.
StopOrderDayToExpiration StopOrderDayToExpiration = number of days for the order expiration.
  1. 0 - ORDER_TIME_GTC The order will be in the queue until it is removed
  2. 1 - ORDER_TIME_DAY The order will be valid only for the current trading day
  3. 2 ... X - ORDER_TIME_SPECIFIED The order will remain valid until the expiry 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 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.

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 comments 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.
RoundingDigits The number of decimal places when a position or order is opened.
Choices:
  1. Without rounding
  2. To 1 digit
  3. To 2 digits
TypeFilling The type of fill positions and orders.
It is 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, when you open a position, you get an error of 10030
TRADE_RETCODE_INVALID_FILL
An unsupported type of execution of the remainder order is indicated.
Set the type of fill that your broker indicates.
FillOrKill, ImmediateOrCancel, Return
Stops options Parameters of stop orders, StopLoss, TakeProfit
VirtualStops

The function of including virtual stoploss / TakeProfit \ trailing stop instead of real.
Inclusion of virtual (invisible) levels stoploss/TakeProfit/trailing stop/BreakEven (stop loss at break-even point)


Completely redesigned the algorithm of Virtual StopLoss \ TakeProfit \ trailingstop \ Breakeven(installing stoploss on the break-even point).
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 the 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.

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.
  1. With virtual stops - this parameter does not affect.
  2. With AutoSetMinLevel, stop levels will be brought to the lowest possible levels allowed on the server;
  3. 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 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 sales advisor.
Added parameters to the Stops options block:
- TimeToCheckAverageSpread The number (milliseconds, 20,000 = 20 seconds) for determining the average spread
- AutoCheckLowSpread Auto-determination of the low spread.
Automatically determines the spread too low (Less than 1 point) and leads all system settings to the lowest possible spread.
It allows you to protect the system from reducing the spread of the broker.

How to use:
For the parameter calculated in points to be calculated from the average spread of the currency pair, you need to specify the setting with the sign -
For example:
StopLoss = 2000 means that StopLoss of each position will be 2000 points!
StopLoss = -100 means that StopLoss of each position will be equal to 100 * Average spread, which was calculated by the advisor for TimeToCheckAverageSpread milliseconds.

If the spread is 20 points, then stop loss at the time of opening will be 2000 points.
With a floating spread, this value always changes.

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 of options Parameters for working with lot
Lots A fixed lot to open a position.
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.
  1. If Martin = 1, then the martingale does not turn on.
  2. If Martin = 0, then the Expert Advisor can not open the next position
  3. If Martin = 2, then the first lot = 0.1, the second lot = 0.2, and so on, 0.4 - 0.8 - 1.6
  4. 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:

  1. If the SELL position is opened with a price of 1,200, and the price goes up.
  2. Then, if the price is exceeded by 100 points (for example) 1.300 - the advisor opens another SELL position
  3. The average line from these two positions = 1.250
  4. 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 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.
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 deal.
You can set it at 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.
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.
It allows you to bring the level of Break-Even (stoploss on the breakeven point) (middle line) 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

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 deals are ignored.
Averaging_FILTER_IndSigToTrade1
Averaging_FILTER_TF_IndSigToTrade1
Averaging_Filter1_Reverse
The filter parameters are added to the averaging and additional trend opening blocks.
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 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:

  1. If the SELL position is opened with a price of 1,200, and the price goes down.
  2. Then, if the price exceeds 100 points (for example) 1.100 - the advisor opens another SELL position
  3. The average line from these two positions = 1.150
  4. 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 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.
It allows you to bring the level of Break-Even (break-even point) (middle line) 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

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
Additional_FILTER_IndSigToTrade1
Additional_FILTER_TF_IndSigToTrade1
Additional_Filter1_Reverse
The filter parameters are added to the averaging and additional trend opening blocks.
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.
  1. If TradeStartStopbyTime = false, then the Expert Advisor trades around the clock.
  2. 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 advisor 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 Advisor 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 advisor will trade at the time specified above, and when the trading time is over, the advisor will close all open positions and orders.

  1. - Not Use = Do not use the function
  2. - Positions and Orders = Close positions and pending orders
  3. - Only Positions = Closes only positions
  4. - Only Orders = Close only pending 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 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 BreakEven 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.

  1. Distance from the opening price to the profitable stoploss
  2. 1 = 1 point of profit
  3. 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

- when the Expert Advisor starts modifying only from the moment, the position is exited to the Break-even (stoploss on the breakeven point) + TrailingStop of profit points.

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 the trailing point in points
SaveTPafterTrailingStop When enabled, the takeprofit of the modified positions will remain in place.
For example:
  1. SaveTPafterTrailingStop = false: When executing a trailing stop, the takeprofit of the modified position will be deleted;
  2. 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

Type of closing on the total profit or loss, in dollars (deposit currency), points, percent of the balance, percent equity.

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. True - enable, False - disable
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,

  1. when the position gains a profit of $ 100, the adviser will not close these positions but will establish a profit level of $ 90.
  2. Further, if the profit increases by 1 dollar and becomes 101 dollars, the profit level will be fixed at 91 dollars.
  3. 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

  1. Limiting LimitFor - Limit type day / week / month
  2. LimitForLosses - Limit of loss
  3. LimitForProfits- Limit of profit
  4. LimitType - Limit type by Dollars, Points, Deposit Interest
  5. ClosebyLIMITING - Close the advisor's deals when the Limit is exceeded
  6. UseCurrentProfit - Take into account, when calculating the limit, the current profit/loss


This function could disable the work of the Expert Advisor if the Expert Advisor gained a certain profit/loss in the deposit currency for the day \ month \ week. The next work of the adviser will be the next day \ week \ month


For example LimitFor = DAY LimitForProfits = 1 Total profit closing = 10 dollars
Also, you can select the LimitType limit type for calculations. In dollars, points, percent of the balance of the account.
If you need to close and delete all deals for this Expert Advisor, if you exceed the limits, you can put ClosebyLIMITING = true
The UseCurrentProfit parameter disables or allows you to account for the current floating profit/loss for this Expert Advisor

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
limits during the time from the last close!
Attention: works only when using ClosebyLIMITING = true!
This type allows you to take into account closed positions and current positions since the last closing of the total limit. It does not count for
a day, a week, but for the period between the previous closing according to the terms of this block and the current time. When closing by Limits, the
counter sets the current time.

DrawDown options The block for controlling the opening of positions in the drawdown
   
Withdrawal Virtual withdrawal tool in strategy tester for simulating the work with a deposit
   
Only for MT5 version !!!! Symbols options - Set trading on multiple symbols at the same time!
   

MetaTrader 4 Programming your strategy using a custom indicator in MT4

Programming an advisor on the indicator in MT4 consists of 4 steps:

MetaTrader 4 Step 1: Step of loading indicators into resources!


 // Step 
// This part of the code for programming your strategy in open source
// this part is for open source
//
// In order for the indicator to be built into the advisor when compiling, you need to load it into the resources of the advisor
In the case of the expert advisor during the compilation
// # # # # 
// for example:
// * #resource "\\ Indicators \\ MACD.ex4"

Here we are obliged to add the indicators we need to resources.

This will allow us to compile the indicator for the market, as well as relieve us of unnecessary problems when the compiled advisor does not suddenly find the indicator on the other computer!

Rules for writing the name of the market: The full name of the folders, starting with Indicators!

Folder denoted by \\

For example :

If the path to your indicator looks like this:


 C:\ROBO MT4\MQL4\Indicators\Examples\MACD.ex4 

then the path to this indicator in the programming language is written as:

"\\Indicators\\Examples\\MACD.ex4"

 

MetaTrader 4 Step 2: The primary step of creating strategies and signals for opening positions!


 // Step 
// This part of the code for programming your strategy in open source
// this part is for open source
//
// Here we create our signal for opening positions. Fill data buffers
// Here we create our signal for opening positions. Fill in the data buffer
// # # # # 
// for example:
// * if (sigInd == 1)
// * {
//
// Fill in the data
// We fill in the data
//
//
// * double CustomMain = iCustom (StrategySymbol, StrategyTimeFrame, ":: Indicators \\ MACD", periodma1, periodma2,9, MAprice,
// * MODE_MAIN, StartCopyI + ShiftIndicator);
// * double CustomSig = iCustom (StrategySymbol, StrategyTimeFrame, ":: Indicators \\ MACD", periodma1, periodma2,9, MAprice,
// * MODE_SIGNAL, StartCopyI + ShiftIndicator);
//
// * double CustomMain2 = iCustom (StrategySymbol, StrategyTimeFrame, ":: Indicators \\ MACD", periodma1, periodma2,9, MAprice,
// * MODE_MAIN, StartCopyI + ShiftIndicator + 1);
// * double CustomSig2 = iCustom (StrategySymbol, StrategyTimeFrame, ":: Indicators \\ MACD", periodma1, periodma2,9, MAprice,
// * MODE_SIGNAL, StartCopyI + ShiftIndicator + 1);
//
//
// Here we write our strategy, in this example it is the intersection of two lines,
// it is the intersection of two lines
//
// * if (CustomMain> CustomSig && CustomMain2 <CustomSig2)
// // Buy sig
// * sig = 1;
// * if (CustomMain <CustomSig && CustomMain2> CustomSig2)
// // Sell sig
// * sig = -1; //
// Write the data that will be displayed in the log when opening positions on the signal
// When you open the door
//
// * InfoAboutSignal = "InfoAboutSignal sigInd =" + (string) sigInd + "sig =" + (string) sig
// * + "CustomMain =" + CustomMain
// * + "CustomSig =" + CustomSig
// * + "CustomMain2 =" + CustomMain2
// * + "CustomSig2 =" + CustomSig2
// *;
// // --- return the trading signal
// * return (sig);
// *} 

This step is very important for the advisor. Although all other steps are required, otherwise, the advisor will not work.

I have indicated my comments in the code!

  1. Programming code for strategy and signal individually. It depends on the chosen strategy and indicators.
  2. Getting buffers strategies ........
  3. I want to note only that in this block, you can specify any strategy.

  1. Programming strategy. In this case, the intersection of two lines.
  2. Important: The signal for BUY is 1, and for SELL it is -1

Examples of strategies I will post on our forum!

MetaTrader 4 Step 3: Step for specifying filters from your indicators, or using your indicator as a filter for a strategy!


 // Step 
// This part of the code for programming your strategy in open source
// this part is for open source
//
// Here we create our filter to filter the signals. Fill data buffers
// Here we create our filter for signal filtering. Fill in the data buffers
// # # # # 
// for example:
// * if (sigInd == 1)
// * {
//
// Fill in the data
// We fill in the data
//
//
// * double CustomMain = iCustom (StrategySymbol, StrategyTimeFrame, ":: Indicators \\ MACD", periodma1, periodma2,9, MAprice,
// * MODE_MAIN, shift);
// * double CustomSig = iCustom (StrategySymbol, StrategyTimeFrame, ":: Indicators \\ MACD", periodma1, periodma2,9, MAprice,
// * MODE_SIGNAL, shift);
//
// Here we write our strategy, in this example it is the intersection of two lines,
// it is the intersection of two lines
//
// * if (CustomMain> CustomSig)
// // Buy sig
// * sig = 1;
// * if (CustomMain <CustomSig)
// // Sell sig
// * sig = -1; //
// Write the data that will be displayed in the log when opening positions on the signal
// When you open the door
//
// * InfoAboutSignal = "InfoAboutSignal sigInd =" + (string) sigInd + "sig =" + (string) sig
// * + "CustomMain =" + CustomMain
// * + "CustomSig =" + CustomSig
// *;
// // --- return the trading signal
// * return (sig);
// *} 

There is nothing complicated in programming the code in this step, and it is similar to the previous step.

The only difference is that at this step, you are programming your indicators as a Filter.

You can not specify the signals on the indicator and specify only the filter. Or vice versa! It all depends on the strategy.

MetaTrader 5 Programming your strategy on a custom indicator in MT5

MetaTrader 5 Step 1: Step of loading indicators into resources!


 // Step 
// This part of the code for programming your strategy in open source
// this part is for open source
// 
// In order for the indicator to be built into the advisor when compiling, you need to load it into the resources of the advisor
In the case of the expert advisor during the compilation
// # # # #
// for example:
// * #resource "\\ Indicators \\ Examples \\ MACD.ex5"

Here we are obliged to add the indicators we need to resources.

This will allow us to compile the advisor for the market, and also relieve us of unnecessary problems when the compiled advisor does not suddenly find the right indicator on another computer!

Rules for writing the name of the market: The full name of the folders, starting with Indicators!

Folder denoted by \\

For example :

If the path to your indicator looks like this:

C:\ROBO MT5\MQL5\Indicators\Examples\MACD.ex5

then the path to this indicator in the programming language is written as:

"\\Indicators\\Examples\\MACD.ex5"

MetaTrader 5 Step 2: Step of declaring variables for storing the handles of strategy indicators!


 // Step 
// This part of the code for programming your strategy in open source
// this part is for open source
//
// declare the array variable to handle
// Declare the variable of the handle array
// # # # #
// for example:
// * int h_custom;
// * int h_custom2;

Here we indicate the names of our handles that were created above!

There is nothing complicated here.

Handles are created in the form of arrays to use multi-currency in the advisor and use the ability to specify 6 signals or filters at once!

MetaTrader 5 Step 3: Variable declaration step for storing indicator data!


 // Step ###
// This part of the code for programming your strategy in open source
// this part is for open source

// declare an array variable of indicator values
// Declare the variable of the handle array

// for example:
// * double custom1_buffer [];
// * double custom2_buffer [];

Here we specify the names of our data for buffers!

There is nothing complicated here.

The data on the indicator values on each bar will be stored in these arrays. If you need to use multiple buffers, you can use multiple variables.

In our case, for example, we need 2 buffers, for the signal and main lines of the MACD indicator.

 

MetaTrader 5 Step 4: Step of creating handles of indicators for downloading to the advisor!


 // Step 4 
// This part of the code for programming your strategy in open source
// this part is for open source
//
// You need to create a record in the array so that the adviser assigns the handle of the indicator during initialization
// If you’re an expert
// # # # #
// for example:
// * case 1: h_custom = iCustom (StrategySymbolString, StrategyTimeFrame, ":: Indicators \\ Examples \\ Moving Average \\ Moving Average", MAFastPeriod, MAmethod, MAprice);
// * h_custom2 = iCustom (StrategySymbolString, StrategyTimeFrame, ":: Indicators \\ Examples \\ Moving Average \\ Moving Average", MASlowPeriod, MAmethod, MAprice);
// * if (h_custom == INVALID_HANDLE)
// * {
// * Print ("Failed to get the handle of the Moving Average indicator");
// * return (INIT_FAILED);
// *}
// * if (h_custom2 == INVALID_HANDLE)
// * {
// * Print ("Failed to get the handle of the Moving Average indicator");
// * return (INIT_FAILED);
// *}
// * break; 

This step is needed for our indicators to load 1 time during the initialization of the advisor. In MetaTrader 5, it is not necessary to continually load the indicator on the chart.

When creating a handle, we remember the handle of an already open indicator and use it for further work.

Here you need to be very attentive. When creating a handle, we must specify all external variables of the indicator and specify the correct name. Otherwise, the advisor will not be able to load the indicator.

Remember that we uploaded the indicator to the resources of the advisor. Therefore, we will call the indicator from resources!

You can read help on calling indicators via iCustom

We also need a strategy number to write this code. If you have several indicators in one strategy, then you need to specify several indicators but with the same number. That the adviser correctly loaded your strategy.

In our examples above, we need to do this:


 case 1:
h_custom = iCustom (StrategySymbolString, StrategyTimeFrame, ":: Indicators \\ Examples \\ Moving Average \\ Moving Average");
h_custom2 = iCustom (StrategySymbolString, StrategyTimeFrame, ":: Indicators \\ Examples \\ Moving Average \\ Moving Average");
if (h_custom == INVALID_HANDLE)
{
Print ("Failed to get the handle of the Moving Average indicator");
return;
}
if (h_custom2 == INVALID_HANDLE)
{
Print ("Failed to get the handle of the Moving Average indicator");
return;
}
break;

By analogy above, you can add several indicators and handles.

Also, with other strategies that you want to insert into the advisor!

 

MetaTrader 5 Step 5: The primary step in creating strategies and signals for opening positions!


 // Step 5
// This part of the code for programming your strategy in open source
// this part is for open source
//
// Here we create our signal for opening positions. Fill data buffers
// Here we create our signal for opening positions. Fill in the data buffer
// #
// for example:
// * if (sigInd == 1)
// * {
//
// Fill in the data
// We fill in the data
//
// * if (CopyBuffer (h_custom, 0,0,3 + ShiftIndicator, custom1_buffer) <3 + ShiftIndicator)
// * return (0);
// * if (! ArraySetAsSeries (custom1_buffer, true))
// * return (0);
// * if (CopyBuffer (h_custom2,0,0,2 + ShiftIndicator, custom2_buffer) <2 + ShiftIndicator)
// * return (0);
// * if (! ArraySetAsSeries (custom2_buffer, true))
// * return (0);
//
// Here we write our strategy, in this example it is the intersection of two lines,
// it is the intersection of two lines
//
// * if (custom1_buffer [ShiftIndicator + 1] <custom2_buffer [ShiftIndicator + 1] && custom1_buffer [ShiftIndicator]> custom2_buffer [ShiftIndicator])
// * sig = 1;
// * else if ((ShiftIndicator + 1] && custom1_buffer [ShiftIndicator] <custom2_buffer [ShiftIndicator])> (ShiftIndicator + 1]>
// * sig = -1;
// * else sig = 0;
//
// Write the data that will be displayed in the log when opening positions on the signal
// When you open the position
//
// * InfoAboutSignal = InfoAboutSignal + "" + "sigInd =" + (string) sigInd + "TF =" + (string) TF + "Symbol =" + symToWork3 + "sig =" + (string) sig + "" + __ FUNCTION __ + ""
// * + "custom1_buffer [ShiftIndicator + 1] =" + (string) custom1_buffer [ShiftIndicator + 1]
// * + "custom2_buffer [ShiftIndicator + 1] =" + (string) custom2_buffer [ShiftIndicator + 1]
// * + "custom1_buffer [ShiftIndicator] =" + (string) custom1_buffer [ShiftIndicator]
// * + "custom2_buffer [ShiftIndicator] =" + (string) custom2_buffer [ShiftIndicator];
// // --- return the trading signal
// * return (sig);
// *}

This step is very important for the advisor.

Although all other steps are required, otherwise, the advisor will not work.

I have indicated my comments in the code!

Our strategy number is the same as in the first steps!

  1. Programming code for strategy and signal individually. It depends on the chosen strategy and indicators.
  2. Getting buffers strategies ........
  3. I want to note only that in this block, you can specify any strategy.
  4. All indicators that we declared in handles will be loaded into memory and used to build a strategy.

This step can be divided into 2 substeps:

  1. 1. We must copy the data buffers into our data arrays. In the copy settings, we must specify the line numbers (In our case, these are the MACD indicator lines)
  2. We use two lines MAIN and SIGNAL
  3. You can read CopyBuffer help.
  4. 2. Programming strategy. In this case, the intersection of two lines.
  5. Important: The signal for BUY is 1, and for SELL it is -1

MetaTrader 5 Step 6: Step for specifying filters from your indicators, or using your indicator as a filter for a strategy!


 // Step 6 ###
// This part of the code for programming your strategy in open source
// this part is for open source
//
// Here we create our filter to filter the signals. Fill data buffers
// Here we create our filter for signal filtering. Fill in the data buffers
// # # # # #
// for example:
// * if (sigInd == 1)
// * {
//
// Fill in the data
// We fill in the data
//
// * if (CopyBuffer (h_custom, 0,0,3 + ShiftIndicator, custom1_buffer) <3 + ShiftIndicator)
// * return (0);
// * if (! ArraySetAsSeries (custom1_buffer, true))
// * return (0);
// * if (CopyBuffer (h_custom2,0,0,2 + ShiftIndicator, custom2_buffer) <2 + ShiftIndicator)
// * return (0);
// * if (! ArraySetAsSeries (custom2_buffer, true))
// * return (0);
//
// Here we write our strategy, in this example it is the intersection of two lines,
// it is the intersection of two lines
//
// * if (custom1_buffer [ShiftIndicator]! = 0 && custom2_buffer [ShiftIndicator]! = 0)
// * {
// * Alert ("Congratulations! You did a lesson that shows the programming of your strategy!");
// * Alert ("Congratulations! You have done a lesson that shows your programming strategy!");
// *}

// * if (custom1_buffer [ShiftIndicator]> custom2_buffer [ShiftIndicator])
// * sig = 1;
// * else if (custom1_buffer [ShiftIndicator] <custom2_buffer [ShiftIndicator])
// * sig = -1;
// * else sig = 0;
//
// Write the data that will be displayed in the log when opening positions on the signal
// When you open the door

// // --- return the trading signal
// * return (sig);
// *} 

There is nothing complicated in programming the code in this step, and it is similar to the previous step.

The only difference is that at this step, you are programming your indicators as a Filter.

You can not specify the signals on the indicator and specify only the filter. Or vice versa! It all depends on the strategy.

Exp - The xCustomEA Universal trading advisor on custom indicators. Advisor on the indicator!_1 Exp - The xCustomEA Universal trading advisor on custom indicators. Advisor on the indicator!_2 Exp - The xCustomEA Universal trading advisor on custom indicators. Advisor on the indicator!_3 Exp - The xCustomEA Universal trading advisor on custom indicators. Advisor on the indicator!_4
Здесь можно скачать Exp - The xCustomEA Universal trading advisor on custom indicators. Advisor on the indicator!
Купить Exp - The xCustomEA Universal trading advisor on custom indicators. Advisor on the indicator! можно здесь - Прочитать о Exp - The xCustomEA Universal trading advisor on custom indicators. Advisor on the indicator! можно здесь - Обсуждение Exp - The xCustomEA Universal trading advisor on custom indicators. Advisor on the indicator! - стейты, отзывы, комментарии - Отзывы о Exp - The xCustomEA Universal trading advisor on custom indicators. Advisor on the indicator! - Настройки к Exp - The xCustomEA Universal trading advisor on custom indicators. Advisor on the indicator! - Мониторинг Exp - The xCustomEA Universal trading advisor on custom indicators. Advisor on the indicator! - Download Exp - The xCustomEA Universal trading advisor on custom indicators. Advisor on the indicator! - Buy Exp - The xCustomEA Universal trading advisor on custom indicators. Advisor on the indicator! - Read about Exp - The xCustomEA Universal trading advisor on custom indicators. Advisor on the indicator! - Discusion of Exp - The xCustomEA Universal trading advisor on custom indicators. Advisor on the indicator! - Comments of Exp - The xCustomEA Universal trading advisor on custom indicators. Advisor on the indicator! - Settings Exp - The xCustomEA Universal trading advisor on custom indicators. Advisor on the indicator! - Monitoring Exp - The xCustomEA Universal trading advisor on custom indicators. Advisor on the indicator! - Exp - The xCustomEA Universal trading advisor on custom indicators. Advisor on the indicator! скачать бесплатно - Exp - The xCustomEA Universal trading advisor on custom indicators. Advisor on the indicator! ключ - Exp - The xCustomEA Universal trading advisor on custom indicators. Advisor on the indicator! открытый код - Exp - The xCustomEA Universal trading advisor on custom indicators. Advisor on the indicator! скачать
-
Expforex Expforex Идеи для Форекс https://www.expforex.com/1NEWDESIGN/NEWLOGO/LOGONEW.png expforex@meta.ua Украина expforex2
Читать Exp - The xCustomEA Universal trading advisor on custom indicators. Advisor on the indicator!
0 $ Есть в наличии

Exp - The xCustomEA Universal trading advisor on custom indicators.

Our new advisor The xCustomEA is based on the adviser The X - Universal EA

The functionality of the universal trading advisor The xCustomEA exactly repeats all the parameters of our advisor The X except for one thing:

The xCustomEA works on a custom indicator and has the ability to program its own trading strategy for the MT5 and MT4 terminals.

In other words: The xCustomEA has a connection with custom indicators that can be downloaded from the Internet or the mql5 market.

Any custom indicator from the internet!

English instructions and articles FinanceApplication Windows 25.04.2020
5 33