大神求助代码
哪位大神帮忙看一下,代码有问题,看不懂,不知道怎么破。。//+------------------------------------------------------------------+
//| BIAS-乖离率指标.mq4 |
//| FXLong技术部编写 |
//| http://www.fxlong.com/ |
//+------------------------------------------------------------------+
#property copyright"一条龙外汇网:www.fxlong.com"
#propertylink "http://www.fxlong.com/"
//---- indicator settings
#propertyindicator_separate_window
#propertyindicator_buffers 1
#propertyindicator_color1DarkViolet
//---- Level Lines
#property indicator_level1 0
//---- indicator parameters
extern int MA1=20;
//---- indicator buffers
double MA1Buffer[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicator buffers mapping
SetIndexStyle(1,DRAW_HISTOGRAM);
SetIndexBuffer(0,AtrBuffer);
SetIndexBuffer(1,TempBuffer);
//---- name for DataWindow and indicator subwindow label
IndicatorShortName("偏离度("+MA1+")");
SetIndexLabel(0,"偏离度");
//---- initialization done
return(0);
}
//+------------------------------------------------------------------+
//| Moving Averages Convergence/Divergence |
//+------------------------------------------------------------------+
int start()
{
int limit;
int counted_bars=IndicatorCounted();
//---- last counted bar will be recounted
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
//---- bias counted in the 1-st buffer
for(int i=0; i<limit; i++)
{
if(Close> iMA(NULL,0,MA1,0,MODE_SMA,PRICE_CLOSE,i))
{ MA1Buffer= 10000*(High- iMA(NULL,0,MA1,0,MODE_SMA,PRICE_CLOSE,i));
}
else
{ MA1Buffer= 10000*(Low- iMA(NULL,0,MA1,0,MODE_SMA,PRICE_CLOSE,i));
}
//---- done
return(0);
}
//+------------------------------------------------------------------+ 都有代碼了 還要破什麼:L bb2260 发表于 2014-11-3 20:00
都有代碼了 還要破什麼
这个代码有问题,运行不了{:soso_e154:}
:({:soso_e106:}不要沉,希望大神出来解救一下 找版主吧 这是植入广告的小技巧,有意把某一两行写错 //---- indicator buffers mapping
IndicatorBuffers(1);
SetIndexStyle(0,DRAW_HISTOGRAM);
SetIndexBuffer(0,MA1Buffer);
//SetIndexBuffer(0,AtrBuffer);
//SetIndexBuffer(1,TempBuffer);
//---- name for DataWindow and indicator subwindow label 给你修改了
//+------------------------------------------------------------------+
//| BIAS-乖离率指标.mq4 |
//| FXLong技术部编写 |
//| http://www.fxlong.com/ |
//+------------------------------------------------------------------+
#property copyright"一条龙外汇网:www.fxlong.com"
#propertylink "http://www.fxlong.com/"
//---- indicator settings
#propertyindicator_separate_window
#propertyindicator_buffers 1
#propertyindicator_color1DarkViolet
//---- Level Lines
#property indicator_level1 0
//---- indicator parameters
extern int MA1=20;
//---- indicator buffers
double MA1Buffer[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicator buffers mapping
SetIndexStyle(0,DRAW_HISTOGRAM);
SetIndexBuffer(0,MA1Buffer);
//---- name for DataWindow and indicator subwindow label
IndicatorShortName("偏离度("+MA1+")");
SetIndexLabel(0,"偏离度");
//---- initialization done
return(0);
}
//+------------------------------------------------------------------+
//| Moving Averages Convergence/Divergence |
//+------------------------------------------------------------------+
int start()
{
int limit;
int counted_bars=IndicatorCounted();
//---- last counted bar will be recounted
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
//---- bias counted in the 1-st buffer
for(int i=0; i<limit; i++)
{
if(Close> iMA(NULL,0,MA1,0,MODE_SMA,PRICE_CLOSE,i))
{ MA1Buffer= 10000*(High- iMA(NULL,0,MA1,0,MODE_SMA,PRICE_CLOSE,i));
}
else
{ MA1Buffer= 10000*(Low- iMA(NULL,0,MA1,0,MODE_SMA,PRICE_CLOSE,i));
}
//---- done
}
return(0);
}
//+------------------------------------------------------------------+ 学习学习
页:
[1]