User manual to EA Martex

Martexmartingale» and «Forex») – is a universal Expert Advisor for Forex with hedging and martingale. EA Martex can averaged not only their orders, but other orders opened by another EA or opened by the trader manually. To do this, simply set in EA the magic number -1 (minus one). The Expert Advisor will be interesting for both beginners and experienced traders.


  • Before starting the Martex Expert Advisor on a real account, first optimize it in the MT4 strategy tester on historical data (at least 3 months) of your broker.

  • If you want to try Martex Expert Advisor on another currency pair or on another timeframe, you must first optimize the expert Advisor in the strategy tester.

  • Martex EA opens orders on completed bars so when testing in the strategy tester, you can choose the model "Open prices only (fastest method to analyze the bar just completed)".

  • How to optimize the EA see here


  • 4 options for opening orders (by bars and indicators);
  • it can work without averaging, as a regular EA - one order and a fixed lot;
  • can average other, "not their" orders including those opened by the trader manually;
  • in the "hedging" mode, it can open orders in both directions, buy and sell at the same time;
  • control over the use of Free margin, in case of excess - stop trading;
  • Stop Out, upon reaching, closing all orders and stopping work until the next day;
  • breakeven, both for single orders, and the general breakeven for orders with averaging;
  • trailing stop, both for single orders and general for orders with averaging;
  • closing orders by percentage of profit from the Balance;
  • closing hedged orders (“lock”) by percentage, with profit;
  • limit on the number of open orders by martingale;
  • restriction on the total lot size of all open orders of one direction;
  • work on time;
  • sending messages to email about lack of funds and when trading stops;
  • sending Push notifications to your smartphone about lack of funds and when trading stops;
  • "hot buttons" to quickly close all open positions on a currency pair;
  • works on both dollar (USD) and ruble accounts (RUR);
  • works on accounts with quotes of 4 and 5 decimal places.


Hot buttons are designed for quick execution of one command. After pressing the button, its color changes, and the button is blocking, when pressed again, removed the blocking and leads to the original state of the button. Any press of the button EA fixes in its log, you can see the current position of the button on the tab "Experts". You can also unblock the button using the new initialization of the EA (for example, switching to another timeframe). In this case, you do not need to press anything, the blocking is removed automatically.

hot buttons

Close All – closes absolutely all open orders on the current currency pair and removes all pending orders regardless of the magic number.

Close Loss – closes only orders with loss on the current currency pair.

Close Profit – closes only orders with profit on the current currency pair.

enter key

Enter the key = 0 – it is enough to enter the numerical key in the field once so that the Expert Advisor can operate on a real account. After the key is checked, the EA will create a special file which will be stored in the created folder "General_key" (MQL4 -> Files -> General_key). With each new launch, the Expert Advisor finds the key file itself and checks it for compliance with this account. You do not need to re-enter the key. The key is common to all of our free advisors and indicators that are installed on this account.


general setting

Trading is allowed = true, if you select false, then the adviser will no longer open new orders, but all other functions of the adviser will continue to work (trailing stop, breakeven, percentage of closure, etc.).

Magic Number (automatic) = 0 - allows you to specify the EA, which orders (with which magic number) it needs to track. If the magic number = 0, the EA automatically creates the original magic number, which will differ depending on the currency pair and the timeframe on which it is set. Instead of zero, you can set your magic number.

magic number

Lots = 0.01 - if set to 0, the lot volume will be calculated automatically («AutoLot, risk in %» parameter).

Take Profit = 30.

Stop Loss = 0.

Use take profit for martingale = true - to use the additional take profit for orders with a martingale.

Take Profit for martingale orders = 5.0 - in points, the total averaged take profit for all open martingale orders of the one direction.


  • Long only - open and trawl only buy orders;
  • Short only - open and trail only sell orders;
  • Long & Short - for orders of all directions.


Breakeven – when there is a small profit, and trailing stop is still not included, the EA moves the stop loss set at breakeven level.

Profit to enable a breakeven = 15 – level of take-profit in points, at which a breakeven is enabled

Level breakeven = 3 – sets the level, at which a stop-loss must be moved: if set to 1, then the position will be closed, when the profit is 1 point; if set to 0, then the position will be closed with the profit of 0 points.

Slippage = 3 - the level of slippage in points on the volatile market it is better to increase.


risk management

Stop Out %, close all orders = 50 - the level of drawdown in percentage relative to the account Balance, (on Equity) after which all orders on the current currency pair are closed and the EA is suspended the work until the beginning of the next day.

Free margin limit in percent = 30 - the percentage limit on the use of Free margin after which the EA will no longer open new orders, but all other functions of the EA will continue to work (trailing stop, breakeven, closing percentage, etc.).
By this indicator, you can control how much free money is left to open new orders. If the level of use of Free margin has reached 50 % - it means that already 50 % of your funds in margin and you should think about additional replenishment of your account.

AutoLot, risk in % = 0.3 - automatic calculation of size lot depends on the level of risk in percent and the size of Balance. Designed to calculate only the initial lot (orders with a martingale it does not count).

Enable profit percent = false, if true, the EA will close all orders on the currency pair when the set profit percentage on the account is reached.

Profit % for close orders = 1.5 - if the Equity of the account becomes larger than the Balance by a set percentage, all orders will be closed.

_ _ Hedging _ _

Allow hedging = false - allow the EA to open orders both in one direction and in the opposite direction, hedging the current open positions.

Percentage for closing hedging orders = 0.6 - when the set profit percentage is reached, all hedged orders (located in the lock) will be closed.


martingale parametrs

Martingale on/off = true - martingale enabled, false- martingale disabled, if disabled, the EA will work in the normal mode to open market orders, but will not average them.

Multiplier = 1.5 - martingale coefficient, the increase in the lot volume of the subsequent order by a given coefficient. If the multiplier = 1.0, then the EA will place orders only with a lot equal to the lot volume of the first order.

Step between orders = 5.0 - step (distance) in points between martingale orders.

Dynamic step = false - allows to use dynamic step between orders. The distance between orders automatically increases, with the opening of a new order, by the coefficient set in the "Exponent for dynamic step".

Exponent for dynamic step = 1.3 - the coefficient of increasing the distance between orders.

Maximum number of orders = 15 - the maximum number of orders that the EA can open.

Maximum amount of lots = 100 - limit on the total volume of all lots, open orders, one direction.



Indicator: - select the indicator

  • High/Low - by bars, if High is lower than the previous one - sell, if Low is higher than the previous one - buy;
  • CCI - Commodity Channel Index;
  • One MA - one moving average;
  • CCI & MA - one moving average combined with CCI.

select the indicator

Timeframe for indicators: = «current» - select the timeframe of indicators, both for opening the first order and for subsequent orders with averaging. Use the mouse to select the desired timeframe from the drop-down menu. If you select "current" , the indicators will automatically be adjusted for the period of the chart, which is currently set in the open terminal window.

timeframe for indicators

MA period = 27.

MA shift = 0.

MA method: = Exponential.

MA method

MA applied price: = Close price .

MA applied price

CCI period = 11.

Sell level (upper) = 100 - level to open sell orders.

Buy level (lower) = -100 - level to open buy orders.

CCI applied price: = Typical price.

CCI applied price


trailing stop

Mode selection: – the choice of strategy is the trailing stop

  • Normal - standard trailing stop, starts trail only when there is profit;
  • Total trailing stop - by one (average) stop loss closes all open orders in one direction, including lossing orders;
  • Disabled - trailing stop is disabled.

modes trailing stop

Type Trailing stop: - selecting the type of trailing stop on the instrument can be 6 positions:

  • Points - standard trailing stop by points;
  • High/Low - the High/Low of the previous bar;
  • Fractals - by fractals.

trailing stop type

Virtual trailing stop = false - virtual (not visible for broker) a trailing stop.

Timeframe for trailing stop: = «15 Minutes» - choice of the timeframe by which you want to work with trailing stop (except for Points).

timeframe for trailing stop

Trailing stop leve = 14 - trailing stop level in points.

Step trailing stop = 2 - step of trailing, if the profit is 14 points, trailing will move a stop-loss to 2 points.

Indent from High/Low and fractals = 2 - the distance in points from the stop loss to the maximum or the minimum of the bar or the fractal.


trade by time

You can set a period of time, during which the Expert Advisor operates. After the set time has passed, the adviser will stop trading and will not open new orders. At the start of the new period of time (usually it is the next day) the Expert Advisor will start its operation again. "End of operation time" can be set without reference to the "Start of operation time".

In Friday not work = false, if true, then on Friday, the EA will not open new orders, but all other functions will continue to work (trailing stop, breakeven, closing percentage, etc.).

Enable time = false - enable trade by time.

Start of operation time = 02:30 – time, when the Expert Advisor starts to operate, set in hours and minutes.

End of operation time = 21:55 – the time, when the Expert Advisor stops its operation, set in hours and minutes.

Close orders at the end of time = false - allow closing orders at the end of the working time. All orders will be closed only if the account has a profit not lower than the "Profit in the deposit currency". If there is no profit, the EA will not close orders, but will simply stop opening new ones until the next day and the "Start of operation time".

Profit in the deposit currency = 1.0 - the amount of profit at which the EA can close orders at the end of the work.

There are several options of how to set the operation time of the Expert Advisor.

1st option: usual method – the operation time is set in hours and minutes a two-spot ( : ) between hours and minutes is put.

time is set in hours and minutes

2nd option: setting up a year, a month, a day, an hour and a minute of start and end of the operation. A point is put between a year and a month, and also between a month and a day, then a space without a pointis put, and afterwards a two-spot (:) between an hour and a minute is put.

time in days, hours and a minutes

3rd option: setting up a day of start and a day of end of the operation are set. A year, a month and a day of start and a day of end of the operation are set up in the Expert Advisor’s settings. A point is put between a year and a month, but not after a day. The Expert Advisor will start operation at 00:00 and stop operation at 00:00 on the pre-set day.

time only in days


other setting

Sound alert modified stop loss = true - sound signals are allowed when modifying stop loss orders if false, the sound is muted.

Language info panel = English - switch the language on the info panel can be Russian or English.


Background graphics = Dark1 - selects the color background of the chart Dark1 or Dark2 and Light.

background graphics

Send email = false - allow sending messages to email.
How to set up sending messages to e-mail see the "Help" to MetaTrader 4, section "Client Terminal Settings" hereinafter "Email".

Send push notification = false - allow you to send Push notifications to the mt4 mobile terminal installed in your smartphone.
How to set up sending notifications see the "Help" to MetaTrader 4 section "Client Terminal Settings" hereinafter "Notifications".

Show options panel = true - displays textual information about the financial status of the account and currently active commands on the chart, if false, it does not show messages.

Show hot buttons = true - yes, show, false - no, do not show, "hot buttons" in the strategy tester do not work!

Delete objects in minutes = 10 - clears the chart from unnecessary graphical objects (arrows, modified stop-loss and take-profit levels, etc.) in a certain period of time set in minutes passed from the moment, when an object is created.


Currency pair: EURUSD M15
Leverage: 1:500
Deposit: 1000 $
The size of a standard contract: 100 000 EUR
Point value at minimum lot 0.01 = 0.10 $.

martingale on bars

Pic. 1. Set file High_Low_M15.

dynamic step

Pic. 2. Set file Bars_DynamicStep_M15.

martingale on CCI

Pic. 3. Set file CCI_M15

martingale on MA

Pic. 4. Set file OneMA_M15.

martingale on MA and CCI

Pic. 5. Set file CCI&MA_M15.


What is the minimum deposit required to work on martingale? It is difficult to clearly answer this question, the amount of the required deposit depends on many factors, they can be divided into two large groups.

1. Trading conditions of your broker:

  • your trading account type (standard or cent);
  • the contract size of the base currency (usually it is 100 000 at InstaForex 10 000);
  • the cost of the point in the size of 0.01 lot (usually 0.1$ of InstaForex 0.01$);
  • leverage size (optimal 1:500);
  • the Stop Out level, when the broker closes your positions.

2. Your settings and your attitude to risk
For example, let's take one of the parameters, of the allowed number of open orders. Let's say you put there a limit of no more than 7 orders.

Your broker A has contract size 100,000 base currency and the cost of the point with lot 0.01 = 0.10 $. 7 allowed orders is 0.01+ 0.02 + 0.04 + 0.08 + 0.16 + 0.32 + 0.64 and this is 1.27 of the lot! If leverage of 1:500 on EURUSD for this lot size 1.27 a margin will amount 282.66 USD (22.10.2019)! What is the minimum deposit required for such a situation? At least three times more 900-1000 $. If the number of allowed orders is greater, the deposit must be increased accordingly.

Let's see how it will be at another broker B whose contract size 10 000 of the base currency and the value of the point is 0.01 $. On EURUSD with a leverage of 1:500 and lot 1.27, the Deposit will be 28.27 USD (22.10.2019)! That is, the minimum deposit from this broker and with these settings can be only 80-90 $.

Дата публикации: 21-10-2019, 19:05, Проссмотров: 1492

Облако тегов

Архив новостей