Make it work -Expert advisor

MQL5 전문가

명시

//+------------------------------------------------------------------+
//| EMA + Resistance Break & First Retest EA - ATR SL/TP - Risk 3%   |
//| Fully working MT4 EA                                             |
//+------------------------------------------------------------------+
#property strict

//---- Inputs
input double RiskPercent = 3.0;
input int ATR_Period = 14;
input double SL_ATR_Multiplier = 1.5;
input double TP_ATR_Multiplier = 2.0;
input int StopLossPipsFallback = 50;  // Fallback if ATR fails
input int TakeProfitPipsFallback = 100;
input int H4_MA_Period = 9;
input int FastEMA = 5;
input int SlowEMA = 13;
input int ResistanceLookback = 50;      // H4 candles to scan for resistance
input int ResistanceBufferPips = 10;    // Entry buffer around resistance
input string ResistanceLineName = "H4_Resistance";
input bool DrawSLTP = true;

//---- Session Settings (Broker Time)
input int LondonStartHour = 8;
input int LondonEndHour   = 17;
input int NYStartHour     = 13;
input int NYEndHour       = 22;

//---- Other Settings
input int MagicNumber = 12345;
input bool EnableSell = true;

//---- Globals
datetime lastCandleTime = 0;
int lastTradeSession = -1;   // 0=London, 1=NY
int lastTradeDay = -1;
bool firstRetestDone = false;

//+------------------------------------------------------------------+
//| Get current session                                              |
//+------------------------------------------------------------------+
int GetCurrentSession()
{
   int hour = TimeHour(TimeCurrent());
   if(hour >= LondonStartHour && hour < LondonEndHour) return 0; // London
   if(hour >= NYStartHour && hour < NYEndHour) return 1; // NY
   return -1; // No session
}

//+------------------------------------------------------------------+
//| Check if trading allowed in this session                          |
//+------------------------------------------------------------------+
bool CanTradeSession()
{
   int session = GetCurrentSession();
   if(session == -1) return false;

   int day = TimeDay(TimeCurrent());

   // Reset first retest on new session
   if(session != lastTradeSession || day != lastTradeDay)
   {
      firstRetestDone = false;
   }

   // Allow trade if first retest not done yet
   if(firstRetestDone) return false;

   return true;
}

//+------------------------------------------------------------------+
//| Get lot size based on risk                                        |
//+------------------------------------------------------------------+
double GetLotSize(double stopLossPips)
{
   double riskAmount = AccountBalance() * RiskPercent / 100.0;
   double pipValue = MarketInfo(Symbol(), MODE_TICKVALUE);

   double lot = riskAmount / (stopLossPips * pipValue);

   double minLot = MarketInfo(Symbol(), MODE_MINLOT);
   double maxLot = MarketInfo(Symbol(), MODE_MAXLOT);
   double lotStep = MarketInfo(Symbol(), MODE_LOTSTEP);

   lot = MathFloor(lot / lotStep) * lotStep;
   lot = MathMax(minLot, MathMin(lot, maxLot));

   return NormalizeDouble(lot, 2);
}

//+------------------------------------------------------------------+
//| Check if trade is open                                            |
//+------------------------------------------------------------------+
bool IsTradeOpen()
{
   for(int i=0; i<OrdersTotal(); i++)
   {
      if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
         if(OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber)
            return true;
   }
   return false;
}

//+------------------------------------------------------------------+
//| Register trade session                                            |
//+------------------------------------------------------------------+
void RegisterTrade()
{
   lastTradeSession = GetCurrentSession();
   lastTradeDay = TimeDay(TimeCurrent());
   firstRetestDone = true;
}

//+------------------------------------------------------------------+
//| Get last H4 resistance                                           |
//+------------------------------------------------------------------+
double GetLastH4Resistance()
{
   double resistance = 0;
   for(int i=2; i<=ResistanceLookback; i++)
   {
      double high = iHigh(Symbol(), PERIOD_H4, i);
      if(high > resistance) resistance = high;
   }
   return resistance;
}

//+------------------------------------------------------------------+
//| Draw resistance line                                              |
//+------------------------------------------------------------------+
void DrawResistanceLine(double price)
{
   if(ObjectFind(ResistanceLineName) == -1)
   {
      ObjectCreate(ResistanceLineName, OBJ_HLINE, 0, 0, price);
      ObjectSet(ResistanceLineName, OBJPROP_COLOR, clrRed);
      ObjectSet(ResistanceLineName, OBJPROP_WIDTH, 2);
      ObjectSet(ResistanceLineName, OBJPROP_STYLE, STYLE_DASH);
   }
   else ObjectSet(ResistanceLineName, OBJPROP_PRICE1, price);
}

//+------------------------------------------------------------------+
//| Draw SL/TP lines on chart                                         |
//+------------------------------------------------------------------+
void DrawSLTPLines(double slPrice, double tpPrice)
{
   if(!DrawSLTP) return;

   string slName = "ATR_SL";
   string tpName = "ATR_TP";

   // SL
   if(ObjectFind(slName) == -1)
      ObjectCreate(slName, OBJ_HLINE, 0, 0, slPrice);
   ObjectSet(slName, OBJPROP_COLOR, clrRed);
   ObjectSet(slName, OBJPROP_WIDTH, 2);
   ObjectSet(slName, OBJPROP_STYLE, STYLE_DASH);
   ObjectSet(slName, OBJPROP_PRICE1, slPrice);

   // TP
   if(ObjectFind(tpName) == -1)
      ObjectCreate(tpName, OBJ_HLINE, 0, 0, tpPrice);
   ObjectSet(tpName, OBJPROP_COLOR, clrLime);
   ObjectSet(tpName, OBJPROP_WIDTH, 2);
   ObjectSet(tpName, OBJPROP_STYLE, STYLE_DASH);
   ObjectSet(tpName, OBJPROP_PRICE1, tpPrice);
}

//+------------------------------------------------------------------+
//| Get ATR distance                                                  |
//+------------------------------------------------------------------+
double GetATRDistance(int atrPeriod, double multiplier)
{
   double atr = iATR(Symbol(), PERIOD_H4, atrPeriod, 1);
   return atr * multiplier;
}

//+------------------------------------------------------------------+
//| OnTick                                                           |
//+------------------------------------------------------------------+
void OnTick()
{
   int session = GetCurrentSession();
   if(session == -1 || !CanTradeSession()) return;

   datetime currentCandle = iTime(Symbol(), PERIOD_M30, 0);
   if(currentCandle == lastCandleTime) return;
   lastCandleTime = currentCandle;

   if(IsTradeOpen()) return;

   double pip = (Digits==3||Digits==5)?Point*10:Point;

   //--- H4 trend
   double h4_ma = iMA(Symbol(), PERIOD_H4, H4_MA_Period, 0, MODE_EMA, PRICE_CLOSE, 1);
   double h4_price = iClose(Symbol(), PERIOD_H4, 1);

   //--- EMA crossover M30
   double emaFast_1 = iMA(Symbol(), PERIOD_M30, FastEMA, 0, MODE_EMA, PRICE_CLOSE, 1);
   double emaFast_2 = iMA(Symbol(), PERIOD_M30, FastEMA, 0, MODE_EMA, PRICE_CLOSE, 2);
   double emaSlow_1 = iMA(Symbol(), PERIOD_M30, SlowEMA, 0, MODE_EMA, PRICE_CLOSE, 1);
   double emaSlow_2 = iMA(Symbol(), PERIOD_M30, SlowEMA, 0, MODE_EMA, PRICE_CLOSE, 2);

   //--- Resistance
   double resistance = GetLastH4Resistance();
   DrawResistanceLine(resistance);
   double h4_close = iClose(Symbol(), PERIOD_H4, 1);
   double buffer = ResistanceBufferPips * pip;

   bool h4BreakConfirmed = h4_close > resistance;
   bool priceRetest = MathAbs(Bid - resistance) <= buffer;

   //--- ATR SL/TP
   double atrSL = GetATRDistance(ATR_Period, SL_ATR_Multiplier);
   double atrTP = GetATRDistance(ATR_Period, TP_ATR_Multiplier);

   //--- BUY
   bool buyCondition =
       h4BreakConfirmed &&
       h4_price > h4_ma &&
       emaFast_2 < emaSlow_2 &&
       emaFast_1 > emaSlow_1 &&
       priceRetest;

   if(buyCondition)
   {
       double lot = GetLotSize(atrSL/pip);
       double sl = Bid - atrSL;
       double tp = Bid + atrTP;

       DrawSLTPLines(sl,tp);

       if(OrderSend(Symbol(), OP_BUY, lot, Ask, 3, sl, tp,
                    "EMA Buy ATR SL/TP", MagicNumber, 0, clrBlue) > 0)
       {
           RegisterTrade();
       }
   }

   //--- SELL
   if(EnableSell)
   {
       bool sellCondition =
           h4_close < resistance &&
           h4_price < h4_ma &&
           emaFast_2 > emaSlow_2 &&
           emaFast_1 < emaSlow_1 &&
           priceRetest;

       if(sellCondition)
       {
           double lot = GetLotSize(atrSL/pip);
           double sl = Ask + atrSL;
           double tp = Ask - atrTP;

           DrawSLTPLines(sl,tp);

           if(OrderSend(Symbol(), OP_SELL, lot, Bid, 3, sl, tp,
                        "EMA Sell ATR SL/TP", MagicNumber, 0, clrRed) > 0)
           {
               RegisterTrade();
           }
       }
   }
}

//+------------------------------------------------------------------+


Please can you correct this EA to make it work


응답함

