|

How to optimize an Automated trading system?

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.

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

Methods and results

1. Backtesting with default setting

Figure1. Backtesting of USDJPY Periodical Analysis

Annual trading summary

Chart

Figure 2. Backtesting of USDJPY Equity curve Close to Close

Chart

2. Optimization 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 GraphPa d Prism 8.0.

2.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.

2.2 Optimization results

2.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

Chart

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

2.2.2 The 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

 
Chart

Discussion

In Tendency Forex System, all the indicators are essentially using default settings. To our knowledge, over optimization is a major issue 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.

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.

Free Trade Copy is available in FCA, Cysec, FINMA regulated Brokers.The Investor Compensation Fund is up to £85k, €20k, CHF 100k respectively.

Author

Yue Wang

Yue Wang

LinoCapital

Master's Degree in Hepatobiliary Surgery. 

More from Yue Wang
Share:

Editor's Picks

XRP pullback tests $1.40 support amid Ripple Prime product suite expansion

Ripple extends lock-step trading for the third straight day on Friday, as support at $1.40 comes under pressure. The remittance token has remained largely in defense mode since last week’s 72% rally from $1.00 to highs around $1.70.

Crypto Today: Bitcoin, Ethereum, XRP rally loses steam despite steady ETF inflows

Bitcoin is back below $80,000 at the time of writing on Friday, after a second attempt at breaking resistance between $81,000 and $82,000. Meanwhile, Ethereum and Ripple mirror Bitcoin’s cooling trend, with ETH sliding to $2,500 and XRP falling toward $1.40 support.

Bitcoin Weekly Forecast: Billions in ETF inflows push BTC toward decisive breakout

Bitcoin rises over 2% this week, holding near $80,000 after testing the 50-week SMA at $81,114. US-listed spot Bitcoin ETFs are on track for a second straight week of billion-dollar inflows, with $1.13 billion recorded through Thursday.

Hyperliquid Price Forecast: HYPE rally stretches thin amid treasury growth, CFTC innovation push

Hyperliquid (HYPE) is down 2% on Friday after reaching a record high of 86.75 the previous day. Nasdaq-listed Hyperliquid Strategies Inc (PURR) raised almost $650 million in an equity deal to increase its HYPE holding to 29.3 million tokens.

Bitcoin: Billions in ETF inflows push BTC toward decisive breakout
Bitcoin (BTC) extends gains so far this week, trading near $80,000 after testing the 50-week Simple Moving Average (SMA) at $81,114 earlier. Strong institutional demand is supporting the rally, with spot BTC Exchange Traded Funds (ETFs) on track to record a second consecutive week of billion-dollar inflows.