MT5 Expert Advisor (EA) Developer for Automated XAU/USD (Gold) Trading Bot

Termos de Referência


//+------------------------------------------------------------------+
//| XAU_Pro_Scalper.mq5 |
//| Advanced Gold Trading Bot (Educational) |
//+------------------------------------------------------------------+
#property version "1.00"
#property strict

#include <Trade/Trade.mqh>
CTrade trade;

input double RiskPercent = 1.0;
input int StopLossPoints = 250;
input int TakeProfitPoints = 700;

input int FastEMA = 20;
input int SlowEMA = 50;

input int LondonStart = 7;
input int LondonEnd = 10;
input int NYStart = 13;
input int NYEnd = 16;

input int BreakEvenPoints = 200;
input int TrailingStopPoints = 150;

//------------------------------------------------------------
// Check trading session
//------------------------------------------------------------
bool IsKillZone()
{
   MqlDateTime t;
   TimeToStruct(TimeCurrent(),t);

   if((t.hour >= LondonStart && t.hour <= LondonEnd) ||
      (t.hour >= NYStart && t.hour <= NYEnd))
      return true;

   return false;
}

//------------------------------------------------------------
// Trend Bias
//------------------------------------------------------------
bool BullishBias()
{
   double fast = iMA(_Symbol,_Period,FastEMA,0,MODE_EMA,PRICE_CLOSE,0);
   double slow = iMA(_Symbol,_Period,SlowEMA,0,MODE_EMA,PRICE_CLOSE,0);

   return fast > slow;
}

bool BearishBias()
{
   double fast = iMA(_Symbol,_Period,FastEMA,0,MODE_EMA,PRICE_CLOSE,0);
   double slow = iMA(_Symbol,_Period,SlowEMA,0,MODE_EMA,PRICE_CLOSE,0);

   return fast < slow;
}

//------------------------------------------------------------
// Simple Fair Value Gap
//------------------------------------------------------------
bool BullishFVG()
{
   double high2 = iHigh(_Symbol,_Period,2);
   double low0 = iLow(_Symbol,_Period,0);

   if(low0 > high2)
      return true;

   return false;
}

bool BearishFVG()
{
   double low2 = iLow(_Symbol,_Period,2);
   double high0 = iHigh(_Symbol,_Period,0);

   if(high0 < low2)
      return true;

   return false;
}

//------------------------------------------------------------
// Risk based lot size
//------------------------------------------------------------
double LotSize()
{
   double balance = AccountInfoDouble(ACCOUNT_BALANCE);
   double risk = balance * RiskPercent / 100.0;

   double tickvalue = SymbolInfoDouble(_Symbol,SYMBOL_TRADE_TICK_VALUE);

   double lot = risk / (StopLossPoints * tickvalue);

   double minlot = SymbolInfoDouble(_Symbol,SYMBOL_VOLUME_MIN);
   double maxlot = SymbolInfoDouble(_Symbol,SYMBOL_VOLUME_MAX);

   if(lot < minlot) lot = minlot;
   if(lot > maxlot) lot = maxlot;

   return NormalizeDouble(lot,2);
}

//------------------------------------------------------------
// Manage open trades (breakeven + trailing)
//------------------------------------------------------------
void ManagePositions()
{
   for(int i=0;i<PositionsTotal();i++)
   {
      if(PositionGetSymbol(i)!=_Symbol) continue;

      ulong ticket = PositionGetTicket(i);
      double open = PositionGetDouble(POSITION_PRICE_OPEN);
      double sl = PositionGetDouble(POSITION_SL);
      double tp = PositionGetDouble(POSITION_TP);
      long type = PositionGetInteger(POSITION_TYPE);

      double price = SymbolInfoDouble(_Symbol,SYMBOL_BID);

      if(type == POSITION_TYPE_BUY)
      {
         double profit = price - open;

         if(profit > BreakEvenPoints*_Point && sl < open)
            trade.PositionModify(ticket,open,tp);

         if(profit > TrailingStopPoints*_Point)
         {
            double newSL = price - TrailingStopPoints*_Point;
            if(newSL > sl)
               trade.PositionModify(ticket,newSL,tp);
         }
      }

      if(type == POSITION_TYPE_SELL)
      {
         price = SymbolInfoDouble(_Symbol,SYMBOL_ASK);
         double profit = open - price;

         if(profit > BreakEvenPoints*_Point && (sl > open || sl==0))
            trade.PositionModify(ticket,open,tp);

         if(profit > TrailingStopPoints*_Point)
         {
            double newSL = price + TrailingStopPoints*_Point;
            if(newSL < sl || sl==0)
               trade.PositionModify(ticket,newSL,tp);
         }
      }
   }
}

//------------------------------------------------------------
// Check open positions
//------------------------------------------------------------
bool HasTrade()
{
   for(int i=0;i<PositionsTotal();i++)
   {
      if(PositionGetSymbol(i)==_Symbol)
         return true;
   }
   return false;
}

