Hi,
Found from:
http://www.forex-tsd.com/metatrader-4/860-2-lsma-color-indicator.html
Found from:
http://www.forex-tsd.com/metatrader-4/860-2-lsma-color-indicator.html
Code:
//+-------------------------------------------------------------------+
//| Trigger Line |
//| Copyright 2005 dwt5 and adoleh2000 |
//| http://www.metaquotes.net |
//| Modified by Kelvinhand |
//+-------------------------------------------------------------------+
#property copyright "Copyright 2005 dwt5 and adoleh2000 "
#property link "http://www.metaquotes.net/"
//---- indicator settings
#property indicator_chart_window
#property indicator_buffers 4
#property indicator_color1 Red
#property indicator_color2 Red
#property indicator_color3 DeepSkyBlue
#property indicator_color4 DeepSkyBlue
//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];
double ExtMapBuffer4[];
double wt[];
double lsma_ma[];
extern int Rperiod = 55;
extern int LSMA_Period = 144;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- 7 additional buffers are used for counting.
IndicatorBuffers(6);
//---- drawing settings
SetIndexBuffer(0,ExtMapBuffer1);
SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,1);
SetIndexBuffer(1,ExtMapBuffer2);
SetIndexStyle(1,DRAW_LINE,STYLE_SOLID,1);
SetIndexBuffer(2,ExtMapBuffer3);
SetIndexStyle(2,DRAW_LINE,STYLE_SOLID,1);
SetIndexBuffer(3,ExtMapBuffer4);
SetIndexStyle(3,DRAW_LINE,STYLE_SOLID,1);
SetIndexBuffer(4,wt);
SetIndexBuffer(5,lsma_ma);
//---- initialization done
return(0);
}
int start()
{
//***** Modified by Kelvinhand ***********************
int counted_bars = IndicatorCounted();
//---- check for possible errors
if (counted_bars<0) return(-1);
//---- last counted bar will be recounted
if (counted_bars>0) counted_bars--;
int i,j;
double lengthvar;
double sum ;
int limit = Bars - counted_bars - Rperiod;
for(i = limit; i >= 0; i--) // MAIN For Loop
{
sum = 0;
for(j = Rperiod; j >= 1 ; j--) //LSMA loop
{
lengthvar = (Rperiod + 1)/3.0; //lengthvar = 21
sum+= ( j - lengthvar)*Close[Rperiod-j+i]; //tmp = 20 - 7 * close[20-j+i]
}
wt[i] = sum*6/(Rperiod*(Rperiod+1));
lsma_ma[i] = wt[i+1] + (wt[i]-wt[i+1])* 2/(LSMA_Period+1);
ExtMapBuffer1[i] = wt[i];
ExtMapBuffer2[i] = lsma_ma[i];
ExtMapBuffer3[i] = wt[i];
ExtMapBuffer4[i] = lsma_ma[i];
if (wt[i] < lsma_ma[i])
{
ExtMapBuffer4[i] = EMPTY_VALUE;
ExtMapBuffer3[i] = EMPTY_VALUE;
}
}
}
//+------------------------------------------------------------------+
I found this indicator for MT could not find it for amibroker howmuch ever searched, its named as FX Super CrossOver for MT.......if someone has this can u please share it here......posting the screenshots of the indicator.
Last edited: