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 | N Candles v4

The Expert Advisor searches for N identical candlesticks in a row. It buys on bullish candlesticks and sells on bearish ones. The account type is taken into account, i.e. whether it is netting or hedging. The CPositionInfo, CTrade and CSymbolInfo classes are used in the code.

Version 1: N Candles.

Version 2: N Candles v2.

Version 3: N Candles v3.

New in version 4: on netting accounts, the "maximum position volume" parameter is used instead of "maximum number of items".

Inputs

  • N identical candles in a row.
  • Lot.
  • Take Profit (pips).
  • Stop Loss (pips).
  • Trailing Stop ("0" -> not used).
  • Trailing Step (if trailing stop >0).
  • Max positions certain direction (only for the hedging mode).
  • Max position volume (only for the netting mode).
  • Magic.
  • Slippage.

An example of EA operation on a netting account:

MetaTrader Experts, Indicators, Scripts and Libraries

18609

Best MetaTrader Indicators + Profitable Expert Advisors