MT5 Safety EA: Close Oldest Losing Trade On Low Margin Level (Pepperstone, 30:1, Fixed Grid)

MQL5 전문가

작업 종료됨

실행 시간 4 시간
고객의 피드백
Superb service. Andrey delivered a flawless system in half a day — no revisions needed. Fast, professional, and highly skilled. He’s now my go-to MQL5 developer. Strongly recommended.
피고용인의 피드백
Thanks for the project. Looking forward to the next one!

명시

I need a simple but reliable safety EA for MetaTrader 5 (MQL5) to protect my account from margin calls while running multiple Dark Gold EAs on Pepperstone UK.

My setup

– Broker: Pepperstone UK
– Platform: MT5
– Stop-out: 50%
– Leverage: 30:1
– Strategy: Several Dark Gold EAs (around 6 charts). Each uses a fixed grid with no martingale, for example: 0.01, 0.01, 0.01 … up to about 15 positions. All grid positions are equal lot size.

Goal of the EA

I want a separate safety EA that I attach to ONE chart only. It does not open trades. It only:

– Monitors account margin level
– When margin level gets too low (for example 80%), it closes exactly ONE trade: the oldest losing trade
– Waits a configurable cooldown time
– Repeats if needed, until margin improves or there are no more trades

Reasoning

Because I use a fixed grid with equal lot size, the oldest trades are usually the ones furthest away from the current price and doing the most damage to the basket’s average entry and take profit. Closing the oldest losing trade removes the “tail” of the grid and pulls the basket TP closer to current price, so a smaller retrace can clean up the rest.

Functional requirements

  1. Attachment and scope
    – EA runs on exactly one chart (any symbol).
    – It monitors all open positions on the whole account, not just the chart symbol.
    – It must be compatible with running multiple Dark Gold EAs in parallel.

  2. Margin level trigger
    – On every tick, the EA reads ACCOUNT_MARGIN_LEVEL (percentage).
    – Input: MarginLevelThreshold (double, default 80.0).
    – If margin level > threshold: do nothing.
    – If margin level <= threshold: trigger the close logic.

  3. Trade selection logic
    – EA scans all open positions.
    – Optional filter by Magic Number:
    – Input: MagicFilter (long, default -1).
    – If MagicFilter = -1: manage all trades.
    – If MagicFilter = some value: manage only trades with that magic.
    – Optional filter “only losing trades”:
    – Input: OnlyCloseLosing (bool, default true).
    – If true: only trades with POSITION_PROFIT < 0 are considered.
    – From the remaining eligible trades, select the oldest by POSITION_TIME.
    – Close exactly that one position.

  4. Closing and cooldown
    – After closing one position successfully, the EA must wait a minimum cooldown time before closing another, even if margin is still low.
    – Input: CooldownSeconds (int, default 5).
    – The idea is a “slow bleed” of risk, not an instant flush of the whole account.

  5. Notifications
    – Input: SendPushNotifications (bool, default true).
    – If enabled, when the EA closes a position it should send SendNotification() with: ticket, symbol, volume, and margin level at the moment of closing.
    – Also log this clearly in the Experts tab.

  6. Safety conditions
    – The EA must not open trades.
    – It must not modify SL/TP of existing trades.
    – It must only close trades as per the margin logic above.
    – It must not freeze or block the terminal (no heavy loops).

Inputs (must be configurable in EA parameters)

– MarginLevelThreshold (double, default 80.0)
– OnlyCloseLosing (bool, default true)
– CooldownSeconds (int, default 5)
– MagicFilter (long, default -1)
– SendPushNotifications (bool, default true)
– Optional: BrokerStopOutLevel (double, default 50.0) just for logging / information

Example behaviour

– Margin level at 300%: EA does nothing.
– Margin level falls to 82%: still above 80%, EA does nothing.
– Margin level drops to 80% or below:
– EA scans eligible trades (respecting MagicFilter and OnlyCloseLosing).
– Picks the oldest losing trade by POSITION_TIME.
– Closes this single trade.
– Logs it and optionally sends a push notification.
– Starts a cooldown (for example 5 seconds).
– After the cooldown, if margin is still <= threshold, it repeats and closes the next oldest losing trade.
– This continues until margin recovers above threshold or there are no more eligible positions.

Deliverables

– MQL5 source code (.mq5) with clear comments.
– Compiles and runs cleanly on latest MT5 build.
– Brief explanation in comments or text where:
– Margin level is checked
– Oldest losing trade is selected
– Cooldown is managed
– MagicFilter is applied


응답함

