Mastering the Return Strategy for MetaTrader 5: Your Guide to Profitable Trading

Mike 2018.08.23 22:05 24 0 0
Attachments

Strategy Author: Andrey Kornishkin

MQL5 Code Author: barabashkakvn

This strategy leverages pending limit orders to maximize trading opportunities.


Understanding the Core Concept

At the Start Hour, we initiate a grid of pending orders, comprising Number of Pending Orders for both Buy Limit and Sell Limit types. Once these orders are activated, we anticipate a price reversal back to the opening price of the bar where the orders were placed.

For instance, if we set our Start Hour to 19:00 and place four (Number of Pending Orders = 4) Buy Limit and four Sell Limit orders, we expect the price to return to the opening price of the 19:00 bar after one or more orders are triggered.

Important: Make sure there are no pending orders in your trading account at the Start Hour.


Setting Up Your Grid

Distance (from current price) + N * Step (gap between pending orders)

The expiration time for pending orders is defined in hours. Make sure to keep track of this to avoid missed opportunities!


Managing Positions and Orders

When your total profit across all positions hits the defined Total Profit points, all positions will close, and pending orders will be removed. Additionally, at the specified End Hour, any remaining pending orders will be automatically removed.


Input Parameters

  • Stop Loss (in pips) - Sets your stop loss;
  • Start Hour - Time to place pending orders (in hours);
  • End Hour - Time to remove pending orders (in hours);
  • Total Profit (in pips) - The profit threshold to close all positions and remove pending orders;
  • Trailing Stop (in pips) - Enables trailing stop (set to "0" to disable);
  • Trailing Step (in pips) - Defines the step for trailing;
  • Distance - Distance from the current price to the first pending order;
  • Step - Distance between pending orders;
  • Number of Pending Orders - Number of orders per type;
  • Expiration (in hours) - Lifetime of pending orders;
  • Lots - Fixed volume for pending orders;
  • Risk - Dynamic volume based on risk % per trade;
  • Magic Number - Unique identifier for your EA.

Optimization tests were conducted from January 1, 2018, to July 12, 2018, using EURUSD on the H1 timeframe:

Return Strategy

List
Comments 0