Custom indicator in "visual" chart

 
How to detect that the indicator is attached to a chart in "visual" testing mode.
Especially how to get the tick time, the Time[0] value is ok but the TimeCurrent() is market watch time.
Reason: