Announcement

Collapse
No announcement yet.

Crabel stretch

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

  • Crabel stretch

    Would it be possible to create a function that shows the following?

    The stretch value is the 10 day moving average of the difference between the open an the low or high, whichever is smaller.

    (As by Tom Hartle article on the last issue of Active Trader, about Crabel techniques for trading NR7)

    Thanks.
    Gherardo Crespi

  • #2
    See if this does what you want
    Attached Files

    Comment


    • #3
      David, thanks for the file, the formula looks correct
      but checking the result by calculating the value by hand
      for instance on MXIM I get .36 which is quite similar to
      the result I get with a simple formula in TC2000 (.29)
      while with sarge.efs I get .63.
      I really don't know why the output is a different value.
      Essentially what I am trying to get is the smaller of two
      10days moving averages (open-low and open-high).
      Thanks anyway.
      Gherardo Crespi

      Comment


      • #4
        Perhaps the other formula uses EXPONENTIAL averages and mine used SIMPLE?

        Comment


        • #5
          No, it's a simple moving average in the other formula as well.

          Comment


          • #6
            the cause of error is following:
            first MAs are caluculated, and then the diff ...

            should be:
            calc diff for x days and then create an MA

            can READ fine, but unfortunately ca't WRITE... can someone fix it?

            thanks!

            Comment


            • #7
              dimitryg1
              FWIW calculating first the difference between two values and then computing the MA of the difference or computing the MA of the values then calculating the difference between the MAs will return the same result
              The image below shows the result of the following script (note version 7.9 is required to run this script) which calculates Open-Low both ways. As you can see the plots are identical
              Alex

              PHP Code:
              function preMain(){
                  
              setStudyTitle("test");
                  
              setCursorLabelName("plot1",0);
                  
              setCursorLabelName("plot2",1);
                  
              setDefaultBarFgColor(Color.blue,0);
                  
              setDefaultBarFgColor(Color.red,1);
              }

              function 
              main(){

                  var 
              plot1 sma(10,efsInternal("calc"));
                  var 
              plot2 sma(10,open())-sma(10,low());

                  return new Array (
              plot1,plot2);
              }

              function 
              calc(){

                  return 
              open()-low();




              Originally posted by dimitryg1
              the cause of error is following:
              first MAs are caluculated, and then the diff ...

              should be:
              calc diff for x days and then create an MA

              can READ fine, but unfortunately ca't WRITE... can someone fix it?

              thanks!

              Comment


              • #8
                I know this is an old thread but was doing some research on ORB's.
                According to Toby Crabel, "The stretch is determined by looking at the previous 10 days and averaging the differences between the open for each day and the closest extreme to the open on each day."

                I take this to mean if the open is nearer to the low, the difference between the open and the low is used in the calculation. Visa versa, if the open is nearer to the high, the difference between the open and the high is used in the calculation.

                Calculating the above by hand for the emini Russell 2000 (AB #F) today on daily bars May 1, 2006 and counting 10 bars back would be April 18, 2006.

                Date Open High Low Difference
                4/18 754.0 776.0 753.9 -0.9
                4/19 775.2 782.6 771.8 -3.4
                4/20 781.6 783.5 771.3 1.9
                4/21 777.6 782.9 771.5 5.3
                4/24 775.3 776.1 766.1 0.8
                4/25 769.7 771.0 763.3 1.3
                4/26 769.7 776.0 766.3 -3.3
                4/27 760.0 775.2 757.1 6.2
                4/28 762.8 771.8 759.0 -3.8
                5/01 760.8 774.7 760.4 -0.4

                Total 3.7 3.7/10=0.37

                If one uses the absolute values the Total is 27.9/10=2.77

                However the Stretch Indicator is at 5.7 today.

                Hopefully someone can show me the error of my ways.

                Russ
                Attached Files

                Comment


                • #9
                  Hello,
                  I think I have partcialy figured out Toby Crabel's ...Stretch indicator.

                  This is Toby's quote "The stretch is determined by looking at the previous 10 days and averaging the differences between the
                  open for each day and the closest extreme to the open on each day." I take it to mean the 10 period MA of the differences of the extremes

                  I have modified the sarge.efs indicator by changing it to a 1 period MA. This gives us the values of the extremes. All I have to do is add the last 10 values and divide by ten and I have it.

                  Hopefully someone can show me how to take at 10 period MA of these values.

                  Thanks,
                  Russ

                  Comment


                  • #10
                    I forgot to post the file.
                    Attached Files

                    Comment


                    • #11
                      See if this one doesn't match the hand calculations....

                      Need to use the absolute difference.


                      bigtee
                      Attached Files

                      Comment


                      • #12
                        Originally posted by bigtee
                        See if this one doesn't match the hand calculations....

                        Need to use the absolute difference.


                        bigtee
                        bigtee,

                        It calculates right on the money. This is just what the doctor ordered.

                        Thanks,
                        Russ

                        Comment

                        Working...
                        X