EA_Gold_MNAKOO

MQL4 Эксперты

Техническое задание

//+------------------------------------------------------------------+
//| 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;
}

Файлы:

Откликнулись

1
Разработчик 1
Оценка
(151)
Проекты
188
57%
Арбитраж
10
80% / 0%
Просрочено
0
Свободен
Опубликовал: 1 пример
2
Разработчик 2
Оценка
(240)
Проекты
301
28%
Арбитраж
33
24% / 61%
Просрочено
9
3%
Работает
3
Разработчик 3
Оценка
(33)
Проекты
38
21%
Арбитраж
5
0% / 60%
Просрочено
0
Свободен
4
Разработчик 4
Оценка
(321)
Проекты
499
19%
Арбитраж
33
42% / 30%
Просрочено
32
6%
Загружен
5
Разработчик 5
Оценка
(9)
Проекты
20
10%
Арбитраж
4
50% / 50%
Просрочено
5
25%
Свободен
6
Разработчик 6
Оценка
(428)
Проекты
622
54%
Арбитраж
29
55% / 24%
Просрочено
6
1%
Загружен
7
Разработчик 7
Оценка
(5)
Проекты
8
13%
Арбитраж
3
0% / 33%
Просрочено
2
25%
Свободен
Опубликовал: 1 пример
8
Разработчик 8
Оценка
(12)
Проекты
13
23%
Арбитраж
7
0% / 71%
Просрочено
3
23%
Работает
9
Разработчик 9
Оценка
(102)
Проекты
105
60%
Арбитраж
0
Просрочено
0
Свободен
10
Разработчик 10
Оценка
(3)
Проекты
6
17%
Арбитраж
0
Просрочено
3
50%
Свободен
11
Разработчик 11
Оценка
(4)
Проекты
2
0%
Арбитраж
5
0% / 80%
Просрочено
1
50%
Свободен
12
Разработчик 12
Оценка
(121)
Проекты
134
66%
Арбитраж
36
25% / 56%
Просрочено
22
16%
Свободен
Опубликовал: 10 примеров
13
Разработчик 13
Оценка
(462)
Проекты
483
75%
Арбитраж
5
80% / 0%
Просрочено
0
Работает
14
Разработчик 14
Оценка
(102)
Проекты
157
21%
Арбитраж
23
9% / 78%
Просрочено
16
10%
Работает
15
Разработчик 15
Оценка
(539)
Проекты
619
33%
Арбитраж
36
36% / 53%
Просрочено
11
2%
Загружен
16
Разработчик 16
Оценка
(2)
Проекты
1
0%
Арбитраж
1
0% / 100%
Просрочено
0
Свободен
17
Разработчик 17
Оценка
Проекты
0
0%
Арбитраж
0
Просрочено
0
Свободен
Опубликовал: 1 пример
18
Разработчик 18
Оценка
(59)
Проекты
81
43%
Арбитраж
27
11% / 70%
Просрочено
8
10%
Свободен
19
Разработчик 19
Оценка
Проекты
0
0%
Арбитраж
0
Просрочено
0
Работает
Похожие заказы
"I'm searching for a genuinely aggressive, high-risk / ultra-high-reward Expert Advisor (EA) optimized for MetaTrader 5 , capable of running on a very small real account of $100 (or cent/micro account equivalent). Key requirements: Strategy type : Preferably martingale , grid + martingale hybrid , aggressive scalping with recovery , or any other explosive growth-oriented approach (Bollinger/martingale, hedging grid
looking for EA using zone recovery strategy. would like to make small per cent daily with small drawdown. it is a martingale hedge system. Please make the entry based on your own judgement
Hi, is this signal enough for a bot to trade on attached images. its literally just a telegram channel I have access to, the trader avg's 10% weekly for the last 2 years, but I do not have the time to copy trade so wanted to find a solution, all he does is send TV screenshots of his entry/sl/tp and then sends updates as he manages the trade. I thought about hiring someone in a similar timezone to the trader (hes in
Modifiedea 30+ USD
Please my robot doesn’t open trades and I also believe it the ma crossover and others please I want the ma crossover to be fixed.also add trade directions to parameter for both, only sell, or only buys. Please also correct the balance drawdown and equity drawdown if it’s not working.the ea would be carefully tested for assessment l. Also source code will be handed before Payment. Only 30bucks for budget
I need an MT4/MT5 EA modification. Requirements: 1. Equity protection based on DAILY and TOTAL drawdown 2. Automatically close all trades when limit is hit 3. Disable trading after drawdown hit 4. Email notification when: - Daily loss limit reached - Total loss limit reached 5. EA must work on multiple accounts simultaneously 6. Clean and error-free code 7. Compatible with MT5 (or MT4 mention yours)
If you have profitable strategy or profitable EA on the gold pair without martingale / Hedge, then share me the EA with expiry time to back test and to test on the live market. Platform: MT5 pair: Gold Non-Martingale, No Hedging. Need Source Code
I have a working Python backtester for my “DC-WAD Donchian” strategy. I need a MetaTrader 5 Expert Advisor (MQL5) for live trading that matches the Python logic as closely as possible ( no lookahead ). ✅ Critical requirement (must accept) EA must be tick-driven for entries/exits (touch logic). Bar-close approximation is not acceptable . Timeframes Strategy runs on a single Setup Timeframe (HTF) (user input, e.g
This indicator will code into MT5 EA. Trade on live, demo and strategy tester. No repaint, no redraw and stable on chart. 1. Include all inputs variable and value, Lots size in points adjustable, TP in points true or false adjustable, SL in points true or false adjustable, close position on opposite signal true or false, Use pending order true or false, use BE points true or false, use slippage point true or false
Good day, I am searching the very high level expert, which could create the auto-trade robot and I would like to order the trading robot for GOLD XAU/USD auto-trade on MetaTrader. I could pay a lot for the institutional grade auto-trade robot, just contact me and let me know what level of the robot you could offer and we will negotiate the price
Looking to purchase a EA for Gold and US30 with source Requirements: must have proper built in Risk Management Must yield good profit factor and recovery Factor Must work on any Broker Must have less than 15% drawdown Year over Year Z-Score should be high Consecutive Profits Must Outweigh Consecutive losses atleast 3/1 Must be able to work on accounts from 100USD and up Testing must be based off of real Tick Values

Информация о проекте

Бюджет
100+ USD