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
Figure 2. Backtesting of USDJPY Equity curve Close to Close
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
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
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.
CFDs are complex instruments and come with a high risk of losing money rapidly due to leverage. 79.9% of retail investor accounts lose money when trading CFDs with this provider. You should consider whether you understand how CFDs work and whether you can afford to take the high risk of losing your money.
Editors’ Picks
USD/JPY holds above 155.50 ahead of BoJ policy announcement
USD/JPY is trading tightly above 155.50, off multi-year highs ahead of the BoJ policy announcement. The Yen draws support from higher Japanese bond yields even as the Tokyo CPI inflation cooled more than expected.
AUD/USD extends gains toward 0.6550 after Australian PPI data
AUD/USD is extending gains toward 0.6550 in Asian trading on Friday. The pair capitalizes on an annual increase in Australian PPI data. Meanwhile, a softer US Dollar and improving market mood also underpin the Aussie ahead of the US PCE inflation data.
Gold soars as US economic woes and inflation fears grip investors
Gold prices advanced modestly during Thursday’s North American session, gaining more than 0.5% following the release of crucial economic data from the United States. GDP figures for the first quarter of 2024 missed estimates, increasing speculation that the US Fed could lower borrowing costs.
Stripe looks to bring back crypto payments as stablecoin market cap hits all-time high
Stripe announced on Thursday that it would add support for USDC stablecoin, as the stablecoin market exploded in March, according to reports by Cryptocompare.
Bank of Japan expected to keep interest rates on hold after landmark hike
The Bank of Japan is set to leave its short-term rate target unchanged in the range between 0% and 0.1% on Friday, following the conclusion of its two-day monetary policy review meeting for April. The BoJ will announce its decision on Friday at around 3:00 GMT.
RECOMMENDED LESSONS
Making money in forex is easy if you know how the bankers trade!
Discover how to make money in forex is easy if you know how the bankers trade!
5 Forex News Events You Need To Know
In the fast moving world of currency markets, it is extremely important for new traders to know the list of important forex news...
Top 10 Chart Patterns Every Trader Should Know
Chart patterns are one of the most effective trading tools for a trader. They are pure price-action, and form on the basis of underlying buying and...
7 Ways to Avoid Forex Scams
The forex industry is recently seeing more and more scams. Here are 7 ways to avoid losing your money in such scams: Forex scams are becoming frequent. Michael Greenberg reports on luxurious expenses, including a submarine bought from the money taken from forex traders. Here’s another report of a forex fraud. So, how can we avoid falling in such forex scams?
What Are the 10 Fatal Mistakes Traders Make
Trading is exciting. Trading is hard. Trading is extremely hard. Some say that it takes more than 10,000 hours to master. Others believe that trading is the way to quick riches. They might be both wrong. What is important to know that no matter how experienced you are, mistakes will be part of the trading process.