Popular Posts

Editor'S Choice - 2020

Brainy Locker advisor - forget about losing trades

“Any sufficiently advanced technology is indistinguishable from magic.”Arthur Clark

Unprofitable transactions have an extremely negative effect on the brain of a trader, especially when it comes to the fragile beginner's psyche.

Is it possible to avoid stress from drawdown and losing positions? It is possible using the locking technique. However, it is quite complex and requires certain skills to exit the lock.

A powerful auxiliary adviser will help to cope with this. Brainy locker. It's simple: as soon as a drawdown appears on your account (due to manual transactions or the trading of a robot), the adviser takes matters into his own hands and "solves" the problem.

The hero of today's Brainy Locker review is an auxiliary adviser that removes the need to fix a loss by replacing traditional stops with a “lock” (Lock). At the drawdown value set in the settings, the robot automatically opens the opposite position, equal in volume to the trader’s open losing trades.

Such a technique allows you to only “freeze the minus”, but the main value of the Brainy Locker adviser is the inherent algorithm of sequential closing of the “lock” due to the profit received from auxiliary transactions or on price bounces (returns) to the “castle” zone. The adviser can be used as an additional risk management tool in any automatic or manual trading system.

Brainy Locker Advisor Features

Platform: Metatrader 4
Advisor Version: 1.28
Currency pairs: any
Timeframe: any
Working hours: round the clock
Recommended Brokers: Roboforex, Alpari, Exness

Locking Forex Transactions

A lock or lock (Lock) is a tactic that is common only in the Forex market, thanks to the peculiarity of the Metatrader trading platform, which allows you to simultaneously hold two differently directed positions on the same instrument, in particular, a currency pair:For example, a trader can first buy 1 lot of EURUSD and immediately sell 1 lot, the terminal will display the financial result for both positions, whereas similar two operations on another platform would lead to the closure of these positions.

With equal volumes of short and long, the negative result of one order is compensated by the profit of another, it is believed that the loss was taken to the “castle”. What and how to do further with this position is described in detail by a thematic article on our website.

The locking theme is very popular and in demand by traders, this is proved by the unsuccessful attempt of developers to exclude the possibility of opening counter orders at the initial launch of Metatrader 5. Later they had to return this mechanism under the threat of a complete failure to release the new version of the terminal.

The volume of the article on the website about locking positions clearly reflects the complexity of this process, but now, thanks to the efforts of the programmer and PAMM manager Rever27, well known to visitors to our forum, traders can automatically exit the “frozen” losses with the help of a robot Brainy locker.

Advisor working principle

Brainy locker - This is an auxiliary adviser. The task of the robot is to “lock” the drawdown indicated by the trader in the settings for the open position, then apply the algorithm for reducing the loss (taken to the castle) to zero by gradually reducing the lot size of open orders due to future profit.

The robot automatically monitors any manual and automatic transactions, starting work as soon as the loss is equal to or becomes greater than the user set in the settings Brainy locker drawdowns (both as a percentage and in the account currency). The adviser does not manifest itself in any way before the formation of a loss, its first step is to open an opposite order in direction, equal in volume to the already existing transaction of the trader.

Rever27 fully automated the system by adding a trading algorithm to the locker code that opens the “lock” with the help of earned profit, working on the tactics of grids and Martingale. It turned out an adviser with a separate set of optimized and set parameters - Unlocker.

The algorithm is displayed as a separate part of the code that is disabled in the settings, so the trader can use third-party advisers to close the lock. To attach an additional robot to the one working on the chart Brainy locker, you need to set the same "magic numbers" in the settings of both advisers.

MagicNumber are identifier digits that are necessarily present in any robot. They are assigned to open and pending orders of the trading system, so as not to confuse them with the positions of other advisors when working on the same instrument, otherwise one order will open one, and another algorithm will close.

In case of Brainy locker the opposite situation arises - the trader must give orders of “alien” trading systems to the management. This is valid because the locker code only works to exit the drawdown. With the same Magic Number, the algorithm will constantly monitor the total amount of current profit for open positions, automatically closing part of the transactions of a third-party adviser and at the same time reducing the “frozen” loss.

Features of the Brainy Locker:

  • To open the “lock” with the built-in Expert Advisor, you must enable Unlocker, - before starting work, your own version of the Advisor with the same Magic Number must be attached to the account;
  • The robot is not a separate trading system! It can not be run for profit!

Consider this moment when trying to “run in the tester” Brainy locker - the trader will see the logic of the grid, closing the minus, but will not detect the growth of equity. Features of testing and optimizing settings Brainy locker described at the end of the settings list.

Description of settings

The Expert Advisor settings are divided into two blocks: Locker Settings with the parameters for setting the lock, it should be equal to the traditional size of the stop loss used by the trader in the strategy, and the Unlocker block, which can be configured if there is no own adviser to close the "lock".

Developer Rever27 recommends adhering to the built-in algorithm and not interfering once again with automatically placed orders Brainy locker.

Block Locker Settings:

Min Drawdown% for open Lock (0 - off) - percentage of drawdown from the deposit at which losing orders are “locked”. By default, the drawdown is 30%, when the value “zero” is set, the lock setting function is disabled;

Min Drawdown Balance for open Lock (0 - off) - drawdown on the balance in the account currency (not points!), defaults to zero - the option is disabled;

Close Other Symbol Charts - automatic closing of schedules (except for the working one) after installing the lock in order to stop the work of other trading experts. There is a choice of options:

  • Do not close - option does not work;
  • Close Symbol Charts - “duplicate” charts of a specific instrument are closed;
  • Close All Other Charts - all charts are closed, except for the “working one”, in order to stop the work of other robots that may not correctly respond to the locks of this advisor, or change the goals of already “locked” positions.

Delete Locked Orders TakeProfit / StopLoss - removal of all pending orders simultaneously with the conclusion of the first locking transaction, the default value is true (enabled).

Settings for the share of profits allocated for closing the lock - Lock Solve Settings:

Part Close Lock Lot - lot size, with which the "lock is opened", - the lock and locked orders are partially closed, the parameter cannot be larger than the "working" strategy lot, the default value is 0.01;

Use Bank Balance:

  • If the value is “true”, the trader includes the ability to close the loss of the “castle” due to the accumulated profit traded from the moment the lock occurred, as soon as it exceeds the “frozen minus”;
  • If false, the Forcibly close UnLocker Orders function is automatically enabled (see its value below).

Min Sum Balance To Partition Close - the minimum value of the total profit for closing part of the loss of the lock, which consists of the fixed and current profit of positions, the operation of the parameter is associated with the option described below;

Forcibly close UnLocker Orders:

  • If the value is “true”, the EA forcibly closes the profit orders of UnLocker (or your EA) if the threshold for closing a part of the loss defined in the setting described above is reached;
  • If false, only the fixed profit of Bank Balance is used to close the loss.

Unlocker Advisor Settings:

Use unlocker - turns on / off the use of the built-in adviser (grid), whose profit is used to exit the "castle";

Magic Number (Unique) - a unique identifier that in this robot helps to entrust the operation of the lock disclosure algorithm to another adviser, for which their "magic numbers" should have the same value (with Unlocker turned off!). You cannot use the magic “999”, “11111” and the magic of your open losing trades. All of them are taken into account in the code;

Set name - file name with presets of the UnLocker advisor;

Open Orders Direction - direction of opening transactions by UnLocker advisor. It can be both in both directions, and separately;

Lot - fixed volume of the trading lot for the first knee of the adviser grid;

Take profit - the size of the pending order to fix the profit (in points);

TP: Include Swap and Comission - an option that takes into account broker fees (swaps, spreads, commissions). If enabled, then at night the TP of all advisor grid orders is recalculated to the correct one;

Max Spread BUY - protection against slippage, which prohibits the withdrawal of BUY orders into the market when the spread increases above a specified value (in points);

Max Spread SELL - protection against slippage, which prohibits opening SELL orders when the spread increases above a specified value (in points);

Order grid settings - Unlocker Grid Settings:

Grid distance (pips) - negative distance from the last order in points, after which the next averaging order is opened (grid step);

Multiplier - lot multiplier, increasing each subsequent order according to Martingale tactics;

TP Decrease Percent - percentage reduction in the take profit level of the grid with each new open order;

Breakeven level - serial number of the order on which the take-profit of the grid of orders will be transferred to breakeven;

Breakeven step (pips) - the permissible offset from zero of the breakeven line in points (may take negative values);

Averaging level - the sequence number of the grid order, after which Martingale is disabled, and subsequent transactions will be equal in volume to the last open transaction.

Service Settings - Other Settings:

Show panel - display / shutdown of the information panel with reports on the settings / operation of the Advisor;

Show Signal Points - display / deactivation of text labels, information on grid transactions and closed lock orders on the chart;

Panel color - color background of the information panel;

Logging mode - log log filters:

  • All - display all data on work;
  • Only Errors - display only advisor errors;
  • Off - disable logging.

Advisor Test Mode - Testing Settings:

Built extra grid for open lock (testing) - Unlocker error checking mode in testing mode (opening test orders for the possibility of activating the lock). In real trading is not used;

Build second testing grid for open lock - permission to open the lock a second time in test mode.

