您需要 登录 才可以下载或查看,没有帐号?注册
#property indicator_separate_window
#property indicator_buffers 3
#property indicator_color1 DodgerBlue
#property indicator_color2 White
#property indicator_color3 Blue
#property indicator_level1 0
//---- input parameters
extern int L1=6; //乖离率周期1。
extern int L2=12; //乖离率周期2。
extern int L3=24; //乖离率周期3。
extern int PRICE_MODE=0; //价格模式.0=Close,1=Open,2=High,3=Low。
//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];
int limit;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
string short_name;
switch(PRICE_MODE)
{
case 1 : short_name= Bias_O( break;
case 2 : short_name= Bias_H( break;
case 3 : short_name= Bias_L( break;
default
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,ExtMapBuffer1);
SetIndexDrawBegin(0,L1);
SetIndexLabel(0,short_name+L1+ )
SetIndexStyle(1,DRAW_LINE);
SetIndexBuffer(1,ExtMapBuffer2);
SetIndexDrawBegin(1,L2);
SetIndexLabel(1,short_name+L2+ )
SetIndexStyle(2,DRAW_LINE);
SetIndexBuffer(2,ExtMapBuffer3);
SetIndexDrawBegin(2,L3);
SetIndexLabel(2,short_name+L3+ )
IndicatorShortName( Bias( +L1+ , +L2+ , +L3+ )
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int i,counted_bars=IndicatorCounted();
//----
if(counted_bars0) counted_bars--;
limit=Bars-counted_bars;
switch(PRICE_MODE)
{
case 0 : C(); break;
case 1 : O(); break;
case 2 : H(); break;
case 3 : L();
}
//----
return(0);
}
//+------------------------------------------------------------------+
void C()
{
int i;
for (i=0;i
外汇交易有很大的风险性,本站所有资源均来自网络,请选择使用,如若出现亏损,本站不承担任何责任!