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

MQL4 Esperti

Lavoro terminato

Tempo di esecuzione 4 giorni
Feedback del cliente
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 del dipendente
Happy to work with you Oscar, hope we can do it again next time.

Specifiche

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. 

Con risposta

1
Sviluppatore 1
Valutazioni
(121)
Progetti
134
66%
Arbitraggio
36
25% / 56%
In ritardo
22
16%
Gratuito
2
Sviluppatore 2
Valutazioni
(53)
Progetti
74
26%
Arbitraggio
30
10% / 63%
In ritardo
22
30%
Gratuito
3
Sviluppatore 3
Valutazioni
(12)
Progetti
17
29%
Arbitraggio
6
17% / 67%
In ritardo
4
24%
Gratuito
4
Sviluppatore 4
Valutazioni
(258)
Progetti
395
28%
Arbitraggio
69
19% / 49%
In ritardo
120
30%
Gratuito
5
Sviluppatore 5
Valutazioni
(107)
Progetti
149
36%
Arbitraggio
29
3% / 55%
In ritardo
35
23%
Gratuito
6
Sviluppatore 6
Valutazioni
(97)
Progetti
121
25%
Arbitraggio
5
20% / 60%
In ritardo
17
14%
Gratuito
7
Sviluppatore 7
Valutazioni
(76)
Progetti
134
44%
Arbitraggio
11
27% / 64%
In ritardo
26
19%
Gratuito
8
Sviluppatore 8
Valutazioni
(89)
Progetti
137
24%
Arbitraggio
35
9% / 40%
In ritardo
52
38%
Gratuito
Ordini simili
本人现有一个网格EA,内有马丁加仓平仓,需要升级,加入对冲功能和其他功能.(其他细节后谈) 1 . 網格繫統:可選:YES/NO. 如果:YES,設置:網格間隔,網格層數, 2 . 開倉:條件開倉,可選:YES/NO.(目前默認爲NO) 分爲市價開倉/STOP ORDER/ LIMIT ORDER, 3 . 加倉:分爲:固定手數,如:0 . 03,或末單累加:0 . 01,或:末單倍數如:1 . 5倍.多單和空單的加倉方法可以不同設置. 4 . 移動止盈.(單獨移動,多/空方整體點數移動/或金額移動) 5 . 平倉包括: A.多方/空方止盈線,和多方/空方止損線(可以設置三條價格:每條選擇:平倉 1/3,1/2,或全部) B.單獨止盈/止損 (多方和空方可以設置不同的,)盈利點數或金額 整體止盈/止損.(多方和空方可以設置不同的,)
An Expert Advisor based on LEVERAGING needed. I need an EA that can buy or sell when i need it to. Keep opening an infite positions every seconds or ticks once the margin is positive and the lotsize should be based on the inital lotsize
HFT needed 100+ USD
Need hft ea which working properly as well as demo accounts and live accounts with good daily returns as well as monthly returns need experinced programers to show thier most profible ea programers with more than 100 projects done will be shortlisted . And developer should provide its demo version for test before going to further steps
Hey, I trust my messages finds you well, I am in need of an expert seasoned forex trader that also skilled in programming MT4 EA, please read below I have some trading ideas in mind, this is why I mentioned that I need a forex trader who can help me have an expert look to those ideas I will be sharing in comment section then advised on the needed suitable ideas in addition to what I have alreadly have,I mean I need
Trading Gold , tap in & join the ride of the trading platform and watch us grow as the days go on , we're looking forward to have you on board the journey
EA debug 30+ USD
I have an EA bot CODE intend to be use on the MT5 platform, and all I need is a debug expert with full knowledge of what they are doing. The Skillset i need from you as a debugger are: 1. Trading Robot/Robot Debugging 2. Strategy Optimization 3. News Filter I will send you the codes and hope to have the debugged codes in less than 24 hours after we have discussed and come to an agreement
i am currently in need of someone who can be able to help me out.i want my custom indicator to be non repainting and i also want the custom indicator to be able to send out all types of alerts...thank you
Hello expert developer I'm here to write to expert developer that I need to fix my indicator repainting and I need the expert developer that can solve the repainting issue immediately and the project is just fixing the repainting only nothing else ... It shouldn't be more than the time I'm looking for it to be done thanks
hi - indicator is attached >>> turn it into ea - indicator is in a ex4 not mql4 - rules are simple up understand and will be shared - money mangment rules will be shared - other inputs such spread , tp , sl , breakeven , trailing should be included ================ devopler requirments : - have reviews - have experiance with support and resistance - have good money managment concepts - will offer support and ready
I want to create an EA using the RSI Indicator Only for both MT4 and MT5 platforms. The parameters are A. General Settings (i) Comment (ii) Trade Magic (iii) ECN Mode (True/False) (iv) Max Trades (v) Stealth Mode (True/False) (vi) TP (vii) SL (viii) Start Time (ix) Stop Time B. Money Management Settings (i) Money Management (True/False) (ii) Lot (I should be able to specify lt sizes from 0.01 to maximum allowed by

Informazioni sul progetto

Budget
10 - 50 USD
Per lo sviluppatore
9 - 45 USD
Scadenze
da 1 a 3 giorno(i)