Intrabar Data/ Forward Testing - Help!?

 

Ok, I've been stuck on this problem for just over a week now! It's a very simple bit of code:

     C_time=Time[0];  
     C_time1=(C_time-(240*60)); // time 4hours ago.
     BS1=iBarShift(NULL,PERIOD_H4,C_time1,false);

   Line1[0]=iMACD(NULL,PERIOD_H4,10,17,6,PRICE_CLOSE,MODE_MAIN,0);
   Line2[0]=iMACD(NULL,PERIOD_H4,10,17,6,PRICE_CLOSE,MODE_MAIN,BS1);

No loops, just real time update of the iMACD on a 15 minute chart. When run like this everything works like it want it: Real_Time

The problem is that it is going to take me forever to test different settings as it only works in real time. I've tried everything to try and get this working with loops or even in 'Visual Testing' mode. The closest I've come is to use visual testing mode to speed up the drawing process but Line1 comes out at 0.0 :

Visual Mode

I cant see how it's possible to have this code work in real time but not in Visual Testing mode? Am I trying to do something that simply cant be done?

Thanks in advance!

Reason: