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

Specifiche

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



File:

PNG
hedging.png
122.0 Kb

Con risposta

1
Sviluppatore 1
Valutazioni
(60)
Progetti
87
29%
Arbitraggio
24
13% / 58%
In ritardo
7
8%
In elaborazione
2
Sviluppatore 2
Valutazioni
(209)
Progetti
281
46%
Arbitraggio
27
59% / 37%
In ritardo
36
13%
In elaborazione
3
Sviluppatore 3
Valutazioni
(254)
Progetti
260
30%
Arbitraggio
0
In ritardo
3
1%
Gratuito
Pubblicati: 2 codici
4
Sviluppatore 4
Valutazioni
(574)
Progetti
945
47%
Arbitraggio
309
58% / 27%
In ritardo
125
13%
Gratuito
5
Sviluppatore 5
Valutazioni
(311)
Progetti
557
35%
Arbitraggio
79
32% / 43%
In ritardo
202
36%
Gratuito
6
Sviluppatore 6
Valutazioni
(39)
Progetti
65
34%
Arbitraggio
4
25% / 50%
In ritardo
9
14%
In elaborazione
7
Sviluppatore 7
Valutazioni
(354)
Progetti
425
54%
Arbitraggio
20
55% / 15%
In ritardo
29
7%
Caricato
8
Sviluppatore 8
Valutazioni
(44)
Progetti
53
38%
Arbitraggio
8
13% / 38%
In ritardo
8
15%
In elaborazione
9
Sviluppatore 9
Valutazioni
(12)
Progetti
9
33%
Arbitraggio
11
0% / 100%
In ritardo
2
22%
Gratuito
10
Sviluppatore 10
Valutazioni
(45)
Progetti
91
13%
Arbitraggio
34
26% / 59%
In ritardo
37
41%
Gratuito
11
Sviluppatore 11
Valutazioni
(468)
Progetti
486
75%
Arbitraggio
6
67% / 17%
In ritardo
0
In elaborazione
Ordini simili
حلل لي اصل مالي ) اكتب هنا مثلا XAU EUR USD USD اريد تحليلا تعليما و ليس توصية مالية ۱- نوع التحليل المطلوب : ( فني / اساسي / سلوك سعري ) ٢ - المدي الزمني : ( قصير / متوسط / طويل ) M15 / H1 / H4 / ) اذكر الفريمات المطلوبه + (D1 ما اريد استخراجه من التحليل : الاتجاه العام اقوي مستويات دعم و مقاومة رقمية سيناريو صعود و سيناريو هبوط مع شروط كل سيناريو ( IF / THEN ) اين يصبح السيناريو لاغيا مناطق دخول و خروج تعليمية (
Project Description I have three detailed CSV files containing: OHLC price data Timestamps Aggregated time & sales data A column called Arrow showing where signals occurred The data was captured using NinjaTrader 8 with NinZa Renko 8:4 bars on the ES market. All arrows are non-repainting and appear on candle close. Objective The goal is to create a NinjaTrader 8 indicator that reproduces the arrows in real-time
I need modifications to an existing MT5 Expert Advisor. Modification 1 EA must be able to run on indices as well as forex , specifically: SP500 US100 US30 No other changes to the current logic Modification 2 Other alterations/notes: Opening breakout range option for 15min or 30 min from session start. 5 min fair value gap (FVG) break outside of the range (instead of 1 min). At least one of the candles must be within
AutoTrade_v4_Arbon-v4 35 - 250 USD
============================================================ GOLD AI INSTITUTIONAL TERMINAL v4.0 - AutoTrade + EA Indikator EDISI GABUNGAN Sinkronisasi MT4 Realtime + Dasbor PWA + AI Multi-TF Menggabungkan MT4 + Server AI Node.js ============================================================ CARA MENJALANKAN (MUDAH): -------------------------- 1. Ekstrak ZIP ke folder manapun (misal: C:\GoldAI\) 2. Buka folder hasil
I am looking for an experienced quantitative developer to analyze and optimize an MT5 Expert Advisor that I have already developed. The EA is relatively complex and includes: Multiple strategies (Trend Pullback, Breakout, Mean Reversion, EMA Reclaim) Scoring system combining technical score and probabilistic filter Regime detection (ADX based) Volatility filters (ATR regime) Correlation and cluster exposure control
Until zone detection is coded , you will be from that point . Trailing Stop Optimization for live chart . Apply with Specific Currency Support . Clean Code . Zone Upper Limit and Lower Limit . Apply with careful understanding of the project requirement
Subject: Professional MT5 Trading Bot Inquiry - Pre-Purchase Requirements Dear [Bot Name/Company Name] Developers, Greetings, I am a professional trader seeking a highly professional and extremely powerful MT5 trading bot , and after extensive research, your product has caught my attention. However, before I click the payment button, I have specific requirements as I am not looking for an ordinary bot, but rather a
hello, please take a moment to review my project. It is for Quanttower. it is very detailed in the instructions. Thank you, Just let me know if you can do it and the whats the cost and timeframe
GoldAI_v2_FINAL 30 - 70 USD
========================================================== Terminal Institusional GOLD AI v2.10 Sinkronisasi Realtime MT4 + Dasbor PWA + AI Multi-TF ========================================================== CARA MENJALANKAN (MUDAH): -------------------------- 1. Ekstrak ZIP ke folder manapun (misal: C:\GoldAI\) 2. Buka folder hasil ekstrak 3. Klik dua kali: INSTALL.bat → installotomatis 4. Klik dua kali
Exe source code 70+ USD
Need a developer to help with a exe file and provide the source code, if you can do this please kidnly apply and tell me what you need to get this started

Informazioni sul progetto

Budget
50+ USD
Scadenze
da 2 a 4 giorno(i)