Dynamic ATR×10 Sure-Fire Hedge EA (MT5)

Tâche terminée

Temps d'exécution 11 jours
Commentaires du client
My EA was a very complex . But he did it with ease and fixed all the correction with consoling words. Highly skilled and knowledged and a nice person to work with
Commentaires de l'employé
This client has a clear vision of the project, which is very well detailed and makes the work much easier. He is also understanding, honest, and genuinely kind. I am very happy to work with him.

Spécifications


Requirement Specification 
EA Name: Dynamic ATR×10 Sure-Fire Hedge EA (MT5)
1. Project Overview
This Expert Advisor (EA) runs on MT5 (ECN) /VPS server and executes a sequential hedging reverse martingale strategy with dynamic hedge gaps based on ATR.
Includes Range detection, Risk management and perferms efficiently in volatile instruments like BtcUsd/Gold. The system should be engineered for stability,precision, and broker-compliant execution without overwhelming the trading server.
Only one trade is active at any time — every hedge order closes the previous trade instantly.
Goal:
Automatically trade BTCUSD/Gold
Avoid server flooding (no spamming, no excessive modify requests)
Maintain stable, controlled execution even during volatility
Use ATR-based dynamic hedge gap to avoid small tight ranges
Close entire basket at TP, SL, or safety conditions

2. Core Strategy Summary
1️⃣ EA opens first Buy/Sell trade
2️⃣ If price moves against the trade by Hedge Gap,
Expert advisor:
Closes current trade
Opens opposite trade
New lot = PreviousLot × MartingaleMultiplier
Recalculates new Hedge Gap using ATR
3️⃣ Continue until TP is reached or max hedge level hit
4️⃣ Only ONE position exists at any moment (strict rule).

3. Entry Logic
3.1 Case 1 — Default Entry
EA opens the first trade immediately.
3.2 Case 2 — EMA Trend Filter (optional)
User can enable/disable this.
Conditions for entry:
EMAs: 5, 8, 13 (close)
All three EMAs must be parallel, spaced, not touching
If price is ABOVE 13 EMA → Buy
If price is BELOW 13 EMA → Sell
If not clear → No entry
This filter applies only to the first order, not to hedge orders.

4. Volatility Filters Before Opening First Trade
1. ATR Minimum
ATR(3 or user-defined) must be > ATR_Min
Default ATR_Min = 70 for BTCUSD
3. Spread Filter
Spread < user-defined max
4. High volatility block
Skip entry during extreme volatile spikes or news window 

Rules:
Hedge Gap is recalculated for every new hedge order
If ATR < ATR_Min →
→ block ALL new hedges
→ optionally close basket at breakeven
If ATR drops 25–35% during a hedge cycle →
→ close basket at breakeven
→ cancel all pending orders

5. Hedging/Martingale Rules
1. If price moves against the open position by the Hedge Gap:
Close previous order instantly and 
Open opposite order (Reverse direction hedge order)

Hedge order follows two options for the user
Option 1: Hedge gap is fixed and it is user defined
Option 2: Dynamic hedge gap logic (explained in point 6)

6. Dynamic Hedge Gap Logic
Formula
Hedge_Gap (pips) = ATR(Period 3 on M1) * ATR_Multiplier
Default ATR_Multiplier = 10
Example:
If ATR(3) = 143
→ Hedge Gap = 143 × 10 = 1430 pips (143.0 points)
Basket Stop loss value will be the stop loss for dynamic hedge gap

6(a). Static/Fixed Hedge Gap Logic
Lot = PreviousLot × multiplier
Multiplier 1 (2nd order): user input (default ×2 or ×3)
Multiplier 2 (3rd order onwards): user input (default ×2)
Hedging rules 
2. Maximum Hedge Steps: user input (e.g., 3 levels)
3. No simultaneous Buy/Sell allowed.
EA must always maintain exactly one open order.

7. Take Profit (Very Important for Dynamic Gap)
   1) Formula for TP Money Target
