下载MetaTrader 5
要添加评论,请登录注册
理解代码有困难?文章 会帮助您!
1968445
33
1968445 2008.05.11 10:11 

好晕呀,MetaEditor 太他妈的烂了,调试真的麻烦死了,我都快被搞死了,这种问题都出现。


Lao[pos]=(Low[pos]+High[pos]+Close[pos])/3;
Print("pos************************************************",pos);
Print("Lao[index]************************************************",Lao[pos]);
Print("Lao[index+1]************************************************",Lao[pos+1]);
Print("Lao[index+2]************************************************",Lao[pos+2]);
Print("Lao[index+3]************************************************",Lao[pos+3]);
Print("Lao[index+4]************************************************",Lao[pos+4]);
Ban[pos]=(Lao[pos+4]+Lao[pos+3]+Lao[pos+2]+Lao[pos+1]+Lao[pos])/5;
Print("************************************************",Ban[pos]);



2008.05.11 16:06:34 sample2 EURUSD,Daily: ************************************************0
2008.05.11 16:06:34 sample2 EURUSD,Daily: Lao[index+4]************************************************1.5627
2008.05.11 16:06:34 sample2 EURUSD,Daily: Lao[index+3]************************************************1.5716
2008.05.11 16:06:34 sample2 EURUSD,Daily: Lao[index+2]************************************************1.5689
2008.05.11 16:06:34 sample2 EURUSD,Daily: Lao[index+1]************************************************1.5725
2008.05.11 16:06:34 sample2 EURUSD,Daily: Lao[index]************************************************1.5794
2008.05.11 16:06:34 sample2 EURUSD,Daily: pos************************************************22
2008.05.11 16:06:34 sample2 EURUSD,Daily: pos++++++++++++++++++++++++++++++++++++++++++++++22
2008.05.11 16:06:34 sample2 EURUSD,Daily: ************************************************0
2008.05.11 16:06:34 sample2 EURUSD,Daily: Lao[index+4]************************************************1.564
2008.05.11 16:06:34 sample2 EURUSD,Daily: Lao[index+3]************************************************1.5627
2008.05.11 16:06:34 sample2 EURUSD,Daily: Lao[index+2]************************************************1.5716
2008.05.11 16:06:34 sample2 EURUSD,Daily: Lao[index+1]************************************************1.5689
2008.05.11 16:06:34 sample2 EURUSD,Daily: Lao[index]************************************************1.5725
2008.05.11 16:06:34 sample2 EURUSD,Daily: pos************************************************23
2008.05.11 16:06:34 sample2 EURUSD,Daily: pos++++++++++++++++++++++++++++++++++++++++++++++23
2008.05.11 16:06:34 sample2 EURUSD,Daily: ************************************************0
2008.05.11 16:06:34 sample2 EURUSD,Daily: Lao[index+4]************************************************1.5657
2008.05.11 16:06:34 sample2 EURUSD,Daily: Lao[index+3]************************************************1.564
2008.05.11 16:06:34 sample2 EURUSD,Daily: Lao[index+2]************************************************1.5627
2008.05.11 16:06:34 sample2 EURUSD,Daily: Lao[index+1]************************************************1.5716
2008.05.11 16:06:34 sample2 EURUSD,Daily: Lao[index]************************************************1.5689
2008.05.11 16:06:34 sample2 EURUSD,Daily: pos************************************************24
2008.05.11 16:06:34 sample2 EURUSD,Daily: pos++++++++++++++++++++++++++++++++++++++++++++++24
2008.05.11 16:06:34 sample2 EURUSD,Daily: ************************************************0
2008.05.11 16:06:34 sample2 EURUSD,Daily: Lao[index+4]************************************************1.5805
2008.05.11 16:06:34 sample2 EURUSD,Daily: Lao[index+3]************************************************1.5657
2008.05.11 16:06:34 sample2 EURUSD,Daily: Lao[index+2]************************************************1.564
2008.05.11 16:06:34 sample2 EURUSD,Daily: Lao[index+1]************************************************1.5627
2008.05.11 16:06:34 sample2 EURUSD,Daily: Lao[index]************************************************1.5716
2008.05.11 16:06:34 sample2 EURUSD,Daily: pos************************************************25



垃圾,垃圾,垃圾,垃圾,垃圾,垃圾,垃圾,垃圾,垃圾,垃圾,垃圾,垃圾,垃圾,垃圾,垃圾,垃圾,垃圾,垃圾,垃圾,垃圾,垃圾,垃圾,垃圾,垃圾,垃圾,垃圾,垃圾,垃圾,垃圾,垃圾,垃圾,垃圾,垃圾,

topea
74
topea 2008.05.11 15:00  

你只给pos位置的array赋值了



没有给pos+1,,,4赋值



计算机不会错



错的是你



没有用好这个工具



静下心

1968445
33
1968445 2008.05.12 02:51  

怎么没赋值

int counted_bars=IndicatorCounted();

int pos=Bars-counted_bars;

while(pos>=0)
{
Print("pos++++++++++++++++++++++++++++++++++++++++++++++",pos);
CloseBuffer[pos]=iMA(NULL,0,1,0,MODE_EMA,PRICE_CLOSE,pos);
Lao[pos]=(Low[pos]+High[pos]+Close[pos])/3;
Print("pos************************************************",pos);
Print("Lao[index]************************************************",Lao[pos]);
Print("Lao[index+1]************************************************",Lao[pos+1]);
Print("Lao[index+2]************************************************",Lao[pos+2]);
Print("Lao[index+3]************************************************",Lao[pos+3]);
Print("Lao[index+4]************************************************",Lao[pos+4]);
double a = (Lao[pos+4]+Lao[pos+3]+Lao[pos+2]+Lao[pos+1]+Lao[pos])/5;
Print("************************************************",a);
Ban[pos] = a;
Print("Ban[pos]************************************************",Ban[pos]);

pos--;
}

1968445
33
1968445 2008.05.12 02:59  

topea 不过谢谢你关注呀,搞这个人少的可怜,没人交流,郁闷呀。

我们来想用移植一个大智慧股票的算法,没想到问题太多了,最主要就是 MetaEditor 运行效率太差了,两个for 循环,立即死掉。后来我改用dll,外部调用

vc6++ 写的dll,import运行却出现,错误。真是受不了了。

2008.05.12 08:57:38 test EURUSD,M1: expert stopped
2008.05.12 08:57:38 test EURUSD,M1: cannot load library 'test.dll' (error 126)
2008.05.12 08:57:38 test EURUSD,M1: initialized
2008.05.12 08:57:31 test EURUSD,M1: loaded successfully

startexcel
30
startexcel 2008.05.13 04:02  

本人MT4编程和C编程还可以.qq:6066484,可以交流

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