you're right! i just use the date earlier and is resolved... must be due to position of candle to detect the crosses... eg: usually i use the date from 2010/01/01 to start and this might have caused the divide zero, and once i enter the start date to 2009/12/30 and the EA runs normally.. thanks miro for the clue!