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
(24)
Proyectos
31
16%
Arbitraje
7
29% / 43%
Caducado
4
13%
Trabaja
2
Desarrollador 2
Evaluación
(176)
Proyectos
236
45%
Arbitraje
17
82% / 12%
Caducado
35
15%
Trabaja
3
Desarrollador 3
Evaluación
(202)
Proyectos
206
27%
Arbitraje
0
Caducado
3
1%
Libre
4
Desarrollador 4
Evaluación
(563)
Proyectos
932
47%
Arbitraje
302
59% / 25%
Caducado
124
13%
Ocupado
5
Desarrollador 5
Evaluación
(243)
Proyectos
430
34%
Arbitraje
54
37% / 39%
Caducado
157
37%
Trabajando
6
Desarrollador 6
Evaluación
(36)
Proyectos
59
34%
Arbitraje
4
25% / 50%
Caducado
6
10%
Trabaja
7
Desarrollador 7
Evaluación
(76)
Proyectos
85
34%
Arbitraje
3
0% / 0%
Caducado
1
1%
Trabajando
8
Desarrollador 8
Evaluación
(36)
Proyectos
44
32%
Arbitraje
6
17% / 33%
Caducado
8
18%
Trabaja
9
Desarrollador 9
Evaluación
(9)
Proyectos
8
38%
Arbitraje
2
0% / 100%
Caducado
2
25%
Trabaja
10
Desarrollador 10
Evaluación
(42)
Proyectos
88
14%
Arbitraje
30
30% / 53%
Caducado
36
41%
Trabaja
11
Desarrollador 11
Evaluación
(343)
Proyectos
362
70%
Arbitraje
4
100% / 0%
Caducado
0
Trabajando
Solicitudes similares
I want to decompile an ea file and get the source code, i need it really quick as fast as possible. the file must be delivered alongside the source code
I have an algo that is running on ProRealTime, they have their own language. It is a simple strategy with 5 conditions + SL/TP settings, very basic. I need someone that can convert or just create a functional MT5 algo (EA) from these conditions for me, if you do a good job I have around 10+ more algos that need to be transferred to MT5
Dear Developers, I would have a very simple request. I have a ML model developed in Python for EURUSD daily trading. I would like to backtest it in Meta Trader 5 using the Strategy Tester tool. For that I would need an Expert Advisor program. The input would be a csv file that contains two columns: - dates (going back for a few years on a daily basis) - trading signal (it can have only 2 values, either 1: Buy, or -1
Hi I have the code in pinescript for an indicator that I need done in Ninja Trader 1. The Trading View indicator code needs to be converted into and adapted for Ninja Trader 8 2. An indicator and Automated Trading Strategy needs to be developed. 3. Any parts of the Trading View Indicator that can't be replicated needs to be discussed with me and agreed before excluding. (there should not be any) 4. Trailing stop and
1. The Trading View indicator code needs to be converted into and adapted for Ninja Trader 8 2. An indicator and Automated Trading Strategy needs to be developed. 3. Any parts of the Trading View Indicator that can't be replicated needs to be discussed with me and agreed before excluding. (there should not be any) 4. Trailing stop and Trailing Draw Down options need to be implemented 5. Risk needs to be in % of
Create mt4 ea 50+ USD
To convert the provided MT4 indicator script into an Expert Advisor (EA) and implement prompt functionality for user input, we need to modify the code to handle external parameters and provide a user-friendly interface. Below is the EA code that incorporates prompts for user inputs
I WRITE a code i want to conect this for automatic trading through vps .and als advanced features for this code .i attached afile please watch .and give me perfect ea
Hi Developer, I would like to create the Scalping EA based for Mt4 on the investing.com data https://www.investing.com/currencies/eur-usd-technical EA have timing to adjust time to trade. follow the broker time. From starting time to end time EA have a adjustable Lot size (0.01 incremental to 0.01) EA have a adjustable TP (1pip to 100pip incremental 1pip) EA have a adjustable SL (1pip to 100pip incremental 1pip) EA
Hi I have the code in pinescript for an indicator that I need done in Ninja Trader, I wanted this indicator in NT bcs I chart in NT, and if the indicator could also have been an automated strategy even better. Please confirm that it will be an indicator and Automated Trading Strategy
Hello I need a very simple indicator This indicator should show the highest floating or history drawdown of the account It means that it can display the highest number that the account drawdown to be displayed on the chart in this format max drawdown account(xxxx$$) ...date(00/00/00)time:(00:00) max drawdown currency ..( currency name with max drwadown) . (xxxx$$) date(00/00/00)time:(00:00) thanks

Información sobre el proyecto

Presupuesto
50+ USD
IVA (21%): 10.5 USD
Total: 60.5 USD
Para el ejecutor
45 USD
Plazo límite de ejecución
de 2 a 4 día(s)