Question about two symbols which have different length of price array

I have a question about two symbols which have different length of price array.

My AFL script is as following:

  1. Calculate MA of "SPX"
  2. Calculate MA of "UA" which starts trading from 2016.03.23

SetForeign( "$SPX");
idx_long_ma = MA(C,120);
idx_clos = C;
RestorePriceArrays();

sym_stk = Name();
stk_long_ma = MA(C,120);
stk_clos = C;

When I do debugging, it looks like that program will automatically align the two price array from 2016.03.23 and cut the early data of SPX. And the MA calculation of "SPX" was based on array from 2016.03.23 instead of using earlier data. This returns "Null" for SPX MA which is not what I want.

Could you elaborate me how to solve this issue?

Thanks.

Null means “having no value”. 120-bar moving average has NO VALUE for first 120 bars because…
it needs 120 bars of data to produce FIRST value.

Recommended reading:
http://www.amibroker.com/kb/2014/09/29/debugging-techniques-part-1-exploration/