-->

Expert Advisors • Indicators • Scripts • Libraries

MQL.RobotFX.org is the biggest collection of MetaTrader expert advisors (MT5 & MT4), indicators, scripts and libraries that can be used to improve trading results, minimize risks or simply automate trading tasks

Metatrader 5 Expert Advisor | Discover: OB Trader Order Block Strategy tester | MQL5 Community Release

New free code from MQL5: indicators, EAs, and scripts for traders.

*Note*- "After detecting an Oder Block it then immediately trade on the open of the next candle'
*Warning* - "This EA hasn't been optimized but feel free to use the code as you wish"


OB Trader (Order Block Scalper)

Description
The OB Trader is a lightweight, automated trading system designed to identify and trade Order Block (OB) patterns based on price action. This Expert Advisor (EA) focuses on a specific two-candle formation to detect potential institutional buying or selling pressure. It is optimized for scalping with a built-in 1:1 risk-to-reward ratio.

Trading Strategy
The EA looks for two distinct patterns at the close of every new candle:

Bullish Order Block: Identified when a bearish candle (index 2) is followed by a bullish candle (index 1) that breaks the previous candle's high while maintaining specific structural ratios.

Bearish Order Block: Identified when a bullish candle (index 2) is followed by a bearish candle (index 1) that breaks the previous candle's low under specific structural conditions.

Key Technical Features
New Bar Execution: The logic runs exclusively at the opening of a new candle to prevent repainting and excessive calculations.

Automated Risk Management: * Stop Loss (SL): Automatically set at the high/low of the Order Block candle.

Take Profit (TP): Calculated dynamically using a Risk multiplier to ensure a consistent Reward-to-Risk ratio.

CTrade Integration: Uses the standard MQL5 CTrade class for reliable execution and magic number tracking.

Screenshot

Screenshot1

Grid trading done right – try the robust Grid Expert Advisor for controlled risk. Details here.

Complement community code with advanced automation from RobotFX.

68123

Best MetaTrader Indicators + Profitable Expert Advisors