#property description “Nick Wong Spectrum Index”
#property strict
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Yellow
double b[];
input int Ma=200;
input int point = 23040;
//+——————————————————————+
//| Custom indicator initialization function |
//+——————————————————————+
int init()
{
//—- indicators
IndicatorBuffers(2);
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,b);
//—-
return(0);
}
//+——————————————————————+
//| Custom indicator deinitialization function |
//+——————————————————————+
int deinit()
{
//—-
//—-
return(0);
}
//+——————————————————————+
//| Custom indicator iteration function |
//+——————————————————————+
int start()
{
int counted=IndicatorCounted();
if(counted<0)
return(-1);
if(counted>0)
counted–;
int i=Bars-counted;
for(int m=0; m<i; m++)
{
b[m]=Close[m]/(iMA(NULL,0,Ma,0,MODE_SMA,PRICE_CLOSE,m)+point*Point);
}
return(0);
}
//+——————————————————————+



发表回复