virtual trailing stop

virtual trailing stop
Download ALL MT4 experts (885)
YouTube Video Thumbnail



Similar MetaTrader Tools

virtual trailing stop

Info

The virtual trailing stop is a Expert Advisor for MetaTrader 4 that the virtual trailing stop can place stop loss, take profit and trail the order in a way that the stops are not visible to the broker, i. e.

Usage

This tool is typically used for automated trading on major forex pairs and gold.

Platform

This Expert Advisor works exclusively on MetaTrader 4 (both build 600+ and newer versions).

Setup

Place the downloaded file in MQL4/Experts folder via File ? Open Data Folder in MetaTrader 4.


How to Install and Use virtual trailing stop

1. Installation: Open the "File" menu, select "Open Data Folder," navigate to MQL/Experts, paste your file, and restart the terminal.

2. Activation: Drag the EA from the Navigator onto a chart, ensure "Allow live trading" is checked in the Common tab, and verify the AutoTrading button is green.

3. Optimization: Right-click your chart, choose "Expert List," click "Properties" to adjust inputs, and save your preferred setup as a set file for future use.

4. Maintenance: Regularly check the "Experts" tab in the terminal window to monitor trade logs and potential execution errors.

Frequently Asked Questions

Q: Why is my EA not opening trades? A: Check the "AutoTrading" button, ensure "Allow live trading" is enabled, and verify your broker allows automated trading on your account type.

Q: Can I run multiple EAs on one chart? A: No, each chart can only host one active EA; however, you can open multiple charts for different currency pairs to run several EAs.

Q: What does the "smiley face" icon mean? A: A smiley face in the top-right corner of the chart indicates the EA is successfully running; a frowny face means it is disabled.

What this tool does

the virtual trailing stop can place stop loss, take profit and trail the order in a way that the stops are not visible to the broker, i.

Typical Use Case

This Expert Advisor excels in automated trading and technical analysis on MetaTrader 4.

Compatible Platform & Setup

This Expert Advisor works on MetaTrader 4. Place the file in the MQL4/Experts folder and restart the terminal.

Description & Settings

Related: Quantora Trailing Stop Manager: Automatic Stop Loss for MT4 - another powerful expert for MetaTrader 4 traders.


Also recommended: e-trailing2: enhanced trailing stop expert advisor - similar expert with strong performance on MetaTrader 4.

the virtual trailing stop can place stop loss, take profit and trail the order in a way that the stops are not visible to the broker, i.e. they are placed not in the dealing center, but on your computer, and no one is able to see your plans except for you and your computer.
apart from the invisibility, there is another useful thing: many brokers have very large spreads and levels for setting stops, so now these levels have no way of harming you, the expert simply ignores them.
i suppose everything is clear with stop loss and take profit. only the trailing stop will be described.
the trailing stop is controlled by three variables:

length of the trailing stop;

minimum profit for the start;

step of the trailing stop.
the virtual stop loss follows the price at a distance of the trailing stop length. minimum profit — when the virtual stop loss is to be placed. step of the trailing stop — when the virtual stop loss is to be moved.
let the values of 5, 2 and 3 are set, respectively.
once the profit of the order reaches 7 points, the virtual stop loss moves to the order opening price plus 2 points of the minimum profit. next, if the price goes 3 points in the direction of profit, the stop loss will be moved to 5 points of profit, and so on, following the price at the distance of 5 points. if the price pulls back to the stop level, the order will be closed.
the trailing stops are shown as dotted lines.
there are further development plans to add the ability to move the line by hand, so that the stops may be corrected during operation. there are also plans for adding support for the number of orders. currently the trailing stop works properly only with 1 order per side. but despite that the trailing stop will not close losing positions, even if there are several orders placed on each direction.
to have a better understanding of the expert advisor, it can be placed in the strategy tester and seen in action using the visualization mode.

You may also like: e-trailing: automated trailing stop for all positions - excellent alternative for expert users on MetaTrader 4.

Source Code

#property copyright "robotfx"
#property link "https://robotfx.org"
#property strict
input int     stoploss      = 0;    // -
input int     takeprofit    = 0;    // -
input int     trailingstop  = 5;    //  
input int     trailingstart = 5;    //    
input int     trailingstep  = 1;    //  
double   trallb = 0;
double   tralls = 0;

.......

Leave your opinion, ask a question, share some knowledge

Limitations & Risk Warning

  • This tool is provided for educational and testing purposes only.
  • Past performance does not guarantee future results.
  • Trading involves substantial risk of loss. Use on a demo account first.
  • Results may vary depending on market conditions, broker, and settings.
  • We recommend thorough backtesting and forward testing before using with real funds.
© ROBOTFX Free educational tools by RobotFX. Use entirely at your own risk; we are not liable for any financial losses incurred.