To check the “built-in mesh” algorithm for unlocking the lock:

  • Open the Metatrader 4 Strategy Tester;
  • Select Brainy locker, any timeframe, historical span, testing and quality of candlestick modeling;
  • Go to the Expert Advisor settings through the Expert Advisor option and turn on Built extra grid for open lock;
  • To make the process indicative, set the minimum drawdown size Min Drawdown% for open Lock (for example, equal to 3%);
  • Run the tester and adjust the visualization speed to see how the grid of orders is built:

After starting the mode Built extra grid for open lock the first transaction passes instantly, without any logic - the task of the test is to show how the lock is built and closed, demonstrating the operation of the grid:Brainy locker conditionally consists of two parts - the lock (lock) installation code for losing orders and Unlocker, which closes the “frozen minus” using grid tactics. This part of the strategy code can be optimized and used as a third-party adviser for trading, if set in the settings:

  • UseUnlocker true
  • Min Drawdown% for open Lock equal to 0;
  • Min Drawdown Balance for open Lock also zero value.

Advisor work examples

Complexity settings Brainy locker compensated by the simplicity of the logic of work. The trader must calculate what percentage of the deposit is equivalent to the size of his usual stop-loss in order to set “Min Drawdown% for open Lock» in the settings and forget about the stops.

This can be done by “dragging” Brainy locker from the “Navigator” window of Metatrader 4, when the advisor settings window opens. If the user has difficulty installing it on the platform, he can use the appropriate instructions on our website.

If the smiley of the robot smiles, you can start manual trading, the lock will work automatically, the trader will see the opposite order opened by the robot with the same transaction volume (1). The involved “lock resolver” (UseUnlocker must be set to true) connects to the loss reduction process instantly, building its own order grid (2).As can be seen from the figure, the trader left the default value of the minimum size (3) of the grid volume, and it is not comparable with the trading lot (1 to 0.01). This will lead to the fact that the Unlocker algorithm will have to open at least 10 transactions in order to “resolve” the lock.

The first grid order has the largest take profit, which is then adjusted downward, as the number of knees increases.Be careful: the adviser only accompanies the loss recorded by the lock, attempts to open deals with your hands after installing the lock can interfere with the algorithm, the adviser itself will not take them into account in calculating income. Also, you cannot use two versions of the adviser on the same account at once - this will simply violate its logic of work.

That is why in the settings there is a function to close all charts, in addition to which Locker is installed. This helps with modular use. Brainy locker in conjunction with the main automated trading system. Closing the charts disables the adviser, leaving only the management of the “lock”.

Work Brainy locker in conjunction with an advisor replacing Unlocker, it is built in a different way. Before starting a transaction or starting automatic trading of the main algorithm in the Loker settings, turn off the grid (UseUnlocker must be set to false). The next step is changing the Magic Number to another number.After these procedures, we start trading, but first the trader must prepare a “replacement” Unlocker to start it immediately after receiving a loss and installing the lock. Without this, with the UseUnlocker block disabled, the robot will not be able to resolve the lock. Starting the replacement early will start the rollout algorithm earlier than the loss.

Unlocker is replaced only by an adviser with a grid strategy that has the same settings as Brainy locker “Magic number” and allowed only one-way transactions.

In this case, the grid of orders is built on a different chart, where, after opening the lock, we will attach the Unlocker replacement (in the example, this is Smart-Grid). The grid will work only in one direction, and part of its orders will be closed by force Brainy lockeras soon as their total current and fixed profit will partially reduce the size of the “frozen” loss. It is also worth noting: if your adviser closes orders at a loss, Locker will take this into account when calculating the balance of closed orders, so carefully choose a trading system.

Brainy Locker Features

Using Brainy locker as an auxiliary module for setting a lock on the orders of the main trading adviser, be sure to test their bundle on a demo account. Once again, pay attention to the important nuances of organizing such a joint trade:

  • Robots must be installed on different graphs;
  • After installing the lock, only the schedule should remain Brainy lockerAll old advisers should be removed;
  • At this stage, the trader can connect any other algorithm instead of Unlocker, provided that it is installed in the settings UseUnlocker = false and the same value Magic Number;
  • For additional trading, you can use any currency pairs;
  • In case of questions, please contact the forum thread devoted to the description and discussion of the robot Brainy locker. The developer of this adviser takes an active part in the topic. Your question needs to be described in great detail, if you find an error, attach screenshots from the terminal and the trading logs of the adviser.


Locking is just one of the tactics of trading money management, i.e. It is not a panacea, but it reduces the psychological burden on the trader. The adviser will help those traders who consciously choose this method of trading, cannot or cannot control drawdowns on their own.

Advanced traders can combine modular connectivity Brainy locker with other advisers - this opens up the scope for creating combined automated trading systems.

Forum thread

Articles on the topic of locking:

Leave Your Comment