Sign In Password Login

Find passwordVerification code will be sent to your phone

Set your new password

Bind mobile phone numberVerification code will be sent to your phone

+86

Send code
60s
Send code
60s

Create an account

Login
Submit

I have read and agreed User Agreement , Privacy Policy

Other login methods

User Agreement

Confirm

Privacy Policy

Confirm

How to optimize an Automated trading system?

Put on your headphones and enjoy podcast ~!
The optimization of a trading system has been the consensus of programmers for a long time. 
A lot of software provide optimization function. However, we could not only focus on the higher profit after optimization. More scientific and systematic method is needed.
This article gives a brief introduction.

1.Sample and Setting

(1) Tendency Forex System: Coded with JavaScript, no repaint, no Grid, no Martingale. Works on 240-minute timeframe for USDJPY, EURUSD and USD Index.
(2)Historical Data Feed: eSignal charting system
(3)Period: From Jan. 2010 to Oct. 2020
(4)Initial Virtual Balance: $100k
(5)Contract Size: Fixed 1 standard lot per trade
(6)SPSS 24.0
(7)GraphPad Prism 8.0

2.Methods and Results

(1) Backtesting with default setting
Figure 1. Backtesting of USDJPY-- Periodical Analysis
Figure 2. Backtesting of USDJPY-- Equity curve ( Close to Close )

3. Optimization

We compared the optimization results of Tendency Forex System, SPSS 24.0 was used for statistical analysis. Studies’ parameters were displayed as Mean ± SD (Standard Deviation) for continuous variables. The comparison between the two groups was performed by t test. The comparison between multiple groups was performed by variance analysis and Dunnett's t test. A P value <0.05 was considered statistically significant for all analysis. The statistical charts were drawn by GraphPad Prism 8.0.
3.1 Optimization was done year by year
Tendency Forex System was optimized with the historical data from 2010 to 2015 and got the "optimized setting for 2016", then calculated the total net profit in 2016 with the "optimized setting 2016";
Tendency Forex System was optimized with the historical data from 2010 to 2016 and got the "optimized setting for 2017", then calculated the total net profit in 2017 with the "optimized setting 2017";
And so on.
3.2  Optimization results:
3.2.1 After optimization, the overall return was increased by at least 10% compared to the results of the default setting. It shows the optimization method is very effective. The details can be seen in Table 1(omitted).
However, in the variance analysis on the Average Annualized Return, there was no statistically significant among multiple groups. ( F=0.218, P=0.953>0.05 ) The details can be seen in Table 2(omitted).
Figure 3. Variance Analysis of the Average Annualized Return
In theory, pairwise comparisons are only necessary if there is s statistical difference in variance analysis. However, for rigorous purpose, a Dunnett's t test was done with one group ( Default setting ) as a control group and compared all the other groups to it. All the Significance was higher than 0.05, further confirmed there was no statistically significant among multiple groups. The details can be seen in Table 3(omitted).
3.2.2The annualized net profit of 2016, 2017, 2018, 2019, and 2020 was calculated with the optimized settings. Compared with the default setting, although the annualized return in 2016 was significantly higher, the overall profit was reduced by nearly 30%. The details can be seen in Table 4(omitted).
However, in the t test of the Average Annualized Return, there was no statistically significant between the two groups. ( t= 0.706, p=0.500 > 0.05) The details can be seen in Table 5(omitted).
Figure 4. t test of the Average Annualized Return of Default setting and Optimized setting

4.Discussion

In Tendency Forex System, all the indicators are essentially using default settings. To our knowledge, over optimization is a majorissue with most Algos, which can lead them to show excellent performance in the backtesting but then fail to work well in live forward trading.
Too much data mining may be the problem. It more-or-less gets some results - for example the 50-period Moving Average may be more sensitive for symbol A than symbol B - but when you move from backtesting to a live forward test, this kind of system generally will not work. According to the statistical analysis,there is no value in optimizing the Tendency Forex System further.

5.Conclusion

To optimize an automated trading system, there are three essential things which should be kept in mind: 
(1)Fully understand its core logic and all the indicators included.
(2)The quality of historical data feed: the higher the better. 
(3)Statistical analysis method must be used to measure the optimization result. 
(by Brian)

Comments

Post comment after logging in
0/500
Comments

Short Comments

  • I am using an automated trading system, which is sometimes limited. I am planning to optimize it. This article is a good reference.

    Reply
    0/500
  • The automatic trading system needs to be updated and optimized regularly according to market changes. The article is very practical!

    Reply
    0/500
  • This article is very in-depth, and the technical content is quite high, so there are more good articles of this kind.

    Reply
    0/500

Short Comments

No comments yet, comment now

I want to contribute

ForexSoul - An online magazine for forex traders

Podcast of quality content assists your trading journey

Current Issue(Total of 10 articles)

HottestNext

Feedback

We value your suggestions

  • Select your problem

  • Content(0/200)

  • Contact

  • Submit

Add website to favorites

Quality content to hone your trading skills!

Add to favorites