Update recovery logic EA

MQL5 Indicatori Esperti

Specifiche

Hi Developers!


Looking for an experienced dev ( 50 jobs + on the platform ) to make an update on the recovery logic I currently have.


The logic as per now is not a classic recovery martingale, is computing the loss diving by 2 and computing automatically the lots needs to do it in order to make the recovery. ( You can have a look at in the attachments )

Now the logic is done at a daily level ( in case is touching the max entries or the trading day is finished the EA it stops trading ) the update needs to recover a loss in case there are some previous days losses.

Bellow you can find the logic of the actual recovery implementation

Some more details about the core of the EA

🔁 Where and how the recovery is implemented in the code

The recovery system is not in a single line. It is implemented through three components that work together:


1️⃣ Loss tracking – UpdateHistory()

👉 This is where the EA decides which trades were losses and stores their lot sizes

📍 Function:

void UpdateHistory(int idx, int jdx)

📍 Key code:

LotSizes[nTrades] = HistoryDealGetDouble(tk, DEAL_VOLUME); if (pro >= 0) IsLoss[nTrades] = false; else IsLoss[nTrades] = true; nTrades++;

What this does:

  • Reads account trade history

  • Filters only trades:

    • with the current Magic Number

    • after SeqStartTime[idx][jdx] (current sequence only)

  • For every closed trade (DEAL_ENTRY_OUT):

    • stores:

      • LotSizes[] → used volume

      • IsLoss[] → whether it was a loss

📌 Without UpdateHistory() there is no recovery, because GetLot() would have no data.


2️⃣ Recovery lot calculation – GetLot()

👉 THIS is the actual recovery engine

📍 Function:

double GetLot()


🔹 Recovery activation

v = LotSizes[CurIdx]; if (IsLoss[CurIdx]) { ... }

➡️ Recovery starts only if the last trade was a loss.


🔹 Core recovery formula

vv = v / nRecov * SL / TP;

Where:

  • v = lot size of the losing trade

  • nRecov =

    • 2 for the first recovery

    • 4 for chained recoveries

  • SL / TP = risk-to-reward compensation ratio

📌 This is NOT classic martingale
✔ Lot size does not double
✔ Lot grows proportionally to SL / TP


🔹 Recursive recovery (loss chains)

CurIdx++; if (CurIdx == nTrades) { return vv; } else { if (IsLoss[CurIdx]) { res = GetLot(); if (res > 0) break; } }

📌 Meaning:

  • For multiple consecutive losses:

    • the EA walks through the loss chain

    • calculates a controlled recovery volume

    • avoids explosive growth

👉 Recursive but capped recovery


🔹 Safety limits

if (AddInitLot) limit += LotSize; if (Vol > MaxLot) Vol = MaxLot; if (Vol > 0.0001 && Vol < 0.01) Vol = 0.01;

✔ Maximum lot cap
✔ Minimum volume enforcement
✔ Optional addition of initial lot


3️⃣ Applying recovery to real trades – OnTick()

👉 This is where recovery becomes an actual trade

📍 Key code:

Vol = GetLot(); cmnt = "r "; if (Vol < 0 || nTrades == 0) { cmnt = "i "; Vol = UpdatedLotSize(); SeqStartTime[i][k] = TimeCurrent() - 1; }

Decision logic:

Condition Action
GetLot() > 0 Recovery trade ( "r " )
GetLot() < 0 Initial trade
nTrades == 0 Initial trade
Profit achieved Sequence resets

Order comments:

  • "i " = initial

  • "r " = recovery


❌ What this recovery system does NOT do

❌ No forced trades
❌ No grid entries
❌ No lot doubling
❌ No guaranteed breakeven
❌ No recovery without a valid signal

✔ Recovery only affects position sizing, not entries


🧠 Final conclusion

  • Loss detection → UpdateHistory()

  • Recovery math → GetLot()

  • Execution decision → OnTick()

👉 Recovery is volume-based, signal-dependent, and risk-capped.


Con risposta

