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

MQL5 Experts

Spécifications

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.

Répondu

1
Développeur 1
Évaluation
(642)
Projets
750
35%
Arbitrage
50
52% / 38%
En retard
14
2%
Travail
2
Développeur 2
Évaluation
(295)
Projets
368
30%
Arbitrage
37
27% / 65%
En retard
10
3%
Travail
Publié : 10 codes
3
Développeur 3
Évaluation
(64)
Projets
145
46%
Arbitrage
21
38% / 24%
En retard
32
22%
Gratuit
4
Développeur 4
Évaluation
(469)
Projets
823
49%
Arbitrage
76
21% / 51%
En retard
143
17%
Travail
5
Développeur 5
Évaluation
(637)
Projets
1009
47%
Arbitrage
33
36% / 36%
En retard
99
10%
Travail
Publié : 6 codes
6
Développeur 6
Évaluation
(62)
Projets
90
29%
Arbitrage
24
13% / 58%
En retard
7
8%
Travail
7
Développeur 7
Évaluation
(111)
Projets
184
25%
Arbitrage
25
16% / 76%
En retard
16
9%
Gratuit
8
Développeur 8
Évaluation
(24)
Projets
32
38%
Arbitrage
4
50% / 25%
En retard
5
16%
Travail
9
Développeur 9
Évaluation
Projets
0
0%
Arbitrage
0
En retard
0
Gratuit
10
Développeur 10
Évaluation
(5)
Projets
7
86%
Arbitrage
0
En retard
0
Gratuit
Publié : 4 codes
11
Développeur 11
Évaluation
(1)
Projets
1
100%
Arbitrage
0
En retard
0
Travail
Publié : 7 codes
12
Développeur 12
Évaluation
(11)
Projets
19
21%
Arbitrage
3
0% / 67%
En retard
3
16%
Chargé
13
Développeur 13
Évaluation
(191)
Projets
205
47%
Arbitrage
4
50% / 25%
En retard
1
0%
Chargé
14
Développeur 14
Évaluation
(61)
Projets
61
51%
Arbitrage
1
0% / 100%
En retard
1
2%
Gratuit
15
Développeur 15
Évaluation
Projets
0
0%
Arbitrage
0
En retard
0
Gratuit
16
Développeur 16
Évaluation
(9)
Projets
11
73%
Arbitrage
0
En retard
0
Travail
Publié : 1 article, 2 codes
17
Développeur 17
Évaluation
(1)
Projets
1
0%
Arbitrage
0
En retard
0
Gratuit
Publié : 4 codes
18
Développeur 18
Évaluation
Projets
0
0%
Arbitrage
0
En retard
0
Gratuit
19
Développeur 19
Évaluation
(1)
Projets
1
100%
Arbitrage
0
En retard
0
Gratuit
20
Développeur 20
Évaluation
Projets
0
0%
Arbitrage
0
En retard
0
Gratuit
Publié : 2 codes
21
Développeur 21
Évaluation
(1)
Projets
4
50%
Arbitrage
3
0% / 100%
En retard
2
50%
Gratuit
Publié : 4 codes
22
Développeur 22
Évaluation
(4)
Projets
5
60%
Arbitrage
0
En retard
1
20%
Gratuit
23
Développeur 23
Évaluation
(568)
Projets
866
61%
Arbitrage
33
27% / 45%
En retard
24
3%
Gratuit
Publié : 1 code
24
Développeur 24
Évaluation
(2)
Projets
3
33%
Arbitrage
0
En retard
2
67%
Travail
25
Développeur 25
Évaluation
(25)
Projets
35
40%
Arbitrage
9
22% / 33%
En retard
5
14%
Chargé
Publié : 9 articles, 35 codes
26
Développeur 26
Évaluation
(4)
Projets
11
55%
Arbitrage
1
100% / 0%
En retard
0
Gratuit
27
Développeur 27
Évaluation
(2)
Projets
3
33%
Arbitrage
0
En retard
2
67%
Gratuit
28
Développeur 28
Évaluation
(45)
Projets
63
52%
Arbitrage
5
0% / 40%
En retard
1
2%
Gratuit
29
Développeur 29
Évaluation
Projets
0
0%
Arbitrage
0
En retard
0
Gratuit
30
Développeur 30
Évaluation
(1)
Projets
1
0%
Arbitrage
0
En retard
0
Gratuit
31
Développeur 31
Évaluation
Projets
0
0%
Arbitrage
0
En retard
0
Gratuit
Publié : 7 codes
32
Développeur 32
Évaluation
(268)
Projets
319
74%
Arbitrage
16
75% / 0%
En retard
6
2%
Travail
33
Développeur 33
Évaluation
Projets
0
0%
Arbitrage
0
En retard
0
Gratuit
Publié : 1 code
34
Développeur 34
Évaluation
Projets
0
0%
Arbitrage
0
En retard
0
Gratuit
Publié : 2 codes
35
Développeur 35
Évaluation
(3)
Projets
4
0%
Arbitrage
1
0% / 100%
En retard
0
Gratuit
36
Développeur 36
Évaluation
Projets
0
0%
Arbitrage
0
En retard
0
Gratuit
37
Développeur 37
Évaluation
(60)
Projets
96
43%
Arbitrage
4
0% / 100%
En retard
4
4%
Gratuit
38
Développeur 38
Évaluation
(1)
Projets
1
0%
Arbitrage
1
0% / 100%
En retard
0
Gratuit
39
Développeur 39
Évaluation
(2)
Projets
2
50%
Arbitrage
0
En retard
1
50%
Gratuit
40
Développeur 40
Évaluation
Projets
0
0%
Arbitrage
0
En retard
0
Gratuit
Publié : 5 codes
41
Développeur 41
Évaluation
(2354)
Projets
2960
63%
Arbitrage
125
44% / 26%
En retard
429
14%
Travail
Commandes similaires
--- 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

Informations sur le projet

Budget
70 - 100 USD
Délais
à 10 jour(s)

Client

Commandes passées1
Nombre d'arbitrages0