Fixed a bug with drawing objects for new versions of MT5 terminal
-Added a parameter for calculating the commission per trade, if the commission is not fixed.
CommissionPer1LotinPercent = The cost of the commission for 1 trade per 1 trading lot in percentage.
This parameter can be viewed in the contract specification in the Commissions section, If this parameter is not fixed and is indicated as a percentage!
Helps the advisor to calculate the commission when closing a deal, if the commission is not known in advance from the contract specification (Some brokers)
EAPADPRO v40 update, according to the new rules for using the MQL5 Market
EAPADPRO v39 update;
Recompilation of the Expert Advisor in the latest build of the terminal!
The Trading Days Work function has been updated.
Permission to trade on days of weeks, with round-the-clock work, has been updated.
Fixed display of Recommended field
Функция ForcedModify проверяет и Магический номер.
Force global variables to disk.
The delay of searching for the next signal is added if the position of the previous signal is not yet open.
Push error when opening and closing positions has been fixed.
Recompilation in the new version of the terminal.
An important update for those using the MQL5 VPS!
Due to the fact that the hosting location folder has changed and MetaQuotes added a new variable TERMINAL_VPS, new edits were applied to all experts . !
EAPADPRO v31 Update
Code optimization and increased speed.
Fixed display of the current Mooving Average signal.
Added information labels to the chart:
When activated ShowInfoAverager = to true, you will see the following information:
1. Average = Display the average (zero) line from positions of the same direction. If you move to a label, then there will be additional information about the calculation of the average line!
2. Next Average = Display the next averaging position, which will be open in this direction. If you move to a label, then there will be additional information about the distance!
- EAPADPRO v27 update
- Fixed the error of obtaining the average spread when opening a new bar on some currency pairs (when Ask and Bid = 0).
EAPadPRO version 26
- Update EAPADPRO v 25
- Additional languages added to the panel: Spanish, Portuguese (Brazil), German, Chinese, Japanese;
The translation was made using the GOOGLE Translator + MQL + Terminal site!
If you find an error in your language, please report it in messages. Thank!
- Increase the speed of the panel;
- Updating data on the block "Profit by Date" works 1 time in 5 minutes to save computer resources;
- Fixed "duplication" of lines in the help and greeting;
- Automatic closing of the panel 3 hours after the last use to save computer resources;
- Automatic closing of the panel on the VPS from METAQUOTES to save resources MQL VPS;
- Added the ability to Collapse / Expand the panel when you double-click on the window title (Analog Windows);
- By default, we collapsed the Extra Buttons block;
- Update EAPADPRO panel to v23 version
- Added a control unit and control the speed of the quotes and the speed of testing.
- Added block output table open deals and positions.
Manual setting of the minimum average spread so that all parameters of the adviser are brought to this average spread.
with AutoCheckLowSpread = false and setting ManualMinimumAverageSpread = 10:
If the average spread on a currency pair is lower than 10 pips, then the adviser takes the value of the average spread ( AverageSpread ) as 10 pips, and all system parameters work from an average spread of 10 pips.
If the average spread calculated by the advisor is more than 10 points, then the advisor takes the average spread = the calculated value.
EA works on the movement of currency pair quotes.
An important parameter of the system is the spread.
A zero spread is prohibited for the program.
In this version, the adviser brings the average spread to 1 if the spread on the server is 0.
This allows you to avoid erroneous opening positions with an average value of 0!
-------------------------------------------------- -------------------------------------------------- ------------
For your convenience, we have added a brief description of the parameters in the table of external variables and expert settings.
Update panel EAPAPDPRO v21:
-Added information about the ban on trade for various reasons.
EAPADPRO Update v20
Upgrade the EAPADPRO to version 20.
Block Limiting losses and profits updated:
Parameters LimitForLosses and LimitForProfits changed by type to double
A new CUSTOM mode has been added to the LimitType type. You can specify your monitoring values in minutes, the LimitForCustom_Minutes parameter.
To the Last Price information output block:
Added the number of points till the next averaging. Indicated in brackets from the last opening price.
To the Aver Price information output block:
Added the amount of commission and swap in points.
The CloseByMa function has been divided into 3 types of closing:
False=0 - the EA does not close positions when the MA direction changes.
OnlySignal=1 - when the MA direction changes, the EA closes only when one main signal position is open. There should be no averaging positions open.
SignalAverage=2 - when the MA direction changes, the EA closes all positions, including averaging positions.
Update New Feature:
Use the original calculation of commission and swap when enabling the functions: Breakeven, Trailing Stop, Averaging.
The original commission calculation is based on the formula for calculating the value of 1 point from the open positions on a given symbol and magic number. Negative swap and commission are taken into account during calculations. The function returns the value of the negative swap and commission in points, and considers this when working with breakeven and trailing stop.
Note: if your broker has a floating spread, commission is calculated and set during the operation of the breakeven and trailing stop functions, but the spread may increase, leading to additional loss points. This is not a calculation error!
Also, note that when a swap occurs, the EA recalculates the breakeven line and sets new stop loss levels is the server allows it (restriction on the minimum Stop Level of your broker). If the server does not allow setting breakeven and returns the minimum stop level error, the EA will be unable to modify the position and additional loss points may be received.
In order to avoid losses when using accounts with commission and when receiving a negative swap, it is recommended to increase the distance of the breakeven or trailing stop.
The breakeven level (LevelWLoss/LevelWLossMANUAL) can be calculated manually, taking the commission into account.
For example: commission for opening and closing position = 2 USD (EURUSD) per 1 lot. So, in order to cover the loss on the commission, it is necessary to set LevelWLossMANUAL = 2 (points) + 1 (confirming) = 3 points.
Thus, the EA sets breakeven to +3 points, which in turn will cover the loss on the commission.
- Added a special mode to the breakeven function through the LevelWLossMANUAL parameter
When LevelWLossMANUAL = 0, the breakeven point is calculated based on the current spread. This allows making the breakeven level dynamic and closing with the minimum profit of 1 spread. If the position's profit increases, trailing stop comes into play.
(This mode worked in previous versions of the expert)
If LevelWLossMANUAL = 1, the EA will set breakeven to 1 point!
Only the negative values are considered in calculation of the additional commission and swap points (positive swap has no effect on calculation)
- Update for the information panel EAPADPRO v2.0;
- The code of the EA has been optimized to receive a large number of signals;
- Increased the EA operation speed;
- Updated work with a small spread;
- Updated the operation of averaging;
- Updated the commission calculation algorithm;
- Updated the average spread calculation algorithm;
- Updated the operation by bars, now the EA is able to perform multiple deals if a signal is repeated on 1 bar.
- Added the ClosingPositionAtASpecificTime parameter = close all positions at a certain day and time.
The variable format: WeekDay/CloseHour:Close Minute
For example: ClosingPositionAtASpecificTime=5/20:00
This means the EA closes all open positions at 20:00 on Friday.
- Fixed commission calculation on SELL positions when using averaging
- Attention: Typos have been fixed in some parameters. Check your settings if you changed them.
-Fixed an error which prohibited trading when using Limiting losses and profits
- Fixed the trailing stop error when there are positions in different directions.
- Improved the operation of the Set_StopLoss_to_the_next_profitable_position_level
- Improved the operation of the Averager
Fixed an error with position averaging when trading multiple symbols with the same magic number simultaneously
- Increased the algorithm processing speed towards performance and receiving signals.
- Added the SecondsToRefresh parameter to the EAPADPRO block - refresh rate of the information on the chart (default is 10 seconds). This is done to reduce the CPU load.
- Added the Set_StopLoss_to_the_next_profitable_position_level option. When enabled, this option monitors the open positions and transfers the stop loss to the next profitable levels. If the EA opens a BUY order, but the price moves against the position, 3 averaging positions are opened at the lower levels. Then, the price moves in the direction, but does not yet touch the middle line to activate the trailing stop. And if the price passes the opening level of lower position 2, the new option activates transferring the stop loss of the lowest position to the breakeven level. And if the price passes the level of the lower position 3, then the stop loss of the first position will be equal to the opening level of the position 2. And the stop loss of the position 2 = opening price of this position, and so on. If the price touches and goes down, the 2 positions will achieve breakeven and profit. Then the EA opens the averaging positions according to the algorithm again. But 2 profitable deals will be fixed.
- Fixed the breakeven error that occurred in accounts where the stop level = 0.
- Added the automatic spread level function. On accounts with commission, the EA may set too small levels due to the small spread. At the same time, the "Low" message will be displayed in the EAPADPRO dashboard. This function protects from using the EA on a small spread and allows to neutralize the difference between "normal trading" and trading on the accounts with the "small spread".
- Added support for the deposit currencies for the Autolot function, which are different from EUR USD RUB
- Added the RiskRate parameter - the exchange rate of your currency against the USD. The default RiskRate = 0 means that the EA will attempt to find the correct exchange rate in the "Market Watch". For the autolot to work adequately with all currency pair, it is necessary to "Show all" currency pairs in the "Market Watch".
Update of the "Averaging" block for the Brazilian market
Global update 2017
- Improved the signal detection system. Fully revised the algorithm for obtaining signals.
- Fully revised the function for determining the average spread. Changed the default value of the TimeToCheckAverageSpread parameter to 80000 (80 seconds) for determining the average spread
Note: During the first TimeToCheckAverageSpread/1000 seconds the EA does not trade, but collects information!
This done to average the floating spread of your broker and to avoid false signals during significant fluctuations in the spread values.
This option is disabled for fixed spreads.
- The DistanceMANUAL parameter has been renamed to AverageDistanceMANUAL;
- Updated the calculation of averaging and the MaxOrders parameter for hedging accounts.
- Algorithm for signal calculations will be disabled when the trading time (Time Traiding) is disabled in order to increase the testing speed of the EA.
- Modified the TrailingStep parameter. If TrailingStep =0, the TrailingStep = TrailingStop.
This means that the trailing stop modification step will be equal to the trailing stop level in spreads.
- Removed timer from the EA code, due to the unstable operation of the timer.
- When using trading by time, the calculation of the signals logic is stopped at non-trading time in order to increase the algorithm operation speed.
- Added the ReverseSignal parameter - reverses the strategy signals when enabled.
Note: When enabled, the МА filter is also reversed
- Added the Magic parameter (Other Settings block) - default values is -1 (for maintaining old positions without magic). If there are no existing positions, you may use a unique magic number.
- Added the CloseByMa parameter - when this parameter and the MA filter are used, the positions opened not based on the MA trend will be close
Note: if the position has averaging positions open, those positions will not be closed.
- Added support for rouble accounts for calculation of the automatic lot in DynamicLot
- Added parameter to manually set the distance for the TimeOpen signal:
DistanceTickMANUAL - set the signal distance in points.
DistanceTickMANUAL has a higher priority than DistanceTickSpred
- Added the EAPADPRO information panel
Details on the panel in our blog: https://www.mql5.com/ru/blogs/post/687140
Moved the technical information on the strategy to the Strategy block. Its details are not disclosed. This block helps in studying the market and subsequent signals
Added automatic checking and normalization for all stops to tick size on the current currency pair.
For example, if the tick size on the WING17 symbol is 5 points, then all stop loss and take profit values will be normalized.
For example, the contract price is 58840 and the automatic stop loss calculation resulted in 1211 points, the final stop loss will be normalized to 1210 points.
Added function that allows simultaneous trading in both directions.
Trade_by_BUYSELL_Separate - when enabled, two directions are traded separately from each other - BUY and SELL orders are processed separately.
Attention: Only for HEDGING accounts
Added the average price line for hedging accounts
Added the ClosePosifChange parameter - closing position by opposite, once a signal for changing direction appears.
Attention: This parameter should be activated with caution and only when necessary. When this parameter is enabled, the averaging algorithm stops working correctly!
Limiting loss and profit per 1 day/week/month
Limiting LimitFor - Limitation type day/week/month
LimitForLosses - Limit by profit
LimitForProfits- Limit by loss
LimitType - Limit by USD, points, percentage of the deposit
ClosebyLIMITING - Close deals of the EA when the limit is exceeded
UseCurrentProfit - Consider the current profit/loss in calculation of limit
This function is capable of disabling the EA operation in case the EA accumulates certain profit/loss in deposit currency per day/week/month The EA will be reactivated the next day/week/month
For example, LimitFor=DAY LimitForProfits=1 Close by total profit = 10 USD
You can also select the limit type (LimitType) for calculations. In the USD, points, percentage of the account balance.
If you need to close and delete all deals using this EA once the limits are exceeded, you can set ClosebyLIMITING = true
The UseCurrentProfit parameter prohibits or allows considering the current floating profit/loss for this EA
Added check of margin requirements for the brokers, with which the current balance and the margin are updated daily.
Code optimized in order to reduce CPU load.
Added support for the EA operation on the Brazilian market.
Added automated calculation of commission and swap in the Trailing Stop and Breakeven functions.
Now Trailing Stop will only trigger when the position covers charged commission.
Fixed MovingInWLUSE breakeven error, where Stop Loss could be ranging between the breakeven level and an activated trailing stop.
The Expert Advisor works on hedging and netting accounts.
Improved trailing stop and stop loss modification.
Changed the operation of Stop loss\Take profit modification with floating spread.
For brokers, who do not accept too frequent modification requests.
Fixed the price rounding error for averaging block
In the 'Profit' field: new profit/loss value in points
New parameter StartAveragingFilterMAafterNdeals
The parameter enables filter of averaging trades after a preset value, e.g.:
Every averaging will be filtered using MA
First two averaging trades will not be filtered using MA, third trade will be filtered
Updated parameter DistanceAverageSpred_Koef.
First distance = Spread*DistanceAverageSpred*DistanceAverageSpred_Koef
Second distance = Spread*DistanceAverageSpred*DistanceAverageSpred_Koef*2........
First distance = Spread*DistanceAverageSpred
Second distance = Spread*DistanceAverageSpred*DistanceAverageSpred_Koef........
Alert: This EA may not work on hedge account.
Added parameter for selecting the trading direction:
new parameter "typeorder" - type of trading:
- Only Buy;
- Only Sell;
- Both Buy and Sell;
Added parameters for filtering deals based on MA:
MethodFilterMa - MA METHOD;
TFFilterMA - TIMEFRAMES;
Improved the averager operation. The averager operation is filtered by current prices.
Added parameter SaveTPafterTrailingStop - save the take profit when modifying the trailing stop
Fixed the error in determining the MinMax of the spread
Added the step parameter for the trailing stop - TrailingStep
Added Rounding parameter:
Without rounding - place stop orders without rounding
To 1 digit - rounding by 1 digit. For example, if Stoploss= 1.23456, the trade will be opened with a stop loss of 1.23450
To 2 digits - rounding by 2 digits. For example, if Stoploss= 1.23456, the trade will be opened with a stop loss of 1.23400
Added the parameters:
MaxSpreadToNotTrade - maximum allowed spread, when exceeded trading is disabled
MinSpreadToNotTrade - minimum allowed spread, when exceeded trading is disabled
AveragingbyFilterMA - set an averaging order only if the MA Filter shows the same direction as the direction of the trade
(If you want to open an averaging order and MA is above the buy price, the averaging order is not opened).
Added the Autolot selection mode.
TypeAutolot= 1 Autolot is calculated based on the current balance
TypeAutolot= 2 Autolot is calculated based on the current free margin
Added automatic detection of the order filling type.
Set the default for MaxOrders = 5. The maximum number of averagings for the position = 5.
New parameter Slippage - slippage in points during deal opening. If a server returns a requote on a signal, the deal will be omitted.
New parameter CloseAllTradesbyOutofTime - all trades positions will be closed at the end of the trading time with Times options used.
ShowInfo=true - show an information block on the chart
Added a trend filter.
Algorithm for determining a trend - location of MA relatively to the price.
The MA period parameter is included into PeriodFilterMa settings.
MA is determined by TF = M1
HoursSleepEaAfterStopLoss=0 - hours to wait before opening a new positions after closing a deal by stop loss.
Manual Take Profit has been fixed.
Fill policy parameter has been added to the external parameters:
This fill policy means that an order can be executed only with the specified volume. If the required volume for a given financial instrument is currently unavailable in the market, the order will not be executed. The required volume can be filled using several offers currently available in the market.
This means that a trade will be executed with the maximum volume available in the market within the value indicated in the order. In case entire order volume is not available in the market at the moment, a partial fulfillment is possible, but any portion that cannot be filled immediately is canceled.
This fill policy is used for market, Limit and Stop Limit orders and only in the Market Execution and Exchange Execution modes. In case of partial filling a market or Limit order with remaining volume is not canceled but processed further.
When a Stop Limit order triggers, a relevant Limit order will be placed with the Return fill policy.
A new option has been added:
MinTimebeforenextAverage = 5; // Min Time in minutes for next step for averaging
The minimum number of minutes until the next opening of an Averaging order! Useful for large candlesticks. Thus, we set a limit for the next order opening in minutes.
Added option ModifyStoplossEverySeconds = 0.
Modification of the Stop Loss at a new spread every specified amount of seconds.
This allows you to modify the Stop Loss for a new spread.
The value of at least 10 seconds is recommended, so that you are not banned by your broker for frequent stop loss midifications.
If 0, the option is disabled.
This modification is disabled when your position reaches breakeven.
Added new averaging parameters:
DistanceAverageSpred_Koef = Koef to next step for averaging
- set spread increase/decrease ratio for trade averaging from the initial DistanceAverageSpred value.
DistanceAverageSpred_Koef = 2, DistanceAverageSpred = 50: the first averaging trade is performed at the distance of 50 current spreads. The second one is performed at the distance of 100 current spreads!
DistanceAverageSpred_Diferent = steps for averaging separated by commas
- set averaging values in spreads separated by comma.
"10,20,50,50,20,10" means that the first averaging trade is performed at the distance of 10 current spreads, the second one - 20 spreads, the third one - 50, etc.
If three values of "10,20,30" are specified, all trade distances after the third trade are equal to 30.
Added open parameters for manual setting:
TakeProfitMANUAL = TakeProfit 0 - Autoset
DistanceMANUAL = Distance of Averaging 0 - Autoset
TrailingStopaMANUAL = Distance TrallingStop 0 - Autoset
StopLossMANUAL = StopLoss 0 - Autoset
LevelWLossMANUAL and LevelProfitMANUAL
If you want to set fixed values, for example, for a stop loss, you may set StopLossMANUAL = 1 000 points.
Or if you want to set fixed values of the averaging distance, you may set DistanceMANUAL = 100 points.
Significantly increased the speed of the EA testing in the strategy tester.
Fixed too long stop loss received during a too high spread leap (if the spread is increased 10 times, the stop loss is too big).
Fixes reported bugs.
Added the info panel to the chart the EA is launched at.
Displayed signal volume and power.
- Forced Modification of SL\TP in Market Trade
- Comments To Open Orders
- Use trade sounds
Fixed errors reported by users.
Added forced attempt of Stop Loss modification when opening a deal.
Fixed variable "Maximum number of orders for averaging".
In case of any error from the server, a comment is added in the Log.
Added ability to disable Take Profit. When TakeProfitTickSpred=0, Take Profit is not specified.
Fixed error of deal opening, if the last deal is not found in history.
- Maximum number of orders during averaging.
- Stop loss of every next deal is calculated on the basis of the open price of the last order instead of the current price.
- Signals and variables of arrays containing signals are reset on start and every new day.
- Signals are now detect only at non-rollback movements in the same direction.
Added an option to calculate average spread used for calculation of parameters and trading. As a result, fast changing spread does not affect trading and false signals. There are less false signals during testing.
TimeToCheckAverageSpread=8000 - time in milliseconds to calculate average spread.