指定
I need an MT5 Expert Advisor for XAUUSD on the M15 timeframe, based strictly on the following trading rules.
This EA is for personal use. Please provide clean and well-commented MQL5 source code.
⸻
1. Basic setup (timeframe & indicators)
Main trading timeframe
• EA runs on: M15 only
• Higher timeframes (M30/H1) are for manual reference only; no multi-TF logic is required in V1.
Indicators used
• EMA50 (short-term trend) – blue
• EMA200 (long-term trend) – red
• MACD
• Main line – blue
• Signal line – orange
• Histogram – green (bullish), red (bearish)
• Inputs: Fast=12, Slow=26, Signal=9
• Volume: tick volume
• With SMA20 of volume (blue line)
• ATR14 (for volatility, SL, trailing)
Colors are for visual consistency only (no need to enforce colors in code).
⸻
2. Pre-entry 6-step filter
(Checks are only performed after a UT Bot signal appears.)
Step 1 – Trend filter (EMA50 vs EMA200)
• If EMA50 > EMA200 → uptrend → EA is allowed to open Buy only
• If EMA50 < EMA200 → downtrend → EA is allowed to open Sell only
• If EMAs are very close and frequently crossing (sideways) → no trades
Implementation suggestion:
You may add a parameter like Min_EMA_Distance (in points) to avoid trading when EMAs are almost overlapping.
⸻
Step 2 – UT Bot signal (direction only)
• UT Bot Buy → potential Buy setup
• UT Bot Sell → potential Sell setup
• EA must NOT enter immediately; UT Bot is only the 1st directional filter.
UT Bot logic requirements
• ATR-based logic similar to TradingView “UT Bot Alerts”
• Inputs:
• UT_ATR_Period
• UT_ATR_Multiplier
• UT_Sensitivity
Important implementation rules
• Signals must be generated and confirmed on bar close only (no intra-bar repaint).
• EA should react only to new UT Bot signals (max one Buy/Sell signal per bar).
⸻
Step 3 – MACD momentum confirmation
For Buy:
• MACD main (blue) crosses above signal (orange) → golden cross
• Histogram turns green
• Main line direction is upwards
For Sell:
• MACD main crosses below signal → dead cross
• Histogram turns red
• Main line direction is downwards
Conflict rule (no trade):
If:
• UT Bot gives Buy but MACD is clearly bearish (red histogram, main pointing down), or
• UT Bot gives Sell but MACD is clearly bullish (green histogram, main pointing up),
→ signals are conflicting → no trade is allowed.
⸻
Step 4 – Volume filter (avoid fake breakouts)
Use tick volume with SMA20:
• Let VolCurrent = current volume bar
• Let VolMA = SMA(20) of volume
Entry is allowed only if:
VolCurrent >= VolMA * Volume_Min_Ratio
• Volume_Min_Ratio default = 1.2
If current volume is much lower than VolMA → low liquidity → no trade.
Inputs:
• Volume_MA_Period = 20
• Volume_Min_Ratio = 1.2 (user-adjustable)
⸻
Step 5 – ATR volatility filter (M15 only)
EA runs on M15.
• Use ATR_Period = 14 on M15.
• Input: ATR_Min (default 6.0, in USD per 1.0 lot price movement).
If:
ATR(14) < ATR_Min → no new trades (market is too flat)
If ATR is extremely large, the risk-based position sizing (section 7) will naturally reduce the lot size (because SL distance is larger).
Inputs:
• ATR_Period = 14
• ATR_Min = 6.0 (default)
⸻
Step 6 – Major news filter
No new trades are allowed X minutes before and after major news.
Existing open trades should be managed normally (SL/TP/trailing still active).
News types to block:
• CPI, Core CPI, Core PCE
• NFP (Non-Farm Payrolls)
• FOMC rate decision
• FOMC meeting minutes
• Fed Chair speech (Powell)
• Unemployment rate
• Other manually specified high-impact events
V1 simple implementation
• Use a manual string input with semicolon-separated news times in server time:
Example:
NewsTimes = "2025.11.14 21:30;2025.11.14 23:00;2025.11.15 21:30"
Inputs:
• UseNewsFilter (true/false)
• NewsTimes (string, server time, format “yyyy.MM.dd HH:MI;…”)
• MinutesBefore = 30
• MinutesAfter = 60
If current server time TimeCurrent() is within:
[newsTime - MinutesBefore, newsTime + MinutesAfter]
→ Block new entries.
Note: user must input times according to the broker server time zone.
⸻
3. Pullback entry filter (do not chase price)
After UT Bot signal and all 6 filters above pass,
EA must wait for a pullback before opening a position.
Entry is allowed if ANY of the following is satisfied:
A) Pullback to EMA50 (trend pullback zone)
Inputs:
• EMA50_Pullback_Tolerance = 1.0 (in USD, e.g. ±1.0 around EMA50)
Buy:
• Recent price low touches a zone EMA50 ± tolerance
• Then price turns up (e.g. current close > previous close)
→ Enter Buy
Sell:
• Recent price high touches EMA50 ± tolerance
• Then price turns down
→ Enter Sell
⸻
B) Pullback to 50% midpoint of UT Bot signal candle
Example: UT Bot Sell candle:
• High = 4200
• Low = 4180
• Midpoint = (High + Low) / 2 = 4190
Inputs:
• Midpoint_Pullback_Tolerance = 1.0 (USD)
Sell:
• After signal, price retraces back to Midpoint ± tolerance
→ Enter Sell
Buy: same logic in opposite direction.
⸻
C) MACD pullback & re-expansion
Buy:
• After MACD golden cross, main line pulls back toward signal line (distance decreases),
• Then turns upwards again and the distance widens
→ Enter Buy
Sell:
• After dead cross, main line pulls back toward signal,
• Then turns down and widens again
→ Enter Sell
Inputs:
• Enable_EMA50_Pullback = true
• Enable_Midpoint_Pullback = true
• Enable_MACD_Pullback = true
EA should allow enabling/disabling each type of pullback independently.
At least one enabled condition must be satisfied for an entry.
⸻
4. Stop Loss (SL) – ATR based
SL is defined in USD terms per 1.0 lot:
SL_Size_USD = ATR(14) * SL_Multiplier
Inputs:
• SL_Multiplier default range: 1.5 – 2.0
Example, ATR = 12.6:
• Normal SL: 12.6 × 1.5 ≈ 18.9 USD
• Conservative SL: 12.6 × 2.0 ≈ 25.2 USD
Price-level SL:
• Buy: SL = EntryPrice − SL_Size_USD
• Sell: SL = EntryPrice + SL_Size_USD
(Using XAUUSD where 1.0 price = 1 USD.)
⸻
5. Take Profit (TP) – Risk/Reward based
TP is defined as a multiple of SL:
TP_Size_USD = SL_Size_USD * RR_Ratio
Inputs:
• RR_Ratio (default 1.5–2.0)
Example:
• SL_Size_USD = 20
• TP at 1.5R → 30 USD
• TP at 2.0R → 40 USD
Price-level TP:
• Buy: TP = EntryPrice + TP_Size_USD
• Sell: TP = EntryPrice − TP_Size_USD
⸻
6. Profit protection – Dynamic trailing using ATR
Inputs:
• BE_ATR = 1.0 (move SL to BE after +1 ATR profit)
• Trail_Step_ATR = 0.5 (trailing step)
• Trail_Move_ATR = 0.3 (how much SL moves per step)
Logic:
1. When floating profit ≥ BE_ATR × ATR
→ Move SL to break-even (entry price).
2. For each additional Trail_Step_ATR × ATR profit
→ Move SL forward by Trail_Move_ATR × ATR in the trade direction.
This gradually locks in more profit as the trend continues.
⸻
7. Position sizing – Institutional risk-based model
Goal: each trade risks a fixed % of account balance,
regardless of SL distance (ATR size).
Inputs:
• RiskPercent = 0.01 (1% per trade, default; can also use 0.005 for 0.5%)
• MinLot / MaxLot (according to broker)
• Lot step should respect broker’s SYMBOL_VOLUME_STEP
Steps:
1. Compute RiskAmount in USD:
RiskAmount = AccountBalance * RiskPercent
2. Compute SL distance in USD per 1.0 lot:
SL_Distance_USD = ATR(14) * SL_Multiplier // same SL as section 4
3. Compute TickValue and Point size:
TickValue = SymbolInfoDouble(_Symbol, SYMBOL_TRADE_TICKVALUE);
PointSize = SymbolInfoDouble(_Symbol, SYMBOL_POINT);
(For XAUUSD brokers, typically 0.01 price step and TickValue ≈ 1 USD per 0.01 move, but EA should not hard-code this.)
4. Convert SL to points:
SL_Points = SL_Distance_USD / PointSize;
5. Institutional lot size formula:
LotSize = RiskAmount / (SL_Points * TickValue);
6. Safety adjustments:
if (LotSize < MinLot) LotSize = MinLot;
if (LotSize > MaxLot) LotSize = MaxLot;
// round to broker lot step
double lotStep = SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_STEP);
LotSize = MathFloor(LotSize / lotStep) * lotStep;
Result: every trade’s maximum loss ≈ RiskPercent × Balance,
regardless of ATR/SL distance.
⸻
8. Additional safety rules (recommended)
Add two global protections:
1. Daily max loss (drawdown stop)
Inputs:
• UseDailyLossLimit = true
• DailyLossPercent = 0.03 (3% of balance per day, default)
Logic:
• Track realized P/L for the current day.
• If daily loss ≤ −Balance × DailyLossPercent →
→ Stop opening new trades for the rest of the day.
2. Max trades per day
Inputs:
• MaxTradesPerDay = 3 (default)
Logic:
• Count number of opened trades during the current broker day.
• If tradesToday >= MaxTradesPerDay → no new trades.
⸻
9. Final checklist (EA entry summary)
A Buy trade is opened only if ALL of the following are true:
1. EMA50 > EMA200 → long-only regime.
2. New UT Bot Buy signal on closed bar.
3. MACD is bullish (golden cross + green histogram + main up).
4. Volume >= VolumeSMA20 × Volume_Min_Ratio.
5. ATR >= ATR_Min.
6. Current time is outside any blocked news window.
7. At least one pullback condition is satisfied
(EMA50 / midpoint / MACD pullback, respecting tolerances).
8. Lot size is calculated using the RiskPercent model, and is within [MinLot, MaxLot].
9. Daily loss limit and MaxTradesPerDay are not violated.
A Sell trade is the exact mirror:
• EMA50 < EMA200
• UT Bot Sell
• MACD bearish (dead cross + red histogram)
• Volume/ATR/News filters pass
• Pullback in short direction
• Position sizing & safety checks identical
⸻
応答済み
1
評価
プロジェクト
6
0%
仲裁
1
0%
/
100%
期限切れ
0
暇
2
評価
プロジェクト
29
14%
仲裁
3
0%
/
67%
期限切れ
3
10%
仕事中
3
評価
プロジェクト
72
8%
仲裁
18
11%
/
56%
期限切れ
18
25%
暇
4
評価
プロジェクト
0
0%
仲裁
0
期限切れ
0
暇
5
評価
プロジェクト
0
0%
仲裁
0
期限切れ
0
暇
6
評価
プロジェクト
0
0%
仲裁
0
期限切れ
0
暇
7
評価
プロジェクト
42
43%
仲裁
2
100%
/
0%
期限切れ
4
10%
暇
8
評価
プロジェクト
5
0%
仲裁
2
0%
/
50%
期限切れ
1
20%
仕事中
9
評価
プロジェクト
0
0%
仲裁
0
期限切れ
0
暇
10
評価
プロジェクト
19
11%
仲裁
1
0%
/
100%
期限切れ
5
26%
暇
11
評価
プロジェクト
199
12%
仲裁
38
37%
/
34%
期限切れ
5
3%
仕事中
パブリッシュした人: 2 codes
12
評価
プロジェクト
0
0%
仲裁
0
期限切れ
0
暇
類似した注文
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
来个ea工程师好吧 解决问题100u奉上
50+ USD
就是mt5里面的metaEditor好用不,我拿豆包写的策略,来给我解决一下里面的错误QQ:2996177133解决你说价格
高频交易~5 分钟图~一天翻倍~免费测试。
300+ USD
本EA专为黄金XAUUSD设计,日内高频交易,5分钟图,本金3000,每次开0.1手。 社区挂售页面(英文版): https://www.mql5.com/zh/market/product/170754?source=Site+Profile+Seller 下面附上截图,和软件下载,无验证码,下载可直接测试使用。
寻找震荡带止损ea
55+ USD
周末真枯啊,兄弟们,不用马丁了,不是在扛单就是扛单的路上,停市了,有没有聊天的兄弟,如果有玩其他的btc的ea也行啊,V:ABK1570 有合适的震荡带止损ea 黄金 btc欢迎来撩,奉上1000u
帮写EA,免费送面板指标,有意者加qq893689417。
50+ USD
帮写EA,另外免费送我自己研发的带面板助记的指标,有意者可加我QQ893689417。加了合作不成也没关系,可以和我聊天,有什么问题都可以问我,纯聊天也行,说不定哪次就合作了呢?
一次一单的手搓策略ea实现,提供0订阅费带单,有意向了解的+V administrator000008
30 - 200 USD
出售高频EA 效果顶流欢迎打扰
30+ USD
只售不租 微信:wx2266wx88
寻找带止损牛逼ea
35+ USD
不想用马丁马丁裸奔了,带止损或者剥头皮的来聊聊,满意1000u奉上v:ABK1570欢迎各位来战
出售一套自己研发的显示面板类指标,想要中文界面的,可以加我qq893689417(也接定制EA的业务)。
60 - 500 USD
下载演示链接: https://www.mql5.com/zh/market/product/170466?source=Site+Profile+Seller 盘口记忆型分析指标: 1.本指标为辅助信息面板类指标,针对主流交易平台仅提供实时盘口数据、无法调取历史盘口数据的痛点进行研发。 2.本指标通过智能记忆对历史成交手数和相应价位,精准还原关键价位的成交分布特征,清晰识别成交密集区与成交稀薄区, 精准定位关键价位的多空最大痛点,辅助用户科学设置止损与止盈区间 ,告别模糊的主观感觉,让交易有据可依,为日内短线交易者提供最直观、最高效的看盘分析依据。 3.本指标支持自定义参数调节,可手动调整步长档位,操作逻辑贴近交易所盘口界面,同时搭载升级数据记录体系,深度捕捉盘面成交数据,助力短线交易精准研判。 特别注意:本指标是信息面板,修改步长时,要把图标上的就面板指标删除再添加新指标,否则会覆盖,让你误认为参数没有修改。
EA自动操作,胜率70%,最大回撤10%,一次一单,黄金日内短线,月化收益1倍
30 - 200 USD
QQ3262939810 EA自动操作,胜率70%,最大回撤10%,一次一单,黄金日内短线,月化收益1倍,免费跟单验证!➕Q3262939810
プロジェクト情報
予算
3000 - 5000 USD