Need a Hedging bots that would close all related orders when the sum of all open orders and hedge reaches the stated take profit

Specification

I need a bot that would buy or sell, then open a hedge if the trade is losing  

Create a hedging Expert Advisor (EA) in MQL5 for MetaTrader 5, which persistently opens counteracting trades based on the outlined logic, with features that manage the initiation and oversight of these trades, adhering to the defined multipliers for position sizes. The EA will terminate all trades once it achieves a collective take profit target.

Design of the Hedging EA:

1. Initialization: Establish initial settings, the base lot size, profit targets, trade type and the multiplier for escalating trades.

  • Two different sort of inputs for multipliers: first multiplier and subsequent multiplier
  • The hedging trades would be pending orders added one by one, created as soon as the previous one is traded,. so we only need to have one pending order at a time

2. Opening Initial Trades: Execute an opening buy or sell order according to the strategy's guidelines.

3. Hedging Logic: - If the first trade is a buy, then the initial hedge will be a sell. following hedges will switch directions (sell after buy, buy after sell), with the lot size of each new hedge doubling that of the one before.

  • If the first trade reaches tp, close and start all over again in the direction of the win
  • If the first trade reaches hedge distance, trigger a new trade in the opposite direction with the first multplier

4. Monitoring for Take Profit: - Constantly track the aggregate of all open trades. - Liquidate all positions when the total profit meets the pre-set take profit threshold.

5. Out of Margin option (Enable/Disable): Average all profitable vs losing trades and close them. - restart hedge on the remaining losing trade as per step 2

6. Need a trade panel for to show all the positions and balances.


Input

  • Lots size
  • Overall take Profit (Amount)
  • Trade type: Buy/Sell
  • Magic Number
  • Hedge Distance (Amount)
  • First Trade Multipliers
  • Subsequent Multipliers
  • <:Display Panel Settings:>

Kindest Regards



Files:

PNG
hedging.png
122.0 Kb

Responded

1
Developer 1
Rating
(61)
Projects
89
28%
Arbitration
24
13% / 58%
Overdue
7
8%
Working
2
Developer 2
Rating
(210)
Projects
283
46%
Arbitration
27
59% / 37%
Overdue
36
13%
Free
3
Developer 3
Rating
(258)
Projects
264
30%
Arbitration
0
Overdue
3
1%
Free
Published: 2 codes
4
Developer 4
Rating
(574)
Projects
945
47%
Arbitration
309
58% / 27%
Overdue
125
13%
Free
5
Developer 5
Rating
(313)
Projects
559
35%
Arbitration
80
31% / 44%
Overdue
203
36%
Free
6
Developer 6
Rating
(39)
Projects
65
34%
Arbitration
4
25% / 50%
Overdue
9
14%
Working
7
Developer 7
Rating
(362)
Projects
435
54%
Arbitration
20
55% / 15%
Overdue
30
7%
Working
8
Developer 8
Rating
(44)
Projects
53
38%
Arbitration
8
13% / 38%
Overdue
8
15%
Working
9
Developer 9
Rating
(12)
Projects
9
33%
Arbitration
11
0% / 100%
Overdue
2
22%
Free
10
Developer 10
Rating
(45)
Projects
91
13%
Arbitration
34
26% / 59%
Overdue
37
41%
Free
11
Developer 11
Rating
(470)
Projects
488
75%
Arbitration
6
67% / 17%
Overdue
0
Free
Similar orders
FINAL EA STRATEGY DOCUMENT (Chandelier Exit + EMA Breakout System) ------------------------------------ CORE INDICATOR - Chandelier Exit (MAIN LOGIC) - ATR Period: Editable (Default 22) - ATR Multiplier: Editable (Default 3) IMPORTANT: - ATR must NOT be shown as a separate indicator - ATR must be used ONLY internally inside Chandelier Exit - All SL & trailing must strictly follow Chandelier Exit line
Super scalper 30 - 200 USD
Articles 1 How to create Requirements Specification for ordering a trading robot 28 MetaQuotes 225 289 Table of Contents Prerequisites for ordering a trading robot Why is it important to have a well-prepared Requirements Specification? Requirements Specification examples What is contained in the Requirements Specification? Where do I get Requirements Specification if I can't create it? Terms to use How to write an
i have a tradingview simple indecator of 40 lines of code ,i want it to convert it into mt5 EA strategy details given below AUTOMATED TRADING STRATEGY Multi-Lot Execution & Dynamic Trailing Stop Logic System Architecture & Operational Rules Trading Bot Strategy Profile Entry Conditions Buy Logic • • • Wait for Buy Signal candle. Confirmation: Future candle must break the signal high. Execution: Open 2 orders of 0.01
Situation: Please contact me privately so I can provide the source code for review. Thank you. Project Overview: I have developed a high-frequency trading (HFT) EA that performs consistently in demo environments and passes most prop-firm requirements. While short live phases showed profitability, the results were not reproducible over time. My primary goal is stable live performance on retail accounts , not just
"I need an MT5 EA based on price action — liquidity sweep + hammer/shooting star reversal strategy. TREND: Identified by HH/HL for uptrend, LL/LH for downtrend on selected timeframe. No trade in ranging conditions. BUY SETUP: In uptrend, price retraces to swing low zone, wicks below it (liquidity sweep), hammer forms (lower wick min 2x body, closes above swept low). Buy stop entry at hammer high. SL below hammer
EA SPECIFICATION SHEET OBJECTIVE: Build a transparent, non-martingale, non-grid breakout EA for XAUUSD that trades only high‑quality breakouts during London + New York sessions. 1. TRADING INSTRUMENT - XAUUSD only - MT4 platform - 5‑digit ECN broker 2. CORE STRATEGY LOGIC (BREAKOUT + CONFIRMATION) A trade is allowed ONLY when ALL conditions are true: - Candle closes beyond previous high/low (no wick breakouts) -
I am looking to develop a custom Expert Advisor (EA) for MetaTrader (MT4/MT5) based on a defined technical analysis strategy and flexible risk management rules. The EA should operate on a chart and timeframe that I manually specify, with the ability to adapt its behavior dynamically when the timeframe is changed. Core Strategy Logic The EA will execute trades based on predefined technical analysis zones
I need a professional MT5 Expert Advisor (EA) built with clean, modular code. This is an advanced strategy combining liquidity concepts, controlled DCA, hedge protection, and strict risk management. Core Requirements: Entry Logic (ALL must align): Liquidity sweep (Previous Day High/Low breakout and return) EMA50 and EMA200 trend alignment Higher timeframe bias (H1 or H4) RSI confirmation Bollinger Band entry Filters
I need a professional MQL5 developer. BEFORE I SHARE ANY DETAILS: 1. You must sign a PERPETUAL NDA with no expiration date 2. NDA includes €100,000 penalty for any breach 3. I require full .mq5 source code ownership 4. Developer must have 500+ completed jobs, 4.9+ rating Budget: €1500 EUR Duration: 14 days Start your application with "RULER" to prove you read this
Pip Scalper Bot 60+ USD
i want a trading bot that is aleast 98% sure,and cam also do scalping 99% correct using smart money concept, ICT, ALL technical analysis on it and also put risk management on it

Project information

Budget
50+ USD
Deadline
from 2 to 4 day(s)