Backtester Telegram Signals Custom – Complete Setup Guide for Python Parser and MT5 Strategy Tester

Backtester Telegram Signals Custom – Complete Setup Guide for Python Parser and MT5 Strategy Tester

21 September 2026, 10:19
Sergey Batudayev
0
219

Backtester Telegram Signals Custom – Setup Guide

Backtester Telegram Signals Custom uses two separate parts:

1. Python Telegram Parser – reads Telegram messages, recognizes trading signals and exports them to a CSV file.

2. MetaTrader 5 Backtester – reads the generated CSV file inside the MT5 Strategy Tester and controls how those signals are executed, filtered and managed.

This separation is important. Settings related to understanding the Telegram message should normally be configured in the Python Parser. Settings related to trade execution and trade management should be configured in the Expert Advisor.

1. General Workflow

The normal workflow is:

  1. Configure the signal format in the Python Parser.
  2. Test several real messages from the Telegram channel.
  3. Select the Telegram channel and historical period.
  4. Export the parsed history to signals.csv.
  5. Open MetaTrader 5 Strategy Tester.
  6. Select Backtester Telegram Signals Custom.
  7. Set SignalFile to the CSV file created by the Python Parser.
  8. Configure execution and trade management settings.
  9. Run the test.

It is highly recommended to verify parsing before starting a long backtest. If Entry, Symbol, SL or TP is parsed incorrectly, changing trade-management settings in MT5 will not correct the original parsing problem.

2. What Should Be Configured in the Python Parser?

The Python application is responsible for converting normal Telegram messages into structured trading signals.

This is where you configure how your Telegram channel writes its signals.

Keywords

The Keywords section tells the parser which words should be treated as Entry, Stop Loss, Take Profit, Buy, Sell and different trade-management commands.

The main categories are:

  • Entry Point – words placed before the entry price.
  • Stop Loss – words used before the initial SL.
  • New Stop Loss – phrases used when the provider changes SL.
  • Take Profit – words used before TP levels.
  • New Take Profit – phrases used when a TP is changed.
  • Buy / Sell – market-direction keywords.
  • Buy Limit / Sell Limit – pending limit orders.
  • Buy Stop / Sell Stop – pending stop orders.
  • Close TP – commands such as closing a specific TP position.
  • Close Order – general close commands.
  • Cancel Order / Cancel All Pending – pending-order cancellation commands.
  • Breakeven – commands telling the system to move SL to entry.
  • Update SL / Update TP – modification commands.
  • Close Partial / Close Half – partial-close commands.
  • Exception (skip these) – words normally found in reports, summaries or other messages that should not be interpreted as new signals.

Multiple variations can be separated by commas.

For example, if a provider writes:

BUY GOLD 4350
SL 4330
TP1 4370
TP2 4390

the parser must recognize BUY, GOLD, the Entry, SL and TP keywords.

You do not need to add every possible trading word. Configure the parser for the actual format used by the channel you want to test.

Using [X] in Keywords

Some keyword fields support [X] as a variable number.

For example:

TP[X] ->

can be used for messages such as:

TP1 -> 4400
TP2 -> 4420
TP3 -> 4440

This is useful when a signal provider numbers TP or SL modifications.

Symbols

The Symbols tab defines which trading instruments the parser is allowed to recognize.

If you want to test gold signals, for example, make sure the relevant symbol is present.

Typical examples are:

XAUUSD
EURUSD
GBPUSD
BTCUSD

Symbol Mappings

Symbol Mappings are useful when the Telegram channel uses a different name from the standard trading symbol.

For example:

GOLD → XAUUSD
XAU/USD → XAUUSD
XAU USD → XAUUSD

The objective is to normalize different Telegram names into one symbol before the signal reaches the Strategy Tester.

Broker-specific suffixes and prefixes can then be handled later on the MT5 side.

Test Mode

Before downloading a complete channel history, use Test Mode.

Paste several real messages from the channel and check the parsed result.

Pay particular attention to:

Type → Symbol → Entry → Stop Loss → Take Profits

Also test modification messages such as Break Even, Close TP, Update SL and Update TP if the channel uses them.

A parser configuration should be tested with several different message formats from the same channel, not only one ideal signal.

3. Creating the Historical CSV

After the parser configuration is ready, open Backtest Mode - Process Historical Messages.

Select:

Channel – the Telegram channel or group to download.

Start Date / End Date – the historical period you want to test.

Output File – the CSV file that will later be read by MetaTrader.

The easiest configuration is to save the file as:

signals.csv

inside the MetaTrader shared Common\Files directory.

Keeping Skip messages that cannot be parsed enabled is normally recommended. Normal discussion, news, screenshots and other non-signal messages will then not become invalid rows in the testing file.

Press Start Parsing and wait until the required Telegram history has been processed.

4. Signal Time and Broker Time

The Python Parser exports Telegram message time in UTC.

In the Expert Advisor use:

Broker UTC offset (in hours. Negative values allowed)

to align Telegram signal time with the historical time used by your broker.

Example:

If a signal was published at 12:00 UTC but your broker history uses UTC+2, use:

Broker UTC offset = 2

The signal will then be processed at 14:00 broker time during the Strategy Tester run.

This setting is especially important when testing intraday strategies.

5. Connecting the CSV to the Backtester

In MetaTrader 5 Strategy Tester, set SignalFile to the file created by the Python Parser.

For the standard configuration:

SignalFile = signals.csv

If you are testing only one instrument from a CSV containing several symbols, use:

Backtest_only_this_symbol (empty = all)

Example:

XAUUSD

Leave it empty if you want the Backtester to process all supported symbols contained in the file.

Broker Symbol Names

If your broker uses symbols such as:

XAUUSD.m
XAUUSD.pro
m.XAUUSD

use:

Broker symbols prefix
Broker symbols suffix

This is different from Python Symbol Mappings.

Python Symbol Mappings translate the Telegram provider's naming into a normalized symbol.

Broker symbols prefix/suffix adapt that normalized symbol to the broker used for the backtest.

6. Lot and Risk Configuration

The main setting is:

Lot mode

Available modes include fixed lots, dynamic risk, symbol-specific lots, symbol-specific risk and individual lot sizes for TP slots.

For a simple test, use fixed lots together with:

Lot value (if lot mode is fixed)

If several positions are opened from one signal and you want the total calculated lot to be split between them, enable:

Divide lot by TP count

Example:

A calculated lot of 0.03 with three active TP positions can be divided into approximately 0.01 per position, subject to the broker's minimum lot and lot step.

Selecting Specific TP Levels

Use:

Which_TPs_need_copy 1,3 if empty all

to test only selected TP positions.

Examples:

1,3 – use TP1 and TP3.

An empty value means that TP filtering is not applied.

Number of TPs to copy can additionally limit how many available TP levels are processed.

A value of 0 means all available TP levels. A positive value defines the maximum number to use.

7. Signal SL and TP vs Custom SL and TP

Without the Custom Management Engine, the basic settings are:

SL MODE: Signal/Custom
TP MODE: Signal/Custom

Select Signal to use the value extracted from Telegram.

Select Custom to replace it with your own value.

Custom SL and Custom TP are distances from the entry in points.

Signal SL/TP Units

Use:

Unit for Stop Loss (Price/Pips/Points)
Unit for Take Profit (Price/Pips/Points)

according to the format used by the Telegram provider.

Example using Price:

BUY XAUUSD 4300
SL 4280
TP 4340

Example using Points:

BUY XAUUSD
SL 200
TP 400

The correct unit is important because the same number can represent either an absolute market price or a distance from the entry.

Strict SL/TP Validation

The following settings control whether incomplete Telegram signals are accepted:

Reject orders without SL
Reject orders without TP
Require original signal to contain SL and TP before Custom SL/TP

The last option deserves special attention.

If Require original signal to contain SL and TP before Custom SL/TP is enabled, the original Telegram signal must already contain SL and TP even if you later replace them with Custom SL or Custom TP.

If you specifically want to test signals that do not publish SL or TP and supply your own values instead, disable this requirement and configure the rejection settings accordingly.

8. Entry Zones

Telegram providers often publish entry ranges instead of one exact price:

BUY XAUUSD 4300 - 4290

Use:

Entry mode: First/Middle/Second price

to choose which value from the range should be used as the theoretical entry.

First uses the first price.

Middle uses the average of both prices.

Second uses the second price.

If:

Only accept signals within the entry zone = true

the Backtester requires the current market price to be inside the published entry range when the signal is processed.

This setting can create a significant difference in results when testing signal channels that frequently use wide entry zones.

9. Market Execution and Slippage

Force market execution?

When enabled, the Backtester opens the signal using the current market price instead of trying to reproduce the published entry price.

For more realistic testing of channels that publish specific entry levels, it is normally better to keep this disabled.

Maximum slippage for entry price defines how far the market may move from the signal price before special handling is used.

The related setting:

What to do when price exceeds slippage

provides two main choices:

Pending – keep the intended entry as a pending order when appropriate.

Ignore – skip the signal when the allowed deviation has already been exceeded.

Expiration time for pending orders (minutes) controls how long these pending orders remain active. Use a value of at least 11 minutes.

10. Order Management Messages

Enable:

Enable handling of order-related commands

if the Telegram provider publishes follow-up instructions after the original signal.

This allows the backtest to reproduce supported actions such as:

Close TP, Close Order, Cancel Order, Break Even, Update SL, Update TP, Close Partial and Close Half.

