Identify trend with last 2 appropriate candles and execute order.

MQL5 Experts

Specification

Hi. Need a bot for mt5.

My idea - use two big candles to identify the trend. If first big candle is down and the one after it is up, then trend is positive. If first big candle is up and the one after it is down - trend is negative.

I need the bot to identify trend this way and open order according with the trend it recognised.

Order should have a stop loss, take profit and optional trailing in points.

If order didnt stop because of sl, tp or trailing - bot needs to monitor next trend identification and be able to close current order and open new one.

If order hit by sl then start to monitor last 2 candles to restart the strategy.

If order hit trailing or tp, start to monitor last 2 candles to restart the strategy.

Only scan for last 2 closed candles, dont open order if candle is not closed and next one didnt start yet.

Only one open order at a time.

Only candle body is important, no shadows (candle open and close price).

Bot has to work on any chart (crypto or forex). Only on the timeframe its attached to. Also need magic number to run same bot on many charts.


How to tell the bot which candles are big? In settings:

Points for first candle (more than x amount but less than x amount)

Points for second candle (more than x amount but less than x amount)

Stop loss in points

Take profit in points

Trailing stop (enable or disable)

Trailing start in points

Trailing step in points

Magic number


How it works.

Bot is always scanning for last 2 candles. Only candle body matters, no shadows. If last 2 candles are closed in a set range then look at second candle. If that candle is down then open sell, if second candle is up then open buy. If order hit sl, tp or trailing then start looking at last 2 closed candles again. If order didnt hit sl, tp or trailing, always keep monitoring for possible trend changes.



Responded

1
Developer 1
Rating
(572)
Projects
664
32%
Arbitration
42
45% / 45%
Overdue
12
2%
Loaded
2
Developer 2
Rating
(106)
Projects
173
25%
Arbitration
23
9% / 78%
Overdue
16
9%
Working
3
Developer 3
Rating
(1)
Projects
2
0%
Arbitration
0
Overdue
1
50%
Working
4
Developer 4
Rating
(62)
Projects
90
29%
Arbitration
24
13% / 58%
Overdue
7
8%
Working
5
Developer 5
Rating
Projects
0
0%
Arbitration
0
Overdue
0
Free
6
Developer 6
Rating
(2663)
Projects
3388
68%
Arbitration
77
48% / 14%
Overdue
342
10%
Working
Published: 1 code
7
Developer 7
Rating
(453)
Projects
715
34%
Arbitration
34
71% / 9%
Overdue
22
3%
Free
8
Developer 8
Rating
(85)
Projects
174
44%
Arbitration
3
100% / 0%
Overdue
5
3%
Free
Published: 1 code
9
Developer 9
Rating
(74)
Projects
84
27%
Arbitration
8
13% / 63%
Overdue
4
5%
Free
10
Developer 10
Rating
(2322)
Projects
2925
63%
Arbitration
123
45% / 25%
Overdue
429
15%
Free
11
Developer 11
Rating
(23)
Projects
34
53%
Arbitration
1
100% / 0%
Overdue
1
3%
Free
12
Developer 12
Rating
(313)
Projects
559
35%
Arbitration
80
31% / 44%
Overdue
203
36%
Free
13
Developer 13
Rating
(10)
Projects
11
0%
Arbitration
3
0% / 33%
Overdue
1
9%
Working
14
Developer 14
Rating
Projects
0
0%
Arbitration
0
Overdue
0
Free
15
Developer 15
Rating
(24)
Projects
30
13%
Arbitration
12
0% / 75%
Overdue
8
27%
Working
16
Developer 16
Rating
(278)
Projects
374
72%
Arbitration
19
32% / 47%
Overdue
14
4%
Working
Published: 14 codes
17
Developer 17
Rating
(6)
Projects
5
0%
Arbitration
3
33% / 67%
Overdue
2
40%
Working
18
Developer 18
Rating
(3)
Projects
5
20%
Arbitration
1
100% / 0%
Overdue
2
40%
Free
19
Developer 19
Rating
(458)
Projects
796
49%
Arbitration
73
16% / 52%
Overdue
139
17%
Loaded
20
Developer 20
Rating
Projects
0
0%
Arbitration
0
Overdue
0
Free
21
Developer 21
Rating
(23)
Projects
29
31%
Arbitration
0
Overdue
2
7%
Free
22
Developer 22
Rating
(162)
Projects
289
35%
Arbitration
18
22% / 61%
Overdue
43
15%
Free
23
Developer 23
Rating
(8)
Projects
8
0%
Arbitration
2
50% / 0%
Overdue
1
13%
Free
Similar orders
I want to convert an MT4 Fractal Breakout EA to MT5. This EA places pending stop order to capture the fractal breakout and trail it. No complex indicator or rules. Enable only Buy or Only Sell or Both Buy Sell option in any indices. MT4 backtest should match Mt5 to some extent
Hello! Is there any person who can teach me Forex. I prefer high time frame strategies Like H4, D1, but I am open for your propositions. Have a nice day
SNIPER X AI 30 - 200 USD
I really need a developer Who can help me to create my SNIPER X AI - Elite AI Trading System Overview SNIPER X AI BOT is an AI-assisted trading system for Forex, Crypto, Stocks, Indices, and Gold. Currency: USD,RAND,KWD, POUND,EURO Core Features AI Scalping, Sniper Entries, Auto Buy/Sell, Smart Risk Management, Telegram Alerts, Mobile Monitoring, VPS Deployment. Supported Platforms MetaTrader 4, MetaTrader 5, Exness
Emmanuel bot 30 USD
No thank you just choose for me I need to be automatically buy and sell and take a profit only that is enough for me thank you so much and my name is Emmanuel kabale
Emmanuel bot 30 USD
No thank you just choose for me I need to be automatically buy and sell and take a profit only that is enough for me thank you so much my name is Emmanuel kabale
I am looking for a professional developer to create an automated trading bot for Synthetic Derivative Indices. The bot should be designed for efficiency, precision, and stability, with the ability to execute trades automatically based on predefined strategies and market conditions. and synthetic indices trading is essential for this project
Existing EA needed Hi, Im looking to purchase or build an EA that can open many trades or big lot size to churn out IB commission, it doesnt have to be super profitable but will need to have the number of trades on going in order to earn IB commission. If you have any EA or strategy that are gearing towards this, let me know and i would be glad to purchase it
Limzy 30+ USD
//+------------------------------------------------------------------+ //| HighPerformanceEA.mq5 | //| Copyright 2026, AI Developer | //| https://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2026" #property link " https://www.mql5.com " #property version "1.00" #property strict //
I need an experienced MQL5 developer to build a professional XAUUSD scalping Expert Advisor. The trading logic is already fully defined and will be shared privately with selected developers. Requirements Fast execution suitable for scalping Dynamic lot sizing Strict risk management Clean and optimized MQL5 code Compatible with MetaTrader 5 Additional Rules No repainting logic No delayed execution Avoid duplicate
It seems we need to convert this mql5 file into another platform like MULTICHARTS, NINJATRADER, SIERRACHART or other platform, I am open forr your sugestion, propositions, integrations etc. Anybody will help me with this project here? Source of code required

Project information

Budget
30+ USD