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

MQL4 エキスパート

仕事が完了した

実行時間4 日
開発者からのフィードバック
Happy to work with you Oscar, hope we can do it again next time.
依頼者からのフィードバック
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.

指定

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%
暇
パブリッシュした人: 10 codes
2
開発者 2
評価
(53)
プロジェクト
74
26%
仲裁
30
10% / 63%
期限切れ
22
30%
暇
3
開発者 3
評価
(12)
プロジェクト
17
29%
仲裁
6
17% / 67%
期限切れ
4
24%
暇
4
開発者 4
評価
(258)
プロジェクト
396
28%
仲裁
70
19% / 49%
期限切れ
121
31%
暇
5
開発者 5
評価
(107)
プロジェクト
149
36%
仲裁
29
3% / 55%
期限切れ
35
23%
暇
6
開発者 6
評価
(97)
プロジェクト
121
25%
仲裁
5
20% / 60%
期限切れ
17
14%
暇
7
開発者 7
評価
(76)
プロジェクト
136
45%
仲裁
11
27% / 64%
期限切れ
26
19%
暇
パブリッシュした人: 5 codes
8
開発者 8
評価
(89)
プロジェクト
137
24%
仲裁
35
9% / 40%
期限切れ
52
38%
暇
類似した注文
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
I want to create an EA that will take trades according to a trading zone condition. The logic will start with the identification of a trading zone for BUY and SELL in the EA. After the trading zone has been identified, then the EA will use the current time frame prices to determine if the market will be a BUY or SELL. The market will be a BUY if the low price range goes above the lowest price after the installation
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

プロジェクト情報

予算
10 - 50 USD
締め切り
最低 1 最高 3 日