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

MQL4 Experts

Trabalho concluído

Tempo de execução 4 dias
Comentário do 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.
Comentário do desenvolvedor
Happy to work with you Oscar, hope we can do it again next time.

Termos de Referência

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. 

Respondido

1
Desenvolvedor 1
Classificação
(121)
Projetos
134
66%
Arbitragem
36
25% / 56%
Expirado
22
16%
Livre
2
Desenvolvedor 2
Classificação
(53)
Projetos
74
26%
Arbitragem
30
10% / 63%
Expirado
22
30%
Livre
3
Desenvolvedor 3
Classificação
(12)
Projetos
17
29%
Arbitragem
6
17% / 67%
Expirado
4
24%
Livre
4
Desenvolvedor 4
Classificação
(258)
Projetos
395
28%
Arbitragem
69
19% / 49%
Expirado
120
30%
Livre
5
Desenvolvedor 5
Classificação
(107)
Projetos
149
36%
Arbitragem
29
3% / 55%
Expirado
35
23%
Livre
6
Desenvolvedor 6
Classificação
(97)
Projetos
121
25%
Arbitragem
5
20% / 60%
Expirado
17
14%
Livre
7
Desenvolvedor 7
Classificação
(76)
Projetos
134
44%
Arbitragem
11
27% / 64%
Expirado
26
19%
Livre
8
Desenvolvedor 8
Classificação
(89)
Projetos
137
24%
Arbitragem
35
9% / 40%
Expirado
52
38%
Livre
Pedidos semelhantes
I need an automated EA to open positions based on the closing of a candle over/under the 50MA TP must be able to be set at specific points SP must be able to be set at previous candle open
MT4 TRADE COPIER EA 30 - 35 USD
Hello , how are you doing? Am in need of MT4 developer that can help me to develop trade copier EA for MT4 account Kindly bid for the project if it is what you can do for me thanks
I am looking for a professional developer to help me with creating a hedge grid bot. The concept is in the picture. The bot is quite simple. The bot basically opens buy and sell positions on each grid and self terminates when the upper limit (manually set is reached) 1. Set timer for new's releases (manual entry) 2. Slippage in pip's (manual entry) 3. Maximum drawdown in USD with self termination when entry
I needed to create a script based on MQL5, which depends on Stochastic and MACD indicators. Long entry should be once Stochastic lines are crossed above and MACD lines are crossed above and vice versa for short entry. If you know pine script, I have the pine script strategy code for this strategy, you can convert this into MQL5, Refer the below text file for the code
Nt8 30+ USD
I trade in NT8 and would like to code an Elliott wave measurment tool, which is very easy because I have the major Script for that.We need only to add some aspects into it. If you are interested,if you can do this do well to bid on it
This is ready made grid ea Bug- This ea has some bug like - a>if mt4 restart ea trade random without any logic. B>if i add 300 pips grid ,some time ea take next trade at 400 distance pips Feature 2. Add supply and demnad + 200 ma entry logic (supply demad indicator are add to attach) 3.Add two separet engine en1 -- en2. But engine have same grid logic but separate parameter and magic number bot have anti-grid
Due to developers not responding I try again. Im going to automate my strategy which is a breakout strategy but with some extra confirmations and rules, see attached file with description of the requirements. Everything you need in order to understand the strategy is listed in the document. If any questions appear feel free to ask! Please leave a quote, and only after reading the document attached. thanks ahead
Programmer needed to make my HFT bot more suitable for live trading. After testing and proven, if up to expectation, full funds will be received. Genuine offer but if this is successful further discussions can take place. DM me first so we can discuss further
An Expert Advisor based on Martingale's strategy is needed. Based on a tendency indicator, open a position, and if it hits the stop loss, open another position in the same or opposite direction (The EA should have the option to select this preference) with the lot size two times the previous lot. Also, the EA should have a risk management option to set the maximum drawdown limit to stop opening more orders. The EA
Hidden SL & TP 1. Design a simple interface on chart. Order No | Pair | Lot | TP | SL 5110022 | EURUSD | 1.0 | +20 | -30 2. EA will scan All existing orders and new orders and put to Chart Interface. 3. User is able to select which order on interface and put a custom TP and SL number. Eg: TP +20 | SL -30. And prices will calculate accordingly. 4. TP & SL is hidden on the MT4. 5. When the Order is closed, it will auto

Informações sobre o projeto

Orçamento
10 - 50 USD
Desenvolvedor
9 - 45 USD
Prazo
de 1 para 3 dias