If you're looking to boost your trading game, the N-Candles Expert Advisor (EA) for MetaTrader 5 is a fantastic tool to consider. This EA identifies a sequence of identical candlesticks and makes trades based on their patterns. It buys on bullish candles and sells on bearish ones, all while checking if your account is set to netting or hedging.
This code leverages various trade classes, including CPositionInfo, CTrade, CSymbolInfo, and CAccountInfo.
-
Version 1: Check out the original N Candles.
Here’s a quick look at how it works with N=3:

-
Version 2: Discover what's new in N-Candles v2: Introduced parameters for "Take Profit," "Stop Loss," and "Trailing".
-
Version 3: Get the details on N-Candles v3, which added the "Maximum amount of one-direction positions" parameter.
-
Version 4: Explore N-Candles v4, where the "maximum number of positions" parameter was replaced with "maximum position volume" for netting accounts.
-
Version 5: Find out about N-Candles v5, which introduced a new "Working time" parameter.
-
Version 6: Check out N-Candles v6, featuring the new "Black sheep" parameter.
What's New in Version 7
Version 7 brings an exciting update: you can now close positions once a profit level, defined by the Closing of positions at achievement of the general profit, is reached.
Inputs
- N identical candles which go in a row - defines the number of identical candlesticks needed;
- Lot - the volume of the position to open;
- Take Profit - sets the Take Profit; if this value is "0", it won't be used;
- Stop Loss - sets the Stop Loss; if this value is "0", it won't be used;
- Trailing Stop - enables Trailing Stop; if this value is "0", it won't be used;
- Trailing Step - sets the trailing step; if this value is "0", it won't be used;
- Max positions certain direction (only for hedging) - maximum number of one-direction positions (for hedging only);
- Max position volume (only for netting) - maximum volume of open positions (for netting only);
- Use trade hours - toggle the "working time" parameter on or off;
- Start hour - sets the trading start hour;
- End hour - sets the trading end hour;
- Closing of positions at achievement of the general profit - close all positions when profit level is met (in monetary terms);
- Magic number - a unique identifier for the EA;
- The type of closure at the meeting of the "black sheep" - specifies the closing type for the "black sheep".
With these updates, N-Candles v7 is set to enhance your trading experience. Dive in and see how it can work for you!
Related Posts
- Harnessing MQL5 Wizard for Trading Signals: 3 Black Crows & 3 White Soldiers with MFI
- Creating a Stochastic-Based EA for Hammer and Hanging Man Patterns in MetaTrader 5
- Mastering Bullish and Bearish Harami Patterns with Stochastic in MT5
- Mastering Trading Signals with MQL5 Wizard: Bullish and Bearish Engulfing Strategies
- Creating an Expert Advisor for Dark Cloud Cover and Piercing Line Patterns with CCI Confirmation