Exp SafetyLock PRO
allows traders to avoid strong market reversals by setting an opposite order for an already opened position.
If a trader or an EA opens a position, SAFETYLOCK opens an opposite pending order for it. If the position becomes loss-making, the pending order is activated creating a lock.
The EA allows you to close the initial position, work with a trailing stop, or multiply the lot.
You can also modify the pending order Open price following the position price.
- The system monitors open orders on all pairs or only the ones specified in the EA settings (Symbol_Monitor);
- The system monitors positions placed in the Type_Monitor Expert Advisor;
- The system monitors the specified magic numbers (Magic_Monitor);
- A pending order is set at a distance of StopOrderDeltaifUSE from the current price;
- Then a pending order is monitored further;
- If StopOrderDeltaifUSE distance from an order is passed and ModifyOrdPend=true, pending order price is moved to breakeven;
- As soon as a pending order is activated, the EA starts monitoring it;
- The system allows you to disable the monitoring of orders. If SafetyPosMonitor=false, monitoring of positions opened by the EA is disabled;
- If true, the system monitors its pending orders;
- If a pending order is not activated while an appropriate order is closed manually or otherwise, the pending order is automatically removed;
- The system allows you to multiply lots of pending orders (MNLOT). Suppose that an order is opened with 0.2 lots. This means that a pending order is opened with 0.2 * MNLOT lots;
- If CloseOneifStopsActive=true, position (an appropriate pending order was opened for) is closed. Only position opened by the EA remains;
- Pending orders can be accompanied by StopLoss and TakeProfit;
- You can also enable a trailing stop (Tralling);
- No new pending orders are placed when resetting the terminal. Instead, it monitors the previously placed ones.
- ReopenClosedSafetyOrders - reopen Safety pending orders if they were closed by stops while the protected position is still open.
- NumberofStopOrder - number of pending orders placed for position
- DistancefromStopOrders - distance between the Safety orders
- CloseOneifStopsActive - Close the position if a Safety pending order was triggered
- Min_Lot_Monitoring - Minimum lot size to be monitored by the EA, if 0 - disabled;
- Max_Lot_Monitoring - Maximum lot size to be monitored by the EA, if 0 - disabled;
for example, you need to use the SafetyLock EA to protect positions, that accumulated lot size, for example, after using martingale. The lot for placing the opposite stop order is 0.16. At the same time, the EA is no supposed to affect positions less than 0.16. So you need to set the parameters as follows: Min_Lot_Monitoring =0.16;
for example, you need to lock all positions that have a lot size from 0.1 to 0.25. So you need to set the parameters as follows: Min_Lot_Monitoring = 0.1; Max_Lot_Monitoring = 0.25;
When set to AutoSetMinLevel, the stop levels will be reduced to the minimum possible levels, allowed on the server;
When set to ManualSet, user will receive a message, which says the stop levels of the EA are less than the minimum and the EA will stop trading.
- CloseSafetyPositionsifclosed - Close Safety positions that are activated, if the main position was closed.
- Added two options:
Remove_TAKEPROFIT_ofOriginalifStopsActive - remove the take profit of the original position, if the SafetyLock pending order was triggered;
Remove_STOPLOSS_ofOriginalifStopsActive - remove the stop loss of the original position, if the SafetyLock pending order was triggered;
It allows to "hard" lock two positions by removing the stop loss and take profit. It creates a "safe lock", which will not be unlocked if the original position was closed by its stop loss or take profit.
Details on the panel in our blog: https://www.mql5.com/en/blogs/post/687140
Min_Lot_Monitoring - minimum lot for the EA to monitor, if 0 - parameter is disabled;
Max_Lot_Monitoring - maximum lot for the EA to monitor, if 0 - parameter is disabled;
For example, you need to use the current SafetyLock EA for protecting positions which accumulated a large lot, such as after using martingale. The lot for which an opposite stop order should be placed = 0.16, at the same time the EA must not touch the positions less than 0.16. To do that, set the parameter to: Min_Lot_Monitoring =0.16;
For example, you need to lock all positions with lot sizes from 0.1 to 0.25, to do that, set the parameters to:
Min_Lot_Monitoring = 0.1;
Max_Lot_Monitoring = 0.25;
Added the SetMinStops variable:
In case of AutoSetMinLevel, the stop levels are reduced to the minimum possible levels, allowed on the server;
In case of ManualSet, user receives a message that the stop levels in the EA are less than the minimum allowed ones, and the EA stops operation.
Added the CloseSafetyPositionsifclosed variable:
Close SAFETY positions that have been activated, if the main position was closed.
ReopenClosedSafetyOrders - reopen the 'Safety' pending orders, if they were closed by a stop order, while the protected position is still open.
NumberofStopOrder - the number of pending orders placed for a position.
DistancefromStopOrders - the distance between the 'Safety' orders
CloseOneifStopsActive - Close the position if the 'Safety' pending orders was triggered
SymbolMonitoring = ALL_SYMBOL = Monitor all symbols, all trades on the account. If you placed the EA on 1 chart of any currency pair, then it will monitor every currency pair on the account;
SymbolMonitoring = ONLY_CURRENT_SYMBOL = Monitor only the current symbol. The EA will monitor and maintain only trades on the symbol the EA is set on;
SymbolMonitoring = SPECIFID_SYMBOL = Monitor only the trades on the symbol specified in SPECIFID_Symbol_Monitor. For example, EURUSD - then the EA will only maintain the trades on the EURUSD symbol;