Skip to main content
Version: 3.0

Example R2: Parameter forwarding and feedback parsing with custom indicator and external Python script

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 demonstrates parameter forwarding between MetaTrader and Python with feedback parsing. Three parameters are sent to the Python script which processes them and returns calculated values. The feedback system displays both sent parameters and received results for complete transparency.

Bidirectional communication enables dynamic strategy adjustment based on external calculations. Python scripts can access databases, web services, or complex models, returning optimized parameters for trading. The 100-bar symbol series provides market context for external processing.

This sophisticated integration represents the future of algorithmic trading where multiple systems collaborate. Traditional indicators combine with modern data processing for superior strategy development.

caution

This example requires an external indicator and an additional Python script. Please download, compile, and use the files listed below. Ensure the paths are correctly configured and the Python script is running during execution.

MQL 4 indicator example code: MyExternalIndicator.mq4

MQL 5 indicator example code: MyExternalIndicator.mq5

Python example script: MyExternalIndicatorGenerator.py

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 signals only drawn
  • General signal visualization = Off

Signal Generation - CUS - Custom indicator

  • Signal in use = On
  • Signal used for = Entry
  • Selected indicator = CUS - Custom indicator
  • Custom parameter 1 = 1.00000000
  • Custom parameter 2 = 2.00000000
  • Custom parameter 3 = 3.00000000
  • MetaTrader4 path to indicator file = \FEA Trading\MT4\MyExternalIndicator.ex4
  • MetaTrader5 path to indicator file = FEA Trading\MT5\MyExternalIndicator
  • Draw in chart = On
  • Drawing slot = 1

Data Feedback

  • Symbol series bars current = On
  • Symbol series bars completed = On
  • Symbol series M1 = Off
  • Symbol series M5 = Off
  • Symbol series M15 = On
  • Symbol series M15 range = 100
  • Symbol series M30 = Off
  • Symbol series H1 = Off
  • Symbol series H4 = Off
  • Symbol series D1 = Off
  • Symbol series W1 = Off
  • Symbol series MN = Off

Screenshots

Example R2: Parameter forwarding and feedback parsing with custom indicator and external Python script.webp
Example R2: Parameter forwarding and feedback parsing with custom indicator and external Python script.webp