Update recovery logic EA

MQL5 Indikatoren Experten

Auftrag beendet

Ausführungszeit 11 Tage
Bewertung des Kunden
Mahdi is an excellent developer! Already working with him in some improvement points and will work together in the next projects. 5* +++
Bewertung des Entwicklers
MMIMMI,One of the best clients I've worked with. Very understanding, cooperative, and fair.Recommended A++

Spezifikation

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.


Bewerbungen

1
Entwickler 1
Bewertung
(15)
Projekte
19
16%
Schlichtung
5
40% / 40%
Frist nicht eingehalten
0
Frei
2
Entwickler 2
Bewertung
(18)
Projekte
22
9%
Schlichtung
6
33% / 50%
Frist nicht eingehalten
1
5%
Arbeitet
3
Entwickler 3
Bewertung
Projekte
0
0%
Schlichtung
0
Frist nicht eingehalten
0
Frei
4
Entwickler 4
Bewertung
(75)
Projekte
80
6%
Schlichtung
46
11% / 54%
Frist nicht eingehalten
7
9%
Arbeitet
5
Entwickler 5
Bewertung
(309)
Projekte
556
35%
Schlichtung
78
32% / 42%
Frist nicht eingehalten
202
36%
Arbeitet
6
Entwickler 6
Bewertung
(4)
Projekte
3
33%
Schlichtung
2
0% / 100%
Frist nicht eingehalten
0
Frei
7
Entwickler 7
Bewertung
(10)
Projekte
14
43%
Schlichtung
0
Frist nicht eingehalten
3
21%
Frei
8
Entwickler 8
Bewertung
(3)
Projekte
1
100%
Schlichtung
3
0% / 100%
Frist nicht eingehalten
0
Frei
9
Entwickler 9
Bewertung
(144)
Projekte
186
41%
Schlichtung
24
58% / 21%
Frist nicht eingehalten
13
7%
Frei
10
Entwickler 10
Bewertung
(16)
Projekte
35
23%
Schlichtung
4
0% / 50%
Frist nicht eingehalten
2
6%
Arbeitet
11
Entwickler 11
Bewertung
(3)
Projekte
3
33%
Schlichtung
0
Frist nicht eingehalten
0
Frei
Veröffentlicht: 2 Artikel
12
Entwickler 12
Bewertung
(2644)
Projekte
3360
68%
Schlichtung
77
48% / 14%
Frist nicht eingehalten
342
10%
Frei
Veröffentlicht: 1 Beispiel
13
Entwickler 13
Bewertung
(11)
Projekte
18
28%
Schlichtung
4
50% / 50%
Frist nicht eingehalten
1
6%
Frei
14
Entwickler 14
Bewertung
(11)
Projekte
13
23%
Schlichtung
0
Frist nicht eingehalten
4
31%
Beschäftigt
15
Entwickler 15
Bewertung
Projekte
1
0%
Schlichtung
1
0% / 100%
Frist nicht eingehalten
1
100%
Arbeitet
16
Entwickler 16
Bewertung
(2)
Projekte
2
0%
Schlichtung
3
0% / 100%
Frist nicht eingehalten
1
50%
Frei
17
Entwickler 17
Bewertung
Projekte
0
0%
Schlichtung
0
Frist nicht eingehalten
0
Frei
18
Entwickler 18
Bewertung
(13)
Projekte
15
27%
Schlichtung
3
67% / 0%
Frist nicht eingehalten
0
Beschäftigt
19
Entwickler 19
Bewertung
(390)
Projekte
416
30%
Schlichtung
74
19% / 72%
Frist nicht eingehalten
52
13%
Arbeitet
20
Entwickler 20
Bewertung
(13)
Projekte
19
37%
Schlichtung
1
0% / 100%
Frist nicht eingehalten
1
5%
Arbeitet
Ähnliche Aufträge
I am looking for MQL5 Programmer who can convert a trading view indicator into MT5 Prop firm EA. The EA should follow all trading rules of a prop firm and able to pass evaluations. The EA should be able to generate profits in funded account also. There must be dashboard that should all parameters like Account size, daily drawdown, target profit, session name, etc. Please contact me for more details
I am looking for an experienced MT4 (MQL4) developer to build a Harmonic Pattern Indicator with a PRZ (Potential Reversal Zone) detection system , similar to advanced harmonic scanners. Kindly apply if you can handle this project. Note: I don't want unprofessional developer
hello, i want a convertion of this trading view indicator FVG (NEPHEW_SAM_) to mql5 to be add later to an expert advisor. i want to access this data, gap data printed on current timeframe and multi timeframe that i choose (current, timeF1, timeF2, timeF3, timeF4)(gap time, gap value, top gap value, low gap value, gap type bull / bear, gap type iFVG or FVG). a function that check if the price is checking the gap at
I have developed a ready-made quantitative trading system for MetaTrader 5. The system uses an ensemble of machine learning models (XGBoost, LightGBM, Random Forest) combined with a market regime filter based on a Hidden Markov Model. Core features: - Automated trading for XAUUSD - Risk management and dynamic position sizing - Market regime detection (trend / range) - Volatility filter - Telegram monitoring interface
Dm me to get the demo version of the EA. It is based on order flow ,RSI and MA 99 Divergence .See the performance graph on the attached file below
Hello 100 - 200 USD
Programmer Requirement The programmer must have good experience with the following indicators and price action patterns used in this strategy: Bollinger Bands RSI ATR The programmer must also understand and correctly implement the following candlestick patterns: Bullish Engulfing Bullish Pin Bar Bearish Engulfing Bearish Pin Bar The programmer must have experience combining technical indicators with candlestick
EA CONVERTER 30 - 100 USD
I need someone who can create EA CONVERTER that can installed in my phone and convert my EA into mobile bot and should be my app ,and people should be able to use it they're are interested but they should pay for it
I need EA programmer to create me an Ea that trades Gold and Indices it should be mobile bot automation, that can both scalp and swing trades, the bot should use top analysis from D1 then H4 and H1
Bot 50 - 150 USD
Hello, I am looking to purchase a professional trading bot for Gold (XAUUSD) that includes the full strategy . However, I would like the option to test the bot for one month before committing to the purchase . If you have a bot that performs well on Gold trading , please send me the details along with the trial option for one month so I can evaluate its performance. Thank you
I’m looking for an experienced MQL5 developer to build an EA for MetaTrader 5 based on a Pin Bar price action strategy. The developer should propose and explain the detailed strategy. Goal: Consistent performance with a target around 8%+ monthly profit. Stability and risk control are more important than high risk. When applying, please include: Your Pin Bar strategy logic Examples of previous MT5 EAs Estimated

Projektdetails

Budget
30 - 80 USD