MT5 Expert Advisor: Buy/Sell Based on Previous Candle Color (MQL5)

MQL5 Asesores Expertos

Tarea técnica

Write an MQL5 Expert Advisor (EA) for MetaTrader 5.

Trading logic:
- On each new bar, check the last closed candle.
- If the candle is bearish (close below open), open a SELL.
- If the candle is bullish (close above open), open a BUY.
- If open equals close (doji), do nothing.

Inputs (adjustable by the user):
- Lot size
- Stop Loss in points
- Take Profit in points
- Maximum number of open positions allowed
- Magic number

Rules:
- Do not open a new trade if the maximum number of positions is already reached.
- Include only these features. No extra indicators, filters, or unnecessary options.
- Keep the code short, clean, and easy to read, with brief comments.
- Use the standard CTrade class.

Output:
- Provide the full .mq5 source code, ready to compile in MetaEditor and to publish on mql5.com.

Han respondido

1
Desarrollador 1
Evaluación
(642)
Proyectos
750
35%
Arbitraje
50
52% / 38%
Caducado
14
2%
Trabaja
2
Desarrollador 2
Evaluación
(295)
Proyectos
368
30%
Arbitraje
37
27% / 65%
Caducado
10
3%
Trabaja
Ha publicado: 10 ejemplos
3
Desarrollador 3
Evaluación
(64)
Proyectos
145
46%
Arbitraje
21
38% / 24%
Caducado
32
22%
Libre
4
Desarrollador 4
Evaluación
(469)
Proyectos
823
49%
Arbitraje
76
21% / 51%
Caducado
143
17%
Trabaja
5
Desarrollador 5
Evaluación
(637)
Proyectos
1009
47%
Arbitraje
33
36% / 36%
Caducado
99
10%
Trabaja
Ha publicado: 6 ejemplos
6
Desarrollador 6
Evaluación
(62)
Proyectos
90
29%
Arbitraje
24
13% / 58%
Caducado
7
8%
Trabaja
7
Desarrollador 7
Evaluación
(111)
Proyectos
184
25%
Arbitraje
25
16% / 76%
Caducado
16
9%
Libre
8
Desarrollador 8
Evaluación
(24)
Proyectos
32
38%
Arbitraje
4
50% / 25%
Caducado
5
16%
Trabaja
9
Desarrollador 9
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
10
Desarrollador 10
Evaluación
(5)
Proyectos
7
86%
Arbitraje
0
Caducado
0
Libre
Ha publicado: 4 ejemplos
11
Desarrollador 11
Evaluación
(1)
Proyectos
1
100%
Arbitraje
0
Caducado
0
Trabaja
Ha publicado: 7 ejemplos
12
Desarrollador 12
Evaluación
(11)
Proyectos
19
21%
Arbitraje
3
0% / 67%
Caducado
3
16%
Trabajando
13
Desarrollador 13
Evaluación
(191)
Proyectos
205
47%
Arbitraje
4
50% / 25%
Caducado
1
0%
Trabajando
14
Desarrollador 14
Evaluación
(61)
Proyectos
61
51%
Arbitraje
1
0% / 100%
Caducado
1
2%
Libre
15
Desarrollador 15
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
16
Desarrollador 16
Evaluación
(9)
Proyectos
11
73%
Arbitraje
0
Caducado
0
Trabaja
Ha publicado: 1 artículo, 2 ejemplos
17
Desarrollador 17
Evaluación
(1)
Proyectos
1
0%
Arbitraje
0
Caducado
0
Libre
Ha publicado: 4 ejemplos
18
Desarrollador 18
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
19
Desarrollador 19
Evaluación
(1)
Proyectos
1
100%
Arbitraje
0
Caducado
0
Libre
20
Desarrollador 20
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
Ha publicado: 2 ejemplos
21
Desarrollador 21
Evaluación
(1)
Proyectos
4
50%
Arbitraje
3
0% / 100%
Caducado
2
50%
Libre
Ha publicado: 4 ejemplos
22
Desarrollador 22
Evaluación
(4)
Proyectos
5
60%
Arbitraje
0
Caducado
1
20%
Libre
23
Desarrollador 23
Evaluación
(568)
Proyectos
866
61%
Arbitraje
33
27% / 45%
Caducado
24
3%
Libre
Ha publicado: 1 ejemplo
24
Desarrollador 24
Evaluación
(2)
Proyectos
3
33%
Arbitraje
0
Caducado
2
67%
Trabaja
25
Desarrollador 25
Evaluación
(25)
Proyectos
35
40%
Arbitraje
9
22% / 33%
Caducado
5
14%
Trabajando
Ha publicado: 9 artículos, 35 ejemplos
26
Desarrollador 26
Evaluación
(4)
Proyectos
11
55%
Arbitraje
1
100% / 0%
Caducado
0
Libre
27
Desarrollador 27
Evaluación
(2)
Proyectos
3
33%
Arbitraje
0
Caducado
2
67%
Libre
28
Desarrollador 28
Evaluación
(45)
Proyectos
63
52%
Arbitraje
5
0% / 40%
Caducado
1
2%
Libre
29
Desarrollador 29
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
30
Desarrollador 30
Evaluación
(1)
Proyectos
1
0%
Arbitraje
0
Caducado
0
Libre
31
Desarrollador 31
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
Ha publicado: 7 ejemplos
32
Desarrollador 32
Evaluación
(268)
Proyectos
319
74%
Arbitraje
16
75% / 0%
Caducado
6
2%
Trabaja
33
Desarrollador 33
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
Ha publicado: 1 ejemplo
34
Desarrollador 34
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
Ha publicado: 2 ejemplos
35
Desarrollador 35
Evaluación
(3)
Proyectos
4
0%
Arbitraje
1
0% / 100%
Caducado
0
Libre
36
Desarrollador 36
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
37
Desarrollador 37
Evaluación
(60)
Proyectos
96
43%
Arbitraje
4
0% / 100%
Caducado
4
4%
Libre
38
Desarrollador 38
Evaluación
(1)
Proyectos
1
0%
Arbitraje
1
0% / 100%
Caducado
0
Libre
39
Desarrollador 39
Evaluación
(2)
Proyectos
2
50%
Arbitraje
0
Caducado
1
50%
Libre
40
Desarrollador 40
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
Ha publicado: 5 ejemplos
41
Desarrollador 41
Evaluación
(2354)
Proyectos
2960
63%
Arbitraje
125
44% / 26%
Caducado
429
14%
Trabaja
42
Desarrollador 42
Evaluación
(30)
Proyectos
37
38%
Arbitraje
0
Caducado
2
5%
Trabaja
Ha publicado: 1 ejemplo
43
Desarrollador 43
Evaluación
(1)
Proyectos
1
0%
Arbitraje
1
0% / 100%
Caducado
0
Libre
44
Desarrollador 44
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
Ha publicado: 2 ejemplos
45
Desarrollador 45
Evaluación
(1)
Proyectos
1
0%
Arbitraje
1
0% / 100%
Caducado
0
Trabaja
46
Desarrollador 46
Evaluación
(2682)
Proyectos
3434
68%
Arbitraje
78
49% / 14%
Caducado
344
10%
Trabaja
Ha publicado: 1 ejemplo
47
Desarrollador 47
Evaluación
(105)
Proyectos
136
43%
Arbitraje
1
100% / 0%
Caducado
3
2%
Libre
Solicitudes similares
--- I need an MT5 Expert Advisor (EA) for Forex trading. Strategy: - Trade when fast Moving Average (9) crosses above slow Moving Average (21) = BUY - Trade when fast Moving Average (9) crosses below slow Moving Average (21) = SELL - Only 1 trade at a time Settings I want to change: - Lot size - Stop Loss in pips - Take Profit in pips - Trailing Stop - Trading hours (Start and End time) Risk: - Close all trades at
ICC SMART STRUCTURE EA 50 - 100 USD
DEVELOPMENT REQUIREMENTS Project Title: ICC Smart Structure EA – MT5 Automated Trading System 1. Project Objective I want a fully automated Expert Advisor (EA) for MetaTrader 5 (MT5), based on my Indication–Correction–Continuation (ICC) trading strategy. The EA must identify market structure, Break of Structure (BOS), swing highs and lows, supply and demand zones, corrections and continuation entries across multiple
The EA is already developed and functional, but there are some issues with its current behaviour that need to be investigated and corrected. **Requirements:** - Review the existing EA source code and identify the root cause of the issues. - Fix the existing problems without affecting other working functionalities. - Ensure the EA operates correctly under different market conditions. - Maintain the existing trading
Project Description I am looking for an experienced MQL5 developer with strong knowledge of FIX Protocol (Financial Information Exchange) to integrate FIX API connectivity into an existing MetaTrader 5 Expert Advisor. The main objective is to improve order execution speed, reduce execution latency, and minimize slippage, especially for high-frequency scalping strategies. Required Features 1. Integrate FIX Protocol
I want reading tradingviwer signal and want open mt5 account trades. Want reading stop loss size and take a profit size and when signalClosing ! This ea want cancel open trades
a { text-decoration: none; color: #464feb; } tr th, tr td { border: 1px solid #e6e6e6; } tr th { background-color: #f5f5f5; } I’m looking for a developer to create a fully automated trading bot (Expert Advisor) for MT5. I am not an expert trader, so the bot should have its own trading strategy, scan the market automatically, identify trading opportunities, and place buy/sell trades without manual input. It should
برمجة روبوت تداول MQL5 بهدف 50 نقطة مع إدارة مخاطر.مطلوب برمجة خبير تداول آلي يعمل على منصة MQL5، يركز على تحقيق هدف 50 نقطة مع إدارة صارمة للمخاطر وتحديد وقف الخسارة
I want full experience devloper need , I want devlope 4 Type Bot , Grd strategy 2 , and other bias strategy 2 scaning on market condition choose one order buy or sell and take profit and target fully automatic management, I am explain full details on private chat only experience developer contact me
Hello everyone, I am a final-year AI & Data Science student interested in building a career in algorithmic trading and EA development. I have good technical knowledge of MQL5, MT5 Expert Advisors, risk management, technical indicators, and automated trading strategies. I have also worked on building trading systems using Machine Learning and Neural Networks. I know how to develop EAs and trading strategies, but I am
Hello! I don't have time, but I bought some challanges and honestly I don't feel 100% confident yet for trading, I am eager to share prop firm account with good, profitable trader. 50% of profits are your, but first I need to make selection, I need to trust you somehow that you will not blow up account within few days. Only serious persons please, please don't waste me time and yours

Información sobre el proyecto

Presupuesto
70 - 100 USD
Plazo límite de ejecución
a 10 día(s)

Cliente

Encargos realizados1
Número de arbitrajes0