amibroker debugging

Hello,
I have 4 parameters for optimization. When i did that i got 238%profit maximum.
With same parameters in backtest it is showing 172% profit.
and big questin is that .... when i put 0.1 percent brokrage to very trade for intraday only i got -97% loss.
Please explain where i am...

Hi,
Please help me debug following code.
I am encountering error in 6th line when accessing the array Close beyond a certain index. The error encountered is following:
Error 10. Array subscript out of range. You must not access array elements outside 0..(BarCount-1) range. You attempted...