下载MetaTrader 5
要添加评论,请登录注册
启用MQL5存储来存储您的源代码。这是免费的!
beensu
5
beensu 2011.03.07 11:55 

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 Green
extern int 变色均线=18;
double duo[],aspect[],stopprice1,aspect1;
double kong[],stopprice[],stopnum;
int init()
{
SetIndexBuffer(0,aspect1);
SetIndexBuffer(1,stopprice1);
SetIndexStyle(0,DRAW_LINE);
SetIndexStyle(1,DRAW_LINE);
SetIndexDrawBegin(0,变色均线);
SetIndexDrawBegin(1,变色均线);
IndicatorDigits(Digits);
return(0);
}
int start()

{

double temp0,temp1;
int limit;
int counted_bars=IndicatorCounted();
if(counted_bars<0) return(-1);
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
aspect[Bars-1] =0;
stopnum =.02;
stopprice[Bars-1] =0;
if (limit ==Bars-1)

//多头处理
for(int i=limit; Low[i] <= stopprice[i]; i--)

//多反空
{aspect[i]= 1;
stopprice[i]= High[i]+stopnum;}

if (Low[i] - stopnum > stopprice[i])
{ stopprice[i] = Low[i]-stopnum;}

else
{
if (High[i] >= stopprice[i])

//空头处理


//空反多
{ aspect[i]= 0;
stopprice[i] = Low[i]-stopnum;}


//处理移动的底部
if (High[i] + stopnum < stopprice[i])
{stopprice[i] = High[i]+stopnum;}

}
stopprice1=stopprice[i];

return(0);
}

angelstar
73
angelstar 2011.03.09 10:43  

你的这个是什么意思?

1SetIndexBuffer(0,aspect1);
SetIndexBuffer(1,stopprice1);

aspect1, stopprice1 都必须是数组。你定义的不是

2.limit ==Bars-1 永远不相等。画不出图来

/
要添加评论,请登录注册