Hedge function for existing EA & Trailing stop for open positions if TP level is reached.

MQL4 Asesores Expertos

Trabajo finalizado

Plazo de ejecución 4 días
Comentario del Cliente
My first time working with a freelancer here, Billy was a pleasure to work with. Very fast and highly skilled. My EA is greatly improved. Will work with him again and I can highly recommend him.
Comentario del Ejecutor
Happy to work with you Oscar, hope we can do it again next time.

Tarea técnica

Dear all,

I'm new to, but learning, MQL4 coding. I've created a very simple EA that I'm quite happy with. But I'd like to pay for some help with a few more complicated (at least for me) functions. I really want to improve my coding skills so I'd appreciate well-commented code. That way I can learn.

Please note that this EA is only aimed at short positions

What I'm looking for is to extend my EA with the following:

1 - Hedging short positions

  • I wish to prevent margin calls and negative liquidity/ equity fluctuations if a short position temporarily moves against me. 
  • I'd like to profit from the hedge position if my short position gets stopped out and the price keeps moving up. 

Specifically: 

  1. I'd like to have an input variable called something like "input double HedgeCost=10.0;"
  2. Every time my EA opens a short position, I'd like a buystop order to be placed at a level of the OpenSell price + HedgeCost. In this example, the buystop order would be triggered when the bid price reaches 10.0 PIP's above the OpenSell price).
  3. When the price moves down, I'd like the hedge position to be closed at OpenSell price - HedgeCost. And again, another BuyStop order should be placed, at OpenSell price + HedgeCost. So if the price moves up again, my short position will be hedged again.
  4. When my short position is closed by Take Profit or any reason except Stop Loss, I want the BuyStop order to be canceled.
  5. If my short position is closed due to a stop loss, the hedge position should be modified and a trailing stop should be placed at the exact level of where my short position got stopped out.

I also would like this hedge function to really attach to the ticket number. Because in the future, my EA may open several positions, and all of these need to be hedged. So it won't work if the hedge order is triggered by looking at the total open orders, it has to really check any open short position that hasn't got a hedge Buystop attached to it. And then hedge those that don't. 

 

2 - Trailing stop when TP is reached

I think this is relatively simple. Again I'd like to learn how to do this, based on your code.

  1. I'd like an input variable called something like "input int TrailingRange=3"
  2. When my short position almost reaches it's TP level, I'd like an OrderModify to happen so that the TP is removed and a trailing stop loss is put into place at the TP - TrailingRange level.
Thank you in advance and I look forward to your offer/ reply.

Best regards,

Oscar. 

Han respondido

1
Desarrollador 1
Evaluación
(121)
Proyectos
134
66%
Arbitraje
36
25% / 56%
Caducado
22
16%
Libre
2
Desarrollador 2
Evaluación
(53)
Proyectos
74
26%
Arbitraje
30
10% / 63%
Caducado
22
30%
Libre
3
Desarrollador 3
Evaluación
(12)
Proyectos
17
29%
Arbitraje
6
17% / 67%
Caducado
4
24%
Libre
4
Desarrollador 4
Evaluación
(258)
Proyectos
395
28%
Arbitraje
69
19% / 49%
Caducado
120
30%
Libre
5
Desarrollador 5
Evaluación
(107)
Proyectos
149
36%
Arbitraje
29
3% / 55%
Caducado
35
23%
Libre
6
Desarrollador 6
Evaluación
(97)
Proyectos
121
25%
Arbitraje
5
20% / 60%
Caducado
17
14%
Libre
7
Desarrollador 7
Evaluación
(76)
Proyectos
134
44%
Arbitraje
11
27% / 64%
Caducado
26
19%
Libre
8
Desarrollador 8
Evaluación
(89)
Proyectos
137
24%
Arbitraje
35
9% / 40%
Caducado
52
38%
Libre
Solicitudes similares
Hi, Coding Skills Required: Experience in coding trading robots for MT5. Ability to implement increasing coefficients for the distance between orders and lot size 1. Project Objective: Develop an automated trading robot for MetaTrader 5 (MT5) as per the specified trading strategy. 2. Trading Strategy: The robot must execute a strategy that includes the following elements: Opening initial orders. Placing pending
I have this EA that I have build with another developer. I tried backtesting and optimizing it but the test runs too slow. The EA gets instructions from a number of custom indicators to produce orders, I think that's what makes it to slow when testing. I need an experienced MQL4 developer who can dismantle the coded EA and rewrite it in a more logical way, without using the iCustom function. I want everything to be
simple job code I want u to revers my ea pending orders to limit orders and add a time filter.... my budget is 10$ cuz the ea code are too simple
I need ea trade copier reversal.. I have an ea if u can revers pending orders stops to limit orders I'll be glad and add time filter my budget is 10usdt
olá. preciso de um robô para me alertar no telegram quando as medias moveis cruzarem. esse alerta tem que ser instantâneo. o expert precisa também reconhecer qualquer operação que esteja aberta e colocar em breakeaven essa operação assim que o preço avançar o tamanho equivante ao stop loss pré definido manualmente. o robô também deve recolher a operação em aberto e me informar quando ela for fechada, seja com stop
Are you a coding maestro with a passion for optimizing indicators to blazing speeds? Look no further – I’m in search of a skilled developer to take my indicator to the next level! The Task: I need someone who can dive deep into the code, iron out any pesky errors, and optimize the indicator for lightning-fast responsiveness. Additionally, I require seamless integration of the Zigzag indicator, which currently resides
I need trading robots 30 - 80 USD
Building a bot that copies signals from the indicator to the slave platform The expert must work on two remote computers, not the same computer Control settings for masters and slaves as well If necessary, it is preferable to use an interface from a server
This is a Ready Made grid Automatic EA 1.Need some bug fixing and little modification. This EA has some bug like -Place Random Trade after MT4 Restart . Also not follow custom parameter grid distance, grid slippage . like if i set 300pips grid distance, some time it place trade at 400 pips distance . fix this bug 2.first trade open by RSI logic if rsi30 open buy trade Add Revise Order mode. (anti-martingle grid )
So does anyone have a mt4 to sway markets trade copier that can send trades from mt4 to sway markets Thats really all Ill need to do and manage them. someone posted one before if you see this let me know if we can get something done. or if theres anyone that has or can make this for me I would prefer one that uses your login to send trades over from mt4 to sway
Helping me will secure all my work in the future. need help fixing two errors I can give you one job a week if your good at what you do

Información sobre el proyecto

Presupuesto
10 - 50 USD
Para el ejecutor
9 - 45 USD
Plazo límite de ejecución
de 1 a 3 día(s)