Return Strategy
This software component for MetaTrader 5 is built to enhance the capabilities of your trading environment. This Expert Advisor serves as automated trading software. It is utilized to monitor financial markets and execute trades based on predefined algorithmic rules, enabling precise position management without the need for constant manual oversight.
How to Setup and Use Return Strategy
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.
Description & Settings
The strategy operates with pending limit orders.
Main idea
If at
Start Hour
, we set the grid of pending orders from
Number of pending orders
of each type (Buy Limit and Sell Limit), one or several pending orders are activated. Then the price necessarily returns to the Open price of the bar the grid of pending orders has been placed at.
For example, at 19:00 (
Start Hour
= 19), we place four (
Number of pending orders
= 4) Buy Limit and four Sell Limit orders. We expect that after one or several pending orders are activated, the price returns to the 19 hour bar's Open price.
Note
: There should be no pending orders on a trading account at
Start Hour
.
Constructing grid
The Expiration lifetime value is set for pending orders in hours.
Closing positions and removing pending orders
If the total profit of all positions becomes "Total profit" points, all positions are closed while pending orders are removed. At "End Hour", pending orders are forcibly removed.
Inputs
Stop Loss (in pips)
- stop loss;
Start Hour
- pending order placing time (in hours);
End Hour
- pending order removal time (in hours);
Total profit (in pips)
- when this profit is reached, all positions are closed, while pending orders are removed;
Trailing Stop (in pips)
- trailing ("0" - disable trailing);
Trailing Step (in pips)
- trailing step;
Distance
- distance from the current price to the first pending order;
Step
- step between pending orders;
Number of pending orders
- number of pending orders of each type;
Expiration (in hours)
- pending order lifetime (in hours);
Lots
- fixed volume of pending orders;
Risk
- dynamic volume of pending orders, calculated as a risk % per trade;
magic number
- unique EA identifier.
Optimization was performed from 2018.01.01 to 2018.07.12 on EURUSD,H1: