Direction Control EA - Allow Buy Only/ Sell Only

MQL4 Uzmanlar

Şartname

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.


Yanıtlandı

1
Geliştirici 1
Derecelendirme
(279)
Projeler
350
29%
Arabuluculuk
37
27% / 65%
Süresi dolmuş
10
3%
Yüklendi
2
Geliştirici 2
Derecelendirme
(17)
Projeler
21
19%
Arabuluculuk
5
40% / 40%
Süresi dolmuş
0
Serbest
3
Geliştirici 3
Derecelendirme
(213)
Projeler
286
47%
Arabuluculuk
27
59% / 37%
Süresi dolmuş
36
13%
Serbest
4
Geliştirici 4
Derecelendirme
(435)
Projeler
641
53%
Arabuluculuk
34
62% / 21%
Süresi dolmuş
6
1%
Çalışıyor
5
Geliştirici 5
Derecelendirme
(13)
Projeler
20
40%
Arabuluculuk
1
0% / 100%
Süresi dolmuş
1
5%
Serbest
6
Geliştirici 6
Derecelendirme
(396)
Projeler
512
23%
Arabuluculuk
60
57% / 25%
Süresi dolmuş
60
12%
Yüklendi
7
Geliştirici 7
Derecelendirme
(195)
Projeler
242
34%
Arabuluculuk
11
45% / 45%
Süresi dolmuş
8
3%
Serbest
Yayınlandı: 1 makale, 8 kod
8
Geliştirici 8
Derecelendirme
(62)
Projeler
90
29%
Arabuluculuk
24
13% / 58%
Süresi dolmuş
7
8%
Çalışıyor
9
Geliştirici 9
Derecelendirme
Projeler
1
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
10
Geliştirici 10
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
11
Geliştirici 11
Derecelendirme
(18)
Projeler
22
18%
Arabuluculuk
8
38% / 38%
Süresi dolmuş
3
14%
Yüklendi
Yayınlandı: 1 kod
12
Geliştirici 12
Derecelendirme
(176)
Projeler
188
46%
Arabuluculuk
3
33% / 33%
Süresi dolmuş
1
1%
Yüklendi
13
Geliştirici 13
Derecelendirme
(45)
Projeler
53
57%
Arabuluculuk
2
100% / 0%
Süresi dolmuş
1
2%
Serbest
Yayınlandı: 5 kod
14
Geliştirici 14
Derecelendirme
(111)
Projeler
183
25%
Arabuluculuk
24
17% / 75%
Süresi dolmuş
16
9%
Serbest
15
Geliştirici 15
Derecelendirme
(25)
Projeler
31
13%
Arabuluculuk
13
0% / 77%
Süresi dolmuş
9
29%
Serbest
16
Geliştirici 16
Derecelendirme
(87)
Projeler
121
68%
Arabuluculuk
5
80% / 0%
Süresi dolmuş
12
10%
Çalışıyor
17
Geliştirici 17
Derecelendirme
(6)
Projeler
8
38%
Arabuluculuk
1
100% / 0%
Süresi dolmuş
2
25%
Serbest
Benzer siparişler
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

Proje bilgisi

Bütçe
30+ USD
Son teslim tarihi
from 1 to 2 gün