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:
📌 Without UpdateHistory() there is no recovery, because GetLot() would have no data.
2️⃣ Recovery lot calculation – GetLot()
👉 THIS is the actual recovery engine
📍 Function:
🔹 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:
📌 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:
👉 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
👉 Recovery is volume-based, signal-dependent, and risk-capped.
Solicitudes similares
Project Summary: Create an alert-only MT4 EA for XAU/USD (5-minute chart) that detects a specific sequence of price action events and sends push notifications and optional sound/Telegram alerts when all conditions are met. ⸻ 1. Inputs / Settings • Enable/Disable Alerts → Boolean (true/false) • FVG minimum width (pips) → Default 2 • Order Block maximum width (pips) → Default 30 • Optional time filter → Default
I need a MetaTrader 5 Expert Advisor (EA) for Forex trading. Account size: $1000 Requirements: 1. The EA should work only on Forex pairs. 2. Automatic Buy and Sell trades. 3. Lot size starting from 0.04. 4. Stop Loss and Take Profit settings. 5. Only one trade at a time. 6. Works on pairs like EURUSD, GBPUSD, USDJPY etc. 7. Risk management suitable for a $1000 account. 8. Easy settings for lot size, SL, TP and risk
Hi, I need a custom MT5 indicator based on a multi-timeframe fractal break reversal. 1️⃣ The indicator should use two timeframes: Higher Timeframe (HTF) Lower Timeframe (LTF) (Timeframes should be adjustable in inputs, e.g., HTF = H1 and LTF = M5) 2️⃣ Use standard fractals to detect fractal highs and fractal lows. 3️⃣ Primary signal (HTF): When a Lower High fractal is formed and price breaks that Lower High in one
I’ve been following your profile and I'm interested in your expertise with the ATAS API and C# development. I have a clear technical scope for a high-performance M1 indicator focused on Binary Options and Scalping. The core logic is based on institutional Order Flow convergence: Stacked Imbalances: 300% ratio with a minimum of 3 consecutive levels. Delta/Price Divergence: Filtering for market exhaustion (New Highs
can you help me with editing the existing ATR Trailing Stop Indicator to include a logic to include additional script, where my ninZaRenko bars when it closes above OR below the dynamic stop line, I will be out of trade. Please remember, in this Indicator, now when the price touches the stop line, I am stopped out .. . I want to edit the script, in lieu of the price touch, I like to update this logic to when the bar
APARTE DE PASAR EL CÓDIGO A MT5 QUIERO QUE CONTENGA TODOS LOS DATOS NECESARIOS PARA QUE ESTE NUEVO CÓDIGO SE PUEDA USAR EN LA FÁBRICACIÓN DE UN ROBOT, NO SE MUCHO DE ESTO PERO INVESTIGUE QUE DEBE LEER BUFFERS Y OTRAS COSAS
Create a ZigZag indicator, which is constructed based on extreme values determined using oscillators. It can use any classical normalized oscillator, which has overbought and oversold zones. The algorithm should first be executed with the WPR indicator, then similarly add the possibility to draw a zigzag using the following indicators: CCI Chaikin RSI Stochastic Oscillator Algorithm and Terms The first stage is the
Hello programmer! I am looking to build an Indicator with your help :) you must speak English so if we have to conference call to work out details WHAT Indicator DOES: Alerts when pullbacks end and trend resumes ARROWS: 🟢 Green = Confirmed Long 🔴 Red = Confirmed Short 🔵 Blue = Add to position ⚫ Black = Better second chance 🟡 Yellow = Early warning (inside bar) ⚪ White = Early warning (pullback) CORE RULE: - Trail
I need an Expert Advisor for MetaTrader 5 based on SMT and CISD strategy using NASDAQ and S&P500. Strategy logic: - The bot compares NASDAQ and S&P500. - Timeframe: 3 minutes. - First condition: One of the pairs must take liquidity from a previous high or low while the other pair does NOT take that liquidity (SMT divergence). - Second condition: The pair that took liquidity must close back below the high (or above
I’m looking for a Pine Script developer who can reverse engineer the “Swing Only” logic of the Polytrends indicator on TradingView. The goal is to recreate how the swing trends are detected and plotted so it can be used as a custom indicator. If you have experience with TradingView Pine Script and reverse-engineering indicator logic , please reach out