THE X AND XCUSTOMEA DESCRIPTIONS OF SETTINGS AND EXTERNAL VARIABLES

THE X AND XCUSTOMEA DESCRIPTIONS OF SETTINGS AND EXTERNAL VARIABLES

7 August 2021, 18:37
Vladislav Andruschenko
1
1 519

===========================================================================================================

The X universal automatic Expert Advisor for MetaTrader working on standard indicators.

             


MT4 The X FULL
MT5 The X FULL

Download The X DEMO + PDF





Signal options Additional signal processing unit
Show_alert_without_opening_positions

If this option is enabled, the Expert Advisor will not open a new position on the signal, but only notify the user that a new signal has appeared.

In this case, all other functions will work in normal mode.
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!


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 > 0, then the next position can be opened only when the previous position on the signal has passed DistanceToOpenNextPosition of profit points!
If DistanceToOpenNextPosition is < 0, then the next position can be opened only when the previous position on the signal is at a distance DistanceToOpenNextPosition points in both sides of the profit or loss!
OpenOppositePositionAfterStoploss

open the opposite position when closing the current stoploss.

Opens the opposite position immediately after receiving the stoploss of the previous deal without using indicator signals.
If the last position was 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.:
if OnePosPerDirection = true and ONlyOnePosbySignal = false
then the advisor can open 1 Buy deal on a signal and 1 Sell deal on a signal
if OnePosPerDirection = false and ONlyOnePosbySignal = true
then the advisor can only open one deal at a signal, either Buy or CELL
if OnePosPerDirection = false and ONlyOnePosbySignal = false
then the advisor can open any deals for each indicator signal
OnlyOnePositionPerMagic Opening of 1 position on 1 magic,
The advisor checks whether there are open positions for this magic number in other currency pairs. If there is no position, the advisor will open the deal at the signal, and the remaining advisors will wait for the completion of this deal.
If OnePosPerDirection = false, then OnlyOnePositionPerMagic = true works like this: 1 position by magic number is allowed;
If OnePosPerDirection = true, then OnlyOnePositionPerMagic = true works as follows: 1 position of each direction is allowed by magic number;
OnlyAlternateSignals Allows you to open positions only one by one.
If the last closed position was SELL, the next could be opened only BUY!
It is necessary to trade the main indicator in No Signal mode
MAX_BUY_POSITION

limit of the maximum number of BUY deals.

The positions opened by signals of indicators are taken into account.

The averaging and refilling positions are not taken into account

MAX_SELL_POSITION

limit of the maximum number of SELL deals.

The positions opened by signals of indicators are taken into account.

The averaging and refilling positions are not taken into account

MaxSpreadToNotTrade The maximum spread at which the advisor can open a position
If the current spread at the time of receiving the signal is greater than the specified value, the indicator signal is ignored until the spread is less than the specified value.
MinSpreadToNotTrade

Minimum spread, in which the advisor can open a position
Warning: This filter is 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 main signal.
And when ClosePositionifChangeOWNSignal - the signal change is found only on the main indicator.
It also works for pending orders.
ClosePosition_After_X_Minutes Closing the position after the set number of minutes.
Also, the Expert Advisor checks the included CloseChangeOnlyInProfit parameter: Closing only profitable positions.
CloseChangeOnlyInProfit Closing deals on a return signal, only when the current position is in profit.
Pending orders options The block of work with pending and limit orders.
StopOrderUSE

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

You can also enable Virtual pending orders:

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

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

StopOrderDeltaifUSE Number of points for a deferred or limit order
(Distance of pending orders)
StopOrderDayToExpiration StopOrderDayToExpiration = number of days for the order expiration.
  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.

Notice! For the EA to work correctly, set a comment no longer than 12 characters.

eg:

Right: ExpforexTheX

Not Right: Expforex The X Set # 12345

RoundingDigits The number of decimal places when a position or order is opened.
  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

If you get a Rejected error and when you hover over the order in the history you see this: (incomplete FOK information of the order), Or you have a BCS broker or Open broker, then you need to install:

TypeFilling = ImmediateOrCancel or TypeFilling = Return

