Update recovery logic EA

İş tamamlandı

Tamamlanma süresi: 11 gün
Müşteri tarafından geri bildirim
Mahdi is an excellent developer! Already working with him in some improvement points and will work together in the next projects. 5* +++
Geliştirici tarafından geri bildirim
MMIMMI,One of the best clients I've worked with. Very understanding, cooperative, and fair.Recommended A++

İş Gereklilikleri

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.


Yanıtlandı

1
Geliştirici 1
Derecelendirme
(15)
Projeler
19
16%
Arabuluculuk
5
40% / 40%
Süresi dolmuş
0
Serbest
2
Geliştirici 2
Derecelendirme
(18)
Projeler
22
9%
Arabuluculuk
6
33% / 50%
Süresi dolmuş
1
5%
Çalışıyor
3
Geliştirici 3
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
4
Geliştirici 4
Derecelendirme
(75)
Projeler
80
6%
Arabuluculuk
46
11% / 54%
Süresi dolmuş
7
9%
Çalışıyor
5
Geliştirici 5
Derecelendirme
(309)
Projeler
556
35%
Arabuluculuk
78
32% / 42%
Süresi dolmuş
202
36%
Çalışıyor
6
Geliştirici 6
Derecelendirme
(4)
Projeler
3
33%
Arabuluculuk
2
0% / 100%
Süresi dolmuş
0
Serbest
7
Geliştirici 7
Derecelendirme
(10)
Projeler
14
43%
Arabuluculuk
0
Süresi dolmuş
3
21%
Serbest
8
Geliştirici 8
Derecelendirme
(3)
Projeler
1
100%
Arabuluculuk
3
0% / 100%
Süresi dolmuş
0
Serbest
9
Geliştirici 9
Derecelendirme
(144)
Projeler
186
41%
Arabuluculuk
24
58% / 21%
Süresi dolmuş
13
7%
Serbest
10
Geliştirici 10
Derecelendirme
(16)
Projeler
35
23%
Arabuluculuk
4
0% / 50%
Süresi dolmuş
2
6%
Çalışıyor
11
Geliştirici 11
Derecelendirme
(3)
Projeler
3
33%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
Yayınlandı: 2 makale
12
Geliştirici 12
Derecelendirme
(2644)
Projeler
3360
68%
Arabuluculuk
77
48% / 14%
Süresi dolmuş
342
10%
Serbest
Yayınlandı: 1 kod
13
Geliştirici 13
Derecelendirme
(11)
Projeler
18
28%
Arabuluculuk
4
50% / 50%
Süresi dolmuş
1
6%
Serbest
14
Geliştirici 14
Derecelendirme
(11)
Projeler
13
23%
Arabuluculuk
0
Süresi dolmuş
4
31%
Yüklendi
15
Geliştirici 15
Derecelendirme
Projeler
1
0%
Arabuluculuk
1
0% / 100%
Süresi dolmuş
1
100%
Çalışıyor
16
Geliştirici 16
Derecelendirme
(2)
Projeler
2
0%
Arabuluculuk
3
0% / 100%
Süresi dolmuş
1
50%
Serbest
17
Geliştirici 17
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
18
Geliştirici 18
Derecelendirme
(13)
Projeler
15
27%
Arabuluculuk
3
67% / 0%
Süresi dolmuş
0
Yüklendi
19
Geliştirici 19
Derecelendirme
(390)
Projeler
416
30%
Arabuluculuk
74
19% / 72%
Süresi dolmuş
52
13%
Çalışıyor
20
Geliştirici 20
Derecelendirme
(13)
Projeler
19
37%
Arabuluculuk
1
0% / 100%
Süresi dolmuş
1
5%
Çalışıyor
Benzer siparişler
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

Proje bilgisi

Bütçe
30 - 80 USD