You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
i write such code in experts , it can work !
#include <Indicators\Trend.mqh>
CiMA *ma;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
ma=new CiMA;
ma.Create(Symbol(),PERIOD_CURRENT,20,0,MODE_EMA,PRICE_CLOSE);
ma.Refresh(-1);
Alert(ma.Main(0));
return(0);
}
the successed result is :
but ,the same code is used in indicator that are create by me !,it can not work !
#include <Indicators\Trend.mqh>
CiMA *ma;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
ma=new CiMA;
ma.Create(Symbol(),PERIOD_CURRENT,20,0,MODE_EMA,PRICE_CLOSE);
ma.Refresh(-1);
Alert(ma.Main(0));
return(0);
}
the result is not right , please see:
why make the different result ? who can tell you ,thank you very much!