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

MQL4 Experts

Tâche terminée

Temps d'exécution 4 jours
Commentaires de l'employé
Happy to work with you Oscar, hope we can do it again next time.
Commentaires du client
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.

Spécifications

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. 

Répondu

1
Développeur 1
Évaluation
(121)
Projets
134
66%
Arbitrage
36
25% / 56%
En retard
22
16%
Gratuit
Publié : 10 codes
2
Développeur 2
Évaluation
(53)
Projets
74
26%
Arbitrage
30
10% / 63%
En retard
22
30%
Gratuit
3
Développeur 3
Évaluation
(12)
Projets
17
29%
Arbitrage
6
17% / 67%
En retard
4
24%
Gratuit
4
Développeur 4
Évaluation
(258)
Projets
396
28%
Arbitrage
70
19% / 49%
En retard
121
31%
Gratuit
5
Développeur 5
Évaluation
(107)
Projets
149
36%
Arbitrage
29
3% / 55%
En retard
35
23%
Gratuit
6
Développeur 6
Évaluation
(97)
Projets
121
25%
Arbitrage
5
20% / 60%
En retard
17
14%
Gratuit
7
Développeur 7
Évaluation
(76)
Projets
136
45%
Arbitrage
11
27% / 64%
En retard
26
19%
Gratuit
Publié : 5 codes
8
Développeur 8
Évaluation
(89)
Projets
137
24%
Arbitrage
35
9% / 40%
En retard
52
38%
Gratuit
Commandes similaires
BUDGET: 100-120 USD - FIXED - includes source code .mq5 + .ex5 I will test demo first on 100$ demo account. If good, I pay. WHAT I WANT: 1. SIGNAL STRENGTH LOGIC: - WEAK SIGNAL = 1 position only. - STRONG SIGNAL = 2,3,4,5 positions (more positions because signal is strong). - Signal strength calculated by indicators. 2. ADAPTIVE TO CAPITAL: - Lot auto = Balance / 100 * 0.01. Example 100$ = 0.01 lot, 300$ = 0.03 lot
Hello, I am an independent developer selling an Expert Advisor (EA) on the MQL5 Market. I am looking for an experienced Forex affiliate marketing company or professional marketer to promote my existing MT5 trading robot to customers worldwide. My proposed partnership offers a 30% commission per verified sale, with the possibility of a long-term collaboration. I would like to know: Do you promote third-party MT5
The bot should open trades when the price breaks out of the band by a specified percentage, for example, 0.10%. If the price breaks above the band, the bot should open a long position. If the price breaks below the band, it should open a short position. The bot should also open trades when the price touches a band: Bullish band cross: When a bullish cross occurs between the bands, the bot should open a long position
Project: MT5 Expert Advisor — Dual-Sided Hedging Grid with Fibonacci Lot Progression I need a custom Expert Advisor (EA) developed in MQL5 for MetaTrader 5. 1. Trading Strategy The EA must open both Buy and Sell market positions when a new trading cycle starts, provided the broker account supports hedging. The EA must manage the Buy and Sell directions independently. When the market moves downward against the Buy
I’m looking for an experienced MQL4/MQL5 developer with proven expertise in genuine high-frequency trading (HFT) or ultra-fast scalping Expert Advisors. Project requirements: Develop MT4 and MT5 versions with complete source code and no restrictive licensing. Implement fast execution, selective entries, and rapid trade exits. Support XAUUSD, EURUSD, GBPUSD, and BTCUSD. Include robust risk controls: stop-loss
Hello everyone, I am looking for an experienced MQL4/MQL5 developer with proven expertise in developing high-performance scalping or high-frequency trading (HFT) Expert Advisors. Project requirements: Develop a fast, robust automated trading EA for MetaTrader 4 and MetaTrader 5. Focus on ultra-short-term scalping, selective entries, and rapid trade execution and exits. Support XAUUSD, EURUSD, GBPUSD, and BTCUSD
Hello everyone, I am looking for an experienced MQL4/MQL5 developer with proven expertise in developing high-performance scalping or high-frequency trading (HFT) Expert Advisors. Project requirements: Develop a fast, robust automated trading EA for MetaTrader 4 and MetaTrader 5. Focus on ultra-short-term scalping, selective entries, and rapid trade execution and exits. Support XAUUSD, EURUSD, GBPUSD, and BTCUSD
Hello lovies, I’m reaching out because I’m working on a specialized macroeconomic intelligence service focused on major economic releases and their potential impact on gold (XAUUSD), the US dollar, and the wider financial markets. My approach goes beyond simply following the economic calendar. I focus on understanding the information behind upcoming events, market expectations, and the potential implications for
Se tiene 2 Meta Trader 5, metar trader5 A ( master) meta trader 5 B ( slave) En el A se esta ejectunado algunas operaciones, dodne suele abrir multiples levels de ordenes, de sell y buy simultaneamente. Se necesita un EA, colocados tanto en el Master para enviar al SLave la copia de los trades , pero unicamente se va activar la copia, cuando en el Metatrader Master, "A" lleguie a un N levels de buy o M levels de
MT5 Expert Advisor Development Brief — Forex Project objective I am looking for an experienced MQL5 developer to build a bespoke, fully automated Expert Advisor for MetaTrader 5. The EA will be used on both proprietary trading firm (prop-firm) accounts and my own live trading account. My priorities, in order, are: 1. Low drawdown and robust risk management. 2. Consistent, repeatable profitability. 3. Reliable

Informations sur le projet

Budget
10 - 50 USD
Délais
de 1 à 3 jour(s)