1
Sviluppatore 1
Valutazioni
(15)
Progetti
19
16%
Arbitraggio
5
40% / 40%
In ritardo
0
Gratuito
2
Sviluppatore 2
Valutazioni
(17)
Progetti
21
10%
Arbitraggio
5
40% / 40%
In ritardo
1
5%
Caricato
3
Sviluppatore 3
Valutazioni
Progetti
0
0%
Arbitraggio
0
In ritardo
0
Gratuito
4
Sviluppatore 4
Valutazioni
(75)
Progetti
80
6%
Arbitraggio
46
11% / 54%
In ritardo
7
9%
In elaborazione
5
Sviluppatore 5
Valutazioni
(305)
Progetti
548
35%
Arbitraggio
79
32% / 42%
In ritardo
197
36%
Caricato
6
Sviluppatore 6
Valutazioni
(4)
Progetti
3
33%
Arbitraggio
2
0% / 100%
In ritardo
0
Gratuito
7
Sviluppatore 7
Valutazioni
(9)
Progetti
13
38%
Arbitraggio
0
In ritardo
3
23%
Gratuito
8
Sviluppatore 8
Valutazioni
(3)
Progetti
1
100%
Arbitraggio
3
0% / 100%
In ritardo
0
Gratuito
9
Sviluppatore 9
Valutazioni
(144)
Progetti
186
41%
Arbitraggio
24
58% / 21%
In ritardo
13
7%
Gratuito
10
Sviluppatore 10
Valutazioni
(15)
Progetti
34
24%
Arbitraggio
4
0% / 50%
In ritardo
2
6%
In elaborazione
11
Sviluppatore 11
Valutazioni
(1)
Progetti
1
0%
Arbitraggio
0
In ritardo
0
Gratuito
Pubblicati: 2 articoli
12
Sviluppatore 12
Valutazioni
(2627)
Progetti
3337
67%
Arbitraggio
77
48% / 14%
In ritardo
342
10%
Gratuito
Pubblicati: 1 codice
13
Sviluppatore 13
Valutazioni
(11)
Progetti
18
28%
Arbitraggio
4
50% / 50%
In ritardo
1
6%
Gratuito
14
Sviluppatore 14
Valutazioni
(6)
Progetti
7
29%
Arbitraggio
0
In ritardo
1
14%
Caricato
15
Sviluppatore 15
Valutazioni
Progetti
0
0%
Arbitraggio
1
0% / 100%
In ritardo
0
Gratuito
16
Sviluppatore 16
Valutazioni
(2)
Progetti
2
0%
Arbitraggio
3
0% / 100%
In ritardo
1
50%
Gratuito
17
Sviluppatore 17
Valutazioni
Progetti
0
0%
Arbitraggio
0
In ritardo
0
Gratuito
18
Sviluppatore 18
Valutazioni
(8)
Progetti
8
13%
Arbitraggio
0
In ritardo
0
In elaborazione
19
Sviluppatore 19
Valutazioni
(390)
Progetti
416
30%
Arbitraggio
74
19% / 70%
In ritardo
52
13%
In elaborazione
Ordini simili
Need to create an MT5 EA based on break out strategy. This will be all in one EA including daily breakout, hourly breakout, support and resistance breakout, pivot breakout, super trend break out, moving average breakout. Extra features include TP, SL, breakeven, notifications, dashboard
Forex Time: 7am to 10am (Can trade up until 11:45am)(enter around 10am) Indicator: prev day indicator by electrified Strategy is based off Wondafx profitable ftmo strategy. Search it up on Youtube before you apply. Currency Pairs: EURUSD AND GBPUSD Criteria for entry: Stop hunt, three levels of rise and fall, max 100 pip distance and three candle formation Time frame: 15 min Risk reward: 1:2 Max 1 trade a day Trade 1
Looking for an MT5 developer to build an automated trading bot that executes trades based on indicator signals. The bot should support flexible inputs, work across Forex, commodities, and crypto, and allow basic configuration options. If you're experienced with MT5 EAs and indicator integration, please reach out
Company is looking for a reliable trading strategy for long-term use. We are only interested in algorithmic systems with logical and transparent entry/exit reasoning. Critical Condition: The use of any form of Martingale , Grid , averaging , or " sitting out " losses is strictly prohibited. Every trade must be accompanied by a fixed or calculated Stop Loss. Requirements for the Proposal: 1. Delivery Format: Full
need an trading expert advisor with full source code for supporting any timeframe, based on multiple indicator and condition (can be imported or built in), Requirment- EA must protected by password or Account number or date-time limit indicator used- EMA, SUPER TREND, VWAP, ATR ( maybe add more) optimized for high number of trading at a time one or more trade (custom number or till limit) fast execution
🔹 Project Description I need a very simple MT4 (MQL4) Expert Advisor to be used on a DEMO account . Main Purpose: When enabled, the EA must prevent opening any NEW trades , while allowing existing open trades to be managed and closed normally . Required Behavior: Do NOT close any open trades. Do NOT modify TP or SL. Prevent opening of: New initial trades New trade cycles Existing trades must continue until they
We are looking to acquire an existing, profitable EA that trades using price action–based logic . The EA must operate as a day-trading system with proper Stop Loss and Take Profit , and must NOT use grid, martingale, or high-frequency scalping . This is a buyout request — we want to purchase the complete strategy along with the full source code . We are not looking to develop a new EA from scratch. Therefore, if you
I want a reliable and broker-independent copy-trading solution that copies trades from a master MT5 account to multiple MT4 and/or MT5 client accounts. The system is designed for stable live trading and works with any broker, handling common differences in symbols, pricing, and execution. The copier supports full trade synchronization, including trade opening, closing, partial closes, and SL/TP modifications, with
EA for mt4 30+ USD
I'm looking for an experience developer that can help develop an EA based Strategy below into EA itself no issues if used martingale & fix lot . Symbol: XAUUSD i will explain to the developer more datils before doing the EA. i will send the indicator and the set point. 1- indicator extreme 2- stochastic Oscillator can you add lots of features to your EA which will be so much useful such as 1- Trailing stop 2-Break
Looking for an ea that pass prop firm accounts. Can be any instrument forex or indices. Proof must be provided either with an account it’s running on or a trial period EA. No screenshots

Informazioni sul progetto

Budget
30 - 80 USD
IVA (21%): 6.3 - 16.8 USD
Totale: 36 - 96.8 USD
Per lo sviluppatore
27 - 72 USD

Cliente

(19)
Ordini effettuati27
Numero di arbitraggi0