错误、漏洞、问题 - 页 378

 

为什么表达 "if(ichi.TenkanSen(i)< ichi.KijunSen(i))"总是(在所有的蜡烛上)返回错误,即使在 "if(ichi.TenkanSen(i)> ichi.KijunSen(i))"?似乎是标准库中 的一个小故障。完整的代码在文件中。

Comment(DoubleToString(ichi.TenkanSen(0),5));

在欧元兑美元方面,它的产出是

附加的文件:
Ich_1.mq5  3 kb
 
Graff:

为什么表达 "if(ichi.TenkanSen(i)< ichi.KijunSen(i))"总是(在所有的蜡烛上)返回错误,即使在 "if(ichi.TenkanSen(i)> ichi.KijunSen(i))"?似乎是标准库中 的一个小故障。文件中的全部代码

首先,TerminalInfoInteger(TERMINAL_MAXBARS) - 你不能这样做。

替换为费率_总数


第二,是的,存在一个错误,即m_data_total一直=0。因此,我们没有价值。

 
sergeev:

首先是TerminalInfoInteger(TERMINAL_MAXBARS) - 你不能这样做。

替换为费率_总数

我用for(int i=0; i<=rates_total-1; i++)替换了它,事实上,没有任何变化。
 
第二,是的,有一个错误,m_data_total =0一直是。这就是为什么没有价值。
 
sergeev:

第二,是的,有一个错误,m_data_total =0一直是。因此,没有任何价值。
试着改变Comment(DoubleToString(ichi.TenkanSen(3),5))中的数值;在Comment中的1,2,3的数值一直是一样的。也许促使该调整使其发挥作用,而官方修复等待没有机会。
 
Graff:
我试着把Comment(DoubleToString(ichi.TenkanSen(3),5))中的数值改为1,2,3,在Comment中不断显示相同的东西。你能不能建议调整一下,让它发挥作用,然后官方修复等待没有机会。
不要使用这个类别。采取通常的处理方法。
 
sergeev:
不要使用这个类。拿着普通的手柄。

你用起来不是很舒服...

好的,感谢您的关注,等待修复。

 
Graff:

使用起来不是很舒服...

好的,感谢您的关注,等待修复。

你不觉得它很舒服吗?:)

int ich;

//+------------------------------------------------------------------+
int OnInit()
  {
   ich=iIchimoku(_Symbol,_Period, TenkanSen, KijunSen, SenkoSpan);
   return(0);
  }
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
    IndicatorRelease(ich);
  }
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
   double ten[]; CopyBuffer(ich, 0, 0, rates_total, ten);
   double kij[]; CopyBuffer(ich, 1, 0, rates_total, kij);
   for(int i=0; i<rates_total; i++)
     {
      if(ten[i]<kij[i]) { up.Create(0,"Tenkan>Kijun"+IntegerToString(i),0,time[i],low[i]); up.Color(clrLimeGreen); }
      else { down.Create(0,"Tenkan<Kijun"+IntegerToString(i),0,time[i],high[i]); down.Color(clrTomato); }
     }
   return(rates_total);
  }
 
sergeev:

那不是很舒服吗?:)


我不是一个程序员,我对这种安排不是很适应。

改动是否有意义

CopyBuffer(ich, 1, 0, rates_total, kij);

BarsCalculated(ich)代替rate_total?

PS:那你来自哪个城市,如果不是一个秘密的话?

 
Graff:


好的,谢谢你的关注,等待修复。

顺便问一下,你确定你不需要调用任何额外的函数吗?

该库同时具有Refresh和 BufferResize。在我看来,它们是正常运作的必要条件。

原因: