Need a Hedging bots that would close all related orders when the sum of all open orders and hedge reaches the stated take profit

Specification

I need a bot that would buy or sell, then open a hedge if the trade is losing  

Create a hedging Expert Advisor (EA) in MQL5 for MetaTrader 5, which persistently opens counteracting trades based on the outlined logic, with features that manage the initiation and oversight of these trades, adhering to the defined multipliers for position sizes. The EA will terminate all trades once it achieves a collective take profit target.

Design of the Hedging EA:

1. Initialization: Establish initial settings, the base lot size, profit targets, trade type and the multiplier for escalating trades.

  • Two different sort of inputs for multipliers: first multiplier and subsequent multiplier
  • The hedging trades would be pending orders added one by one, created as soon as the previous one is traded,. so we only need to have one pending order at a time

2. Opening Initial Trades: Execute an opening buy or sell order according to the strategy's guidelines.

3. Hedging Logic: - If the first trade is a buy, then the initial hedge will be a sell. following hedges will switch directions (sell after buy, buy after sell), with the lot size of each new hedge doubling that of the one before.

  • If the first trade reaches tp, close and start all over again in the direction of the win
  • If the first trade reaches hedge distance, trigger a new trade in the opposite direction with the first multplier

4. Monitoring for Take Profit: - Constantly track the aggregate of all open trades. - Liquidate all positions when the total profit meets the pre-set take profit threshold.

5. Out of Margin option (Enable/Disable): Average all profitable vs losing trades and close them. - restart hedge on the remaining losing trade as per step 2

6. Need a trade panel for to show all the positions and balances.


Input

  • Lots size
  • Overall take Profit (Amount)
  • Trade type: Buy/Sell
  • Magic Number
  • Hedge Distance (Amount)
  • First Trade Multipliers
  • Subsequent Multipliers
  • <:Display Panel Settings:>

Kindest Regards



Files:

PNG
hedging.png
122.0 Kb

Responded

1
Developer 1
Rating
(20)
Projects
24
8%
Arbitration
6
17% / 17%
Overdue
3
13%
Loaded
2
Developer 2
Rating
(174)
Projects
232
45%
Arbitration
17
82% / 12%
Overdue
35
15%
Loaded
3
Developer 3
Rating
(191)
Projects
195
27%
Arbitration
0
Overdue
3
2%
Free
4
Developer 4
Rating
(561)
Projects
929
48%
Arbitration
301
59% / 25%
Overdue
123
13%
Loaded
5
Developer 5
Rating
(230)
Projects
410
34%
Arbitration
53
36% / 40%
Overdue
150
37%
Busy
6
Developer 6
Rating
(32)
Projects
53
36%
Arbitration
4
25% / 50%
Overdue
6
11%
Busy
7
Developer 7
Rating
(48)
Projects
54
30%
Arbitration
2
0% / 0%
Overdue
0
Working
8
Developer 8
Rating
(36)
Projects
44
32%
Arbitration
6
17% / 33%
Overdue
8
18%
Free
9
Developer 9
Rating
(6)
Projects
7
43%
Arbitration
1
0% / 0%
Overdue
2
29%
Busy
10
Developer 10
Rating
(41)
Projects
87
13%
Arbitration
29
31% / 48%
Overdue
35
40%
Busy
11
Developer 11
Rating
(320)
Projects
340
71%
Arbitration
4
100% / 0%
Overdue
1
0%
Loaded
Similar orders
Develop ctrader 30+ USD
Hi mate, i would like to make Tensorflow.NET dlls (including Keras.NET, NumSharp etc ) from https://scisharp.github.io/SciSharp compatible with cTrader, so i can develop algos inside cTrader. Can you help? Cheers
I am looking an Mt4 EA which can place multiple sell stops and buy stops with given distance (Pips) and lot size. EA should place multiple entries with same lot size or variable upto the given values
Statistical Trading EA 30 - 1000 USD
Hi guys First of all I switch to german (number 1 requirement): Ich und ein Freund haben eine Trading Strategie entwickelt, die auf statistischen Daten aus den letzten 10 Jahren basiert. Wir haben total 3 Trading Setups, die unabhängig voneinander tradebar sind. Wir suchen nach einem erfahrenen Python Entwickler, der uns die Strategie umsetzt. Was wir von einem Entwickler benötigen: Viele Jahre Python Erfahrung
Сетка ордеров. Всего на валютную пару предусмотрено будет 300(сменное значение) ордеров с разным шагом в пунктах между ними. 1. 0-100 ордеров с шагом в 1 пункт 2. 100-150 ордеров с шагом в 3 пункта 3. 150-200 ордеров с шагом в 5 пункта 4. 200-250 ордеров с шагом в 7 пункта 5. 250-300 ордеров с шагом в 10 пункта см.рис.6 Тейк профит на каждую сделку установить в 100 п.(Сменное значение) Все выше значения могут
Hello traders and developers, I'm a software developer myself I have been learning mql5 and creating ea's with various strategies since last month but most of them are unprofitable and some of them are inconsistent in giving profits, what I'm looking for right now is as follows, A profitable scalping ea which should take trades based on M5 or M1 timeframe since i like scalping in Minute timeframe i only want scalping
الروبوت المرفق يعمل صفقات بيع وشراء بطريقة ثابته عكس اتجاه الترند بحيث يقوم بعمل صفقات بيع في الاتجاه الصاعد وصفقات شراء في الاتجاه الهابط ويتم اغلاق الصفقات بعد جني ارباح اخر صفقتين والمطلوب من المبرمج تغيير المسافة بين المعتمده بين الصفقات بحيث يتم فتح صفقة بنفس حجم اللوتات في البوت المرفق كل عشر نقاط واغلاق جميع الصفقات اذا عكس الترند 25 نقطه واريد هذا البوت ان يعمل بنفس الاستراتيجية على الذهب والعملات
I want an EA that always trades. Can buy only, sell only, or buy and sell at the same time depending on my selection. It has 5 levels of grid settings. Each grid just contiues onto the next. Not a new grid each time, the settings to continue gridding changes. I have attached an excel file with examples which should be quite self explanatory. INPUTS Initial (first trade) input double StartLot = 0.1; // Starting
MT5 EA 40+ USD
Hi i am searching for who can makes me Mt5 Robot I Need Only These Features In Robot And Add These Features In Inputs: 1: Analysis Method = RSI + ICHIMOKU + Candle 2: Takeprofit in Points 3: SL in Points and also trailingstep trailing step to secure my running trades profits 4: MaxTrades 5: Fixed Lotsize Message me for Ea parameters and for more information i want to add and also want to modify my current Mt5 Ea
Hello, I have two indicators that i would lke to turn into EA on mt5 . I have the Mq5 file for one and the ex5 for the other . I would like to merge the two of them into one EA . I would like to have the possibilities to keep the exact options of the mq5 file indicator that i will give you . And for the ex5 file , i would the EA to take an entry with the possibilities to choose the lots size , the Sl and the TP
Hello I am looking for a developer to help me Backtest my tradingview strategy in tradingview platform and make it work perfectly without errors please kindly reach out to so we can proceed

Project information

Budget
50+ USD
VAT (21%): 10.5 USD
Total: 60.5 USD
For the developer
45 USD
Deadline
from 2 to 4 day(s)