Announcement

Collapse
No announcement yet.

EFS Studies

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #31
    Elhers

    TrendLine Indicator has an error.

    Comment


    • #32
      Next EFS Study

      Our next indicator is VIDYA2 (StdDev).

      Averages > [eSignal EFS Indicators]

      Download: http://share.esignal.com/download.js...DYAStdDev2.efs

      Category: Indicator > Averages

      Description:

      This indicator plots two Variable Index Adjusted Moving Averages (VIDYA),based on StdDev of prices as a measure of volatility on the same chart.

      VIDYA is calculated according to this formula:

      VIDYA = (Alpha x StdDev(n)/StdDev(ref) x Close) + (1-(Alpha x StdDev(n)/StdDev(ref))) x VIDYA[1],

      where:

      Alpha - numerical constant (corresponding roughly to a x-week exponential moving average)
      StdDev(ref) - Average mean of StdDev for n periods

      VIDYA tracks the market better than exponential moving averages do using a fixed smoothing constant. Trading strategies based on VIDYA should perform better than those based on exponential moving averages.

      To get more information, refer Adaptive Moving Averages to Market Volatility article by T.Chande in March 1992 issue of Stocks&Commodities



      Inputs:

      Alpha1 - numerical constant for fast VIDYA
      Alpha2 - numerical constant for slow VIDYA
      sPrice - price data to use
      Lenght - number of bars to calculate

      EFS Code:

      Code:
      /*******************************************************************
      Description : This Indicator plots VIDYA StdDev2 indicator
      Provided By : Developed by TS Support, LLC for eSignal. (c) Copyright 2002
      ********************************************************************/
      
      function preMain()
      {
          setPriceStudy(true);
          setStudyTitle("VIDYA (StdDev) - 2 Lines");
          setCursorLabelName("VIDYA1", 0);
          setCursorLabelName("VIDYA2", 1);
          setDefaultBarFgColor(Color.blue, 0);
          setDefaultBarFgColor(Color.red, 1);
      }
      var StdDevVidya1_1 = null;
      var StdDevVidya2_1 = null;
      var StdDev = null;
      function main(Alpha1, Alpha2, sPrice, Length)
      {
          var BarState = getBarState();
          if (Alpha1 == null) Alpha1 = 0.2;
          if (Alpha2 == null) Alpha2 = 0.04;
          if (sPrice == null) sPrice = "Close";
          if (Length == null) Length = 20;
          var Price = getValue(sPrice, 0, -(Length + 1));
          var i = 0;
          if ((StdDevVidya1_1 == null)||(StdDev == null)||(StdDevVidya2_1 == null))
          {
             StdDevVidya1_1 = Price[0];
             StdDevVidya2_1 = Price[0];
             StdDev = new Array(Length);
             for (i = 0; i < Length; i++)
             {
                 StdDev[i] = 0.0;
             }
             return;
          }
          if (BarState == BARSTATE_NEWBAR) 
          {
              for (i = Length - 1; i > 0; i--)
              {
                  StdDev[i] = StdDev[i - 1];
              }
          }
          var Avg = 0.0;
          for (i = 0; i < Length; i++)
          {
              Avg += Price[i];
          }
          Avg /= Length;
          var SumSqr = 0.0;
          for (i = 0; i < Length; i++)
          {
              SumSqr += (Price[i] - Avg) * (Price[i] - Avg);
          }
          StdDev[0] = Math.sqrt(SumSqr / Length);
          Avg = 0.0;
          for (i = 0; i < Length; i++)
          {
              Avg += StdDev[i];
          } 
          Avg /= Length;
          var StdDevVidya1 = (Alpha1 * (StdDev[0] / Avg) * Price[0]) + ((1 - (Alpha1 * (StdDev[0] / Avg))) * StdDevVidya1_1);
          var StdDevVidya2 = (Alpha2 * (StdDev[0] / Avg) * Price[0]) + ((1 - (Alpha2 * (StdDev[0] / Avg))) * StdDevVidya2_1);
          if (BarState == BARSTATE_NEWBAR) 
          {
              StdDevVidya1_1 = StdDevVidya1;
              StdDevVidya2_1 = StdDevVidya2;
          }
          return new Array(StdDevVidya1, StdDevVidya2);
      }

      Comment


      • #33
        Another request

        Hi TSSuport,

        How about an efs for the Trend DETECTION Index (TDI) also by
        M.H. Pee.

        Thanks a lot.

        Comment


        • #34
          Next EFS Study: Volume Index

          Our next indicator is set of 2 Volume Index index indicators by Dennis Peterson.

          Volume Based > Volume Index [eSignal EFS Indicators]

          Download:

          http://share.esignal.com/download.js...i_Peterson.efs
          http://share.esignal.com/download.js...i_Peterson.efs

          Category: Indicator > Volume Based

          Description:

          The theory behind the indexes is as follows: On days of increasing volume, you can expect prices to increase, and on days of decreasing volume, you can expect prices to decrease. This goes with the idea of the market being in-gear and out-of-gear. Both PVI and NVI work in similar fashions: Both are a running cumulative of values, which means you either keep adding or subtracting price rate of change each day to the previous day’s sum. In the case of PVI, if today’s volume is less than yesterday’s, don’t add anything; if today’s volume is greater, then add today’s price rate of change. For NVI, add today’s price rate of change only if today’s volume is less than yesterday’s. Price rate of change can be found by:

          (Today’s close – yesterday’s close) / yesterday’s close

          <p>


          Inputs:

          EMA_Len - number of bars to calculate EMA

          EFS Code:

          Code:
          /*******************************************************************
          Description	: This Indicator plots the Negative Volume Index
          Provided By	: TS Support, LLC for eSignal
          ********************************************************************/
          
          function preMain(){
              setStudyTitle("Negative Volume Index");
              setCursorLabelName("NVI",0);
              setDefaultBarFgColor(Color.red,0);
              setCursorLabelName("EMA",1);
              setDefaultBarFgColor(Color.blue,1);
          }
          
          var NVI = 0;
          var EMA_1 = 0;
          
          function main(EMA_Len){
          	if(EMA_Len == null)
          		EMA_Len = 255;
          	var K = 2 / (EMA_Len + 1);
          	var ROC = 0;
          	
          	ROC = (close() - close(-1)) / close(-1);
          	
          	if(volume() < volume(-1) && getBarState() == BARSTATE_NEWBAR)
          		NVI += ROC;
          		
          	EMA = K * NVI  + (1 - K) * EMA_1;
          	if (getBarState() == BARSTATE_NEWBAR)
              		EMA_1 = EMA;
          
          	return new Array(NVI,EMA);
          }
          
          ///////////////////////////////////////////////////////////////////////
          
          /*******************************************************************
          Description	: This Indicator plots the Positive Volume Index
          Provided By	: TS Support, LLC for eSignal
          ********************************************************************/
          
          function preMain(){
              setStudyTitle("Positive Volume Index");
              setCursorLabelName("PVI",0);
              setDefaultBarFgColor(Color.red,0);
              setCursorLabelName("EMA",1);
              setDefaultBarFgColor(Color.blue,1);
          }
          
          var PVI = 0;
          var EMA_1 = 0;
          
          function main(EMA_Len){
          	if(EMA_Len == null)
          		EMA_Len = 255;
          	var K = 2 / (EMA_Len + 1);
          	var ROC = 0;
          	
          	ROC = (close() - close(-1)) / close(-1);
          	
          	if(volume() > volume(-1) && getBarState() == BARSTATE_NEWBAR)
          		PVI += ROC;
          		
          	EMA = K * PVI  + (1 - K) * EMA_1;
          	if (getBarState() == BARSTATE_NEWBAR)
              		EMA_1 = EMA;
          
          	return new Array(PVI,EMA);
          }
          Last edited by TS Support; 03-17-2003, 06:20 AM.

          Comment


          • #35
            Triangular MA

            Was wondering if you had a Triangular moving average?

            Comment


            • #36
              http://forum.esignalcentral.com/show...ght=triangular has some info on triangualr moving averages and how to create them

              Comment


              • #37
                EFS Study:

                hi Wavetrader, here TDI indicator i have asked for:

                Trend Identificator > Trend Direction Index (TDI) [eSignal EFS Indicators]

                Download:

                http://share.esignal.com/download.js...r&file=tdi.efs

                Category: Trend Identificator

                Description:

                The Trend Detection Index (TDI) was introduced by M. H. Pee. TDI is used to detect when a trend has begun and when it has come to an end. The TDI can be used as a stand-alone indicator or combined with others; it will perform well in detecting the beginning of trends. TDI should be used in conjunction with protective stops as well as trailing stops. These stops are required to protect against large losses when the indicator generates a losing trade. The TDI can trade a diverse portfolio of markets profitably over many years, using the same parameters throughout.

                To calculate the 20-day trend detection index, first find the value of the momentum indicator. After the market closes, calculate today's 20-day momentum by subtracting the close 20 days ago from that of today. Next, find the 20-day absolute momentum, which is defined as the absolute value of today's 20-day momentum. More details can be found in the formula section above.

                The trend detection index will signal a trend if it shows a positive value and a consolidation if it shows a negative value. As a trend-follower, the position should be entered in the direction of the trend when the TDI is positive. To determine the current direction of the trend, the direction indicator can be used, which is defined as the sum of the 20-day momentum of the last 20 days. An uptrend is signaled by a positive direction indicator value, whereas a downtrend is signaled by a negative value. Basically, it comes down to this: Enter long tomorrow at the open if both the TDI and direction indicator are positive after today's close or enter short at the open if the TDI is positive and the direction indicator is negative.



                Inputs:

                Period - number of bars to calculate

                EFS Code:

                Code:
                /*******************************************************************
                Description	: This Indicator plots the Trend Detection Indexs
                Provided By	: TS Support, LLC for eSignal
                ********************************************************************/
                
                function preMain(){
                	setStudyTitle("Trend Detection Index");
                	setCursorLabelName("TDI",0);
                	setDefaultBarFgColor(Color.blue,0);
                	    addBand(0, PS_SOLID, 1, Color.lightgrey);
                
                }
                
                mom = null;
                
                function main(Period){
                	if(Period == null)
                		Period = 12;
                	if(mom == null)
                		mom = new MOMStudy(Period, "Close");
                
                	var MomSum = 0, MomSumAbs = 0; MomAbsSum = 0, MomAbsSum2 = 0;
                	
                	for(i = -Period + 1; i++; i <= 0)
                		MomSum += mom.getValue(MOMStudy.MOM,i);
                	
                	MomSumAbs = Math.abs(MomSum);
                	
                	for(i = -Period + 1; i++; i <= 0)
                		MomAbsSum += Math.abs(mom.getValue(MOMStudy.MOM,i));
                		
                	for(i = -Period * 2 + 1; i++; i <= 0)
                		MomAbsSum2 += Math.abs(mom.getValue(MOMStudy.MOM,i));
                	TDI = MomSumAbs - (MomAbsSum2 - MomAbsSum);
                	
                	
                	return TDI;
                }

                Comment


                • #38
                  Greetings,

                  I think this may be an error in your code (in the TDI indicator). If not though, can you explain these statements for me?

                  PHP Code:
                  ...
                  for(
                  = -Period 1i++; <= 0)
                     
                  MomSum += mom.getValue(MOMStudy.MOM,i);

                  MomSumAbs Math.abs(MomSum);

                  for(
                  = -Period 1i++; <= 0)
                     
                  MomAbsSum += Math.abs(mom.getValue(MOMStudy.MOM,i));
                  ... 
                  All of those for() loops in that script should actually be something like (unless I am really missing something):

                  PHP Code:
                   for(= -Period +1<= 0i++)
                      ... 
                  Cheers,
                  Joshua C. Bergeron
                  Last edited by jbergeron; 03-16-2003, 02:01 PM.

                  Comment


                  • #39
                    Hi,

                    Thank you for your remark.

                    You can use this

                    Code:
                    for(i = -Period;  i++;)
                    		MomSum += mom.getValue(MOMStudy.MOM,i);
                    or this

                    Code:
                    for(i = -Period + 1; i<=0;  i++;)
                    		MomSum += mom.getValue(MOMStudy.MOM,i);

                    Code:
                    /************************************************
                    Description	: This Indicator plots the Trend Detection Indexs
                    Provided By	: TS Support, LLC for eSignal
                    ************************************************/
                    
                    function preMain(){
                    	setStudyTitle("Trend Detection Index");
                    	setCursorLabelName("TDI",0);
                    	setDefaultBarFgColor(Color.blue,0);
                    	    addBand(0, PS_SOLID, 1, Color.lightgrey);
                    
                    }
                    
                    mom = null;
                    
                    function main(Period){
                    	if(Period == null)
                    		Period = 12;
                    	if(mom == null)
                    		mom = new MOMStudy(Period, "Close");
                    
                    	var MomSum = 0, MomSumAbs = 0; MomAbsSum = 0, MomAbsSum2 = 0;
                    	
                    	for(i = -Period;  i++;)
                    		MomSum += mom.getValue(MOMStudy.MOM,i);
                    	
                    	MomSumAbs = Math.abs(MomSum);
                    	
                    	for(i = -Period; i++;)
                    		MomAbsSum += Math.abs(mom.getValue(MOMStudy.MOM,i));
                    		
                    	for(i = -Period * 2; i++;)
                    		MomAbsSum2 += Math.abs(mom.getValue(MOMStudy.MOM,i));
                    	TDI = MomSumAbs - (MomAbsSum2 - MomAbsSum);
                    	
                    	return TDI;
                    }
                    Last edited by TS Support; 03-17-2003, 05:23 AM.

                    Comment


                    • #40
                      Next EFS:

                      Volume Based > Chaikin Oscillator [eSignal EFS Indicators]

                      Download:

                      http://share.esignal.com/download.js...ChaikinOsc.efs

                      Category: Volume Based

                      Description:

                      Inspired by the prior work of Joe Granville and Larry Williams, Marc Chaikin developed a new volume indicator, extending the work done by his predecessors. The Chaikin Oscillator is a moving average oscillator based on the Accumulation/Distribution indicator.

                      The Chaikin Oscillator is created by subtracting a 10-period exponential moving average of the Accumulation/Distribution Line from a 3-period exponential moving average of the Accumulation/Distribution Line.



                      Inputs:

                      Slow - number of bars to calculate slow EMA
                      Fast - number of bars to calculate fast EMA

                      EFS Code:

                      Code:
                      /*******************************************************************
                      Description	: This Indicator plots the Chaikin Oscillator
                      Provided By	: TS Support, LLC for eSignal
                      ********************************************************************/
                      
                      function preMain(){
                      	setStudyTitle("Chaikin Oscillator");
                      	setCursorLabelName("ChaikinOsc",0);
                      	setDefaultBarFgColor(Color.blue,0);
                              addBand(0, PS_SOLID, 1, Color.lightgrey);
                      }
                      
                      var AccumDist_1 = 0;
                      var FEMA_1 = 0;
                      var SEMA_1 = 0;
                      
                      function main(Slow,Fast){
                      	if(Slow == null)
                      		Slow = 20;
                      	if(Fast == null)
                      		Fast = 10;
                      	var K1 = 2 / (Fast + 1);
                      	var K2 = 2 / (Slow + 1);
                      	var AccumDist = 0;
                      
                      	if( ( high() - low() ) * volume() > 0)
                      		AccumDist = AccumDist_1 + ((close() - open()) /  (high() - low()) * volume());
                      		
                      	FEMA = K1 * AccumDist + (1 - K1) * FEMA_1;
                      	SEMA = K2 * AccumDist + (1 - K2) * SEMA_1;
                      
                      	if (getBarState() == BARSTATE_NEWBAR){
                      		AccumDist_1 = AccumDist;
                      		FEMA_1 = FEMA;
                      		SEMA_1 = SEMA;
                      	}
                      
                      	return SEMA - FEMA;
                      }

                      Comment


                      • #41
                        Swing Trading - ZigZag Chart updates request

                        Hi,
                        I've been using the ZigZag.efs formula (File Sharing/TS Support/Swing Charts) for months now with great effect - i trade the swings, so this tool is a great benefit to me. I'd like to request a couple of updates being made to the study (if possible):

                        a) The ZigZag chart does not move along with the price action - do you know if it can be fixed to the price and simply stay in place - instead of having to constantly reload the formula?

                        b) Is there a way that as a 'new' ZigZag wave is established, the following data will be displayed at the 'end' of the previous pivot point -

                        1 - 'Price' level of the last pivot

                        2 - 'Points' length of the last wave

                        3 - 'Number' of Bars in the last wave

                        If you are able to obtain these results, or know if there's already
                        an updated ZigZag.efs formula that does this, then i'd really appreciate the assistance.

                        Many thanks,

                        Paul Turley

                        Comment


                        • #42
                          Re: Ehlers Instantanaous Trend

                          I have been looking at this study and have a few observations/questions.

                          Looking at INTC, on all of the interval choices except 5 min, 60 mindaily and monthly I get 2 lines which tend to cross over every now and then. On the 5 min, daily and monthly charts I get 2 lines that are roughly parallel and one is about twice the other! This seems quite anomolous to me. Note that differennt stocks give different results, I found another example of the code, and they seem to match. I have tried different time templates thinking it mightbe a data availabilty issue for initialization but cannot account for the resutls.

                          Have others noticed this? It seems odd to me that 3 min and 5 min results would be so different. Am I not understanding something basic about this study?

                          Comment


                          • #43
                            Re: Ehlers Instantanaous (sic) Trend Line

                            Well a couple more points regarding the code for Ehlers Instantanaous (sic) Trend Line posted by TSS support. A Google search will produce a number of sites that have code for this indicator. In particular a Polish(?) site http://klub.chip.pl/tsfp/t-i-Instant...end_Line.html, that has what appears to be the functionally identical routine for tradestation. Even the comments are identical. BTW This should not be taken as a critisism, formulas are made to be adapted in my book.

                            On the other hand there is a apparently a very different routine out there for Metastock. If I can figure out Metastock format I may try to adapt that

                            I don't see why one would plot both the smoothed average of the price and the trendline on the same study.

                            Any thoughts? anyone?

                            Comment


                            • #44
                              EFS Study - T3 Average

                              Averages > T3 Average [eSignal EFS Indicators]

                              Download:

                              http://share.esignal.com/download.js...file=T3avg.efs

                              Category: Averages

                              Description:

                              This indicator plots the moving average described in the January, 1998 issue of S&C, p.57, "Smoothing Techniques for More Accurate Signals", by Tim Tillson. This indicator plots T3 moving average presented in Figure 4 in the article. T3 indicator is a moving average which is calculated according to formula:

                              T3(n) = GD(GD(GD(n))),

                              where GD - generalized DEMA (Double EMA) and calculating according to this:

                              GD(n,v) = EMA(n) * (1+v)-EMA(EMA(n)) * v,

                              where "v" is volume factor, which determines how hot the moving average’s response to linear trends will be. The author advises to use v=0.7.

                              When v = 0, GD = EMA, and when v = 1, GD = DEMA. In between, GD is a less aggressive version of DEMA. By using a value for v less than1, trader cure the multiple DEMA overshoot problem but at the cost of accepting some additional phase delay.

                              In filter theory terminology, T3 is a six-pole nonlinear Kalman filter. Kalman filters are ones that use the error — in this case, (time series - EMA(n)) — to correct themselves. In the realm of technical analysis, these are called adaptive moving averages; they track the time series more aggres-sively when it is making large moves. Tim Tillson is a software project manager at Hewlett-Packard, with degrees in mathematics and computer science. He has privately traded options and equities for 15 years.



                              Inputs:

                              Price - data series to use
                              Periods - number of bars to calculate

                              NOTE:The input, "Period", need not be an integer.

                              EFS Code:

                              Code:
                              /*******************************************************************
                              Description	: This Indicator plots T3 Averages
                              Provided By	: Developed by TS Support, LLC for eSignal. (c) Copyright 2002
                              ********************************************************************/
                              
                              function preMain()
                              {
                                  setPriceStudy(true);
                                  setCursorLabelName("T3Avg");
                              }
                              var e1_1 = 0.0;
                              var e2_1 = 0.0;
                              var e3_1 = 0.0;
                              var e4_1 = 0.0;
                              var e5_1 = 0.0;
                              var e6_1 = 0.0;
                              function main(Price, Periods)
                              {
                                  if (Price == null) Price = "Close";
                                  if (Periods == null) Periods = 5;
                                  var vPrice = getValue(Price, 0);
                                  var b  = 0.7;
                              	var b2 = b * b;
                              	var b3 = b * b * b;
                              	var c1	= -b3;
                              	var c2 = 3 * b2 + 3 * b3;
                              	var c3 = -6 * b2 - 3 * b - 3 * b3;
                              	var c4 = 1 + 3 * b + b3 + 3 * b2;
                              	var f1 = 2 / (Periods + 1);
                              	var f2 = 1 - f1;
                              	var e1 = f1 * vPrice + f2 * e1_1;
                              	var e2 = f1 * e1 + f2 * e2_1;
                              	var e3 = f1 * e2 + f2 * e3_1;
                              	var e4 = f1 * e3 + f2 * e4_1;
                              	var e5 = f1 * e4 + f2 * e5_1;
                              	var e6 = f1 * e5 + f2 * e6_1;
                              	if (getBarState() == BARSTATE_NEWBAR)
                              	{
                                      e1_1 = e1;
                                      e2_1 = e2;
                                      e3_1 = e3;
                                      e4_1 = e4;
                                      e5_1 = e5;
                                      e6_1 = e6;
                                  }
                              	var T3Average = c1 * e6 + c2 * e5 + c3 * e4 + c4 * e3;
                              	return T3Average;
                              }

                              Comment


                              • #45
                                Well a couple more points regarding the code for Ehlers Instantanaous (sic) Trend Line posted by TSS support. A Google search will produce a number of sites that have code for this indicator. In particular a Polish(?) site http://klub.chip.pl/tsfp/t-i-Instan...rend_Line.html, that has what appears to be the functionally identical routine for tradestation. Even the comments are identical. BTW This should not be taken as a critisism, formulas are made to be adapted in my book.
                                I noticed the same thing. BTW, I can also now say that the two versions of Ehlers ITL that I have for eSignal don't match the results from the MESA program. Of course they don't exactly match each other eitherm but they are closer to matching the results of each other than either do to the one in MESA. There is no doubt that Ehler's has fine tuned the MESA ITL.

                                >I don't see why one would plot both the smoothed average of >the price and the trendline on the same study.

                                Well, for one thing much of the calculations for both are the same...so why produce one as a second study? For another, the two taken together tell you what mode the market is in (trending or cycle) and also can give entry and exit signals (though I think they are better used as confirmation to other signals due to their lag).
                                Garth

                                Comment

                                Working...
                                X