CAlgo cBot to MQL4 Professional Conversion with optimization and AI Trade Management for XAUUSD

MQL5 Converting

Job finished

Execution time 4 days

Specification

MQL4 EA Conversion Project – XAUUSD (Gold)

I am looking for a professional MQL4 developer to convert and optimize my existing cAlgo cBot into a fully functional MQL4 Expert Advisor, specifically optimized for XAUUSD (Gold).

This is not a generic EA. I have a portfolio of multiple iterations of the same cAlgo bot with small variations, so I need the MQL4 version written cleanly, modularly, and professionally, making it easy to maintain, extend, and compare logic between versions later.


Project Overview

The EA is a trend-aligned, indicator-confirmed HFT-style system with advanced risk control, multi-position scaling, and smart trade-closure logic. The original cAlgo version already includes a neural-network-based smart exit module, and I want this concept preserved and enhanced in the MQL4 conversion.

The target symbol is XAUUSD only, so gold-specific considerations (digits, pip size, tick value, spread behavior) must be handled correctly.


Core Trading Logic to Be Converted

The EA opens trades only on new candle formation, not on every tick.

BUY conditions (all must be true):

  • Close price above EMA1

  • EMA1 above EMA2

  • EMA2 above EMA3

  • RSI > 50

  • MACD main line above MACD signal line

SELL conditions (all must be true):

  • Close price below EMA1

  • EMA1 below EMA2

  • EMA2 below EMA3

  • RSI < 50

  • MACD main line below MACD signal line

Indicators used:

  • EMA1 / EMA2 / EMA3

  • RSI

  • MACD

All indicators must be implemented using native MQL4 functions ( iMA ,  iRSI ,  iMACD ) with correct buffering and shift handling.


Position Management & Scaling

  • The EA supports multiple open positions per direction.

  • Maximum limits are controlled by:

    • BuyMax

    • SellMax

  • Only trades opened by this EA (via Magic Number and symbol filtering) should be managed.


Money Management Requirements

The EA supports two lot-sizing modes:

  1. Fixed lot size

  2. Risk-based lot sizing

    • Based on  % risk per trade

    • Calculated from account balance and stop-loss distance

This must be implemented correctly for XAUUSD, accounting for:

  • Broker-specific contract sizes

  • Tick value and tick size

  • Lot step, min lot, and max lot restrictions

Gold brokers vary significantly, so I expect robust handling here.


Hard Risk Controls (Must Be Preserved)

  • Stop trading after X% drawdown from the starting balance

    • Starting balance is captured at EA initialization

    • If the drawdown threshold is reached, the EA must stop opening new trades

  • Hard loss cut per trade

    • If a trade exceeds the calculated risk amount in loss, it is closed immediately


Advanced Trade Closure Logic (Critical Section)

Each open trade is evaluated continuously using the following exit rules:

  1. EMA1 vs EMA2 touch or cross

    • If EMA1 touches or crosses EMA2, the trade is closed immediately

  2. Risk-based loss threshold

    • If loss exceeds the defined risk amount, the trade is closed

  3. AI-based smart closure (optional, toggleable)

    • Trades can be closed early based on AI confidence that the trade is no longer favorable

This logic is central to maintaining low drawdown and capital preservation.


AI / Neural Network Requirements (Important)

I want an AI-driven trade management layer added to the MQL4 EA.

Purpose:

  • Reduce drawdown

  • Exit bad trades early

  • Improve overall equity curve stability

Acceptable implementations:

  • Lightweight neural network coded directly in MQL4

  • Logistic regression / perceptron-style classifier for exit decisions

  • DLL-based AI solution (only if well-documented and stable)

The AI logic should evaluate:

  • Indicator state (EMA, RSI, MACD)

  • Trade performance (profit/loss behavior)

  • Market conditions (spread, volatility, recent price movement)


Smart Hedging Feature (Optional but Preferred)

I would like an optional smart hedging module that:

  • Activates only under defined adverse conditions

  • Uses strict risk limits

  • Avoids uncontrolled martingale behavior

  • Includes clear unwind rules once exposure normalizes

This is intended as a loss-recovery and drawdown-control mechanism, not a gambling strategy.


Development Expectations

  • Clean, readable, well-structured MQL4 code

  • Modular functions (entries, exits, lot sizing, AI logic, risk control)

  • Input parameters grouped logically

  • Proper Magic Number usage

  • Efficient execution suitable for fast-moving gold markets

  • No repainting, no tick-spamming entries


Additional Notes

  • I have multiple versions of this strategy with small variations. The EA must be designed so logic can be swapped or adjusted easily without rewriting the entire codebase.

  • This is a serious project for a professional developer. I am not looking for a quick copy-paste job.

If you have experience with gold (XAUUSD) EAs, advanced trade management, or AI-assisted trading logic, please apply and include examples of similar work.

I am happy to answer technical questions before awarding the job.


Responded

1
Developer 1
Rating
(102)
Projects
158
21%
Arbitration
23
9% / 78%
Overdue
16
10%
Working
2
Developer 2
Rating
(428)
Projects
622
54%
Arbitration
29
55% / 24%
Overdue
6
1%
Loaded
3
Developer 3
Rating
(17)
Projects
21
10%
Arbitration
4
50% / 50%
Overdue
1
5%
Working
4
Developer 4
Rating
(8)
Projects
11
0%
Arbitration
6
33% / 67%
Overdue
2
18%
Free

Project information

Budget
100+ USD
Deadline
from 1 to 5 day(s)