Since each Hedge Gap is different, TP must be dynamically computed.
TP_Money = Total_Loss_of_Previous_Orders (in the current sequence only) + UserDefinedProfit
Example:
User profit = $5
Previous lost trades = $18 (in the current sequence only, not the overall account loss)
→ TP must close when basket reaches (18+5)= +$23 total

   2) Formula for fixed Hedge gap target
For fixed gap strategy:
Take profit: Hedge Gap*2
Stop Loss : Same value of hedge gap

TP Execution
Calculate TP price level from monetary target
All Take Profit/ Stop Loss/Pending order should be virtual i(t shoul be working in the EA and not sent to the Broker)
Close entire basket when target is hit
Close all pending orders

8. Basket Exit & Safety Rules
Basket must close immediately if:
1. Any trade hits its virtual TP
2. Basket Profit reaches user setting
3. Basket Loss reaches user setting
4. ATR drops 25–35% from initial entry ATR
5. Larry Williams Ranging Detection triggers (when market price is inside the hedging gap)
6. Spread exceeds max allowed (when market price is inside the hedging gap)
7. Max Hedge Levels reached → close at breakeven
8. Market becomes ranging (ATR compression) -(when market price is inside the hedging gap)
9. Connectivity error recovery requires safe exit
10. Daily Stop Loss reached

9. Larry Williams Trend/Ranging Logic (Optional)
User can toggle this ON/OFF.
Trend valid if:
Consecutive HH/HL candles = X (default 3)
Or consecutive LL/LH candles = X
Range detected if:
No HH/HL or LL/LH structure for X consecutive candles
If detected:
→ block entries
→ optionally close all trades & pending orders

10. Range Detection Filters
Two systems are used:
10.1 ATR Compression Technique
Range = ATR value less than user input threshold
10.2 Larry Williams Candle Structure
Range = HH/HL or LL/LH not formed for defined number of candles
EA actions during range:
Block new entries
Optionally close open trades
Cancel pending hedges
10.3  ATR slope method
ATR_slope ≥ 0
   Calculation:
ATR_slope = ATR(current) − ATR( for the previous 5 canles)

11. Order Management
Only one active position at a time
All SL/TP must be virtual
All pending orders must be virtual
Remove all pending orders when basket ends
EA must restore state on restart using history/global variables
Stop trading if a basket sequence ends in loss
Sound Alert if Market starts reanging
12. Execution & Safety Layer
Must protect from:
Server overload
Order modification spamming
Requote loops
High slippage
Network delays
Important: During network disconnect 

