Direction Control EA - Allow Buy Only/ Sell Only

MQL4 EA

명시

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.


응답함

1
개발자 1
등급
(277)
프로젝트
350
29%
중재
37
27% / 65%
기한 초과
10
3%
로드됨
2
개발자 2
등급
(17)
프로젝트
21
19%
중재
5
40% / 40%
기한 초과
0
무료
3
개발자 3
등급
(213)
프로젝트
286
47%
중재
27
59% / 37%
기한 초과
36
13%
무료
4
개발자 4
등급
(434)
프로젝트
640
53%
중재
34
62% / 21%
기한 초과
6
1%
로드됨
5
개발자 5
등급
(13)
프로젝트
20
40%
중재
1
0% / 100%
기한 초과
1
5%
무료
6
개발자 6
등급
(396)
프로젝트
512
23%
중재
60
57% / 25%
기한 초과
60
12%
로드됨
7
개발자 7
등급
(195)
프로젝트
242
34%
중재
11
45% / 45%
기한 초과
8
3%
무료
게재됨: 1 기고글, 8 코드
8
개발자 8
등급
(62)
프로젝트
90
29%
중재
24
13% / 58%
기한 초과
7
8%
작업중
9
개발자 9
등급
프로젝트
1
0%
중재
0
기한 초과
0
무료
10
개발자 10
등급
프로젝트
0
0%
중재
0
기한 초과
0
무료
11
개발자 11
등급
(18)
프로젝트
22
18%
중재
8
38% / 38%
기한 초과
3
14%
로드됨
게재됨: 1 코드
12
개발자 12
등급
(175)
프로젝트
187
47%
중재
3
33% / 33%
기한 초과
1
1%
로드됨
13
개발자 13
등급
(45)
프로젝트
53
57%
중재
2
100% / 0%
기한 초과
1
2%
무료
게재됨: 5 코드
14
개발자 14
등급
(111)
프로젝트
183
25%
중재
24
17% / 75%
기한 초과
16
9%
무료
15
개발자 15
등급
(25)
프로젝트
31
13%
중재
13
0% / 77%
기한 초과
9
29%
무료
16
개발자 16
등급
(87)
프로젝트
121
68%
중재
5
80% / 0%
기한 초과
12
10%
작업중
17
개발자 17
등급
(6)
프로젝트
8
38%
중재
1
100% / 0%
기한 초과
2
25%
무료
비슷한 주문
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
I need a pine script coder to automate my strategy (based on trendline) on tradingview platform. I simply need tradingview to open a position when the price touches the specified trendline with options to buy or sell and SL level. Please let me know if you are interested and I can give you exact details. Thank you
Hello, I saw an indicator on TradingView and would like to know if you will be able to convert it for use on Thinkorswim platform? Thanks. if anyone can help me with it kindly do well to bid it urgent thanks looking forward too see you
I am looking for an experienced MQL5 developer to create a fully automated Expert Advisor for MetaTrader 5. The EA should be a fast “Flipper”-style trading system that detects short-term market movements and opens Long or Short positions accordingly. This must be an original development and not a copy, clone, or decompiled version of any existing commercial EA. I have some videos of the Trading style lets watch and
Looking to Purchase a High-Risk, High-Return Gold Trading EA 9 minutes ago MQL5 Experts Specification EN I’m looking to purchase an existing MT5 Gold / XAUUSD trading EA. I’m open to any trading strategy as long as the system is designed for higher returns. It can be scalping, grid, martingale, recovery, breakout, trend-following, hedging, or any other approach. I fully understand that high-risk, high-return
I’m looking to purchase an existing MT5 Gold / XAUUSD trading EA . I’m open to any trading strategy as long as the system is designed for higher returns. It can be scalping, grid, martingale, recovery, breakout, trend-following, hedging, or any other approach. I fully understand that high-risk, high-return strategies can experience very large drawdowns and may potentially blow the account . I’m aware of the risks
MT5 EA DEVELOPMENT SPECIFICATION CHANNEL + RSI REVERSAL STRATEGY I need a professional MetaTrader 5 Expert Advisor based on the following exact strategy. 1. Core Strategy The EA must automatically identify a valid price channel using confirmed swing highs and swing lows. The strategy trades reversals from the channel extremes: SELL: Upper channel + RSI above 70 + bearish rejection. BUY: Lower channel + RSI below 40 +

프로젝트 정보

예산
30+ USD
기한
에서 1  2 일