Can anyone help with this code???
Hey people,
Below is the code for one of the indicators I have downloaded. I just wondered if anyone who is familiar with MT4 code could tell me if this indicator repaints its self after the fact?
I don't know much about it, or what it is based on but would be interested in any info you can give!!
As always, many thanks.
R
.................................................. .................................................. .
//++
// CoeffofLine.mq4 
// Ramdass  Conversion only 
//++
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Red
extern int ndot=30;
extern int CountBars=10000;
// buffers
double cfl[];
//++
// Custom indicator initialization function 
//++
int init()
{
string short_name;
// indicator line
IndicatorBuffers(1);
SetIndexStyle(0,DRAW_HISTOGRAM);
SetIndexBuffer(0,cfl);
//
return(0);
}
//++
// CoeffofLine_v1 
//++
int start()
{
if (CountBars>=Bars) CountBars=Bars;
SetIndexDrawBegin(0,BarsCountBars+ndot+1);
int i,shift,cnt,ndot1,counted_bars=IndicatorCounted();
double TYVar,ZYVar,TIndicatorVar,ZIndicatorVar,M,N,AY,AIn dicator;
//
if(Bars<=ndot) return(0);
//
shift=CountBarsndot1;
while(shift>=0)
{
TYVar=0;
ZYVar=0;
N=0;
M=0;
TIndicatorVar=0;
ZIndicatorVar=0;
ndot1=ndot;
if (shift+1<ndot1) ndot1=shift+1;
for (cnt=ndot; cnt>=1; cnt)
{
N=N+cnt*cnt;
M=M+cnt;
}
for (cnt=ndot1; cnt>=1; cnt)
{
ZYVar=ZYVar+(High[shiftcnt+1]+Low[shiftcnt+1])/2*(ndot+1cnt);
TYVar=TYVar+(High[shiftcnt+1]+Low[shiftcnt+1])/2;
ZIndicatorVar=ZIndicatorVar+iMA(NULL,0,5,3,MODE_SM MA,PRICE_MEDIAN,shiftcnt+1)*(ndot+1cnt);
TIndicatorVar=TIndicatorVar+iMA(NULL,0,5,3,MODE_SM MA,PRICE_MEDIAN,shiftcnt+1);
}
AY=(TYVar+(N2*ZYVar)*ndot/M)/M;
AIndicator=(TIndicatorVar+(N2*ZIndicatorVar)*ndot/M)/M;
if (Symbol()=="EURUSD"  Symbol()=="GBPUSD"  Symbol()=="USDCAD"  Symbol()=="USDCHF"
 Symbol()=="EURGBP"  Symbol()=="EURCHF"  Symbol()=="AUDUSD"
 Symbol()=="GBPCHF")
{cfl[shift]=(1000)*MathLog(AY/AIndicator);}
else {cfl[shift]=(1000)*MathLog(AY/AIndicator);}
shift;
}
return(0);
}
//++
__________________ Do, or do not, there is no such thing as try.
__________________ I'm easily pleased with perfection, and if trading is an art, then I'm painting my masterpiece.
__________________ If the margin between your goal and failure is too small then any shortfall will inevitably lead to failure.
It's far better to aim high because if you don't quite achieve your ambition you may very well be left with something worthwhile.
__________________
