Latest News

2022 Start working on a new website

BBS Trading Expert
Watch the Youtube BBS video and here is a crude oil trading example

 

Want to know more about:

NinjaTrader formulas.

MetaStock formulas.

MetaTrader formulas.

My YouTube videos.

AXIOM business books awards, bronze medal! Thank You!

No longer available!

 

 

Favorite articles in 2010, 11, 12, 14 and 2015 S&C Readers' Choice Awards.

readers choice awards

AXIOM Business Books Awards, bronze medal.

AXIOM award

 

 

 

 


 

MetaTrader Formulas

HOME   Back to MetaTrader Formulas Overview

Typical price & Heikin ashi TEMA average crossings

Heikin ashi, Japanese for “average bar,” is a technique used to better visualize price trends by recalculating the standard candlesticks. This technique was introduced by Dan Valcu in 2004. The average heikin ashi closing I calculate dividing the sum of the re-calculated heikin ashi values for open, high, low and close by 4. You can use a heikin ashi TEMA average smoothed value with a zero-laging technique, crossing with a TEMA zero-lagging average closing price, to create fast reliable crossings.  

These are the formulas:

SVE_HA_Tema_ZL

// SVE_haC_Tema_ZL.mq4
// Copyright © 2010, Sylvain Vervoort - http://stocata.org/
// A zero-lagging TEMA average indicator on the average heikin ashi price
// You need also the "SVE_haC" function
// and the "SVE_TEMA_haC" function that are called by this function
// Note that you need about 5 times the choosen TEMA average before getting a usefull signal!!!

#property copyright "Copyright © 2010, Sylvain Vervoort"
#property link      "http://stocata.org/"
#property indicator_chart_window
#property indicator_buffers 1
extern int TEMA_period=30;
double TEMA1[];
double Diff[];
double Ema1[];
double Ema2[];
double Ema3[];
double ZlCl[];
// initialization function
int init()
  {
   IndicatorBuffers(6);
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,ZlCl);
   SetIndexBuffer(1,Ema1);
   SetIndexBuffer(2,Ema2);
   SetIndexBuffer(3,Ema3);
   SetIndexBuffer(4,TEMA1);
   SetIndexBuffer(5,Diff);
   IndicatorShortName("haC_TEMA_ZL("+TEMA_period+")");
   return(0);
  }
// Custom indicator SVE_haC_Tema_ZL function
int start()
  {
  int i,limit,limit2,limit3,counted_bars=IndicatorCounted();
   if (counted_bars==0)
      {
      limit=Bars-1;
      limit2=limit-TEMA_period;
      limit3=limit2-TEMA_period;
      }
   if (counted_bars>0)
      {
      limit=Bars-counted_bars-1;
      limit2=limit;
      limit3=limit2;
      }
   for (i=limit;i>=0;i--) TEMA1[i]=iCustom(NULL,0,"SVE_TEMA_haC",TEMA_period,0,i);
   for (i=limit;i>=0;i--) Ema1[i]=iMAOnArray(TEMA1,0,TEMA_period,0,MODE_EMA,i);
   for (i=limit;i>=0;i--) Ema2[i]=iMAOnArray(Ema1,0,TEMA_period,0,MODE_EMA,i);
   for (i=limit;i>=0;i--) Ema3[i]=iMAOnArray(Ema2,0,TEMA_period,0,MODE_EMA,i);
   for (i=limit;i>=0;i--) Diff[i]=TEMA1[i]-(3*Ema1[i]-3*Ema2[i]+Ema3[i]);
   for (i=limit;i>=0;i--) ZlCl[i]=TEMA1[i]+Diff[i];
   return(0);
  }
//-----------END of Function SVE_haC_Tema_ZL-------------------------------------

Special offer: "Capturing Profit with technical Analysis"

SVE_Typ_TEMA_ZL

For MetaTrader4 you can use the following formula (SVE_Typ_TEMA_ZL):
// SVE_Typ_TEMA_ZL.mq4
// a zero-lagging TEMA average indicator on the typical price.
// You need to have the function "SVE_TEMA_Typ" available! ----

#property copyright "Copyright © 2010, Sylvain Vervoort"
#property link      "http://stocata.org/"
#property indicator_chart_window
#property indicator_buffers 1
extern int TEMA_period=30;
double TEMA1[];
double Diff[];
double Ema1[];
double Ema2[];
double Ema3[];
double ZlCl[];
// Custom indicator initialization function
int init()
  {
   IndicatorBuffers(6);
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,ZlCl);
   SetIndexBuffer(1,Ema1);
   SetIndexBuffer(2,Ema2);
   SetIndexBuffer(3,Ema3);
   SetIndexBuffer(4,TEMA1);
   SetIndexBuffer(5,Diff);
   IndicatorShortName("Typ_TEMA_ZL("+TEMA_period+")");
   return(0);
  }
// Typical TEMA zero-lagging price calculation
int start()
  {
  int i,limit,counted_bars=IndicatorCounted();
//----
   if (counted_bars==0)
      {
      limit=Bars-1;
      }
   if (counted_bars>0)
      {
      limit=Bars-counted_bars-1;
      }
   for (i=limit;i>=0;i--) TEMA1[i]=iCustom(NULL,0,"SVE_TEMA_Typ",TEMA_period,0,i);
   for (i=limit;i>=0;i--) Ema1[i]=iMAOnArray(TEMA1,0,TEMA_period,0,MODE_EMA,i);
   for (i=limit;i>=0;i--) Ema2[i]=iMAOnArray(Ema1,0,TEMA_period,0,MODE_EMA,i);
   for (i=limit;i>=0;i--) Ema3[i]=iMAOnArray(Ema2,0,TEMA_period,0,MODE_EMA,i);
   for (i=limit;i>=0;i--) Diff[i]=TEMA1[i]-(3*Ema1[i]-3*Ema2[i]+Ema3[i]);
   for (i=limit;i>=0;i--) ZlCl[i]=TEMA1[i]+Diff[i];
   return(0);
  }
//------END of Function SVE_Typ_TEMA --------------------------------------

 

fast crossings with heikin ashi tema

Here you can see recent fast profitable crossings between a 55-days zero-lagging TEMA average on the typical price and a 55-days zero-lagging TEMA average on the heikin ashi closing price on the S&P500 index. Red: SVE_HA_TEMA_ZL, Blue: SVE_Typ_TEMA_ZL.

 

 

Search the Internet

 

HOME   Back to MetaStock Formulas Overview


 
 

Risk Disclosure: Futures and forex trading contains substantial risk and is not for every investor. An investor could potentially lose all or more than the initial investment. Risk capital is money that can be lost without jeopardizing ones’ financial security or life style. Only risk capital should be used for trading and only those with sufficient risk capital should consider trading. Past performance is not necessarily indicative of future results.

Hypothetical Performance Disclosure: Hypothetical performance results have many inherent limitations, some of which are described below. no representation is being made that any account will or is likely to achieve profits or losses similar to those shown; in fact, there are frequently sharp differences between hypothetical performance results and the actual results subsequently achieved by any particular trading program. One of the limitations of hypothetical performance results is that they are generally prepared with the benefit of hindsight. In addition, hypothetical trading does not involve financial risk, and no hypothetical trading record can completely account for the impact of financial risk of actual trading. for example, the ability to withstand losses or to adhere to a particular trading program in spite of trading losses are material points which can also adversely affect actual trading results. There are numerous other factors related to the markets in general or to the implementation of any specific trading program which cannot be fully accounted for in the preparation of hypothetical performance results and all which can adversely affect trading results.

See more 'Legal Disclosures' in the bottom menu bar!

Copyright © 2007 Stocata.org, All rights reserved.
-->