Discussing the article: "Low-Frequency Quantitative Strategies in Metatrader 5: (Part 2) Backtesting a Lead/Lag Analysis in SQL and in Metatrader 5"
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Check out the new article: Low-Frequency Quantitative Strategies in Metatrader 5: (Part 2) Backtesting a Lead/Lag Analysis in SQL and in Metatrader 5.
The article describes a complete pipeline that uses data analysis for finding low-frequency lead/lag trading opportunities. It goes into building a cross-correlation-based Lead/Lag analyser step-by-step, with special attention to the most common errors beginners may commit while developing cross-asset diffusion queries. After screening dozens of cointegrated and correlated pairs, a trading candidate pair is chosen, and its tradeability is evaluated in a pure SQL backtest. Once it is qualified, the strategy is backtested on the MetaTester for parameter optimization. The Expert Advisor with respective backtest settings and optimization inputs is provided, along with Python and SQL scripts.
You have probably already heard of “the butterfly effect”. It is an easy-to-understand metaphor popularized in pop culture to illustrate chaos theory. In summary, it says that the flapping of a butterfly's wings in, for example, Australia could cause an earthquake in North America. It is a beautiful image to say that tiny changes in complex systems, like the weather, may be the cause of huge, unpredictable consequences.
This image would also be a perfect illustration of the central idea behind this article and the kind of analysis it describes. Financial markets are like complex systems. They are frequently modeled as stochastic processes, processes in which the future state cannot be predicted with precision because of the impact of random factors. Each tick, each price change encapsulates these random factors — the flapping of many butterflies' wings, so to speak. Some are close to the change and have a direct impact; others are distant and have an indirect impact. But they are all there, making the price.
Despite this uncertainty, finance professionals try to trace the root causes of events such as price changes. They hope that understanding the drivers will allow them to estimate future outcomes with reasonable probabilities. In this quest, at least one now-obvious truth emerged: irrespective of the nature of the random factors, the change propagates to different assets at different speeds. Since the time the change takes to propagate can be valuable information to better understand the behavior of the assets involved, we developed methods to measure it. In this article, we’ll see one of these methods.
Author: Jocimar Lopes