请求帮助!谢谢(
MT4编程)
我是新手,在
学习MT4编程,下面的程序在MT4中为什么没有显示啊?
请高手指点,谢谢!!
//+------------------------------------------------------------------+
//| CZY.mq4 |
//| Copyright ?2007, MetaQuotes Software Corp. |
//|
http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright ?2007, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 White
extern int Xperiod=14;
extern int Maperiod1=5;
double ind_buffer0[];
double ind_buffer1[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID,2);
SetIndexBuffer(0,ind_buffer0);
IndicatorShortName("CZY("+Maperiod1+")");
SetIndexLabel(0,"CZY");
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int limit,i;
int counted_bars=IndicatorCounted();
//---- check for possible errors
if(counted_bars<0) return(-1);
//---- last counted bar will be recounted
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
//----
for(i=0; i<limit; i++)
ind_buffer1=iRSI(NULL,0,Xperiod,PRICE_CLOSE,i);
for(i=0; i<limit; i++)
ind_buffer0=iMAOnArray(ind_buffer1,0,Maperiod1,0,MODE_EMA,i);
//----
return(0);
}
//+------------------------------------------------------------------+
[
本帖最后由 shadowczy 于 2007-12-19 15:32 编辑 ]