//------------------------------------------------------------
// Main
//------------------------------------------------------------
void OnTick()
{
   ManagePositions();

   if(!IsKillZone()) return;
   if(HasTrade()) return;

   double lot = LotSize();

   double ask = SymbolInfoDouble(_Symbol,SYMBOL_ASK);
   double bid = SymbolInfoDouble(_Symbol,SYMBOL_BID);

   if(BullishBias() && BullishFVG())
   {
      double sl = ask - StopLossPoints * _Point;
      double tp = ask + TakeProfitPoints * _Point;

      trade.Buy(lot,_Symbol,ask,sl,tp,"Gold Buy");
   }

   if(BearishBias() && BearishFVG())
   {
      double sl = bid + StopLossPoints * _Point;
      double tp = bid - TakeProfitPoints * _Point;

      trade.Sell(lot,_Symbol,bid,sl,tp,"Gold Sell");
   }
}

Respondido

1
Desenvolvedor 1
Classificação
(72)
Projetos
147
67%
Arbitragem
21
10% / 71%
Expirado
44
30%
Livre
2
Desenvolvedor 2
Classificação
(18)
Projetos
22
9%
Arbitragem
6
33% / 50%
Expirado
1
5%
Trabalhando
3
Desenvolvedor 3
Classificação
(33)
Projetos
38
21%
Arbitragem
5
0% / 60%
Expirado
0
Livre
4
Desenvolvedor 4
Classificação
(16)
Projetos
17
29%
Arbitragem
1
0% / 0%
Expirado
2
12%
Trabalhando
5
Desenvolvedor 5
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
6
Desenvolvedor 6
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
7
Desenvolvedor 7
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
8
Desenvolvedor 8
Classificação
(4)
Projetos
5
0%
Arbitragem
1
0% / 100%
Expirado
1
20%
Livre
9
Desenvolvedor 9
Classificação
Projetos
0
0%
Arbitragem
1
0% / 100%
Expirado
0
Trabalhando
10
Desenvolvedor 10
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
Pedidos semelhantes
Looking for an experienced MQL5 developer to optimise and backtest my Expert Advisor (EA). The full requirements and EA file will be shared once accepted. You should have solid experience with strategy testing in MetaTrader 5 and be comfortable working with custom EAs. If this sounds like something you can help with, feel free to reach out and we can get started Developers with no reviews and no projects will be
hello, please take a moment to review my project. It is for Quanttower. it is very detailed in the instructions. Thank you, Just let me know if you can do it and the whats the cost and timeframe
Key Requirements: Source Account: Connect to a Master account using Investor (Read-only) Password. Destination Account: Execute trades on a Live Slave account with full trading access. Currency Focus: The system must handle Currency Pairs accurately, including symbol mapping (e.g., EURUSD to EURUSD.m) between different brokers. Stealth Features: Remove/Disable all trade comments. Assign custom Magic Numbers to the
I need a developer to start robot from scratch based on existing EA that is running live. I do not have the source file as my previous coder did not give it to me. What I do have is the investor password which is running the EA from the coder side but not from my end. I like someone to monitor the account and re create the same system for me
Project Overview: I am looking for a highly experienced MetaTrader 4 (MQL4) developer to build a sophisticated automated trading system. This is not a standard grid bot; it requires complex trade management, dynamic exposure rebalancing, and a custom "Salami" liquidation module for partial loss mitigation . Key Features to Implement: Virtual Grid & Dynamic Trend: Price-action-based grid triggers without pending
We are looking for a professional developer or trader who already has a proven profitable EA or strategy based mainly on price action logic. Important requirements: No Martingale No Grid No Micro-scalping Avoid heavy indicator-based strategies Strategy should be based mainly on price behavior / market structure We are not looking for aggressive systems that promise unrealistic returns. Our focus is on stable
I run an ea it makes good profits bit that one bad grid blows up the account. I want an EA which runs parallel to it which can intelligently close bad trades or grids. It shouldn't close recoverable trades but close very bad entries and grids. It can even close with hedging. The goal recover max and also not blow up the account
I am looking for an expert MQL5 developer to build a high-precision Hedging System between two different MT5 brokers running on the same local PC. Core Objective: Execute opposite (inverse) trades between a Master and Slave account (e.g., Master BUY = Slave SELL, Master SELL = Slave BUY). The Challenge: Standard "Trade Copiers" are insufficient as they cannot prevent single-legged exposure when using manual trading
I want robot that can help me trade and make some money so that I can be able to learn from it while I'm still in depot account now.Is how it gonna help me with some money
Hello, I have two requests: First: Feature Modification Request Currently, the EA places only one pending order at a time. I want to modify this to place two opposite pending orders (Buy Stop and Sell Stop) simultaneously, with the distance between them aligned with the existing Breakeven and Trailing Stop settings in the bot. How it should work: The EA places a Buy Stop above current price and a Sell Stop

Informações sobre o projeto

Orçamento
30 USD
Prazo
de 7 para 30 dias

Cliente

Pedidos postados1
Número de arbitragens0