Using fractals indicator in EA

 

I tried to use fractal indicator in my EA, but it always gives zero result in strategy testing. But when I attach indicator to a chart it very well shows on the chart and data is dispalyed in data window. While compiling my EA there is no error.

Kindly help.

Thanks

 
you look
use at least 3 Bars back !

double val=iFractals(NULL, 0, MODE_UPPER, 3);