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

MQL4 Эксперты

Работа завершена

Время выполнения 4 дня
Отзыв от заказчика
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.
Отзыв от исполнителя
Happy to work with you Oscar, hope we can do it again next time.

Техническое задание

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. 

Откликнулись

1
Разработчик 1
Оценка
(121)
Проекты
134
66%
Арбитраж
36
25% / 56%
Просрочено
22
16%
Свободен
2
Разработчик 2
Оценка
(53)
Проекты
74
26%
Арбитраж
30
10% / 63%
Просрочено
22
30%
Свободен
3
Разработчик 3
Оценка
(12)
Проекты
17
29%
Арбитраж
6
17% / 67%
Просрочено
4
24%
Свободен
4
Разработчик 4
Оценка
(258)
Проекты
395
28%
Арбитраж
69
19% / 49%
Просрочено
120
30%
Свободен
5
Разработчик 5
Оценка
(107)
Проекты
149
36%
Арбитраж
29
3% / 55%
Просрочено
35
23%
Свободен
6
Разработчик 6
Оценка
(97)
Проекты
121
25%
Арбитраж
5
20% / 60%
Просрочено
17
14%
Свободен
7
Разработчик 7
Оценка
(76)
Проекты
134
44%
Арбитраж
11
27% / 64%
Просрочено
26
19%
Свободен
8
Разработчик 8
Оценка
(89)
Проекты
137
24%
Арбитраж
35
9% / 40%
Просрочено
52
38%
Свободен
Похожие заказы
I want to develop metatrader to trading bot and i want an expert that has experience in this field that can do the work perfect well for me without error
Hello colleagues, I have a request for development. It is required to develop a trading panel for manual trading. If you have experience in implementing similar projects, please send us estimated time frames and costs. I will be glad to hear your questions and work with you on this project. General description: It is required to develop a panel for manual trading. This is a panel with Risk Reward Tool for installing
Hello I have a EA and Custom Indicator That Someone Made for Me But I need to fix it up and get it to function properly using the customer indicator I want to fix the bug's and add a water mark to it that is all if someone could do this work asap that would be even better. EA is 3771 Lines Of Code Indicator Is 918 Lines Of Code list of things I need fixed (More then half of this is already coded in) #.1 I need the EA
Hi there Here is a video of the logic: its based on market structure and swings using validated highs and lows based on candle closure. Just in case you would like to take a look at the code/indicator here is the link: https://youtu.be/igj0OaQoM7o?si=7nigL8OU2Nt1Zxkx Let me know if you can help
Robot should have the option to either to Buy or Sell, and Buy and Sell based on selected technical indicators: PSAR, MACD, Stochastics, and Bollinger bands. Either one, all, or combination can be used to open order Lot size is either based on fixed lot, size per USD, or free margin per USD Target profit based on points and option for trail stop Stop loss is either in points or as a % of free margin Option for
Create MT5 deriv EA 30 - 35 USD
Hello . Am in need of a developer that can Create deriv EA .I need to create a Deriv Bot with Martingale 1 min candles 30 martingale plus I can change the amount of martigale with the option of 1 min up or down . Kindly bid and let discuss about the project
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

Информация о проекте

Бюджет
10 - 50 USD
Исполнителю
9 - 45 USD
Сроки выполнения
от 1 до 3 дн.