1
개발자 1
등급
(18)
프로젝트
22
9%
중재
6
33% / 50%
기한 초과
1
5%
로드됨
2
개발자 2
등급
(104)
프로젝트
168
24%
중재
23
9% / 78%
기한 초과
16
10%
작업중
3
개발자 3
등급
(328)
프로젝트
510
19%
중재
33
45% / 30%
기한 초과
34
7%
로드됨
4
개발자 4
등급
(60)
프로젝트
87
29%
중재
24
13% / 58%
기한 초과
7
8%
작업중
5
개발자 5
등급
(16)
프로젝트
35
23%
중재
4
0% / 50%
기한 초과
2
6%
작업중
6
개발자 6
등급
(2)
프로젝트
3
0%
중재
0
기한 초과
0
무료
7
개발자 7
등급
(1)
프로젝트
2
0%
중재
1
0% / 100%
기한 초과
1
50%
무료
8
개발자 8
등급
(144)
프로젝트
186
41%
중재
24
58% / 21%
기한 초과
13
7%
무료
9
개발자 9
등급
(509)
프로젝트
977
74%
중재
27
19% / 67%
기한 초과
101
10%
무료
게재됨: 1 기고글, 6 코드
10
개발자 10
등급
프로젝트
0
0%
중재
0
기한 초과
0
무료
11
개발자 11
등급
(4)
프로젝트
6
17%
중재
2
0% / 100%
기한 초과
3
50%
무료
12
개발자 12
등급
프로젝트
0
0%
중재
0
기한 초과
0
무료
13
개발자 13
등급
(271)
프로젝트
553
50%
중재
57
40% / 37%
기한 초과
227
41%
작업중
14
개발자 14
등급
(311)
프로젝트
557
35%
중재
79
32% / 43%
기한 초과
202
36%
작업중
15
개발자 15
등급
(10)
프로젝트
15
27%
중재
0
기한 초과
3
20%
무료
16
개발자 16
등급
프로젝트
0
0%
중재
0
기한 초과
0
무료
17
개발자 17
등급
(10)
프로젝트
19
42%
중재
6
0% / 50%
기한 초과
3
16%
작업중
18
개발자 18
등급
(16)
프로젝트
20
0%
중재
10
0% / 80%
기한 초과
6
30%
무료
19
개발자 19
등급
(24)
프로젝트
30
13%
중재
12
0% / 75%
기한 초과
8
27%
무료
20
개발자 20
등급
프로젝트
0
0%
중재
0
기한 초과
0
무료
21
개발자 21
등급
프로젝트
2
0%
중재
4
25% / 50%
기한 초과
1
50%
무료
22
개발자 22
등급
(627)
프로젝트
989
47%
중재
33
36% / 36%
기한 초과
98
10%
작업중
게재됨: 6 코드
23
개발자 23
등급
(266)
프로젝트
598
35%
중재
64
20% / 58%
기한 초과
147
25%
무료
게재됨: 1 기고글, 22 코드
24
개발자 24
등급
(162)
프로젝트
287
34%
중재
18
22% / 61%
기한 초과
42
15%
작업중
25
개발자 25
등급
(3)
프로젝트
1
100%
중재
3
0% / 100%
기한 초과
0
무료
26
개발자 26
등급
(40)
프로젝트
47
28%
중재
14
21% / 64%
기한 초과
1
2%
바쁜
27
개발자 27
등급
(255)
프로젝트
262
30%
중재
0
기한 초과
3
1%
무료
게재됨: 2 코드
28
개발자 28
등급
(6)
프로젝트
5
0%
중재
2
50% / 50%
기한 초과
2
40%
무료
29
개발자 29
등급
(12)
프로젝트
16
13%
중재
4
50% / 25%
기한 초과
4
25%
로드됨
30
개발자 30
등급
프로젝트
0
0%
중재
0
기한 초과
0
무료
비슷한 주문
Nyasco 90+ USD
Fast trading bot for starters less losses which leads to bigger profits made for thousands of people making billions of dollars .be the best trader for your self all the way
Nyasco 30+ USD
Faster robot with less losses which can be used for a long term earning money every day creating a bot for more than thousands of people to earn billions of money
Max amount grid 30+ USD
max amount grid step for magic number do keep deleting .only when it is in negative floating .but when it is profit allow to go over the max and replays to grid step
Apply with a screen of your work . Symbol Specific Logic . Live Chart Optimization Check the Core logic . [back tests as well] Change points to pips . Create buffer for the zone
I will pay 3000+ USD (negotiable) for an EA for existing MT5 that generates a minimum of 15-20% or higher a month consistently (provide source code after final deal) Looking for a highly profitable EA Please send demo version directly subject (Buying profitable EA Budget up to $ 3000 USD), past results and optimal settings so I can test, if it performs in a strategy tester i will also need option to forward test it
EA fx 30+ USD
Hello, I need an already developed EA similar to the one trading XAUUSD, with consistent entries and good risk management. Before we proceed, I would like to verify its performance. Please provide a live or demo account login along with the investor (read-only) password so I can monitor the trading results. I am looking for stable performance, controlled drawdown, and consistent profit on gold (XAUUSD). Once I
The strategy records the highest and lowest prices within a specified duration (default 15 minutes) after the New York market opens, forming the opening range. Post-Formation Breakout: When the price breaks above or below the opening range after its formation, it may indicate the direction of the day’s price movement. Trend Confirmation: The strategy uses two EMAs (default 20-period and 50-period) as trend filters to
Tengo una estrategia basada en divergencia para el oro sobre todo en tf m1 Basado en divergencia con stoch .. confirmando la entrada con ciertos parameteos de entrada Es mejor conversarlo para dar mejor los detalles Cuando entrar, porque o todas las divergencias se debe tomar para entrar en compras o ventas He adjuntado un ejemplo La confrmacion más exacta es el cruce de esos parámetros de stoch edebajo de level de
BUY ALERT 1. Supertrend turns Bullish 2. On this candle , or during the last time Supertrend was Bearish, price was < or = MA1 3. On this candle , or during the last time Supertrend was Bearish , BBStops is Bearish 4. STEP MA1 and STEP MA 2 are both Bullish SELL ALERT 1. Supertrend turns Bearish 2. On this candle , or during the last time Supertrend was Bullish, price was

프로젝트 정보

예산
50 - 120 USD