Announcement

Collapse
No announcement yet.

Moving Linear Regression Channel (already produced)

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

  • #31
    Originally posted by dloomis
    The code at the link you posted was supposed (imho) to be actual efs code. If so, it has syntax errors and will not run.

    Perhaps the author make a mistake and posted the wrong code, I don't know why code would be posted that has errors.

    Anyway, Jason posted some code that was identified as Mel's method and I commented that code. They appear to be quite similar.

    Here are my comments, hope they help.
    David,

    Thanks for the comments. What I am asking in this thread is for someone to disect the actual coding from e-signal.txt /original mel's EFS that JasonK produced, and spit out the formula's that were used. Similar to the "documentary" type coding that I posted before. I AM NOT making an EFS, or editing this EFS to fit my needs. I just want to extract the formula's and what/how needs to be plotted. (again, like I posted below with this example:

    ***********************
    Single Regression Line algorithm:

    1. Going through the last N periods calculate:

    SumX - sum of all X values
    SumY - sum of all Y values
    SumXY - sum of all XY
    SumX2 - sum of all XX

    2. B = (N*SumXY-SumX*SumY)/(N*SumX2+SumX*SumX)
    A = (SumY-B*SumX)/N


    3. Calculate standard deviation

    Go through all N periods and for each calculate
    F = Y-(X*B+A)

    4. SumF = sum of all F*F from step 3

    5. StD = SQRT(SumF/N)


    Plot the lines:

    Y=B*X+A for the central line
    Y=B*X+A+W*StD for upper channel line (where W is the width of the
    channel)
    Y=B*X+A-W*StD for lower channel line (where W is the width of the
    channel)

    ***********************

    Comment


    • #32
      Oh, sorry for the confusion. I didn't understand.

      Comment


      • #33
        Originally posted by JasonK
        Hello KuJax,

        In addition to a single regression line like your instructions, the study also draws lines at 1 and 2 standard deviation lines above and below a 23 period regression line with the same slope. It also draws the moving linear regression value of a 3 period regression along with a moving average. The moving average is a 4 period exponential moving average of the close by default.
        JasonK -

        I am not sure if we are thinking about the same thing. I posted a "human logic" type code for the "Single Regression Line algorithm." This is what a programmer got, and he programmed in that indicator. Is there anyway that you or someone else can extract the "human logic' out of the EFS you created for Mel? I really enjoy the step by step guide of the single regression line algorithm documentation that I posted. Does this make sense?

        Comment


        • #34
          Originally posted by KuJaX
          JasonK -

          I am not sure if we are thinking about the same thing. I posted a "human logic" type code for the "Single Regression Line algorithm." This is what a programmer got, and he programmed in that indicator. Is there anyway that you or someone else can extract the "human logic' out of the EFS you created for Mel? I really enjoy the step by step guide of the single regression line algorithm documentation that I posted. Does this make sense?
          seems silly to bring this up again.

          I still don't know the actual coding (human logic) behind the indicator JasonK produced for Mel. I understand slope, and how to produce the middle line (linear regression), but the Stardard devisions I am confused with. When I try to produce this in another program, I get a bit different (but obvious) standard deviations. The slope and linear regression line are the same (or it seems).

          Comment

          Working...
          X