1
개발자 1
등급
(15)
프로젝트
34
24%
중재
4
0% / 50%
기한 초과
2
6%
작업중
2
개발자 2
등급
(17)
프로젝트
21
10%
중재
4
50% / 50%
기한 초과
1
5%
작업중
3
개발자 3
등급
(15)
프로젝트
21
0%
중재
3
0% / 67%
기한 초과
4
19%
로드됨
4
개발자 4
등급
(18)
프로젝트
19
74%
중재
0
기한 초과
1
5%
작업중
게재됨: 2 코드
5
개발자 5
등급
(4)
프로젝트
5
20%
중재
0
기한 초과
0
무료
6
개발자 6
등급
(305)
프로젝트
546
35%
중재
79
32% / 42%
기한 초과
196
36%
작업중
7
개발자 7
등급
(3)
프로젝트
6
17%
중재
0
기한 초과
3
50%
무료
8
개발자 8
등급
(27)
프로젝트
38
24%
중재
14
0% / 93%
기한 초과
4
11%
무료
9
개발자 9
등급
프로젝트
0
0%
중재
0
기한 초과
0
무료
10
개발자 10
등급
(3)
프로젝트
3
33%
중재
2
0% / 100%
기한 초과
0
무료
11
개발자 11
등급
프로젝트
0
0%
중재
0
기한 초과
0
무료
12
개발자 12
등급
프로젝트
0
0%
중재
0
기한 초과
0
무료
13
개발자 13
등급
프로젝트
0
0%
중재
0
기한 초과
0
무료
14
개발자 14
등급
(71)
프로젝트
254
53%
중재
16
50% / 38%
기한 초과
83
33%
무료
15
개발자 15
등급
(1)
프로젝트
0
0%
중재
5
0% / 80%
기한 초과
0
무료
16
개발자 16
등급
(2)
프로젝트
2
0%
중재
1
0% / 100%
기한 초과
0
작업중
17
개발자 17
등급
(9)
프로젝트
9
11%
중재
0
기한 초과
2
22%
무료
18
개발자 18
등급
(8)
프로젝트
8
0%
중재
0
기한 초과
0
무료
19
개발자 19
등급
프로젝트
0
0%
중재
0
기한 초과
0
무료
20
개발자 20
등급
프로젝트
0
0%
중재
0
기한 초과
0
작업중
비슷한 주문
Trading Bot Executes Trades on Specific Days via TradingView Alerts **As a** trader, **I want** to develop a trading bot that integrates with TradeLocker and MTS, **So that** when a TradingView alert (based on a 2,4,5,10,15,30 minute break and retest strategy whichever one) is triggered first. the bot will execute trades on both platforms, but only on specific days of the week. --- ## Acceptance Criteria 1
Project Description I am looking to collaborate with an experienced MQL5 / algorithmic trading developer who also has hands-on experience with Large Language Models (LLMs) and AI-driven systems. This is a long-term partnership opportunity , not a one-off paid freelance job. I bring 9 years of practical Elliott Wave trading experience , applied in live market conditions. The objective is to translate Elliott Wave
Hello, I’m looking for an experienced MT4 (MQL4) developer to convert the Lucky Reversal indicator from indicatorspot.com into a fully functional Expert Advisor (EA). Project Scope Code an MT4 EA that replicates the exact logic and signals of the Lucky Reversal indicator Trades should open and close automatically based on the indicator’s rules Must match indicator behavior 1:1 (no approximations) EA Requirements MT4
Looking for a developer to develop or provide past expert advisor that can cope with high impact news and high trends. needs to be mt5. Any strategy necessary. need to be able to backtest myself or see past results. Minimum profit per month 30% but needs to be very low drawdown. Can be one shot trade a day or a 1 min scalper ea. I will not be going to telegram to discuss further
🔹 COMPLETE DEVELOPMENT ASSIGNMENT Institutional Volume & Structure Indicator Platform: MT5 (preferred) OR TradingView (Pine Script v5) Type: Indicator only (NO EA, NO auto trading) Purpose: Institutional analysis for manual trading & manual backtesting 1. GENERAL REQUIREMENTS Indicator only (no orders, no strategy execution) No repainting Auto update + auto remove logic Clean, modular, performance-safe code User
specification High-Frequency Candle Momentum Scalper 1. Strategy Overview Core Logic: The EA identifies the current color of the active candle (Bullish or Bearish). Entry Trigger: It opens positions only after a specific duration of the candle has passed (e.g., after 30 seconds on a 1-minute candle) to confirm the direction. 2. Entry Logic (The "Half-Candle" Rule) Timeframe: M1 (Default, but adjustable). Time Filter
Looking for experience MT5 developer to build a rule-based EA using Volume Profile concept. Only developer with proven past experience working with Volume Profile indicator (ie, VAH, VAL, POC, session profiles or anchored profiles) will be considered. Interested developer must submit a screenshot or video clip of a past project involving Volume Profile, before being shortlisted. Specification will only be shared and
I need an Expert Advisor (EA) coded for MetaTrader 5 based on the following specifications: Objective: Autonomous trading on Bollinger Band breakouts, robust across trending and consolidating years. Architecture: Max 1 open trade at a time Ignore opposite signals if a trade is open Spread filter: always execute Indicators (Custom): Bollinger Bands (WMA, length 20, deviation 1.5, source: close) ATR (WMA, length 14)
I need a professional MQL5 developer to build a REAL-account XAUUSD (Gold) scalping Expert Advisor. Requirements: - MT5 only - Scalping on M1 timeframe - Works on REAL accounts (not demo-only) - Max spread & slippage filter - News filter - Auto lot (risk % adjustable) - One trade at a time Delivery: - Final EX5 file - Testing before full payment Please apply only if you have real experience with XAUUSD scalping
My expert already has the rest of the required features implemented . Bring in your support and resistance expert to save time . My expert already has money management , session filter etc . Trailing is threshold based . Please send a picture as well to show your expert on a live chart . Most specific is the 5m tf , to 1m execution

프로젝트 정보

예산
30+ USD
기한
 10 일

고객

넣은 주문1
중재 수0