Reply-based Telegram commands are especially useful because they can be associated with the original signal message.

Accept Keyword Modifications Without Quoting should normally remain disabled unless the channel regularly sends trade modifications without replying to the original Telegram signal.

11. Custom Management Engine

The Custom version includes an additional management system.

Its main switch is:

Enable custom management engine

When this is disabled, the Backtester uses the standard management logic.

When enabled, the additional settings described below become available.

12. One Trade or Multiple Trades per Signal

Use:

Allow multiple trades per signal

together with:

Max trades to open per signal when enabled

to decide how multi-TP signals are represented.

For example, a signal with TP1, TP2 and TP3 can be tested as three separate positions.

If:

Allow multiple trades per signal = true
Max trades to open per signal when enabled = 3

the system can open one position for TP1, one for TP2 and one for TP3.

If multiple trades are disabled, only one position is opened.

In that case use:

Single trade TP mode

to determine which TP is assigned to the single position.

For explicit testing, First TP or Last TP is preferable to relying on the default selection.

13. Selecting the SL and TP Source in Custom Management

Use signal Stop Loss

When enabled, the system first attempts to use the SL extracted from Telegram.

When disabled, or when the signal SL cannot be used, Custom SL can be used as the fallback.

Use signal Take Profit

does the same for TP.

If signal TP is disabled and no custom TP ladder is active, Custom TP can be used instead.

14. Custom TP1..TP6 Ladder

For more advanced testing enable:

Use Custom TP1..TP6 Ladder instead of signal TP

You can then define:

Custom TP1
Custom TP2
Custom TP3
Custom TP4
Custom TP5
Custom TP6

Only levels greater than zero are used.

This feature is different from the standard Custom TP setting.

Custom TP is a single TP distance.

Custom TP1..TP6 Ladder creates an entire sequence of TP levels.

The ladder uses the setting:

Unit for Take Profit (Price/Pips/Points)

For example, if you want the custom ladder to represent distances in points:

Unit for Take Profit = Points
Custom TP1 = 100
Custom TP2 = 200
Custom TP3 = 300

The resulting levels will be calculated 100, 200 and 300 points from the entry price.

15. Break Even in Custom Management

Use:

Break Even trigger points

to define how far the trade must move into profit before the SL is moved to Break Even.

Use:

Break Even offset points

to move SL slightly beyond the original entry.

Example:

Break Even trigger points = 100
Break Even offset points = 20

After the position reaches +100 points, SL is moved to entry plus 20 points for a Buy trade or entry minus 20 points for a Sell trade.

Set the offset to 0 if you want exact Break Even.

16. TP-Level Management / Milestone Mode

Enable:

Use TP levels as SL management milestones

when you want multiple TP levels to manage one position rather than opening a separate position for each TP.

A typical configuration is:

Enable custom management engine = true
Allow multiple trades per signal = false
Single trade TP mode = Last TP
Use TP levels as SL management milestones = true

The logic then works as follows:

TP1 reached → SL moves to Entry

TP2 reached → SL moves to TP1

TP3 reached → SL moves to TP2

TP4 reached → SL moves to TP3

and so on.

The final TP can remain the last target while the earlier targets are used as protection milestones.

The milestone levels can come directly from the Telegram signal or from the Custom TP1..TP6 Ladder.

Milestones from Telegram TP Levels

Use:

Use signal Take Profit = true
Use Custom TP1..TP6 Ladder instead of signal TP = false

The Telegram TP1, TP2, TP3, etc. become the management levels.

Milestones from Custom TP Levels

Use:

Use Custom TP1..TP6 Ladder instead of signal TP = true

and configure your own TP1..TP6 values.

This is useful for comparing the same management model across different Telegram channels regardless of how their original TP structure was published.

17. Custom Trigger Step Trailing

The Custom Engine can also use several profit zones with different trailing distances.

Each pair consists of:

Trigger level 1 + Trigger step 1
Trigger level 2 + Trigger step 2
... up to level 10.

Trigger level is the amount of profit, in points, required to activate that stage.

Trigger step is the distance, in points, that SL should trail behind the current price once that stage is active.

Example:

Trigger level 1 = 100
Trigger step 1 = 80

Trigger level 2 = 200
Trigger step 2 = 50

Trigger level 3 = 300
Trigger step 3 = 30

After +100 points the position begins trailing 80 points behind the current price.

After +200 points the trailing distance changes to 50 points.

After +300 points it changes to 30 points.

Trigger levels should be entered in increasing order.

Unused levels can simply remain at 0.

Step Trailing Without Break Even

Enable:

Step trailing only without Break Even

when you want only the custom trigger trailing system and do not want the separate Break Even trigger to be applied first.

When it is disabled, Break Even and custom step trailing can be combined.

If Use TP levels as SL management milestones is enabled, TP milestone management takes priority over custom trigger trailing.

18. FXGDP 2-Day Rule

Enable:

Use FXGDP 2-day rule

to activate the additional time-based management model.

The rule uses the original Telegram signal time and tracks the trade until the end of the following working day.

Weekends are skipped.

If TP1 is reached before the timeout, the trade can be protected by moving SL to the entry price.

The recommended setting is:

Use automatic FXGDP timeout logic by trade state = true

At the timeout, the system evaluates the current position state.

If the position is around the entry price, it is closed.

If the position is in profit, SL is moved to entry.

If the position is in loss, TP is moved to entry.

Use:

Points to treat trade as at or near entry

to define the tolerance around the entry price.

Example:

Points to treat trade as at or near entry = 50

means the trade can be considered approximately at entry while it remains within 50 points of its opening price.

Manual Timeout Action

If:

Use automatic FXGDP timeout logic by trade state = false

the setting:

Legacy timeout action when automatic state logic is disabled

defines one fixed action for the timeout.

The available choices are closing the trade, moving SL to entry or moving TP to entry.

Additional FXGDP Filters

Block new trades for same signal after TP1

can be used to prevent additional entries connected to the same Telegram signal after TP1 has already been reached.

Do not open trade if TP1 already reached before entry

can prevent a delayed entry when the market has already reached the first target before the original entry condition was filled.

These settings are useful when testing signals where the provider may send several updates or where an entry remains pending for a long time.

Use test timeout override instead of FXGDP 2-day rule and Test timeout in minutes are intended mainly for quickly testing the timeout behavior. They should normally remain disabled for a normal historical backtest.

19. Choosing a Management Configuration

Standard Telegram Signal

Use the original Entry, SL and TP exactly as published by the provider.

Enable custom management engine = false
SL MODE = Signal
TP MODE = Signal

One Position to the Last TP

Enable custom management engine = true
Allow multiple trades per signal = false
Use signal Stop Loss = true
Use signal Take Profit = true
Single trade TP mode = Last TP

One Position per TP

Enable custom management engine = true
Allow multiple trades per signal = true
Max trades to open per signal = required number
Use signal Stop Loss = true
Use signal Take Profit = true

One Position with TP Milestones

Enable custom management engine = true
Allow multiple trades per signal = false
Single trade TP mode = Last TP
Use TP levels as SL management milestones = true

Custom TP Ladder in Points

Enable custom management engine = true
Use Custom TP1..TP6 Ladder instead of signal TP = true
Unit for Take Profit = Points

Then configure Custom TP1, TP2, TP3 and any additional required levels.

Break Even + Step Trailing

Enable custom management engine = true
Break Even trigger points = required value
Break Even offset points = required value
Step trailing only without Break Even = false

Then configure Trigger level / Trigger step pairs.

20. Risk and Time Filters

Account-level protection is configured entirely inside the Expert Advisor, not in the Python Parser.

The Backtester includes daily trade limits, daily loss limits, weekly and monthly loss limits, Percentage/Currency control modes and trading-time filters.

These settings can be applied after the basic parsing and signal execution configuration has been verified.

For clean strategy comparison, it is usually better to first confirm that the signals themselves are reproduced correctly and only then enable additional account-level restrictions.

21. Recommended Testing Procedure

When configuring a new Telegram channel, avoid enabling every function at once.

Start with a simple configuration and compare the result with several original Telegram messages.

First verify:

Parsing → Signal time → Symbol → Entry → SL → TP

Then test multi-TP execution.

After that test Break Even, trailing or milestone management separately.

Finally add FXGDP rules, risk limits and time filters.

This makes it much easier to understand why a specific trade was opened, skipped, modified or closed.

22. Debugging

If you need more information during testing, enable:

Print flexible engine debug logs

This adds additional Custom Engine information to the Strategy Tester log.

It is useful when checking TP selection, Custom TP ladders, Break Even, milestone transitions, FXGDP management or custom trigger trailing.

For normal finished backtests this option can remain disabled.

Conclusion

The most important concept when using Backtester Telegram Signals Custom is to keep parsing and execution configuration separate.

Python Parser: defines how Telegram messages are understood.

MT5 Backtester: defines how those parsed signals are executed and managed.

If a symbol, Entry, SL or TP is not recognized correctly, correct the Python Parser first.

If the signal is recognized correctly but you want to change lot size, Entry behavior, TP selection, Break Even, trailing, milestone management, FXGDP rules or account protection, configure those settings inside the Expert Advisor.

This approach makes it possible to use the same Telegram history to compare different execution and trade-management models without changing the original signals.

This article was created with the help of AI and may contain errors.

Backtester Telegram Signals Custom:
https://www.mql5.com/en/market/product/172677