Tarea técnica


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};


Archivos adjuntos:

Han respondido

1
Desarrollador 1
Evaluación
(161)
Proyectos
209
19%
Arbitraje
18
44% / 17%
Caducado
0
Libre
2
Desarrollador 2
Evaluación
(70)
Proyectos
90
26%
Arbitraje
24
21% / 50%
Caducado
24
27%
Libre
3
Desarrollador 3
Evaluación
(19)
Proyectos
24
38%
Arbitraje
2
50% / 50%
Caducado
2
8%
Libre
4
Desarrollador 4
Evaluación
(18)
Proyectos
30
30%
Arbitraje
8
50% / 25%
Caducado
3
10%
Trabaja
5
Desarrollador 5
Evaluación
(10)
Proyectos
11
18%
Arbitraje
0
Caducado
1
9%
Trabaja
6
Desarrollador 6
Evaluación
Proyectos
1
100%
Arbitraje
2
0% / 0%
Caducado
0
Trabaja
7
Desarrollador 7
Evaluación
(5)
Proyectos
8
13%
Arbitraje
0
Caducado
0
Trabaja
8
Desarrollador 8
Evaluación
(270)
Proyectos
550
49%
Arbitraje
55
40% / 36%
Caducado
227
41%
Trabaja
9
Desarrollador 9
Evaluación
(2)
Proyectos
2
0%
Arbitraje
0
Caducado
0
Libre
10
Desarrollador 10
Evaluación
Proyectos
2
50%
Arbitraje
0
Caducado
0
Libre
11
Desarrollador 11
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
12
Desarrollador 12
Evaluación
(571)
Proyectos
942
47%
Arbitraje
303
59% / 25%
Caducado
125
13%
Libre
Solicitudes similares
im looking for a developer to build a fully automated trading robot Expert Advisor for Metatrader 5. The EA must do the following open buy sell orders based on a custom strategy details below place take profit and stop loss automatically Lot size should be adjustable Should avoid overtrading e.g. max 3 trades per day Close trades automatically based on criteria Work on multiple pairs if possible News filler optional
I need an Expert advisor (EA) for metatrader 5 (MT5), coded in MQL5. The EA should open and close trades based on the RSI indicator. A buy trade is triggered when RSI crosses below 30 and then moves back above it. A sell trade when RSI crosses above 70 and then drops below. The EA must include customizable input settings such as RSI period, lot size, stop loss, take profit, maximum number of trades, and trading time
I'm looking for a professional MQL developer to convert an Indicator codes (Pine Script) from TradingView to MQL5 and modifying it , It's based on FVG and OB indicator in tradingview
hello coders , i want you to create a trading bot in mt5. i have the pinescript code for the strategy. the trading bot is a type of scalping bot hence the entry and exit would be very fast typically in the same candle and within 20 seconds. so if anyone can help me in creating i would be very muh happy
Hi Experts! Please advise if it possible to modify an EA attached to my requirements? 1. Would like to add a volatility parameter of the instrument 2. Would like to add a trigger for intitalization / termination of this EA
Hello.. I need a professional developer to correct the expert's errors and add some necessary options to it... The expert makes profits in the demo account of most companies while losing in the real account.. The expert works on the strength of liquidity with fast trades and very tight stop loss... I need a developer to detect the expert's errors
Hi traders, I'm looking for a developer who can turn an indicator strategy i've developed into an EA. I have 3 Indicators i use and I do not have the source code for them. They all deliver PUSH alerts in MT4 though. I am looking for a developer who can create an EA (either MT4 or MT5) that can code an EA based off of 3 indicators, again which I have, but I do NOT have source code for the indicators. I have a strategy
This Expert Advisor (EA) is based on the 'Liquidity Sweep + Momentum Shift' scalping strategy, built for EURUSD, XAUUSD (Gold), and NAS100 (NASDAQ). It is designed to trade on the 5-minute (M5) timeframe, identifying high-probability reversals following liquidity grabs. The EA must scan for trades continuously and may execute up to 10 trades per symbol per day, depending on conditions met. 2. Symbols and Timeframes -
We are seeking an experienced MQL5 developer to create a custom Expert Advisor (EA) tailored to our specific trading strategy. The ideal candidate should have proven experience in building high-performance trading robots with a focus on strategy optimization, debugging, and efficient order execution. Key Responsibilities: Develop and code an Expert Advisor based on our pre-defined strategy. Conduct in-depth testing
Two EAs previously developed by developers one from HongKong and another from Nigeria. Need to first cross verify whether they did right coding or not? If no, report those errors, fix them. If yes, carry on for creating combined EA to achieve main purpose of making this new EA profitable along with fresh coding of entry logics

Información sobre el proyecto

Presupuesto
30+ USD

Cliente

Encargos realizados1
Número de arbitrajes0