Announcement

Collapse
No announcement yet.

Code Explanation

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

  • Code Explanation

    Hello,

    I think only Chris D. Kryza or Gareth can answer the following question, however I would appreciate anyone taking a stab at it.

    Can someone please explain what macTIME represents in the attached efs? It appears on line 111, 129, 146, 147, 148, 151.

    I believe its the interval time of the chart. If so, should it not automatically change to whatever chart I have pull up on the screen, i.e. weekly, daily, etc? It appears to have a default of 5. Can you also please tell me what 5 represents?

    Cheers

    Carlton
    Attached Files

  • #2
    Hi,

    It isn't the interval of the chart. It looks like a method of taking a longer period version of the MA's...and hence a longer period MACD.

    In essence you are (in the default case) taking the interval of the chart and externding it 5x.

    Garth
    Garth

    Comment


    • #3
      I can tell you what they mean but not what is going on....

      Lines 146... calculate a moving average, and the first parameter of the ma
      is a variable comprised of two numbers macShort and macTime, rounded
      down.Math.floor(macShort*macTime)

      macShort is defined above as a default of 12, and macTIme is defaulting to
      5, so the multipicand is 60 in the default case, meaning the Math.floor
      function is not required for the default case.

      What nCoeff is doing I have no idea.

      Comment


      • #4
        Wow!,

        I think my brain is fried trying to understand.

        So, can you please tell me what the net affect is on the chart? Or can only Chris answer that question?

        Thx

        Carlton

        P.S.
        Sorry for misspelling your name Garth.

        Comment


        • #5
          I think nCoeff is just a way to take an EMA of the signal lines.

          G
          Garth

          Comment


          • #6
            I'm afraid that I'm still somewhat confused.

            Carlton

            Comment


            • #7
              The net effect would SEEM to be that you are seeing how the short and long MACD impulse relate. If the net of the two are positive, you have a long, if the net of the two is negative you have a short...if they net is zero you can have either both long and short or neither long or short.

              Interesting formula.

              Garth
              Garth

              Comment


              • #8
                Very interesting formula, indeed.

                I'm gonna have to read and re-read your comments before I understand.

                Thanks anyway.

                Cheers

                Carlton

                Comment


                • #9
                  To Clarify a bit:

                  He calculates a short term MACD (normal MACD based off the interval of the chart). He then calculates a longer term (default 5x longer) MACD.

                  He then does some math which gives him an impulse of the signal line for both the long and short.

                  He then compares those impulses and determines if you are long, short, both or neither. It looks like everytime you are both you will also be neither - so I don't get that part.

                  Longs are the blue line = 1
                  Shorts are the red lines = 1
                  Both is the green line > 0
                  Neither is the brown line < 0
                  Garth

                  Comment


                  • #10
                    Garth,

                    Its starting to make sense. Very interesting....

                    Comment


                    • #11
                      Guys:

                      Sorry I missed this thread before. The MACD-Impulse was a Tradestation conversion that I did for another user a few months ago. It is a direct translation of the TS code but, honestly, I have no good explanation of what it is doing or the value, if any, of this approach. I can usually write them but I will admit that I don't always understand them.

                      Chris

                      Comment


                      • #12
                        Chris,

                        Its based on Dr. Alexander Elders momentum analysis.

                        Its my number one indicator at the moment.

                        Anyway, thanks mate.

                        Carlton

                        Comment

                        Working...
                        X