DayToExpiration = 1

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 \ Beyond excess (stop loss at break-even point)
Completely redesigned the algorithm of Virtual StopLoss \ TakeProfit \ trailingstop \ Absolute (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 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 on 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 parameter 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 options Parameters for working with lot
Lots A fixed lot to open a position.

AdditionalLots - An additional lot that will be added to each new deal based on a new signal
CoeficienteLots - Lot coefficient, by which the lot will be multiplied for each new deal on a new signal
(When the advisor is allowed to open more than one position for each signal ONlyOnePosbySignal = false / OnePosPerDirection = false)

DynamicLot A dynamic lot, Autolot for an open position.
You are enabling dynamic lot calculation in percent of free margin and other factors.
Calculation of our autolot.
LotBalancePercent Percent for autolot
RiskRate RiskRate - the rate of your currency against the dollar.
By default, RiskRate = 0 - means that the Expert Advisor will try to find the correct rate in the Market Review.
For Autolot to work adequately with all currency pairs, you need to include the "Show all currency pairs" in the Market Review.
MaxLot The maximum lot that an advisor can open when calculating an autolot and martingale for the first main position
Martin The standard multiplication of the lot of the last closed position at a loss.
If Martin = 1, then the martingale does not turn on.
If Martin = 0, then the Expert Advisor can not open the next position
If Martin = 2, then the first lot = 0.1, the second lot = 0.2, and so on, 0.4 - 0.8 - 1.6
If Martin = 0.5, then the first lot = 1, the second lot = 0.5, and so on, 0.25 - 0.125
Averager options The block of functions for averaging positions, opening positions against the trend
UseAverAdditionalOpeningOrderinOne

The number of orders is considered common for both topping and for the averager.

Attention! Only for MT4 version

AverageUSE Turn on the averaging function.
If the Main position is lost at a certain number of points, our adviser opens a position of the same type. Thus, averaging the first position.
All the functions of the Expert Advisor (trailing stop, Break-even (Stop-loss on the breakeven point ...) will work already from the middle line of positions, which is calculated from all positions of the same type.
For example:
If the SELL position is opened with a price of 1,200, and the price goes up. Then, if the price is exceeded by 100 points (for example) 1.300 - the advisor opens another SELL position
The average line from these two positions = 1.250
The trailing stop and all other functions will work from the middle line of these two positions.
Attention: For different lots of positions, the average price is calculated by the mathematical formula.
TakeProfitALL The distance of the total takeprofit at the opening of the averaging deals.
This option is useful only when you turn on AverageUSE.
Sets the specified takeprofit from the current midline of all positions for ALL positions / deals
Works only when the averaging position is opened
Distance

Distance from the last open position of one type for averaging.

The distance between the positions, the grid cell.
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 deal.
You can set 1.5. Then each new averaging position will be opened through 100 +50 (100*1.5) loss points from the last open position. (100,150,225,337,506)
LotsMartin

Increase the lot for the grid positions.

The coefficient of increase of each averaging position.
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 positions are ignored.

CloseFirstAfterMaxAverage

CloseFirstAfterMaxAverage - Close the first averaging deal (the very first of the currently open averaging deals),when the advisor has opened the maximum number of deals with the MaxOrdersOpen parameter.
If you want to keep a fixed number of Averager grid items (e.g. 5 grid items),the smallest element must be closed with a loss when the 6th element is opened.
For example:

CloseFirstAfterMaxAverage = false MaxOrdersOpen = 5:
If the EA opens the maximum number of averaging deals, which is set by MaxOrdersOpen = 5,then the next averaging deal cannot be opened.

CloseFirstAfterMaxAverage = true MaxOrdersOpen = 5:
If the EA opens the maximum number of averaging deals, which is set by MaxOrdersOpen = 5,then the first averaging trade is closed and the next trade is opened.

Averaging_FILTER_IndSigToTrade1
Averaging_FILTER_TF_IndSigToTrade1
Averaging_Filter1_Reverse

Signal filtering options for opening additional positions.
The Expert Advisor checks the indications of the selected indicator (Filter) and allows or forbids the opening of new positions of an averaging or additional opening on a trend.
The following options are available: Selection of the indicator for the filter, Timeframe, Reverse signals
Additional opening Block of functions for the additional opening of positions on a trend
AdditionalOpening Enabling the opening of additional deals.
If the Main position goes into profit by a certain number of deals, our advisor opens a position of the same type. Thus, averaging the first position.
This helps to top up with a lucrative signal.
All the functions of the Expert Advisor (trailing stop, Break-even (the breakeven point) ...) will work from the middle line of positions, which is calculated from all positions of the same type.
For example:
If the SELL position is opened with a price of 1,200, and the price goes down. Then, if the price exceeds 100 points (for example) 1.100 - the advisor opens another SELL position
The average line from these two positions = 1.150
The trailing stop and all other functions will work from the middle line of these two positions.
Attention: For different lots of positions, the average price is calculated by the mathematical formula.
StopLossALL The distance of the general stoploss at the opening of additional deals.
This option is useful only when you turn on AdditionalOpening.
Sets the given stop-loss from the current midline of all positions for ALL positions
Works only when the refresh position is opened
DistanceAdditionalOpening

Distance from the last open position of one type.

The distance between the positions, the grid cell.
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

CloseFirstAfterMaxAdd

CloseFirstAfterMaxAdd - Close the first additional opening deal along the trend (the very first of the current open deals),when the EA opened the maximum number of deals with the MaxOrdersOpenAdditionalOpening parameter.

Same as CloseFirstAfterMaxAverage Paramter.

Additional_FILTER_IndSigToTrade1
Additional_FILTER_TF_IndSigToTrade1
Additional_Filter1_Reverse

Signal filtering options for opening additional positions.
The Expert Advisor checks the indications of the selected indicator (Filter) and allows or forbids the opening of new positions of an averaging or additional opening on a trend.
The following options are available: Selection of the indicator for the filter, Timeframe, Reverse signals
Time Trade options The block of work with the time of trade, the time limit.
TradeStartStopbyTime The function of work on time.
  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 Undisturbed function (stop loss at the breakeven point) to open positions.
Attention: If the averaging or refilling function is enabled, when the 2 or more positions are opened, the Expert Advisor turns on the Break-Even function (stoploss on the break-even point) from the middle line, and not from the opening price of positions
LevelWLoss

The level of profit in points on which the Stop Loss is set when this function is enabled.

Distance from the opening price to the profitable stoploss

1 = 1 point of profit

0 = Automatic minimum profit mode. The number of points of profit for the Break-even (stoploss on the breakeven point) = Spread of the current currency pair.

LevelProfit The number of profit points gained by the position for setting a stoploss in the LevelWLoss of profit points
Standard Trailing options Standard trailing stop (Escorting positions, by modifying Stoploss into profit!)
TrailingStopUSE Enabling the standard trailing stop function.
Note: If the averaging or refilling function is enabled, if you open 2 or more positions, the Expert Advisor turns on the trailing stop function from the middle line, and not from the open position price
IfProfTrail
  1. - if true, the Advisor starts the modification only when the position is gaining profit to Breakeven (setting stop loss on the break-even point) + TrailingStop profit points.
  2. - if false - TrailingStop starts working immediately after opening a position and making a profit of 0 points and leaving a position as a profit.

In other words: IfProfTrail = false, then the trailing stop starts working immediately after the position is in profit

TrailingStop Distance trailing stop in points
TrailingStep Step of stop loss at a trailing point in points
SaveTPafterTrailingStop When enabled, the takeprofit of the modified positions will remain in place.
For example:
SaveTPafterTrailingStop = false: When executing a trailing stop, the takeprofit of the modified position will be deleted;
SaveTPafterTrailingStop = true: When the trailing stop is executed, the takeprofit of the modified position will be saved.
TrailingStop by SAR Parabolic Trailer Stop block (installing and modifying stoploss on the Parabolic SAR indicator points)
TrailingStopSAR Enable trailing stop function on the Parabolic SAR indicator.
Attention, if the indicator is at a loss for the position, the advisor waits until the parabolic point is in profit for the position.
If we have 2 or more positions of the average, then the Break-even (stoploss on the breakeven point) is considered from the mid-line of the aggregate positions.
TrailingStopSAR_TimeFrame Timeframe for indicator
maximum Indicator settings
CloseALL when Profit or LOSS options Block of closing on the total profit or loss
TypeofClose

Closing on the total profit or loss,

  1. in dollars (deposit currency),
  2. points,
  3. percent of the balance,
  4. 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.

  1. True - enable,
  2. 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.

  1. True - enable,
  2. False - disable
lossss

The number of units (dollars (deposit currency), points, percent) for closing.

TrailOptions Include trailing the total profit when exceeding prifitessss units.
This option means the distance from the prifitessss parameter to include profit trailing.
For example prifitessss = $ 100 (deposit currency) TrailOptions = $ 10 then,
when the position gains a profit of $ 100, the adviser will not close these positions, but will establish a profit level of $ 90. Further, if the profit increases by 1 dollar and becomes 101 dollars, the profit level will be fixed at 91 dollars.
If the profit goes down and reaches 91 dollars - all positions will close at this level.
TrailOptionsStep The step of increasing the fixed profit level
BalanceStart The starting balance, from which the percentage of the balance will be calculated. If 0 =, then the current account balance is set.
ForcedClose Forced closure of all positions after receiving a total profit or loss
MailSend Send mail when closing
Orderdelete Delete pending orders when closing positions
OFFAfterClosePROF Disable the advisor after closing on the total profit
OFFAfterCloseLOSS Disconnect the Expert Advisor after closing for a total loss
CloseTerminalAfterClosePROF Closing the terminal after closing on the total profit
CloseTerminalAfterCloseLOSS Close the terminal after closing for a total loss
Limiting losses and profits Limitation of losses and profits for a certain period
LimitFor

Limit loss and profit for 1 day \ Week \ Month
Limiting LimitFor - Limit type day / week / month
LimitForLosses - a limit on profit
LimitForProfits- loss limitation
LimitType - Limit type by Dollars, Points, Deposit Interest
ClosebyLIMITING - Close the advisor`s deals when the Limit is exceeded
UseCurrentProfit - Take into account, when calculating the limit, the current profit/loss

This function can 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 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
DrawDown_Level
DrawDown_Level - turn on the drawdown control block
Type_DrawDownHR - the type of drawdown calculation based on deals in history and current deals
DrawDown_Level_One - the first level of drawdown in percent double
Type_Deal_Level_One - action when passing the first level of drawdown (disable new signals \ disable averaging of deals or additional opening \ disconnect all deals \ display message)
DrawDown_Level_Two - the second level of drawdown in percent double
Type_Deal_Level_Two - action when passing the second level of drawdown (close all profitable positions \ close all loss-making positions \ close all \ display message)

For example:
DrawDown_Level = true, DrawDown_Level_One = 50, Type_Deal_Level_One = No_NewDeal, DrawDown_Level_Two = 90, Type_Deal_Level_Two = Close_All. With these settings, as soon as the current drawdown of deals in history and current deals exceeds the level of 50% of the current deposit, EA can not open new deals on new signals. At the same time, the averaging functions will work. When the drawdown exceeds 90%, EA immediately closes all deals.
Withdrawal Virtual withdrawal tool in strategy tester for simulating the work with a deposit
OnTester_Custom_max

In the Tester block, the variable OnTester_Custom_max is added, in which you can write down your criterion of genetic
optimization.
More details about the test results: Statistics
A record in the form of a formula.

For example :

OnTester_Custom_max = "STAT_PROFIT * STAT_TRADES / STAT_EQUITY_DD"

It is mandatory to specify the names of variables, as in the reference book!

You can set the minimum values at which the optimization will take into account the result during genetic enumeration!

In other words: You can set a condition: "the minimum number of deals" (or other parameters),
upon which this run will be counted as a result.

If during selection the advisor opens fewer deals than specified in the settings, then this run of the optimizer will not be counted as a result!

--Attention! For advanced users only.

  1. OnTester_Min_Trades = 0; // Min Deals for optimization
  2. OnTester_Min_Profit = 0; // Min Profit for optimization
  3. OnTester_Min_ProfitFactor = 0; // Min ProfitFactor for optimization
  4. OnTester_Min_Balance = 0; // Min Balance for optimization
  5. OnTester_Min_Equity = 0; // Min Equity for optimization
  6. OnTester_Max_Balance_DD = 0; // Max Balance DD% for optimization
  7. OnTester_Max_Equity_DD = 0; // Max Equity DD% for optimization

Detailed USER GUIDE for this

Withdrawal Added a virtual withdrawal of funds in the tester:

Withdrawal - Enable virtual withdrawal of funds when testing in the strategy tester;
Withdrawal_mode - withdrawal mode, in the deposit currency, as a percentage of the current balance (currency/percentage);
Withdrawal_amount - Number of withdrawal tools;
Withdrawal_periodicity_days - Frequency of withdrawal in days;
Withdrawal_Max - Maximum withdrawal amount;
Withdrawal_EndOfTest - Withdrawal after the end of testing;


Share it with friends: