Skip to main content
Version: 3.0

Example M1: Indicator value for volume calculation with external indicator

caution

This is not a ready-to-use trading strategy. A trading strategy requires adjustment to the timeframe and symbol, along with thorough backtesting. The example is intended as a foundation for your own custom strategy and to help you get familiar with the Expert Advisor Builder web application. To import and use an example, please follow the instructions provided here.

Description

This example integrates external volume calculations through custom indicators, demonstrating advanced integration capabilities. The external MyExternalVolume indicator provides volume calculations beyond standard options. This flexibility allows proprietary algorithms while using external risk management.

Custom indicators must be properly installed in MetaTrader's indicator folder with correct paths specified. The system forwards calculated values for position sizing, creating dynamic volume management based on custom logic. This bridges proprietary methods with systematic execution.

External integration enables unlimited strategy sophistication. Traders can implement complex mathematical models, machine learning outputs, or proprietary calculations while leveraging the framework's trade management capabilities.

caution

To run this example, you'll need an external indicator. Just download, compile, and use the files listed below.

MQL 4 indicator example code: MyExternalVolume.mq4

MQL 5 indicator example code: MyExternalVolume.mq5

Recreate the Example

You can either import this example directly or set it up manually. To manually replicate the trading module, make sure a newly added module includes the following key settings and that the professional mode is activated:

Trade Basics

  • Operation type = Long

Signal Generation - Indicators - STD

  • Signal in use = On
  • Signal used for = Forward
  • Selected indicator = STD
  • Draw in chart = Off
  • Forward adjustment = 3.50

Signal Generation - Indicators (MACD Main line)

  • Signal in use = On
  • Signal used for = Entry
  • Selected indicator = MACD
  • Line index = Main line
  • Draw in chart = On
  • Drawing slot = 1

Signal Generation - Indicators (MACD Signal line)

  • Signal in use = On
  • Signal used for = Entry
  • Selected indicator = MACD
  • Line index = Signal line
  • Draw in chart = On
  • Drawing slot = 2

Signal Generation - CUS - Custom oscillator

  • Signal in use = On
  • Signal used for = Forward
  • Selected indicator = CUS - Custom oscillator
  • MetaTrader4 path to indicator file = \FEA Trading\MT4\MyExternalVolume.ex4
  • MetaTrader5 path to indicator file = FEA Trading\MT5\MyExternalVolume
  • Draw in chart = On
  • Drawing slot = 3

Signal Generation - Indicator Combinations (MACD Main line & MACD Signal line)

  • Signal in use = On
  • Signal used for = Entry
  • Input indicator 1 = MACD (Main line)
  • Input indicator 2 = MACD (Signal line)
  • Value relation = Value 1 cross value 2

Signal Generation - News

  • Selection = Indicator
  • Used indicator = STD

Signal Generation - News

  • Selection = Risk ratio
  • Risk ratio = 1.40

Signal Generation - News

  • Volume calculation method = Indicator value
  • Used indicator = CUS

Screenshots

Example M1: Indicator value for volume calculation with external indicator.webp