I can't get the value of lower timeframe

 
Hello, i am using the icustom function to get values for current and lower tf but when i test it with strategy tester it is getting the value of current timeframe but i can not get value for lower time frame such as 5 min. Can someone help me to fix my problem, thanks
#property strict

input int smart_candle_count = 4;
input bool smart_lot=true;
input double smart_risk=5.0;
input int smart_sl_modify=1500;
input int difference = 500;
input string separator1="CCI Settings";
input int _CCIPeriod = 14;
input int ccicandle=1;
input ENUM_APPLIED_PRICE _CCIPriceType = PRICE_TYPICAL;
input ENUM_TIMEFRAMES lowtf = PERIOD_M5;
input int takeprofit=100;
int orderID;
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
string signal ="";

double val=f_cci_div(Symbol(),Period(),3,0,ccicandle);
double val2 = f_cci_div(Symbol(),Period(),4,0,ccicandle);
double val3 = f_cci_div(Symbol(),lowtf,3,0,ccicandle);
double val4 = f_cci_div(Symbol(),lowtf,4,0,ccicandle);
Print("val3:" +val3);
Print("val4: " + val4);

if (val==1)
{
 signal = "buy";
}

if (val2==-1)
{
 signal = "sell";
}
if (val3==1)
{
 signal = "buy2";
}
if (val4==-1)
{
 signal = "sell2";
}
}

double f_cci_div(string simbol,int tf,int buff,int shift,int cnt)
  {
   return(iCustom(simbol,tf,"ccitest",
                  separator1,
                  _CCIPeriod,
                  _CCIPriceType,
                  300,
                  cnt,buff,shift));
  }
 
Berk Cetiner:
Hello, i am using the icustom function to get values for current and lower tf but when i test it with strategy tester it is getting the value of current timeframe but i can not get value for lower time frame such as 5 min. Can someone help me to fix my problem, thanks

do you get an error when compiling this code 

 
Amos Tsopotsa #:

do you get an error when compiling this code 

Nope, it is compiling without error. I copied only the part of icustom function and didnt copy the rest of code because it could be long.

Maybe this happens because there is a lack of history data in lower timeframe thats why i couldnt get the value for lower time frame because in backtesting if i set near date to current date, it gives value without error.

Do you have an idea or suggest to fix this issue? 

Thanks

Reason: