finally found this code of MT4 in our forum itself........can someone please convert this for amibroker it will really be very helpful......can somenone plz check this code in mt4 and tell if this the same code that I'm in search of.......
//+-------------------------------------------------------------------+
//| 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
= sum*6/(Rperiod*(Rperiod+1));
lsma_ma = wt[i+1] + (wt-wt[i+1])* 2/(LSMA_Period+1);
ExtMapBuffer1 = wt;
ExtMapBuffer2 = lsma_ma;
ExtMapBuffer3 = wt;
ExtMapBuffer4 = lsma_ma;
if (wt < lsma_ma)
{
ExtMapBuffer4 = EMPTY_VALUE;
ExtMapBuffer3 = EMPTY_VALUE;
}
}
}
//+------------------------------------------------------------------+