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 | TwoBarsComparison

Idea by: Dmitriy.

MQL5 code by: Vladimir Karputov.

the EA compares the opening prices (Open) of bar#0 and bar#2:

MetaTrader Experts, Indicators, Scripts and Libraries

Inputs

  • Stop Loss (in pips) - Stop Loss;
  • Take Profit (in pips) - Take Profit;
  • Trailing Stop (in pips) - trailing;
  • Trailing Step (in pips) - trailing step;
  • Breakeven - breakeven;
  • Breakeven Profit - profit for breakeven;
  • Lots (or "Lots">0 and "Risk"==0 or "Lots"==0 and "Risk">0) - position volume (for manual defining);
  • Risk (or "Lots">0 and "Risk"==0 or "Lots"==0 and "Risk">0) - risk per trade as percent of free margin;
  • magic number - unique identifier of the EA.

Test results in the "Every tick" mode for all symbols on D1:

MetaTrader Experts, Indicators, Scripts and Libraries

20635

Best MetaTrader Indicators + Profitable Expert Advisors