汇市提款机 2008-5-29 19:27
求教
老师给看下哪里不对
//+------------------------------------------------------------------+
//| MaGrad.mq4 |
//| Copyright ?2006, MetaQuotes Software Corp. |
//| [url]http://www.metaquotes.net[/url] |
//+------------------------------------------------------------------+
#property copyright "Copyright ?2006, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"
#property indicator_sep***te_window
#property indicator_buffers 3
#property indicator_color1 Red
#property indicator_color2 DarkTurquoise
#property indicator_color3 LightGreen
#property indicator_level1 0
#property indicator_level2 15
#property indicator_level3 30
#property indicator_level4 45
#property indicator_level5 60
#property indicator_level6 -15
#property indicator_level7 -30
#property indicator_level8 -45
//---- input p***meters
extern int P_MA = 20;
extern int KPeriod = 1;
extern int DPeriod = 3;
extern int SPeriod = 5;
//---- buffers
double ExtMapBuffer0[];
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
IndicatorBuffers(4);
SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,0);
SetIndexBuffer(0,ExtMapBuffer0);
SetIndexStyle(1,DRAW_LINE,STYLE_SOLID,0);
SetIndexBuffer(1,ExtMapBuffer1);
SetIndexStyle(3,DRAW_NONE);
SetIndexBuffer(3,ExtMapBuffer);
SetIndexStyle(2,DRAW_LINE,STYLE_SOLID,0);
SetIndexBuffer(2,ExtMapBuffer2);
IndicatorDigits(Digits+1);
IndicatorShortName("MaGrad("+P_MA+","+KPeriod+","+DPeriod+")");
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
int limit;
int counted_bars=IndicatorCounted();
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
for(int i=0; i<limit; i++)
ExtMapBuffer=(iMA(NULL,0,P_MA,0,MODE_EMA,PRICE_CLOSE,i)
-iMA(NULL,0,P_MA,0,MODE_EMA,PRICE_CLOSE,i+KPeriod))/KPeriod/Point;
for(i=0; i<limit; i++)
ExtMapBuffer2=iMAOnArray(ExtMapBuffer,Bars,DPeriod,0,MODE_SMA,i);
for(i=limit-1;i>=0; i--)
{
if(ExtMapBuffer>ExtMapBuffer[i+1])
{ExtMapBuffer0=ExtMapBuffer;
if (ExtMapBuffer[i+1]<ExtMapBuffer[i+2]) ExtMapBuffer0[i+1]=ExtMapBuffer[i+1];
}
if(ExtMapBuffer<ExtMapBuffer[i+1])
{ExtMapBuffer1=ExtMapBuffer;
if (ExtMapBuffer[i+1]>ExtMapBuffer[i+2]) ExtMapBuffer1[i+1]=ExtMapBuffer[i+1];
}
}
}
//+------------------------------------------------------------------+
xfxyldj 2008-5-29 19:32
不知道你要实现什么目的,也不知道你遇到了什么问题。
汇市提款机 2008-5-29 19:53
怎么出现了乱码?
星号处字母是sep***te和p***meters
startexcel 2008-5-30 10:42
indicator_sep***te_window
***是什么?
大维 2008-5-30 11:10
[quote]原帖由 [i]汇市提款机[/i] 于 2008-5-29 19:55 发表 [url=http://www.onefx.net/bbs/redirect.php?goto=findpost&pid=235899&ptid=45480][img]http://www.onefx.net/bbs/images/common/back.gif[/img][/url]
奇怪!
sep***te p***meters [/quote]
***这部分的文字,每个字母间都加一个空格就可以发上来。