Monday, June 5, 2023
HomeForexUltimate Trailing Stop EA: Importing and Backtesting/Optimizing Signal History - Other -...

Ultimate Trailing Stop EA: Importing and Backtesting/Optimizing Signal History – Other – 19 November 2022


Because Ultimate Trailing Stop EA (UTS) is great at managing one’s exits with 16 trailing stop methods, it can also be extremely useful to apply any of these methods to a subscribed signal, in order to enhance it. 

To this end, we built an advanced signal analysis tool within UTS so that you can import, backtest and optimize any trailing stop configuration on historical signal data, so long as it is in csv format (ex: MQL5 or Myfxbook signals).

This feature presents a more objective way to determine the ideal settings for the system you are interested in enhancing with your trailing stop.

You just need to download the CSV signal history, drop it into the Tester > Files directory, and configure the inputs below. 



  • Report CSV files    You need to indicate the name of the history file that you have dropped into DataFolder > Tester > Files folder.
    For example, Report CSV Files=HeroSP500.csv
  • Code Page (Dropdown)   ANSI | UTF7 | UTF8

    Different signalhistory.csv will have downloaded in different csv formats, and Code Page allows you to correct for that peculiar csv format. 

  • Data separator  You need to indicate the primary separator format of the signalname.csv file.

    For MQL5 signalhistory.csv, use ; (semi-colon), so that Data Separator=; 
    For Myfxbook signalhistory.csv, use . (period), so that Data Separator=.

  • Hour adjustment   You need to indicate make the hourly adjustment if your broker is different from history file broker.  For example, if signalname.csv is derived from a broker with GMT=1, and your broker had a GMT=3, you indicate Hour Adjustment=2
  • Date format  — You need to indicate the date format of the signalhistory.csv file.

    For MQL5 signalhistory.csv, use yyyy/mm/dd, so that Date format=yyyy/mm/dd
    For Myfxbook signalhistory.csv, use mm/dd/yyyy, so that Date format=mm/dd/yyyy

  • Date Separator   You need to indicate the date separator of the csv file.

    For MQL5 signalhistory.csv, use . (period), so that Date separator=.
    For Myfxbook signalhistory.csv, use / (forward slash), so that Date separator=/

  • Symbol to use  You need to indicate the symbol to perform the test upon. For example, Symbol to use=SPX500

Steps to Import MQL5 Signal History in Strategy Tester. 

  1. On selected MQL5 signal, click on Trade History tab.  
  2. Scroll down to the bottom of the trade history and left click on Export to CSV: History 
  3. SignalHistory.csv will download to your computer with something like 7digits.history.csv (ex.1731202.history.csv). You might want to right click and rename this file to signalname.csv (ex. HeroSP500.csv)
  4. Copy and paste the signalname.csv file into your DataFolder > Tester > Files folder. To get to this folder, click on File > Open Data Folder > Tester > Files


  5. In Strategy Tester (View > Strategy Tester or Ctr+R), load Ultimate Trailing Stop EA and open up UTS inputs, and scroll down to the last input section.
  6. Report CSV Files input, you indicate the exact name of the file (ex. Report CSV Files=HeroSP500.csv)
  7. Keep CodePage=ANSI; 
  8. You DO NOT need to adjust the following defaults (as they already work with MQL5 signals): 

    Data Separator=; 
    Date Format=yyyy/mm/dd
    Date Separator=/

  9.  You can adjust the hour adjustment to match your broker GMT time, if different from file broker. For example, if signalname.csv is derived from a broker with GMT=1, and your broker had a GMT=3, you indicate Hour Adjustment=2
  10. You can indicate Symbol to Use with the symbol you are using. In my case, I will implement Symbol to Use=SPX500
  11. You can keep or remove the defaults to Preserve Original SL/TP/Close:

    Preserve Original SL=true
    Preserve Original TP=true
    Preserve Original Close=true

Backtesting Signal History

After configuring your signalhistory.csv file within the inputs of UTS in Strategy Tester, it is time to backtest the signal history without any trailing stop configurations. 

Here are the steps I take: 

1. Make sure you have downloaded enough 1 minute data for your selected symbol. 

For instance, I am wanting to backtest HeroSP500.csv on SPX500 (Darwinex SP500 symbol). Since the signal has trade history from March-1-2022 till Nov-17-2022, I want to make sure I have at least that much data loaded in MT4. To do so, I use a tool like Quant Data Manager (free with ads or $49 lifetime) to download 1 minute SP500 data from Dukascopy. 

3. I then use Period Converter.mq4 script to turn that 1 minute data into M5, M15, M30 and H1. 

4. I then prepare Strategy Tester settings.

Expert: Ultimate Trailing Stop EA

Symbol: The symbol you want to test for. In my case, it is SPX500.

Model: It is advised to use Model=EveryTick. However, it can be much faster to test on Mode=Open Prices Only if your strategy uses open prices.

Use Date: Adjust date to the range of the signalhistory.csv. In my case, it is from March 1, 2022 to Nov 18, 2022. 

Period: Your preferred timeframe period. I prefer something low, like M1 or M5 or M15, to get more accurate results. 

4. Very important. Disable the trailing stops of UTS by putting threshold out of reach, such as Threshold in Pips or ATR=1000. At this point, you want to get one backtest that matches your downloaded signal history, in order to establish a baseline performance. When you have the baseline performance, you can then put threshold back in reach and optimize different trailing stops in the Optimization stage. 

5. Run Strategy Tester by pressing Start Button. 

6. Verify that the Results more or less match your signal results. Below is my Hero SP500 signal results: 

In my case, the above results approximately match my trade signal history for the last 9 months for Hero SP500

As noted in the backtest, my signal’s baseline performance is: $781, 1.31 PF (176 trades), -435 DD, 4.44 Payoff.

This baseline performance is good, but I want better.

My goal is to see if I can increase returns and reduce draw downs. 

With this baseline performance on hand, I can see if adding an optimized trailing stop to my signal will increase its baseline performance. 

Optimizing Signal History: Example: Period/Multiplier of Chandelier Exit and Threshold in ATR

Ideally, one ought to test out all 16 trailing stops of Ultimate Trailing Stop EA to see which one improves the baseline performance. 

In my case, I have tried every one and discovered that Chandelier Exit has the most promise. 

After selecting Trailing Stop Method=Chandelier Exit, I am going to optimize three parameters in two steps:

  1. Chandelier ATR Period and Chandelier Multiplier.
  2. Threshold in ATR. 


The key to any optimization is to figure out what parameters have the most impact. Knowing enough about Chandelier Exit, I think that the most impact comes from Chandelier ATR Period and Multiplier. I will keep the defaults on Chandelier Range (7), Shift (1), and Show Channel (true). 

I will optimize:

Chandelier ATR Period from 10 to 40, in step of 5


Chandelier Multiplier from 3 to 6, in step of 0.5

When I click on Optimize button, I get the following result: 

As you can see, I discovered that Chandelier Period=30 and Chandelier ATR Multiplier=5.5 show the best result. 

If I apply this optimization result, my signal has increased in performance from:


$781, 1.31 PF (176 trades), -435 DD, 4.44 Payoff. 


Best Outcome of Optimization#1: Chandelier Period=30 and Chandelier ATR Exit=5.5:

$855, 1.45 (176 trades), -283 DD, 4.86 Payoff. 🚀🚀

Optimization#1 improves returns by 9.5% and DD by by 35%. 

I make sure to input these newly optimized values into these two parameters. I then deselect the checkmarks for these two boxes and proceed to the next optimization. 


The next optimization I will conduct is on threshold.

Since I am using a CFD contract, I know I will get the more impact of out of Threshold in ATR than Threshold in pips. 

Once I indicate Threshold in pips or ATR=ATR, I will optimize: 

Threshold in ATR from 0 to 5, in step of 0.5

When I click Optimize, I get the following result: 

As you can see, the best outcome is Threshold in ATR=2.

If I apply both optimizations, my signal has increased in performance from: 


$781, 1.31 PF (176 trades), -435 DD, 4.44 Payoff. 


Best Outcome of Optimization#1: Chandelier Period=30 and Chandelier ATR Exit=5.5:

$855, 1.45 (176 trades), -283 DD, 4.86 Payoff. 🚀🚀


Best Outcome of Optimization#2: Threshold in ATR=2.0:  

$1224, 1.59 (176 trades), -312 DD, 6.96 Payoff. 🚀🚀🚀

Compared to baseline, optimization#2 (which builds on optimization#1) increases return by 56% and decreases draw down by 28%. This is very promising. 

Here is the results in Strategy Tester: 

Now I can apply Ultimate Trailing Stop EA with the new .set file to my Darwinex MT4.

I’m confident that I elevated my EA/Signal by this optimized Chandelier Exit trailing stop facelift. 😃😃

Now you can do the same for any of your subscribed signals, or any you are considering to subscribe to.  

✅ Links
🌐 Ultimate Trailing Stop EA >>

🌐 Ultimate Trailing Stop EA >>

🌐 Ultimate Trailing Stop EA Free (15-day Trial) >> Download

🌐 Ultimate Trailing Stop EA Demo (restricted to AUDJPY, USDJPY, USDCAD, NZDUSD) >>

🌐 Ultimate Trailing Stop EA MT5 Free (15-day Trial) >>  Download

You can ask any questions about the work of the program in private messages on mql5 website or in Telegram or on my Telegram Group



Please enter your comment!
Please enter your name here

Most Popular

Recent Comments