为稳定盈利 提供动力

这里是我的工作总结和我感性上的碎碎念 3BFund Quant leader CFA 从业6Y Email: wongmanc@88.com

Nick Wong Spectrum Index(NWSI)尼克王频谱(余象)指数


#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);
}
//+——————————————————————+

 

 

 

 


发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注