iCCI problem in strategy tester

 
I have an ea that is using iCCI function.
If I put the ea on daily period in the tester and i use a 1 hour timeframe in iCCI then it allways returns 0. It does the same for 4 hour as well.
I am using build 206 dated 6th June.
here is a cut down version of what i do that reproduces the problem:

#property copyright ""
#property link      ""
int init()
{
 return(0);
}
int deinit()
{
   return(0);
}
int start()
{
   double cci = iCCI(NULL, PERIOD_H1, 7, PRICE_TYPICAL, 1);
   Comment(DoubleToStr(cci,4));
   return(0);
}
 
Make sure that h1 chart is open.
Try to comment returned value from GetLastError() function
 
Not sure what you mean by "make sure h1 chart is open"

It is in strategy tester as i said, not in normal operation. Visual mode is on - that's how i can see the comments. As i said period is Daily or H4.

How do i open H1 chart in strategy tester when it is doing a daily or H4 test?

i added your getlasterror. it says it was error 4054

Make sure that h1 chart is open.
Try to comment returned value from GetLastError() function
 
It means "just open h1 chart". And note that your h1 data can cover not all daily data. (for example daily data begins from 1999.01.01 and hourly data begins from 2004.01.01)
 
But doesn't the strategy tester user fractals to fill in the missing data so that it behaves like ticks?

If it works like you say then there must be another function that will tell you if you have enough data to call an indicator.


It means "just open h1 chart". And note that your h1 data can cover not all daily data. (for example daily data begins from 1999.01.01 and hourly data begins from 2004.01.01)
 
These articles do not answer the question that this issue has led me to which is:

In an ea how do i test if an indicator will have enough data to succeed?


 
Attach this EA:
//+------------------------------------------------------------------+
//|                                                       thebts.mq4 |
//|                      Copyright © 2007, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.ru/ |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2007, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net/forum/3132//"

//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
  string CommString;
  int err;
//----
   double cci = iCCI(NULL, PERIOD_H1, 7, PRICE_TYPICAL, 1);
   CommString=DoubleToStr(cci,4);
   err=GetLastError();
   if (err!=0)  CommString=StringConcatenate(CommString,"  error code = ", err);
   Comment(CommString);
//----
   return(0);
  }
//+------------------------------------------------------------------+



 
And do what?
I already did this. That's how i knew it was error 4054.
It does not answer my question unless you are suggesting that i check the get last error every time i call an indicator. This is a very bad anti pattern.
I should either be able to test the data somehow or i should be able to do a try/catch (yes i know try/catch is not part of the language).



Attach this EA:
//+------------------------------------------------------------------+
//|                                                       thebts.mq4 |
//|                      Copyright © 2007, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.ru/ |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2007, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net/forum/3132//"

//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
  string CommString;
  int err;
//----
   double cci = iCCI(NULL, PERIOD_H1, 7, PRICE_TYPICAL, 1);
   CommString=DoubleToStr(cci,4);
   err=GetLastError();
   if (err!=0)  CommString=StringConcatenate(CommString,"  error code = ", err);
   Comment(CommString);
//----
   return(0);
  }
//+------------------------------------------------------------------+



 
It's very strange. My backtest in visual mode pass done. See picture.



Without visual mode back testing also correct as well. Did you have H1 time frame history on your hard disk?
Reason: