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%
類似した注文
CAPSTONE EA 50+ USD
CAPSTONE EA We are in need of an experienced programmer that could help us create Forex Expert Advisor. SPECIFIC REQUIREMENT: Draw two horizontal line at the high and low of the 6th and 7th candle from the day session line using the one hour chat. ENTRY CONDITION ONE: The EA should wait for the break of the upper or lower horizontal line by 2 pips. i. BUY ENTRY: If the break of the horizontal line
The following items need to be included in the EA a) Include MA filter: Buy trades can only happen if the candles are closing above the MA and Sell trades can only happen if the candles are closing below it (filter can be turned on/off in the settings) b) Fix Orders without TP: Currently the EA (while live trading only) sometimes fails to include/modify the take profit value in the current orders, the error is not a
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
Am lebza fede from ivory park lusaka i work at BSG, Got my on music, am a Producer & a Dj, if i get a job i wanna cover up all my Debts. I Have so many things in life were i need money but its hard to find one, Everytime i hustle things go side ways
Edge Stacking Bias EA 30 - 150 USD
I want to build an EA that give me bias Longs only OR Shorts Only, and recommends Buy or Sell If conditions are met. I want to have the right and the original code for the EA. Conditions: Longs Only 1) 1 hour chat EMA 50 above EMA200, AND Price above 200 EMA (Must meet this criteria ) 2) Previous 4H candle closed Bullish? (Must meet this criteria ) 3) Calculate the Average Daily range, have price
MT4 EA to be backtested using Dukascopy data. 1. 10 currency pairs to be tested and optimized. 2. Period Time frame - H1 . Test with $10,000 account. 3. Test to be run in 10 years Dukascopy historic data 4. Parameter optimisation in 2 phases . Initially larger range and later detailed small range Parameters to be optimized same for all pairs Parameter / Start / Step /Stop Grid Size / 15 / 10 / 75 (7
Hi , i want to create and indicator and a robot that work with rsi with a period of 10 to 14 with moving average implemented in the rsi indicator with data of first indixator crossover that give buy signal one rsi is above and sell once rsi is under moving average and open trade once the crossover is happned and close trade till the next crossover for another opening trade which works with all timeframes
Hi guys, I want an automated trading robot for mt4 with below features: 1-The transaction takes place automatically at a certain time and in both buying and selling directions 2- The trader can give the exact trading time in a week (15-20 times a day) 3- The trader can choose the symbol (this expert can work only on one symbol, without the need to trade in several symbols at the same time) 4- The trader can specify
Hello I'm looking for a profitable scalping EA for MT5 w/low DD No martingales No hedging No grid NOTICE!!!! READ ME PLEASE BEFORE MESSAGING EA must be profitable from year 2000 to 2024 present date Please show me your sample demo EA for back test and Please stop negotiating if you know that your Demo EA will not surpass the 24 years back test If you cannot present sample for the Demo EA please stop messaging me for
I am interested in purchasing a highly profitable Expert Advisor (Open Source EA in MQL4 / MQL5) with a focus on achieving a high Profit Factor and Recovery Factor while maintaining a low Drawdown. I require an EA that not only performs well in backtesting but also has a verifiable track record of success in live trading. Key Criteria: Profitability Metrics: The EA should demonstrate a high Profit Factor and

プロジェクト情報

予算
10 - 50 USD
開発者用
9 - 45 USD
締め切り
最低 1 最高 3 日