Repeated regression

 
Trying to develop trading strategy based on regression an interesting idea came to mind .
By searching around i didnt find this approach despite seriously doubt is "my invention".
So i decide to politely ask for informations from somebody willing to give simple explanations.

Main idea is to calculate  repeated regression(say linear) on first regression results and repeat the process once more on second results as part of indicator algorithm.
Different periods may be used in each step of calculation.
Questions :
1)Somebody try this approach(anywhere even outside forex datasets)?
2)What issues (mathematical,computational or other )may arise from atempt?
3)How to test this idea outside the need to coding it in Metaeditor(mql5 )?
Like other  mathematical/graphic software?
4)It should smooth initial regression curve and eliminate some false signals.  Will this  actually happen?Why not(mathematically)?
Not to be confused with" repeat measure regression "or multiple/multivariable regression
( this keep pop up as search results)
Thanks in advance.
Regression is dynamic so it produce a curve not just straight line.

 

1) The use of linear regression analysis only makes sense with a statistically significant datapool. Hedge funds like to use it in all kinds of financial markets, but only as a corroborative indicator and not as a be-all-end-all trading tool.

2) Well, since you're attempting to model the relationship between two variables, with a given collection of data values, in order to find the "best fit" between the two variables, you'd somehow need to make sure that your data isn't skewed by statistical outliers. Work with median values and avoid averages.

3) What you're looking for is manual backtesting software, but I've already written in another forum post why that is usually out of the question for retail traders. https://www.mql5.com/en/forum/433683#comment_42379223

Even coding it as an EA and testing it via the inbuilt strategy tester of Metatrader will give you misleading data because you're working with In-Sample datasets. <Deleted<

4) It's hard to give a correct answer to that. You need to elaborate on the exact method of your strategy and how you want to implement it. Another problem that stands in your way of receiving a good answer to this problem (either from members here or your own intellect) is how you define the beginning and end of a trend. It's easy to claim when a trend started and ended AFTER the fact, but for this strategy to reliably work, you'd need to be able to see the signs before the whole thing actually starts to happen.

What I'm trying to say is, that this matter is extremely complicated and that you need a large enough sample size to improve the statistical significance of your metrics. 

Manual Backtesting in Strategy Tester
Manual Backtesting in Strategy Tester
  • 2022.09.29
  • www.mql5.com
Hi, I am desperate in finding a good trading panel or something to backtest my manual trading...
 
Suren Khosravi #:

1) The use of linear regression analysis only makes sense with a statistically significant datapool. Hedge funds like to use it in all kinds of financial markets, but only as a corroborative indicator and not as a be-all-end-all trading tool.

2) Well, since you're attempting to model the relationship between two variables, with a given collection of data values, in order to find the "best fit" between the two variables, you'd somehow need to make sure that your data isn't skewed by statistical outliers. Work with median values and avoid averages.

3) What you're looking for is manual backtesting software, but I've already written in another forum post why that is usually out of the question for retail traders. https://www.mql5.com/en/forum/433683#comment_42379223

Even coding it as an EA and testing it via the inbuilt strategy tester of Metatrader will give you misleading data because you're working with In-Sample datasets. I have also written a blog post about this issue.

4) It's hard to give a correct answer to that. You need to elaborate on the exact method of your strategy and how you want to implement it. Another problem that stands in your way of receiving a good answer to this problem (either from members here or your own intellect) is how you define the beginning and end of a trend. It's easy to claim when a trend started and ended AFTER the fact, but for this strategy to reliably work, you'd need to be able to see the signs before the whole thing actually starts to happen.

What I'm trying to say is, that this matter is extremely complicated and that you need a large enough sample size to improve the statistical significance of your metrics. 

Thanks very much for your answers Suren but they didnt exactly catch the main points.

Main question is will repeating regression smooth original curve or not(mathematicaly!)?
As concept not as aplication(this came into play later).
Smoothing is denoted as process of eliminating noise i.e. decrease a number of local extremas that sort of "shouldnt be there" because they are not explanatory and are a mere consequence of applied mathematical algorithm or chaotic nature of dataset  itself.
By testing outside i meant using software like Wolfram Mathematica,Mathlab,Octave or similar(not an advertising !)with datasets that may or even may not be forex related(say audio signal filtering/processing for example)
All indicators,and related strategies , have a tendency to lag or have latency upon reality i.e. they" see" change when change is already happening.Regression( dymamic )eliminate this.Almoust.
Strategy will use change in regression slope direction and need to be smoothed before it can be use as trading signal.
Thanks for your answers once again.
Best regards.

 
Robert72 #: Main question is will repeating regression smooth original curve or not(mathematicaly!)? As concept not as aplication(this came into play later). Smoothing is denoted as process of eliminating noise i.e. decrease a number of local extremas that sort of "shouldnt be there" because they are not explanatory and are a mere consequence of applied mathematical algorithm or chaotic nature of dataset  itself. By testing outside i meant using software like Wolfram Mathematica,Mathlab,Octave or similar(not an advertising !)with datasets that may or even may not be forex related(say audio signal filtering/processing for example) All indicators,and related strategies , have a tendency to lag or have latency upon reality i.e. they" see" change when change is already happening.Regression( dymamic )eliminate this. Almoust. Strategy will use change in regression slope direction and need to be smoothed before it can be use as trading signal.

Linear regression has been used before, for example in "Least Squares Moving Average (LSMA)" or "Endpoint Moving Average (EPMA)", but maybe not in the way you envision it.

So, if you say that your approach of repeated regression has not been attempted before, then probably no one is going to be able to answer your queries and you will have to experiment for yourself to find out.

 
Robert72 #:
Thanks very much for your answers Suren but they didnt exactly catch the main points.

Yeah I completely misunderstood you. I thought you were talking about regression analysis as in "regression channel" and thought your strategy is based on that. Sorry for wasting your time. Perhaps a member with proficiency in robust statistics can answer your question.

 

Linear Regression is the mathematical model. You can calculate the variables you are looking for in different ways. One of the standard ways is OLS (ordinary least square), because you need no assumptions for this. If you use Linear Regression with OLS (which - i think - most of regression channel etc. indicators do), than you can repeat the calculation and you will get the same numbers as before.

Repeating the calculation and getting better variables only works by a filter and/or smother-approach. I think you could transfer the Shumway-and-Stoffer-Smother-Approach and the Kalman-Filter for the Ornstein-Uhlenbeck-Process to the Linear-Regression-Model. But I think you would waste your time. Using a smother and filter for the OU-Process, especially the trending OU-Process, should be more efficient.

 
Ok.Thanks everybody for your answers and suggestions.
It was just an idea that i didnt manage to find somewhere else.So i address it here.
From your answers it seem that  the best way is simply experiment with some coding and see what happen. Was just hopping somebody is familiar with this approach.
Best regards.