Discussion of article "An Example of Developing a Spread Strategy for Moscow Exchange Futures"
Thanks a lot for CalcShowRegression_script.mq5! Cool manual in the form of source code on ALGLIB and GraphPlot.
It's a pity that only one symbol to another was adjusted via LR, not two to one - ALGLIB would be more useful if they added USDRUB. But then the basket would be made of three symbols. And the TS would not be a classical spread one, but more complicated (but the results would be tastier). That is why, apparently, the author did not want to complicate the code of the presented TS in order not to repel the readers. After all, the main goal of the article is to attract, not to repel.
But it is easy to read, it is a good article. And I fully welcome the absence of MQL-inserts in the text of the article. Who really needs it - will look at the source code in full. And in the current form, the impression is good that it is easy to write, visualise and, most importantly, test and optimise multicurrencies in MT5.
A small remark to the article. Before building spread and QC, it is necessary to synchronise the charts of instruments on the time scale bar by bar. Because if there are missed bars (and there are), you will get a mess.
All IMHO)
A small note to the article.
And logarithmise before LR. Otherwise, there is really little understanding of what is being done and why.
A small remark to the article. Before building spread and QC, it is necessary to synchronise the charts of instruments on the time scale bar by bar. Because if there are missing bars (and there are), you will get a mess.
The code will be a bit more complicated, but I suspect that, again, it won't affect the results much.
Why are ticks constantly ignored? In this article, LR is based on bars. Therefore, it cannot be used on small intervals - there are not enough bars.
Moreover, when there are ticks, it is possible to build a tick chart (both Bid and Ask, taking into account commissions of all incoming instruments) of the basket.
As if ticks are needed only for the tester and not for trade analysis.
If you take M1 and low-liquidity characters, it will affect the results greatly.
That'd be rubbish, wouldn't it?

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
New article An Example of Developing a Spread Strategy for Moscow Exchange Futures has been published:
The MetaTrader 5 platform allows developing and testing trading robots that simultaneously trade multiple financial instruments. The built-in Strategy Tester automatically downloads required tick history from the broker's server taking into account contract specifications, so the developer does not need to do anything manually. This makes it possible to easily and reliably reproduce trading environment conditions, including even millisecond intervals between the arrival of ticks on different symbols. In this article we will demonstrate the development and testing of a spread strategy on two Moscow Exchange futures.
We can express correlation between the two assets using a linear regression equation Y(X)=A(X)+B. Let's create a script CalcShowRegression_script.mq5, which takes two arrays of close prices, calculates coefficients and shows the distribution diagram with a regression line straight on the chart.
Regression coefficients are calculated using an ALGLIB function, and the values are drawn using graphic classes of the standard library.
Author: MetaQuotes Software Corp.