✅ 12 Safety Layers for Virtual SL/TP & Virtual Pending Orders
ALL of these are must in EA specification.)
1️⃣ Broker-Side “Emergency Hard Stop-Loss” (Hidden fail-safe)
Even if you use virtual SL/TP, your EA should optionally place a real broker SL far away, only for emergency use.
Example:
Virtual TP = 50 pips
Virtual SL = 80 pips
Emergency SL at broker = Stop loss *3 (never gets hit under normal logic)
Purpose:
2️⃣ Heartbeat Timer (EA Watchdog)
EA should constantly check:
If (LastTickTime > 3 seconds)  → STOP trading & close basket
If (No new prices for 10 seconds) → Close all orders immediately
This protects against:
VPS freeze
MT5 terminal hang
Market data disconnect
3️⃣ Broker-Error Recovery Layer
Every execution function should have:
If ERR_TRADE_CONTEXT_BUSY → retry after delay
If ERR_PRICE_CHANGED → refresh price → retry
If ERR_NO_CONNECTION → switch to Safe Mode
Safe Mode =
No new entries
Only close orders when price becomes available
4️⃣ Server Throttle Protection
To avoid missing SL/TP execution:
Only allow 1 order action every 500–1200 ms
Any additional action is queued, not executed instantly
If queue > 3 → flush queue → close EA operations
This prevents:
“Order Flood”
“Trade is Busy”
Slow execution causing missed exits
6️⃣ Virtual SL/TP Double Check Mechanism
Before executing a virtual SL or virtual TP, do:
If price has moved beyond SL/TP → execute immediately at market
Else → check again after 100 ms and confirm
This prevents:
SL/TP slips due to sudden spike
Execution on incorrect stale price
7️⃣ Global Variable Backup for EA State
Every time a hedge or grid order is opened, write to global variable or file:
Last order type
Last lot size
Last hedge level
Last hedge gap
Basket accumulated loss
Virtual TP price
ATR at entry
On terminal restart:
EA restores state instantly and continues where it left off.
8️⃣ Freeze-Level Aware Execution
Before closing a trade or executing TP:
If distance < FreezeLevel → retry after tick
If still frozen → execute Close at Bid/Ask without SL/TP modification
Prevents:
Failure due to broker-imposed freeze zone
Missed SL/TP due to “Modify not allowed” errors
9️⃣ Execution Window Lock
When EA is closing an order:
Block all other operations
Allow only one close attempt
Wait until confirmation is received
Resume activity
This avoids:
Double closing
Closing same ticket twice
Duplicate trades during volatility
🔟 High-Volatility Safe Mode
If ATR suddenly spikes:
If ATR(current) > ATR(previous) × 2.0/2.5/3.5
> 2.0 → Caution (reduce aggressiveness: widen hedge gap, reduce new-entry frequency)
> 2.5 → Safe Mode (pause new entries, reduce multiplier, no further hedges)
> 3.5 → Emergency Mode (close basket to breakeven or hard-close 
→ Disable hedging  
→ Reduce lot multiplier  
→ Extend hedge gap  
→ Consider emergency close
Protects against:
Flash crashes
Sudden BTC/Gold spikes
Spread blowouts
1️⃣1️⃣ Virtual TP Protection using Tick-by-Tick Watch
Instead of waiting for bar close:
If (Bid/Ask crosses virtual TP):
    Close order immediately 
Tick-based logic prevents:
Missing TP due to fast spikes
Exiting too late
Overrunning by 3–10 pips
1️⃣2️⃣ “Last Chance Close” Mechanism
If all safety systems fail (very rare):
If Floating Loss > 30% of Equity  
    Close ALL orders immediately  
    Reset EA  
This is the final hard shield preventing full account wipeout.

Developer Guidelines:
Use retry logic with limited attempts
Minimum delay between operations
Handle "Trade is busy", "Invalid price", "No connection" gracefully
ECN brokers: send order → modify → check fill
VPS stable loop timing

13. User Inputs
Important instruction: All Entry filter, Exit filter, Range filter, Logic filter should have True/False. (user option to switch it ON or OFF)
Important instruction: Option to switch off all the 12 Safety Layers for Virtual SL/TP & Virtual Pending Orders
Trading
First lot size 
ATR Period (default 3)
ATR Multiplier (default 10)
ATR_Minimum
Take profit in fixed hedge method: multiplier 2/3 with decimal value
Stop loss in fixed hedge method : default same as hedge value
Max Hedge Levels
Martingale multipliers
           Martingale multiplier for the second order
           Martingale multiplier for the 3rd order onwards
Hedge gap (Fixed / Dynamic ATR)
If hedge gap is fixed method: User input for gap value
If hedge gap is Dynamic ATR method : User input for ATR multiplier value
Basket ProfitTarget in USD for Dynamic hedge method
Basket Stop loss in dynamic hedge method : 
Spread Max
Slippage Max
Time filters (start/stop times)
Trade direction (Auto/Buy/Sell)
Time frame for EA to run even if changed in chart : M1/ M5/M15/H1
Loop option: Should the EA run continously after each cycle or not
Virtual TP/SL (ON/OFF) If Off all TP/SL/Pending order will be sent to broker server.
Filters (side heading in User input)
ATR Compression Range detection (threshold value) -
ATR slope filter
Larry Williams Trend logic settings
All Range filters ON/OFF
Block entries ON/OFF
Close trades on range ON/OFF
General (side heading in User input)
Magic number
Digits parameter: decimals
Display options : candle colour, background colour,Virtual Tp line, and other colour changing options
Error alerts ON/OFF
Last Chance Close  Mechanism.Floating loss max value
14. On-Chart Display
Small panel on top left. Spaced so that it wont disturb the chart view on the right hand side
Current day profit
Basket cumulative loss
Spread
Number of hedge steps used
Total lot size of sequence
Virtual TP line
System Status (Idle/Waiting/Trading/Error)
Reason /comment  on Previous hedging sequence order closed.
Alerts for errors
Market status: Trending (green)/ Ranging (letters in red colour)
ATR Compression Technique: Trending or Ranging
ATR slope method: Trending or Ranging
Larry Williams Candle Structure: Trending or Ranging

15. Timeframe Rules
EA must always calculate ATR from M1 timeframe even if chart is different.

16. Developer Deliverables
Full MT5 source code (.mq5)
Full rights for the EA.
Stable, optimized logic
No server spamming
Recovery logic after restart
Virtual SL/TP system
Clean coding standards with 
Comments on history page next to each trade. Reason for the trade closure
Memory-safe, thread-safe design
ECN & VPS compatible

Répondu

1
Développeur 1
Évaluation
(39)
Projets
57
18%
Arbitrage
6
33% / 17%
En retard
1
2%
Gratuit
Publié : 2 codes
2
Développeur 2
Évaluation
(18)
Projets
22
9%
Arbitrage
5
40% / 40%
En retard
1
5%
Chargé
3
Développeur 3
Évaluation
Projets
0
0%
Arbitrage
0
En retard
0
Gratuit
4
Développeur 4
Évaluation
(12)
Projets
24
50%
Arbitrage
1
100% / 0%
En retard
6
25%
Gratuit
5
Développeur 5
Évaluation
Projets
0
0%
Arbitrage
0
En retard
0
Gratuit
6
Développeur 6
Évaluation
(4)
Projets
3
33%
Arbitrage
2
0% / 100%
En retard
0
Gratuit
7
Développeur 7
Évaluation
(2)
Projets
3
0%
Arbitrage
1
0% / 100%
En retard
0
Travail
8
Développeur 8
Évaluation
Projets
0
0%
Arbitrage
0
En retard
0
Gratuit
9
Développeur 9
Évaluation
(58)
Projets
85
27%
Arbitrage
24
13% / 58%
En retard
7
8%
Chargé
10
Développeur 10
Évaluation
(2)
Projets
2
50%
Arbitrage
0
En retard
0
Gratuit
Publié : 2 articles
11
Développeur 11
Évaluation
(32)
Projets
36
17%
Arbitrage
13
8% / 69%
En retard
1
3%
Occupé
12
Développeur 12
Évaluation
(500)
Projets
966
74%
Arbitrage
27
19% / 67%
En retard
100
10%
Chargé
Publié : 1 article, 6 codes
13
Développeur 13
Évaluation
Projets
2
0%
Arbitrage
4
25% / 50%
En retard
1
50%
Gratuit
14
Développeur 14
Évaluation
(1)
Projets
2
0%
Arbitrage
1
0% / 100%
En retard
1
50%
Gratuit
15
Développeur 15
Évaluation
(249)
Projets
255
30%
Arbitrage
0
En retard
3
1%
Gratuit
Publié : 2 codes
16
Développeur 16
Évaluation
(15)
Projets
18
6%
Arbitrage
8
38% / 38%
En retard
2
11%
Chargé
17
Développeur 17
Évaluation
Projets
0
0%
Arbitrage
0
En retard
0
Gratuit
18
Développeur 18
Évaluation
(5)
Projets
6
0%
Arbitrage
1
0% / 100%
En retard
0
Gratuit
19
Développeur 19
Évaluation
(77)
Projets
242
74%
Arbitrage
7
100% / 0%
En retard
1
0%
Travail
Publié : 1 article
20
Développeur 20
Évaluation
(25)
Projets
29
21%
Arbitrage
20
10% / 50%
En retard
8
28%
Travail
21
Développeur 21
Évaluation
(1)
Projets
0
0%
Arbitrage
1
0% / 100%
En retard
0
Gratuit
Commandes similaires
Core Requirements: Two selectable timeframes - dropdown inputs to choose from M1, M5, M15, H1, H4, D1, W1, MN1 Timeframe 1 = Chart's own timeframe (if chart is M5, TF1 should be M5) Timeframe 2 = Higher timeframe for confluence All Ichimoku components displayed for both timeframes: Tenkan-sen Kijun-sen Senkou Span A Senkou Span B Chikou Span Cloud (bullish and bearish) Technical Settings: All buffers accessible for
Hello everyone, I am looking for a highly experienced MQL5 developer to build a fully automated Expert Advisor (EA) based strictly on Smart Money Concepts (SMC) 🔍 Core Strategy Requirements (SMC Only) The EA must be based on Advanced Smart Money Concepts , including: ✅ Market Structure (BOS & CHOCH) ✅ Liquidity concepts (equal highs/lows, stop hunts)✅ Trap Blocks / Fake Order Blocks detection ✅ Valid Order
I need a AI signal generating bot for forex trading that use the latest ai technology to track real time forex market, analyse and give signals. The bot should operate such that when i put it in a chart it will analyse the market, after several minutes it will display whether the trade is buying or selling. It should display the one minute, five minute,15minute, 30 minute, one hour, 4 hours and daily time frame
Hello I want to convert my tradingview indicators into Ninja trader can anyone help me with it it is urgent and I will like to discuss more about it to you if you can help me Kindly do well to bid on it
📌 JOB DESCRIPTION – FULLY AUTOMATED TRADING SYSTEM I am looking for an experienced developer to build a fully automated end-to-end trading system for MetaTrader 5. This is not an indicator-based bot and not a discretionary or black-box AI system. The system must follow a strict, deterministic rule-based trading framework that is already defined. 🎯 PROJECT GOAL Build a system where: A backend continuously evaluates
EA with Zones 30+ USD
Good day! I have an indicator .mq5 this indicator calculates and draw zones on the chart. My request is to add these specific zones drawn and calculated exactly as the indicator in the EA. A replicate behavior of the zones from the indicator to the EA. Thank you
I need a fully automated end-to-end system where a backend continuously runs my deterministic CORE EDGE validator on live market data, generates numeric JSON trade tickets (GO) or alert levels (NO-GO), and automatically pushes those instructions to the MT5 EA for execution. There are no manual signals. ROLE SPLIT (IMPORTANT) Backend (analysis & decision engine): Continuously evaluates live data using my CORE EDGE
I am looking for an experienced MQL4 / MQL5 developer to create a custom Expert Advisor (EA). Trading details: - Symbol: XAUUSD (Gold) only - Platform: MT4 or MT5 - Strategy type: Scalping (fast trades) - Timeframes: M1 / M5 - Fixed Stop Loss and Take Profit - Risk management: - Lot size based on balance OR fixed lot (user configurable) - Maximum trades per day (user configurable) - Spread and slippage filter -
For a buy case, ea will set buy stop order at the high of the current 4H candle, if the close of the current 4h candle is higher than the open and if the close is less than the high of the 4H candle , then ea will set a buy stop at the high of the current 4h candle. Reverse of this is the sell case. , - -- sell SL to 1800point for gold pair only, set 4500 point for TP, --- , BE the SL to 50points when price moved
step by step and structure this into a full IEEE 830 / ISO/IEC/IEEE 29148 style Requirements Specification. This format will include: Introduction System Overview Functional and Performance Requirements Traceability Matrix (linking requirements to test cases) Verification and Validation Compliance Standards 1. Introduction 1.1 Purpose The purpose of this document is to define the technical requirements for the

Informations sur le projet

Budget
30+ USD
Délais
à 15 jour(s)