初学者的问题 MQL5 MT5 MetaTrader 5 - 页 1287

 

请指教!

如何从MQL5的成交量中计算EMA。在MQL4中,有一个iMAonArray()函数,但在MQL5中,我知道没有这样一个函数。

 
Madmas:

请指教!

如何从MQL5的成交量中计算EMA。在MQL4中,它有iMAonArray()函数,但在MQL5中,我认为它没有。

我必须iVolumes指标创建一个手柄然后创建一个iMA指标 手柄,但使用iVolumes手柄而不是价格

//--- create handle of the indicator
   handle_iVolumes=iVolumes(Symbol(),Period(),Inp_Volumes_applied_volume);
//--- if the handle is not created
   if(handle_iVolumes==INVALID_HANDLE)
     {
      //--- tell about the failure and output the error code
      PrintFormat("Failed to create handle of the iVolumes indicator for the symbol %s/%s, error code %d",
                  Symbol(),
                  EnumToString(Period()),
                  GetLastError());
      //--- the indicator is stopped early
      return(INIT_FAILED);
     }
//--- create handle of the indicator iMA
   handle_iMA=iMA(Symbol(),Period(),Inp_MA_ma_period,Inp_MA_ma_shift,
                  Inp_MA_ma_method,handle_iVolumes);
//--- if the handle is not created
   if(handle_iMA==INVALID_HANDLE)
     {
      //--- tell about the failure and output the error code
      PrintFormat("Failed to create handle of the iMA indicator for the symbol %s/%s, error code %d",
                  Symbol(),
                  EnumToString(Period()),
                  GetLastError());
      //--- the indicator is stopped early
      return(INIT_FAILED);
     }

结果。

启用MAVolumesOnMA

附加的文件:
 
Vladimir Karputov:

我们需要 iVolumes指标创建一个句柄然后创建一个iMA指标手柄但用iVolumes手柄代替价格

结果。


谢谢你,我将研究一下))))....。

 
Madmas:

谢谢,我将研究一下)))).... 学

只需注意:这可能不会给出正确的数据......。

 
Сергей Таболин:

只需注意:这可能不会给出正确的数据......

为什么?这和它有什么关系?如果是这样,还有什么其他选择?

 
Madmas:

为什么?这与什么有关?

我不知道...在论坛上问过这个问题--没有答案......

 
Сергей Таболин:

我不知道...在论坛上问过这个问题--没有答案......

数据有什么问题?从视觉上看,它似乎与成交量+MA指标 相匹配,我滚动了一下历史记录

 
Сергей Таболин:

我不知道...在论坛上问过这个问题--没有答案......

唯一的区别是长和双的数据类型

 
Madmas:

唯一的区别是数据类型 long和double

看一看这个。这可能不是一个普遍的故障,但在一个特定的情况下,它也是紧张的...

MT5 :: Где искать ошибку? Или ошибка индикатора, работающего по данным другого индикатора?
MT5 :: Где искать ошибку? Или ошибка индикатора, работающего по данным другого индикатора?
  • 2020.10.13
  • www.mql5.com
Здравствуйте. У меня есть тиковый индикатор, который не привязан ни к какому ТФ. На его основе, я написал советник...
 
与本主题无关的评论已被移至 "MQL4 MT4 MetaTrader 4初学者的问题"。
原因: