遇到严重的死循环求助 新评论 sungge 2009.08.16 06:51 我在求最近一个分形的值时遇到死循环,希望高手能帮帮我,谢谢了啊; 代码如下: int start() {int i,limit; int counted_bars = IndicatorCounted(); if(counted_bars < 0) return(-1); if(counted_bars > 0) counted_bars--; limit = Bars - counted_bars; for(i = 0; i <= limit; i++) { double FUP=iFractals(NULL, 0, MODE_UPPER, i+3); if(FUP==0){ for(int f=i+f;FUP==0;f++){ FUP=iFractals(NULL, 0, MODE_UPPER, f);} } } 为什么会死循环,该如何求出最近一个分形的值,请高手指教。 Number of bars from the last Fractal Up How to code? Array out of range exception when debugging okwh 2009.08.18 13:45 #1 for(int f=i+f;FUP==0;f++) 不要写这样的语句 ! f 也没有初值。 新评论 您错过了交易机会: 免费交易应用程序 8,000+信号可供复制 探索金融市场的经济新闻 注册 登录 拉丁字符(不带空格) 密码将被发送至该邮箱 发生错误 使用 Google 登录 您同意网站政策和使用条款 如果您没有帐号,请注册 可以使用cookies登录MQL5.com网站。 请在您的浏览器中启用必要的设置,否则您将无法登录。 忘记您的登录名/密码? 使用 Google 登录
我在求最近一个分形的值时遇到死循环,希望高手能帮帮我,谢谢了啊;
代码如下:
int start()
{int i,limit;
int counted_bars = IndicatorCounted();
if(counted_bars < 0)
return(-1);
if(counted_bars > 0)
counted_bars--;
limit = Bars - counted_bars;
for(i = 0; i <= limit; i++) {
double FUP=iFractals(NULL, 0, MODE_UPPER, i+3);
if(FUP==0){
for(int f=i+f;FUP==0;f++){
FUP=iFractals(NULL, 0, MODE_UPPER, f);}
}
}
为什么会死循环,该如何求出最近一个分形的值,请高手指教。