Announcement

Collapse
No announcement yet.

Moving Linear Regression Channel (already produced)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Moving Linear Regression Channel (already produced)

    Hello,

    I was curious if anyone could direct me to a website that gives the formula's and algorithms for this indicator that JasonK produced called "Moving Linear Regression":



    also found here:



    Thank you.

  • #2
    Hello KuJax,

    I don't know of a specific web site that details the information you are looking for. Have you tried an internet search? Mel gave me the instructions for his study over the phone. The algorithms in the study are based on the standard linear regression equation and standard deviation. There are many references on the web detailing these two methods. The length for linear regression for our purposes is expressed in bars with the selected price source for the data series.
    Jason K.
    Project Manager
    eSignal - an Interactive Data company

    EFS KnowledgeBase
    JavaScript for EFS Video Series
    EFS Beginner Tutorial Series
    EFS Glossary
    Custom EFS Development Policy

    New User Orientation

    Comment


    • #3
      Originally posted by JasonK
      Hello KuJax,

      I don't know of a specific web site that details the information you are looking for. Have you tried an internet search? Mel gave me the instructions for his study over the phone. The algorithms in the study are based on the standard linear regression equation and standard deviation. There are many references on the web detailing these two methods. The length for linear regression for our purposes is expressed in bars with the selected price source for the data series.
      do these algorithms looks familiar?






      I know there are many references to this on the web, but a lot of statistics have peoples own "version."

      Comment


      • #4
        Hello KuJax,

        Yep, I especially like the second one as it relates to time and price of a security.

        Here's some more references from a google search for "y = mx + b" AND linear regression .
        Jason K.
        Project Manager
        eSignal - an Interactive Data company

        EFS KnowledgeBase
        JavaScript for EFS Video Series
        EFS Beginner Tutorial Series
        EFS Glossary
        Custom EFS Development Policy

        New User Orientation

        Comment


        • #5
          Originally posted by JasonK
          Hello KuJax,

          Yep, I especially like the second one as it relates to time and price of a security.

          Here's some more references from a google search for "y = mx + b" AND linear regression .
          JasonK,

          very interesting. I'm testing some formula's in a program to test the moving linear regression channel you have provided. I talked to Mel today on the phone and he is extremely busy right now with his upcoming seminar and future seminars to help me out.

          When you talked to him on the phone, did he direct you to any website or did you give you the formula over the phone? I am confused about what formula's that are needed. (You can PM me if it is private information) Thanks JasonK!

          Comment


          • #6
            Hello KuJax,

            The calculations for Simple linear regression and stand deviation are not proprietary. They are common algorithms. In the code you have posted, you could use the LinReg(nLRlen, aArray) and StDev() functions for your custom formulas. When you call the LinReg() function from main you will need to pass the length (nLRlen) of the data array and the data array (aArray) to the function. The function returns an array with the slope (A) and y-intercept (B) of the regression line.

            PHP Code:
            var vLRvalues LinReg(nLRlenaY);
            var 
            vLRvalues[0];
            var 
            vLRvalues[1]; 
            By simply plotting B, you get the moving linear regression line. Or you could use A and B to draw the linear regression line similar to what I did in the MR_MovLinReg2.efs on lines 152-153.

            Using the StDev() in this formula is hard coded to do a 23 period standard deviation of the close. Here's a modification that will allow you to pass the length and the price source.

            PHP Code:
            function StDev(nLengthsPriceSource) {
                if (
            nLength == nullnLength 25;
                if (
            sPriceSource == nullsPriceSource "Close";
                
                var 
            aSource getValue(sPriceSource0, -nLength);
                if (
            aSource == null) return null;
                
                var 
            sumX 0;
                var 
            sumX2 0;
                for (
            0nLength; ++i) {
                    
            sumX += aSource[i];
                    
            sumX2 += (aSource[i] * aSource[i])
                }
                var 
            meanX = (sumX/nLength);
                var 
            stdev Math.sqrt((sumX2/nLength) - (meanX*meanX));

                return 
            stdev;

            This uses a length of 25 on the Close if you don't pass any parameters. If you include this function in your formula, you could then call it from main, like so,

            PHP Code:
            var myStdev StDev(10"Close"); 
            Jason K.
            Project Manager
            eSignal - an Interactive Data company

            EFS KnowledgeBase
            JavaScript for EFS Video Series
            EFS Beginner Tutorial Series
            EFS Glossary
            Custom EFS Development Policy

            New User Orientation

            Comment


            • #7
              JasonK,

              First off, your fantastic! Thanks for the help.

              I am not really looking for calculations for "simple linear regressoin and standard deviation" i'm looking for specific formula(s) for the moving linear regression that you have created in that EFS file for Mel Raiman. If a simple linear regression and standard deviation that you have just posted is the same, then so be it.

              I want a chart that I program in a small piece of software to look exactly the same as my e-signal chart, concerning this specific indicator. When I talked to Mel, he said that he spent hours and hours every single day for about a month working with e-signal(you?) for this specific indicator to be correct. If that is true, then where was the problem, and why did it take so long, if essentially all indicators are just formula's and formula's on how to plot them?

              I am looking for a way to program this into my piece of software that I am playing with, so that if I look over at my e-signal charts, and these charts, I will not be able to see a difference. Fun Project!

              As always, your much appreciated JasonK.

              Comment


              • #8
                Hello KuJax,

                The two functions I gave you are from Mel's EFS. As for the development effort with Mel, I wouldn't say there was any problems per se. The time involved with this project had a lot do with other factors besides the formula calculations themselves, which is pretty standard for projects like this. Good luck with your project.
                Jason K.
                Project Manager
                eSignal - an Interactive Data company

                EFS KnowledgeBase
                JavaScript for EFS Video Series
                EFS Beginner Tutorial Series
                EFS Glossary
                Custom EFS Development Policy

                New User Orientation

                Comment


                • #9
                  Hey Jason,
                  I actually have been to get hold of the efs being discussed in this thread and no luck...would you post a link to it?

                  the 2 functions you just mentioned ...Stdev? and what is the other? or something totally different?
                  Thanks.

                  Comment


                  • #10
                    z11
                    Try running a search using JasonK as User Name and either mel or linear AND regression or standard AND deviation as Keyword(s) and you should find it
                    Alex

                    Comment


                    • #11
                      Thanks Alex ...got it...

                      Comment


                      • #12
                        Hi Alex. in your linreg.efs, Linearregressionstudy - is that an EFS built-in functon? whose properties are accessed via the "." operator. if so, is there a list of such built in functions (mathematical or otherwise) out there? Thanks.

                        Comment


                        • #13
                          z11
                          It is a built-in study function. You can find a complete list of all the functions in the EFS KnowledgeBase under EFS Function Reference
                          Alex

                          Comment


                          • #14
                            Alex, after searching the link you provided, I have found no such item as EFS Function Referece.

                            There is only the General Reference and Get Data Functions which contain nothing like linearregressionstudy.

                            Comment


                            • #15
                              Hello z11,

                              Expand the navigation tree for EFS KnowledgeBase on the left side of the page.



                              Here's a shortcut to the LinearRegressionStudy() built-in study.
                              Jason K.
                              Project Manager
                              eSignal - an Interactive Data company

                              EFS KnowledgeBase
                              JavaScript for EFS Video Series
                              EFS Beginner Tutorial Series
                              EFS Glossary
                              Custom EFS Development Policy

                              New User Orientation

                              Comment

                              Working...
                              X