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
(176)
Projects
227
19%
Arbitration
21
38% / 24%
Overdue
0
Working
2
Developer 2
Rating
(70)
Projects
91
25%
Arbitration
26
19% / 54%
Overdue
25
27%
Free
3
Developer 3
Rating
(29)
Projects
36
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
(9)
Projects
13
38%
Arbitration
0
Overdue
3
23%
Working
8
Developer 8
Rating
(270)
Projects
552
49%
Arbitration
57
40% / 37%
Overdue
228
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
1. Goal I want a MetaTrader 5 Expert Advisor that trades a simple Supertrend trend‑following idea, but with professional‑grade risk management and filters. It should be robust enough for real money on instruments like XAUUSD and GBP pairs, using small, consistent risk per trade rather than martingale or grid. 2. Strategy Logic Indicators (I will supply the .mq5 files if needed): Supertrend (ATR‑based), with
Hi developers, I need someone to help me create a simple EA with my indicators and trading plan... I will give you all parameters and you help me create... 2 moving averages, one candle pattern
Please a need a very good expert for this jou I want to create 2 robot one a trade manager Perfect — here’s a clean, professional order description you can post directly to an EA freelancer (MQL5). I’ve written it so it’s clear, serious, and attractive to skilled developers 👌 MQL5 Trade Manager EA – Development Request I am looking for an experienced MQL5 developer to build a robust Trade Manager Expert Advisor for
Henryy999 30 - 3000 USD
The Ai robot must help me with forex and I don't have money soon can the Ai robot give me some money and I will pay it back if the Ai robot does a good job making me rich
Project Title: MT5 Algo Trading EA (Single Strategy + License Panel + Ownership + Manual Trade) --- Project Description I am looking for an experienced MT5 (MQL5) developer to create a clean, stable and professional Algo Trading EA for my company and future clients. This is a long-term business project, not a one-time personal EA. --- 1. Strategy Requirements - Only 1 single trading strategy - No martingale - No grid
I am looking for an experienced StrategyQuant X (SQX) developer to build a reusable trading template , not a single strategy. ⚠️ Please do NOT apply unless you actively use StrategyQuant X and have access to it. This project cannot be completed without SQX. 1. Session and Time Filters Trading restricted to fixed GMT sessions per index Sessions must convert correctly to broker server time and remain correct through
Is there someone who coded the PipJuice indicator? Here is the link: https://www.pipjuice.io/ Unfortunately, I don‘t have access to the indicator or the code. If someone have it please send me some screenshots
Strategy Development: Suggest a high-probability trading strategy based on Technical Analysis (using indicators like RSI, MACD, or Price Action). Risk Management: Explain how to calculate position sizing so I don't lose more than 1-2% of my capital per trade. Market Analysis: Teach me how to identify Support and Resistance levels and how to spot a trend reversal. Psychology: Give me 5 golden rules to maintain
A Grid EA with a hedge that open trades on a percentage based on whats is opened on the other side, closes losing trades with current profits made and utilizes a grid trading strategy combined with hedging technique to mitigate risk and potentially lock in profits. It involves placing buy and sell orders at predetermined price intervals, forming a grid. When a trade within the grid moves against the initial
MQL5 Expert Advisor Development (MT5) I need a professional MQL5 developer to create a custom Expert Advisor (EA) for MetaTrader 5 with high accuracy, low drawdown, and fast execution . 🔹 Strategy Requirements: Timeframe: Scalping-friendly (M1 / M5) Indicators Used: EMA 9 EMA 12 EMA 21 VWAP (as a trend filter) RSI (for trade confirmation) 🔹 Trade Logic: Buy and Sell entries based on EMA crossover + VWAP direction

Project information

Budget
30+ USD