This forum is in read-only mode now. You may discuss your questions on forums of MQL4.community and MQL5.community
geting zero values from indecators in the init functionBack to topics list |
|
johny_abo
2005.08.01 13:53
int init()
{
//----
double adx,ma5,maxp13,maxp21; // the graphs value
ma5=iMA(NULL,PERIOD_H1,5,0,MODE_SMA,PRICE_CLOSE,0);
maxp13=iMA(NULL,PERIOD_H1,13,0,MODE_EMA,PRICE_CLOSE,0);
maxp21=iMA(NULL,PERIOD_H1,21,0,MODE_EMA,PRICE_CLOSE,0);
adx=iADX(NULL,PERIOD_H1,14,PRICE_CLOSE,0,0);
Print("ADX="+adx + " MA5 " +ma5 +" MAXP13 :"+maxp13+" MAXP21 :"+maxp21);
}
|
|
Slawa
2005.08.01 14:40
please analyze result from GetLastError function
|
|
johny_abo
2005.08.01 14:48
please analyze result from GetLastError function the returend value is 0 no error |
|
Slawa
2005.08.01 14:55
GetLastError after first indicator call (ma5=...)
it may be 4066. it may be no data when initialization. there are no reasons to call indicators in the init function |
|
Vooch
2005.08.04 09:46
1). Try using 60 instead of PERIOD_H1.
2). Put that code in the start() function instead of inside the init() function. - Vooch |
Download MetaTrader 5 (450 Kb, web installer) — a new terminal for financial markets
