Download MetaTrader 5

Watch how to download trading robots for free

Interesting script?
So post a link to it -
let others appraise it

You liked the script? Try it in the MetaTrader 5 terminal

2011.06.13 13:55

The class of a module of trade signals, on "inner bar breakthrough" in trend direction - library for MetaTrader 5

| English Русский 中文 Español Deutsch 日本語 Português

votes: 19

The MQL5 Wizard provides an opportunity to create a strategy using different modules. For example, the main module can be written by developer, the other modules (money management, trailing stop) can be developed by other programmers.

The strategy, implemented in this module is following: when outside bar appears, it checks the fact of the inner bar breakthrough in trend direction and generates a signal to open position. The outside (outer) bar is the bar with High price, greater than High of the previous bar and Low, lower than Low price of the previous bar. The "breakthrough" means the extremum crossover of the inner bar.

The trend direction depends on the color of the outer bar. Position is opened after completion of the bar with a signal.

Example of a signal to open a long position:

Description of signals

Description of signals

To use the module, copy innerbarsignal.mqh to the MQL5\Include\Expert\Signal\Mysignal.

After restart of the MetaEditor, the module will appear:

Module of trade signals in MQL5 Wizard

Module of trade signals in MQL5 Wizard

History backtesting results (EURUSD ,D1, 2010-2011):

Testing results

Testing results

Input parameters:

  • TakeProfit = 300;
  • StopLoss = 300;
  • Trailing Stop = 100.

Translated from Russian by MetaQuotes Software Corp.
Original code:

Accelerator Oscillator (AC) Accelerator Oscillator (AC)

The Acceleration/Deceleration Indicator (AC) measures acceleration and deceleration of the current driving force.

Average Directional Movement Index (ADX) Average Directional Movement Index (ADX)

The Average Directional Movement Index Indicator (ADX) helps to determine if there is a price trend.

Example of MACD Automated Example of MACD Automated

Code example of MACD automated with advanced money management function.

Pivot Star Pivot Star

Pivot indicator. Standard, Fibonacci, Camarilla, Woody's, Demark. Calculates pivot points from previous bar of chosen period (M5 - MN).