Martingle

Specification


File Name: ReverseOrderEA_Description.txt
Purpose: Describes the functionality of the MQL5 Expert Advisor ReverseOrderEA.mq5

---

EA Name:
ReverseOrderEA.mq5
Automated MQL5 Expert Advisor that places reverse pending orders based on existing open trades.

---

Functionality Overview:

This EA monitors all open positions on the current chart symbol and automatically places a reverse pending order (Buy Stop or Sell Stop) based on the trade’s stop loss (SL). The logic ensures:

- Only one reverse pending order per open position.
- Reverse orders are deleted and re-placed if the SL, lot size, or entry changes.
- Reverse orders are canceled if the original position is closed (manually or otherwise).
- Reverse lot size is calculated using a multiplier (default 1.0).

---

Reverse Order Logic:

- BUY position:
  - Reverse = Sell Stop at the SL.
  - SL = original entry.
  - TP = SL − (2 × risk).

- SELL position:
  - Reverse = Buy Stop at the SL.
  - SL = original entry.
  - TP = SL + (2 × risk).

---

Key Components:

✅ CheckAndPlaceReversePendingOrder()
- Loops through open positions.
- Calculates reverse price, SL, TP.
- Ensures only one reverse order exists per position.
- Calls DeleteReverseIfChanged() if parameters differ.
- Places new pending orders with appropriate comment format.

🗑️ DeleteReverseIfChanged()
- Deletes existing reverse pending orders if:
  - SL, lot size, or entry price has changed.

🚫 CancelUnusedReverseOrders()
- Deletes reverse orders if the original position is closed or no longer exists.

---

Comment Format:

All reverse orders include a comment:
Reverse_<ticketNumber>_<SL>
This enables matching each pending order to its original trade and verifying its parameters.

---

Inputs:

- lotMultiplier — Multiplier for reverse lot size (e.g., 2 = double lot size).
- magicNumber — Unique magic number to track reverse orders only.
- reversePrefix — Text prefix in order comment (default "Reverse").

---

OnTick Logic:

1. CheckAndPlaceReversePendingOrder()
2. CancelUnusedReverseOrders()

Both are called every tick to keep reverse order logic accurate and synchronized.

---

Notes:

- Works only with positions on the current chart symbol.
- Requires SL on original position to function.

- Does not initiate trades itself — only creates reversals for existing ones.


want to add lot size and tp as step 

// Recovery logic

double lotSteps[] =       {0.01, 0.02, 0.02, 0.04, 0.04, 0.08, 0.08, 0.04, 0.04, 0.08, 0.08};

double tpMultipliers[] =  {2.0,  2.0,  2.5,  2.5,  3.0,  3.0,  4.0,  4.0,  4.0,  4.0,  4.0};


Responded

