有您的持续关注
我们会做得更好

标准偏差通道指标 Standard_Deviation_Channels



Standard_Deviation_Channels指标是在线性回归趋势的基础上绘制标准偏差通道,显示了通过图表价格相差两个点的最小二乘法计算所得的通常的趋势线。

Standard_Deviation_Channels指标图表效果:Standard_Deviation_Channels指标Standard_Deviation_Channels指标源码:

//+------------------------------------------------------------------+
//|                                  Standard Deviation Channels.mq4 |
//|                 Copyright @2006, tageiger, aka fxid10t@yahoo.com |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright @2006, tageiger, aka fxid10t@yahoo.com"
#property link      "http://www.125808047.com/"
//----
#property indicator_chart_window
//----
extern int STD_Rgres_period=0; 
/*
default 0 means the channel will use the open 
time from "x" bars back on which ever time period 
the indicator is attached to.  one can change to 1,5,
15,30,60...etc to "lock" the start time to a specific 
period, and then view the "locked" channels on a different time period...
*/
extern int STD_Rgres_length=56;     // bars back regression begins
extern double STD_Rgres_width=1.618;// widest channel
extern double STD_width=0.618;      // inside channel
//----
int init()   
{ 
   return(0);
}
   int deinit()   
{
   ObjectDelete("regression channel");ObjectDelete("std channel");return(0);
 Comment("www.125808047.com");
}
   int start()   
{
//to refresh properly delete old objects...
   ObjectDelete("regression channel");ObjectDelete("std channel");
//widest channel   
   ObjectCreate("regression channel",OBJ_STDDEVCHANNEL,0,iTime(Symbol(),STD_Rgres_period,STD_Rgres_length), Close[STD_Rgres_length],Time[0],Close[0]);
   ObjectSet("regression channel",OBJPROP_DEVIATION,STD_Rgres_width);
   ObjectSet("regression channel",OBJPROP_COLOR,Orange);
   ObjectSet("regression channel",OBJPROP_RAY,true);
//inside channel
   ObjectCreate("std channel",OBJ_STDDEVCHANNEL,0,iTime(Symbol(),STD_Rgres_period,STD_Rgres_length), Close[STD_Rgres_length],Time[0],Close[0]);
   ObjectSet("std channel",OBJPROP_DEVIATION,STD_width);
   ObjectSet("std channel",OBJPROP_COLOR,Olive);
   ObjectSet("std channel",OBJPROP_RAY,true);
   return(0);
//----
}
//+------------------------------------------------------------------+

如您喜欢此文章请点下面分享按钮↴峰汇在线 » 标准偏差通道指标 Standard_Deviation_Channels
上一篇:
下一篇:
分享到:更多 ()