Update recovery logic EA

MQL5 Индикаторы Эксперты

Техническое задание

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.


Откликнулись

1
Разработчик 1
Оценка
(15)
Проекты
19
16%
Арбитраж
5
40% / 40%
Просрочено
0
Свободен
2
Разработчик 2
Оценка
(17)
Проекты
21
10%
Арбитраж
5
40% / 40%
Просрочено
1
5%
Загружен
3
Разработчик 3
Оценка
Проекты
0
0%
Арбитраж
0
Просрочено
0
Свободен
4
Разработчик 4
Оценка
(75)
Проекты
80
6%
Арбитраж
46
11% / 54%
Просрочено
7
9%
Работает
5
Разработчик 5
Оценка
(305)
Проекты
548
35%
Арбитраж
79
32% / 42%
Просрочено
197
36%
Загружен
6
Разработчик 6
Оценка
(4)
Проекты
3
33%
Арбитраж
2
0% / 100%
Просрочено
0
Свободен
7
Разработчик 7
Оценка
(9)
Проекты
13
38%
Арбитраж
0
Просрочено
3
23%
Свободен
8
Разработчик 8
Оценка
(3)
Проекты
1
100%
Арбитраж
3
0% / 100%
Просрочено
0
Свободен
9
Разработчик 9
Оценка
(144)
Проекты
186
41%
Арбитраж
24
58% / 21%
Просрочено
13
7%
Свободен
10
Разработчик 10
Оценка
(15)
Проекты
34
24%
Арбитраж
4
0% / 50%
Просрочено
2
6%
Работает
11
Разработчик 11
Оценка
(1)
Проекты
1
0%
Арбитраж
0
Просрочено
0
Свободен
Опубликовал: 2 статьи
12
Разработчик 12
Оценка
(2627)
Проекты
3337
67%
Арбитраж
77
48% / 14%
Просрочено
342
10%
Свободен
Опубликовал: 1 пример
13
Разработчик 13
Оценка
(11)
Проекты
18
28%
Арбитраж
4
50% / 50%
Просрочено
1
6%
Свободен
14
Разработчик 14
Оценка
(6)
Проекты
7
29%
Арбитраж
0
Просрочено
1
14%
Загружен
15
Разработчик 15
Оценка
Проекты
0
0%
Арбитраж
1
0% / 100%
Просрочено
0
Свободен
16
Разработчик 16
Оценка
(2)
Проекты
2
0%
Арбитраж
3
0% / 100%
Просрочено
1
50%
Свободен
17
Разработчик 17
Оценка
Проекты
0
0%
Арбитраж
0
Просрочено
0
Свободен
18
Разработчик 18
Оценка
(8)
Проекты
8
13%
Арбитраж
0
Просрочено
0
Работает
19
Разработчик 19
Оценка
(390)
Проекты
416
30%
Арбитраж
74
19% / 70%
Просрочено
52
13%
Работает
Похожие заказы
Looking for an experienced Pine Script v5 & MQL5 developer to connect a custom TradingView indicator to MT5 (Exness) . The indicator already calculates lot size and includes a dropdown (None / Buy / Sell) . When Buy or Sell is selected, a TradingView alert must trigger , send lot size + direction via webhook , and place a market order in MT5 . No strategy conversion. No SL/TP handling. Execution only. Apply only if
I’m looking for a skilled MQL5 developer to help build and manage an automated trading system that bridges TradingView custom indicator alerts to an Exness MT5 account . This role involves capturing Buy/Sell signals and lot sizes from TradingView webhooks , processing them with a Python listener , and executing orders on MT5 hosted on a 24/7 VPS . The ideal candidate will ensure accurate trades, reliable execution
I need a trading signals indicator. So I can learn how to upgrade my trading skills and mentality. I will be very glad if I can upgrade my trading mentality
I am looking for an experienced MQL5 developer to help build and support an automated trade execution system that connects TradingView custom indicator alerts to an Exness MT5 account. The role involves receiving TradingView webhook signals containing Buy/Sell direction and dynamically calculated lot size, processing them via a Python-based webhook listener, and executing market orders on MT5 running on a 24/7
HELLO EVERYONE , I NEED AAN INDICATORE AND EA ON STOCHESTIC OSSILATOR, WHICH CAN GIVE ME ALERT WHEN SIGNAL APEARS, INDICAOTRE I CAN SHOW ON TRADING VIEW , EXACTLTY THAT INDICATORE I NEEDED.INDICATORE NAME ON TRADING VIEW( JL STOCHESTIC DIVERGENCE ALERT).. THANK YOU
//+------------------------------------------------------------------+ //| Expert initialization function | //+------------------------------------------------------------------+ #property strict // Inputs input int EMA_Fast = 9; input int EMA_Slow = 21; input int RSI_Period = 14; input double Lots = 0.1; input int StopLoss = 20; // وقف خسارة (بـ نقاط) input int TakeProfit = 40; // هدف (بـ نقاط)
Indicator 130+ USD
To trade Forex and pass FTMO challenges by combining: Smart Money Concepts (SMC), RSI divergence and Strict filtering to avoid overtrading and drawdown. If you’re experienced in this let me know. Thank you very much
// Add this to your EA after ExportState() function void SendToBase44(const string state, const string dir, double entry, double sl, double tp) { string url = " https://preview-sandbox--ee0a32a725b788974de435e8cef40b7a.base44.app/api/functions/receiveEAState "; string headers = "Content-Type: application/json\r\n"; string json = "{" "\"symbol\":\""+_Symbol+"\","
Hello! I am looking for an experienced, top-rated developer to build highly profitable strategy software that provides accurate signals for both long-term and short-term trades. The software must analyse the market correctly, indicating when to enter and where to set Take Profit (TP) and Stop Loss (SL) levels. It must deliver accurate results across all markets, including Forex, cryptocurrencies, metals, indices, and
I would like an experienced developer to work with. I have an existing EA I would like to modify. The EA works well on demo account but for some reasons, is not profitable on live account. I want an experienced developer to optimise it for a live account. Note: I only have a trial version of the EA, I do not have the source code

Информация о проекте

Бюджет
30 - 80 USD
VAT (21%): 6.3 - 16.8 USD
Итого: 36 - 96.8 USD
Исполнителю
27 - 72 USD

Заказчик

(19)
Размещено заказов27
Количество арбитражей0