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

Tarea técnica

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



Archivos adjuntos:

PNG
hedging.png
122.0 Kb

Han respondido

1
Desarrollador 1
Evaluación
(60)
Proyectos
87
29%
Arbitraje
24
13% / 58%
Caducado
7
8%
Trabaja
2
Desarrollador 2
Evaluación
(209)
Proyectos
281
46%
Arbitraje
27
59% / 37%
Caducado
36
13%
Trabaja
3
Desarrollador 3
Evaluación
(254)
Proyectos
260
30%
Arbitraje
0
Caducado
3
1%
Libre
Ha publicado: 2 ejemplos
4
Desarrollador 4
Evaluación
(574)
Proyectos
945
47%
Arbitraje
309
58% / 27%
Caducado
125
13%
Libre
5
Desarrollador 5
Evaluación
(311)
Proyectos
557
35%
Arbitraje
79
32% / 43%
Caducado
202
36%
Libre
6
Desarrollador 6
Evaluación
(39)
Proyectos
65
34%
Arbitraje
4
25% / 50%
Caducado
9
14%
Trabaja
7
Desarrollador 7
Evaluación
(354)
Proyectos
425
54%
Arbitraje
20
55% / 15%
Caducado
29
7%
Trabajando
8
Desarrollador 8
Evaluación
(44)
Proyectos
53
38%
Arbitraje
8
13% / 38%
Caducado
8
15%
Trabaja
9
Desarrollador 9
Evaluación
(12)
Proyectos
9
33%
Arbitraje
11
0% / 100%
Caducado
2
22%
Libre
10
Desarrollador 10
Evaluación
(45)
Proyectos
91
13%
Arbitraje
34
26% / 59%
Caducado
37
41%
Libre
11
Desarrollador 11
Evaluación
(468)
Proyectos
486
75%
Arbitraje
6
67% / 17%
Caducado
0
Trabaja
Solicitudes similares
حلل لي اصل مالي ) اكتب هنا مثلا 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

Información sobre el proyecto

Presupuesto
50+ USD
Plazo límite de ejecución
de 2 a 4 día(s)