iBars and backtesting

 

Hi,


I'm planning to use iBars function in my EA but the code will be kind of long and would like to know if the iBars will work correctly in backtests before I implement.


I think it didn't work when I tried it but I'm not sure.


Thanks

 

1Mill:

 I'm planning to use iBars function in my EA but the code will be kind of long and would like to know if the iBars will work correctly in backtests

I think it didn't work when I tried it but I'm not sure.

Great , what reply do you wish .....

//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
//----
if (NewBar())
   {
     Print("Bar count on the 'EURUSD' symbol with PERIOD_H1 is",iBars("EURUSD",PERIOD_H1));
     Print("Bar count on the 'EURUSD' symbol with PERIOD_H4 is",iBars("EURUSD",PERIOD_H4));
     Print("Bar count on the this chart ",iBars(Symbol(),0));
     
   }
//----
   return(0);
  }
//+------------------------------------------------------------------+
bool NewBar()
{
   static datetime dt = 0;  
   if (Time[0] != dt)
     {
      dt = Time[0];
      return(true);
     }
   return(false);
}

Is it working ????? 

 

Thanks, will you come and do my dishes too? LOL


Loser

 
1Mill:

Hi,

I'm planning to use iBars function in my EA but the code will be kind of long and would like to know if the iBars will work correctly in backtests before I implement. 

I think it didn't work when I tried it but I'm not sure.

Perhaps you should design a solution that does not rely on iBars() ?
 
RaptorUK:
Perhaps you should design a solution that does not rely on iBars() ?


or he needs to do his dishes