EA_Gold_MNAKOO

MQL4 Experten

Spezifikation

//+------------------------------------------------------------------+
//| XAUUSD Automated Forex Robot                                     |
//| Enhanced Version with Error Handling and Improvements           |
//+------------------------------------------------------------------+
input int FastMA = 10;                 // Fast moving average period
input int SlowMA = 50;                 // Slow moving average period
input int RSI_Period = 14;             // RSI period
input double Overbought = 70;          // RSI overbought level
input double Oversold = 30;            // RSI oversold level
input double RiskPercent = 1.0;        // Risk per trade as a percentage of account equity
input double ATRMultiplier = 2.0;      // ATR multiplier for stop-loss
input double TrailingStop = 300;       // Trailing stop in points
input double MinLotSize = 0.01;        // Minimum lot size
input double LotStep = 0.01;           // Lot size increment
input int ATR_Period = 14;             // ATR period
input int MaxSlippage = 3;             // Maximum slippage in points
input int MAGIC_NUMBER = 123456;       // Unique identifier for trades
input string TradeComment = "XAUUSD Bot"; // Trade comment

//+------------------------------------------------------------------+
//| OnTick Function - Main Logic                                     |
//+------------------------------------------------------------------+
void OnTick() {
    // Calculate indicators
    static double fastMA, slowMA, rsi, atr;
    fastMA = iMA(NULL, 0, FastMA, 0, MODE_EMA, PRICE_CLOSE, 0);
    slowMA = iMA(NULL, 0, SlowMA, 0, MODE_EMA, PRICE_CLOSE, 0);
    rsi = iRSI(NULL, 0, RSI_Period, PRICE_CLOSE, 0);
    atr = iATR(NULL, 0, ATR_Period, 0);

    // Check for existing trades
    bool buyOpen = IsTradeOpen(OP_BUY);
    bool sellOpen = IsTradeOpen(OP_SELL);

    // Entry logic
    if (fastMA > slowMA && rsi > Oversold && rsi < 50 && !buyOpen) {
        // Buy Signal
        double sl = Bid - ATRMultiplier * atr;
        double tp = Bid + ATRMultiplier * atr * 2;
        double lotSize = CalculateLotSize(sl);
        OpenTrade(OP_BUY, lotSize, sl, tp);
    }

    if (fastMA < slowMA && rsi < Overbought && rsi > 50 && !sellOpen) {
        // Sell Signal
        double sl = Ask + ATRMultiplier * atr;
        double tp = Ask - ATRMultiplier * atr * 2;
        double lotSize = CalculateLotSize(sl);
        OpenTrade(OP_SELL, lotSize, sl, tp);
    }

    // Exit logic (Close trades when conditions reverse)
    if (buyOpen && (fastMA < slowMA || rsi >= Overbought)) {
        CloseTrade(OP_BUY);
    }

    if (sellOpen && (fastMA > slowMA || rsi <= Oversold)) {
        CloseTrade(OP_SELL);
    }

    // Manage Trailing Stop
    ManageTrailingStop();
}

//+------------------------------------------------------------------+
//| Calculate Lot Size Based on Risk                                 |
//+------------------------------------------------------------------+
double CalculateLotSize(double stopLossPrice) {
    double accountEquity = AccountEquity();
    double riskAmount = (RiskPercent / 100) * accountEquity;
    double stopLossDistance = MathAbs(Bid - stopLossPrice);
    double lotSize = riskAmount / (stopLossDistance * MarketInfo(Symbol(), MODE_TICKVALUE));

    // Adjust lot size to broker limits
    lotSize = MathMax(lotSize, MinLotSize);
    lotSize = NormalizeDouble(MathFloor(lotSize / LotStep) * LotStep, 2);
    return lotSize;
}

//+------------------------------------------------------------------+
//| Open Trade Function                                              |
//+------------------------------------------------------------------+
void OpenTrade(int tradeType, double lotSize, double stopLoss, double takeProfit) {
    double price = tradeType == OP_BUY ? Ask : Bid;
    int ticket = OrderSend(Symbol(), tradeType, lotSize, price, MaxSlippage, stopLoss, takeProfit, TradeComment, MAGIC_NUMBER, 0, Blue);
    if (ticket < 0) {
        int errorCode = GetLastError();
        Print("Error opening trade: ", errorCode, ". Retrying...");
        Sleep(1000); // Retry after 1 second
        ticket = OrderSend(Symbol(), tradeType, lotSize, price, MaxSlippage, stopLoss, takeProfit, TradeComment, MAGIC_NUMBER, 0, Blue);
        if (ticket < 0) {
            Print("Failed to open trade after retry. Error: ", GetLastError());
        }
    } else {
        Print("Trade opened: ", ticket);
    }
}

//+------------------------------------------------------------------+
//| Close Trade Function                                             |
//+------------------------------------------------------------------+
void CloseTrade(int tradeType) {
    for (int i = OrdersTotal() - 1; i >= 0; i--) {
        if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) {
            if (OrderSymbol() == Symbol() && OrderType() == tradeType && OrderMagicNumber() == MAGIC_NUMBER) {
                int ticket = OrderClose(OrderTicket(), OrderLots(), tradeType == OP_BUY ? Bid : Ask, MaxSlippage, Red);
                if (ticket < 0) {
                    Print("Error closing trade: ", GetLastError());
                } else {
                    Print("Trade closed: ", ticket);
                }
            }
        }
    }
}

//+------------------------------------------------------------------+
//| Manage Trailing Stop Function                                    |
//+------------------------------------------------------------------+
void ManageTrailingStop() {
    for (int i = OrdersTotal() - 1; i >= 0; i--) {
        if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) {
            if (OrderSymbol() == Symbol() && OrderMagicNumber() == MAGIC_NUMBER) {
                double newStopLoss;
                if (OrderType() == OP_BUY) {
                    newStopLoss = Bid - TrailingStop * Point;
                    if (newStopLoss > OrderStopLoss()) {
                        OrderModify(OrderTicket(), OrderOpenPrice(), newStopLoss, OrderTakeProfit(), 0, Blue);
                    }
                } else if (OrderType() == OP_SELL) {
                    newStopLoss = Ask + TrailingStop * Point;
                    if (newStopLoss < OrderStopLoss()) {
                        OrderModify(OrderTicket(), OrderOpenPrice(), newStopLoss, OrderTakeProfit(), 0, Blue);
                    }
                }
            }
        }
    }
}

//+------------------------------------------------------------------+
//| Check if Trade Exists                                            |
//+------------------------------------------------------------------+
bool IsTradeOpen(int tradeType) {
    for (int i = OrdersTotal() - 1; i >= 0; i--) {
        if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) {
            if (OrderSymbol() == Symbol() && OrderType() == tradeType && OrderMagicNumber() == MAGIC_NUMBER) {
                return true;
            }
        }
    }
    return false;
}

Dateien:

Bewerbungen

1
Entwickler 1
Bewertung
(154)
Projekte
192
58%
Schlichtung
10
80% / 0%
Frist nicht eingehalten
0
Arbeitet
Veröffentlicht: 1 Beispiel
2
Entwickler 2
Bewertung
(249)
Projekte
312
28%
Schlichtung
33
27% / 64%
Frist nicht eingehalten
10
3%
Arbeitet
3
Entwickler 3
Bewertung
(33)
Projekte
38
21%
Schlichtung
5
0% / 60%
Frist nicht eingehalten
0
Frei
4
Entwickler 4
Bewertung
(325)
Projekte
505
19%
Schlichtung
32
44% / 31%
Frist nicht eingehalten
34
7%
Beschäftigt
5
Entwickler 5
Bewertung
(9)
Projekte
20
10%
Schlichtung
4
50% / 50%
Frist nicht eingehalten
5
25%
Frei
6
Entwickler 6
Bewertung
(429)
Projekte
628
54%
Schlichtung
30
53% / 23%
Frist nicht eingehalten
6
1%
Beschäftigt
7
Entwickler 7
Bewertung
(5)
Projekte
8
13%
Schlichtung
3
0% / 33%
Frist nicht eingehalten
2
25%
Frei
Veröffentlicht: 1 Beispiel
8
Entwickler 8
Bewertung
(12)
Projekte
13
23%
Schlichtung
7
0% / 71%
Frist nicht eingehalten
3
23%
Arbeitet
9
Entwickler 9
Bewertung
(102)
Projekte
105
60%
Schlichtung
0
Frist nicht eingehalten
0
Frei
10
Entwickler 10
Bewertung
(3)
Projekte
6
17%
Schlichtung
0
Frist nicht eingehalten
3
50%
Frei
11
Entwickler 11
Bewertung
(4)
Projekte
2
0%
Schlichtung
5
0% / 80%
Frist nicht eingehalten
1
50%
Frei
12
Entwickler 12
Bewertung
(121)
Projekte
134
66%
Schlichtung
36
25% / 56%
Frist nicht eingehalten
22
16%
Frei
Veröffentlicht: 10 Beispiele
13
Entwickler 13
Bewertung
(467)
Projekte
486
75%
Schlichtung
6
67% / 17%
Frist nicht eingehalten
0
Arbeitet
14
Entwickler 14
Bewertung
(103)
Projekte
165
24%
Schlichtung
23
9% / 78%
Frist nicht eingehalten
16
10%
Arbeitet
15
Entwickler 15
Bewertung
(548)
Projekte
632
33%
Schlichtung
39
38% / 49%
Frist nicht eingehalten
11
2%
Beschäftigt
16
Entwickler 16
Bewertung
(2)
Projekte
1
0%
Schlichtung
1
0% / 100%
Frist nicht eingehalten
0
Frei
17
Entwickler 17
Bewertung
Projekte
0
0%
Schlichtung
0
Frist nicht eingehalten
0
Frei
Veröffentlicht: 1 Beispiel
18
Entwickler 18
Bewertung
(59)
Projekte
81
43%
Schlichtung
27
11% / 70%
Frist nicht eingehalten
8
10%
Frei
19
Entwickler 19
Bewertung
Projekte
0
0%
Schlichtung
0
Frist nicht eingehalten
0
Arbeitet
Ähnliche Aufträge
Here is an example of Requirements Specification for the development of the MACD Sample Expert Advisor, which is available in the MetaTrader 5 standard package. 1. The idea of the trading system is as follows : market entries are performed when MACD's main and signal lines intersect in the current trend direction . 2. Trend is determined based on the Exponential Moving Average with the specified period
Here is an example of Requirements Specification for the development of the MACD Sample Expert Advisor, which is available in the MetaTrader 5 standard package. 1. The idea of the trading system is as follows: market entries are performed when MACD's main and signal lines intersect in the current trend direction. 2. Trend is determined based on the Exponential Moving Average with the specified period
I am looking for a pre-built MetaTrader 5 (MT5) Expert Advisor (EA) that can fully automate trading on major currency pairs such as EURUSD, AUDUSD, EURCAD, and USDCAD. Requirements: Fully automated trading (no manual intervention required) Compatible with MT5 platform Designed for consistent, long-term performance Demonstrated average monthly return of at least 3% Verified backtest and/or live trading results showing
Project Title Freedom ORB – Fully Automated MT5 Expert Advisor (ORB + Structure + Liquidity) (MT5) Project Description I require a fully automated MT5 Expert Advisor based on a structured Opening Range Breakout (ORB) model with market structure and liquidity confirmation. The EA must: Detect ORB session range Wait for breakout (close-based) Wait for retrace Confirm M1 structure + displacement Execute trade
Hello, I am a serious buyer looking to acquire an existing, stable, and profitable Expert Advisor (EA) designed specifically for: 👉 primarily (XAUUSD) or any fx This is a full buyout request, ⚠️ I am NOT looking to build a new EA from scratch. Only ready-made, proven systems with real performance history. ✅ EA Requirements (Strict) 📌 Symbol & Strategy ✔️ Trades Gold only (XAUUSD) ✔️ Price Action logic preferred
I’m looking for a trading bot where I can use a balance of £1000 to make regular entries making £20-£40 per entry. obviously, I want to have minimum loss with a lot more profit being made
I want an mt5 advisor which use advanced strategies like Accumulation, manipulate, distribution plus ABC pattern Recognition , Smart filters, Rsi + Ema crossovers, Hidden SL, partialTPs and dynamic lot sizing , works on Forex and crypto fully automated no expiry
Gold robot for 1 minute 100 - 150 USD
I need a EA as per the attached video. I need the same type of EA, once it is ready share the video of any demo account. if everything is ok I will purchase immediately. thank you
I’m hiring an experienced MQL5 developer to finish and fix an existing project (NOT building from scratch). I have: An existing MT5 EA (.mq5 + .ex5) that is based on my TradingView logic A TradingView indicator version used for signals/alerts The EA works but has logic/consistency issues and needs improvements + cleanup Goal Make the EA reliable and consistent: Ensure entries/exits match the intended logic Fix
It is better to spend thirty minutes to prepare a good text than to lose hours and days to resolve misunderstanding after concluding the Agreement or when accepting the order execution results

Projektdetails

Budget
100+ USD