1
Developer 1
Rating
(210)
Projects
273
21%
Arbitration
24
54% / 17%
Overdue
0
Working
2
Developer 2
Rating
(70)
Projects
91
25%
Arbitration
26
19% / 54%
Overdue
25
27%
Free
3
Developer 3
Rating
(31)
Projects
38
53%
Arbitration
2
50% / 50%
Overdue
3
8%
Free
4
Developer 4
Rating
(19)
Projects
31
32%
Arbitration
8
50% / 25%
Overdue
3
10%
Working
5
Developer 5
Rating
(12)
Projects
12
17%
Arbitration
2
0% / 50%
Overdue
1
8%
Free
6
Developer 6
Rating
(1)
Projects
2
50%
Arbitration
3
0% / 33%
Overdue
0
Free
7
Developer 7
Rating
(10)
Projects
14
43%
Arbitration
0
Overdue
3
21%
Free
8
Developer 8
Rating
(271)
Projects
553
50%
Arbitration
57
40% / 37%
Overdue
227
41%
Working
9
Developer 9
Rating
(2)
Projects
2
0%
Arbitration
0
Overdue
0
Free
10
Developer 10
Rating
(4)
Projects
5
40%
Arbitration
1
0% / 0%
Overdue
0
Free
11
Developer 11
Rating
Projects
0
0%
Arbitration
0
Overdue
0
Free
12
Developer 12
Rating
(574)
Projects
945
47%
Arbitration
309
58% / 27%
Overdue
125
13%
Free
Similar orders
Hi developer I want to convert my mt4 EA to mt5 EA . I have a mt4 ea with source code. i want developer to copy same mt4 code and create mt5 EA
Gold hunter v5 30+ USD
*TITLE:* 5 Trades EA - EMA20/50 + RSI - Safe for Small Account *SPECIFICATION:* I need MT5 EA - Source Code .mq5 *Logic:* Buy: EMA20 > EMA50 and RSI(14) 45-70 Sell: EMA20 < EMA50 and RSI(14) 30-55 Timeframe M15, Symbol XAUUSD and all Forex *Trade Management:* Max 5 trades at same time. Fixed lot 0.01. No martingale. No lot increase. Distance between trades 150 points. Do not open all 5 at same price. Max 5 total
Investor Account (Read-Only Access) ‎ ‎📌 Platform: MT5 ‎📌 Broker: Fusion Markets Pty Ltd ‎📌 Server: Fusion Markets Demo ‎📌 Login: 422204 ‎📌 Investor Password: Gen@2026 please check this demo account, which strategy added here and understand how to work this robot. i need this kind trading robot. only expert developer needed. no need apply new developer. I will test robot in demo account, when we see bot
Poverty 30+ USD
Develop the EA according to my provided trading strategy and rules. The EA must open and close trades automatically according to the specified conditions. Include configurable Stop Loss, Take Profit, lot size and risk-management settings. Include an option for fixed lot size or percentage-based risk. Include Magic Number and trade-comment settings. The EA must work correctly on the requested MT4/MT5 platform and
I need an Expert Advisor (EA) developed for MetaTrader 5 (MT5) tailored for trading on Exness accounts. Account & Server Details: Trading Platform: MetaTrader 5 (MT5) Broker: Exness Execution Type: Market / Pending Orders Account Type: [Specify: Standard / Pro / Raw Spread / Zero] Target Instruments: [Specify pairs, e.g., XAUUSD, EURUSD, BTCUSD] Strategy Requirements: Entry Rules: [Insert your buy/sell entry
Monthly Report: August 2026 World PEACE Multi FX Algo generated a total realized profit of approximately 31,966 JPY during August. The provider account is normally operated with approximately 200,000 JPY of capital. Compared with this standard operating amount, the realized profit for August was approximately 15.98%. Please note that this is not a compounded monthly return. Realized profits are withdrawn regularly
I’m looking for an experienced developer who can build a Martingale trading bot. I’m willing to pay a fair price for the right developer. I have an example trading account that demonstrates exactly how I want the bot to operate. The strategy is straightforward: the bot trades continuously using a Martingale system. The only exception is that it should automatically pause trading during high-impact news events or
This is a Tradingview project. Would you be able to make this? With a win rate and profit factor and percentage made and profit made and max dd reached. How many modifications would I be able to do? Could there be a table that shows win percentage profit factor and trading window where trades shouldn’t be placed and follows the rules of the pdf How long would it take and would it work on ninjatrader also
Account size 50$ to 100$ or 5000USC to 10000USC ( Account $ Size may not matter ) Max Leverage 1000-2000 Min Lot 0.01 [ if averaging possible ] Averaging + Shift TP Faster Required if Trend Direction is Clear Account Protection Maxx Profit Max Loss Key Based Activation News Filter Need Expert to handle this to avoid false entry [ Developer can suggest extra additional filters inputs here ] as i mentioned I have no
Build a Forex Multi-Basket Trading Bot for OANDA (Python v20 REST API Only) MANDATORY DEVELOPER REQUIREMENTS (PLEASE READ BEFORE APPLYING): Do not apply for this project unless you meet the following strict professional criteria: 1. Deep Mathematical & Quantitative Background: You must thoroughly understand statistical distributions, rolling standard deviations (σ), calculating matrix medians, and dynamic Z-score

Project information

Budget
30+ USD