Direction Control EA - Allow Buy Only/ Sell Only

MQL4 Experts

Termos de Referência

MT4 Direction Control EA — Developer Specification

1. Purpose

Create an MT4 Expert Advisor that allows the trader to control the permitted trade direction on the chart using three on-chart buttons:

  1. BUY ONLY
  2. SELL ONLY
  3. ALLOW ALL

The EA does not generate trades itself. Its primary function is to control and enforce the allowed trade direction.


2. Chart / Symbol Behaviour

When the EA is attached to a chart:

  • It applies to the currency pair/symbol of that chart.
  • Example:

    • EA attached to EURUSD → controls EURUSD.
    • EA attached to GBPUSD → controls GBPUSD.
  • The trader can change the permitted direction by clicking the buttons.


3. Buttons

Display three buttons on the chart:

BUY ONLY

When selected:

  • BUY trades are permitted.
  • SELL trades are NOT permitted.
  • Any existing SELL trade for that symbol should be closed immediately.
  • If a new SELL trade is opened manually or by another EA, the Direction Control EA must detect it and close it immediately.

SELL ONLY

When selected:

  • SELL trades are permitted.
  • BUY trades are NOT permitted.
  • Any existing BUY trade for that symbol should be closed immediately.
  • If a new BUY trade is opened manually or by another EA, the Direction Control EA must detect it and close it immediately.

ALLOW ALL

When selected:

  • Both BUY and SELL trades are permitted.
  • The EA does not close either direction.


4. Immediate Opposite-Trade Protection

The EA must continuously monitor open trades for the chart symbol.

If the current mode is:

BUY ONLY
→ Any SELL position detected must be closed immediately.

SELL ONLY
→ Any BUY position detected must be closed immediately.

The monitoring must be as fast as practically possible within MT4 limitations.

The EA should check on:

  • Every incoming tick
  • Trade/order-state changes where possible
  • EA initialisation
  • Button mode changes

The developer should optimise the code to minimise the delay between detecting an unauthorised trade and sending the close request.


5. Existing Trades When Button Is Changed

If the trader changes from:

ALLOW ALL → BUY ONLY

→ Immediately close all existing SELL trades for that symbol.

If changing:

ALLOW ALL → SELL ONLY

→ Immediately close all existing BUY trades for that symbol.

If changing:

BUY ONLY → SELL ONLY

→ Immediately close all BUY trades.

If changing:

SELL ONLY → BUY ONLY

→ Immediately close all SELL trades.


6. New Trade Protection

The EA must also protect against trades opened after the direction has been selected.

Example:

BUY ONLY is selected.

Another EA opens a SELL trade on EURUSD.

The Direction Control EA detects the SELL trade and immediately attempts to close it.

This must work for:

  • Manually opened trades
  • Trades opened by another EA
  • Market orders


7. Symbol Scope

Default behaviour:

Only control trades belonging to the chart symbol.

Example:

EA attached to EURUSD:

  • Controls EURUSD trades.
  • Does NOT control GBPUSD trades.
  • Does NOT control XAUUSD trades.


8. Magic Number Behaviour

The EA should have an input option:

Control Manual Trades = true/false

Control Other EA Trades = true/false

Recommended default:

  • Manual trades: TRUE
  • Other EA trades: TRUE

The developer should provide filtering options if required by the MT4 implementation.


9. Initial Mode

Input parameter:

InitialMode

Options:

  • BUY_ONLY
  • SELL_ONLY
  • ALLOW_ALL

Recommended default:

ALLOW_ALL

The EA should remember the currently selected mode while it remains attached to the chart.


10. Button Appearance

The currently active mode should be visually obvious.

Example:

BUY ONLY → highlighted/active

SELL ONLY → highlighted/active

ALLOW ALL → highlighted/active

The inactive buttons should remain visible but clearly indicate they are not selected.

Button position should be configurable.


11. EA Inputs

Suggested developer inputs:

  • InitialMode
  • ControlManualTrades
  • ControlOtherEAs
  • ControlCurrentSymbolOnly = true
  • CheckOnEveryTick = true
  • CloseRetryAttempts
  • RetryDelayMilliseconds
  • ButtonCorner
  • ButtonX
  • ButtonY
  • ButtonWidth
  • ButtonHeight
  • ButtonFontSize


12. Important Requirement

The EA must NOT open trades.

It only:

  1. Allows the selected direction.
  2. Blocks/cleans up the opposite direction.
  3. Continuously monitors the symbol.
  4. Immediately closes unauthorised opposite trades.

The EA should be lightweight and designed for extremely fast execution.


Respondido

1
Desenvolvedor 1
Classificação
(279)
Projetos
350
29%
Arbitragem
37
27% / 65%
Expirado
10
3%
Carregado
2
Desenvolvedor 2
Classificação
(17)
Projetos
21
19%
Arbitragem
5
40% / 40%
Expirado
0
Livre
3
Desenvolvedor 3
Classificação
(213)
Projetos
286
47%
Arbitragem
27
59% / 37%
Expirado
36
13%
Livre
4
Desenvolvedor 4
Classificação
(435)
Projetos
641
53%
Arbitragem
34
62% / 21%
Expirado
6
1%
Trabalhando
5
Desenvolvedor 5
Classificação
(13)
Projetos
20
40%
Arbitragem
1
0% / 100%
Expirado
1
5%
Livre
6
Desenvolvedor 6
Classificação
(396)
Projetos
512
23%
Arbitragem
60
57% / 25%
Expirado
60
12%
Carregado
7
Desenvolvedor 7
Classificação
(195)
Projetos
242
34%
Arbitragem
11
45% / 45%
Expirado
8
3%
Livre
Publicou: 1 artigo, 8 códigos
8
Desenvolvedor 8
Classificação
(62)
Projetos
90
29%
Arbitragem
24
13% / 58%
Expirado
7
8%
Trabalhando
9
Desenvolvedor 9
Classificação
Projetos
1
0%
Arbitragem
0
Expirado
0
Livre
10
Desenvolvedor 10
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
11
Desenvolvedor 11
Classificação
(18)
Projetos
22
18%
Arbitragem
8
38% / 38%
Expirado
3
14%
Carregado
Publicou: 1 código
12
Desenvolvedor 12
Classificação
(176)
Projetos
188
46%
Arbitragem
3
33% / 33%
Expirado
1
1%
Carregado
13
Desenvolvedor 13
Classificação
(45)
Projetos
53
57%
Arbitragem
2
100% / 0%
Expirado
1
2%
Livre
Publicou: 5 códigos
14
Desenvolvedor 14
Classificação
(111)
Projetos
183
25%
Arbitragem
24
17% / 75%
Expirado
16
9%
Livre
15
Desenvolvedor 15
Classificação
(25)
Projetos
31
13%
Arbitragem
13
0% / 77%
Expirado
9
29%
Livre
16
Desenvolvedor 16
Classificação
(87)
Projetos
121
68%
Arbitragem
5
80% / 0%
Expirado
12
10%
Trabalhando
17
Desenvolvedor 17
Classificação
(6)
Projetos
8
38%
Arbitragem
1
100% / 0%
Expirado
2
25%
Livre
Pedidos semelhantes
I need a robust optimization of my MT5 EA, mainly for XAUUSD (Gold). Please optimize the existing adjustable parameters such as entry/exit settings, SL/TP, trailing/break-even settings, and any other strategy parameters that are appropriate. I want the optimization focused on stable profitability, low/moderate drawdown, and robustness rather than simply the highest possible profit. Please use out-of-sample testing
I need an MT5 EA based on my strategy: MN1/W1/D1 trend analysis, H4/H1 confirmation, EMA 10/23, Fibonacci 12.7 BUY & 88.6/88.7 SELL entries, market structure/candlestick confirmation, automatic SL/TP, risk-based lot sizing, break-even, trailing stop, news filter, and prop-firm risk management. The EA should support scalping, intraday and swing trading, with future AI integration
Composite robot 30 - 200 USD
Title: Multi-Timeframe Pure Price Action & Elliott Wave Execution Bot for XAUUSD 1. Project Overview I need a robust, automated trading bot (Expert Advisor) for MetaTrader 5 (MT5) to trade XAUUSD (Gold) exclusively. The strategy is built entirely on Top-Down Multi-Timeframe (MTF) market structure, pure price action, and Elliott Wave principles. It does not use traditional lagging technical indicators (like RSI or
Build a fully mechanical EA for XAUUSD on D1 timeframe. Trader spends 5-10 mins per day to run it. No discretion. EA calculates, places orders, and walks away. Timeframe Use the Daily (D1) timeframe . At the close of each completed daily candle, identify: Previous day's High (wick) Previous day's Low (wick) Previous day's Open
The Candle Range Theory (CRT) 3-Candle Strategy is a price action method derived from Smart Money Concepts (SMC). It is based on the "Power of 3" logic (Accumulation, Manipulation, Distribution), essentially compressing an entire market cycle into a sequence of three specific candles. This strategy relies on the idea that the first candle sets a range , the second candle manipulates price to trap traders (liquidity
I will pay 10k (negotiable) for an EA for existing MT5 that generates a minimum of 5% or higher a month consistently Please send demo version with optimal settings so I can test, if it performs in a strategy tester i will also need option to forward test it in a demo account. Developer should be willing to demonstrate how efficient the robot is, Once you send me the demo, I will test the EA on a real-time account
NinjaTrader 8 / NinjaScript Phase 1 build: convert an existing Auction Market Theory (AMT) strategy into objective, alert-only decision-support logic. Not a bot, no auto-execution — trades stay manual. Covers NQ/MNQ, ES, CL, MGC using 30-min TPO/Volume Profile context with 5-min confirmation: one 5-min close outside VAH/VAL = acceptance, close back inside = rejection. Dashboard shows bias, auction state, location
Hi i need help to connect my chat gtp with ninja trader I have all tools. Just need supervision and seeking a professional who can do that for me. This the bridge extension https://crosstrade.io/blog/chatgpt-to-ninjatrader-mcp-walkthrough
i need some one to optimize my ea so its lite on cpu and take less resorce.will give you the code if you are interested i need exprinced devloper and there should be no no change be made on how it looks and how it works
Hello, I need a custom NON-REPAINT MT5 indicator that gives sell/buy arrow signals 1–2 candlesticks before a spike on Crash and boom indices respectively occurs. Requirements: Works perfectly on MT5 Shows arrows before the spike (1–2 candles earlier). Non-repaint – once the arrow appears, it must stay. Should be accurate, not quantity — only quality signals. Must work on both demo and live accounts. I want the

Informações sobre o projeto

Orçamento
30+ USD
Prazo
de 1 para 2 dias