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

MQL4 Experts

Job finished

Execution time 4 days
Feedback from customer
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.
Feedback from employee
Happy to work with you Oscar, hope we can do it again next time.

Specification

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. 

Responded

1
Developer 1
Rating
(121)
Projects
134
66%
Arbitration
36
25% / 56%
Overdue
22
16%
Free
2
Developer 2
Rating
(53)
Projects
74
26%
Arbitration
30
10% / 63%
Overdue
22
30%
Free
3
Developer 3
Rating
(12)
Projects
17
29%
Arbitration
6
17% / 67%
Overdue
4
24%
Free
4
Developer 4
Rating
(258)
Projects
395
28%
Arbitration
69
19% / 49%
Overdue
120
30%
Free
5
Developer 5
Rating
(107)
Projects
149
36%
Arbitration
29
3% / 55%
Overdue
35
23%
Free
6
Developer 6
Rating
(97)
Projects
121
25%
Arbitration
5
20% / 60%
Overdue
17
14%
Free
7
Developer 7
Rating
(76)
Projects
136
45%
Arbitration
11
27% / 64%
Overdue
26
19%
Free
8
Developer 8
Rating
(89)
Projects
137
24%
Arbitration
35
9% / 40%
Overdue
52
38%
Free
Similar orders
Hello, I am looking for developer who develops me a renko trading robo with following requirement Time :1 sec Box assignment method : Percentage change LTP Source : Close/OHLC Auto Break-even setup option after certain box Trialling Profit Pips after certain box profit with auto Sl set in PIPs Auto open reverse trade after hitting Sl with given conditions . It is very simple trading tool
At bot 30+ USD
Help me to trade create orders for me and analyze the markets and decide when is a good time to buy or sell. Determine which pairs are best to use to trade with and indicate trading signals to me
I currently have a Forex trading script in .txt format that I want to be converted to a functional/working robot (in .mq4), without altering the strategy of the script. The strategy of the script is already in and shouldn't be changed unless with mutual understanding
Hi, Can you develop the Scalper EA based on Market indicator. EA should open the buy trade at the buy arrow and at every DOT. Close the buy trade with few Pips TP (profit after commission) and SL at opposite Sell arrow. EA should open the SELL trade at the sell arrow and at every DOT. Close the sell trade with few Pips TP (profit after commission) and SL at opposite Buy arrow. Provide the source code at the end
Hey greetings, It my pleasure to met you . I need a MT4 develop that can develop an EA based on alert . If you are a professional MT4 programmer you can kindly bid for this project and let proceed
Hello, I want an ( EXPERT ADVISER that can run automated) that will use CCI as the main entry and ATR as the exit. When the CCI is greater than the custom value of 0, you buy and when the CCI is less than the custom value -0, you sell. ATR Exit - profit of 1.0 and exit as .05 (Please, let it be modifiable) The time frame can be 15 or 5 minutes (variable) EMA 20 DAYS OR 480 (can be disabled) Spread should not be more
Hi, I would like to create an EA similar to this link: https://www.mql5.com/en/market/product/33508?source=External#description Drawdown 5% Scalping! Ability to avoid big price drop that can hurt capital! stable! bid and ask price different is 0.5
Qwuick Fix 85+ USD
I need a couple options added to an existing EA. I’m in need of an input option to modify pending orders, ensures live positions are correlated with pending orders, and provide an oversight that EA is running smoothly. I also need a calendar feature added to an existing input option for scheduling trades. This project is a side project to do on your own time with a 3-day window due date on Sunday – Monday by next
I am looking for an experienced expert to develop an Expert Advisor based on my idea. We can discuss the details in private messages. Please apply only if you are available now, as I need this project completed within one day
Mt4/mt5 30 - 100 USD
i need a remote trade copier over internet for mt4 and mt5, i need the open source, its ok also from stratch or if you have someone available please share some screen or other about it

Project information

Budget
10 - 50 USD
For the developer
9 - 45 USD
Deadline
from 1 to 3 day(s)