Try Norm_SP500 = SP500 / LastValue(Ref(SP,-13));

This should give you the value of 13 bars from the end of the array as the 
divisor

----- Original Message ----- 
From: "polomorabe" <[email protected]>
To: <[email protected]>
Sent: Wednesday, April 21, 2010 2:42 PM
Subject: [amibroker] Question about accessing a specific value in an array


>I apologise if this is a silly question, i just can't figure it out!
>
> I would like to create a normalised chart of an index, for example the 
> S&P500, using a specific value in the past as the reference. For example, 
> 13 weeks ago, the S&P was at 1073. I would like to create a new array 
> which has all S&P data points divided by this value.
>
> Something like
> Norm_SP500 = SP500 / Ref(SP,-13)
>
> I know that this is wrong because the Ref() function creates a new 
> timeshifted array. I would like to divide all data points by the same 
> integer value.
>
> Also, the timeshift parameter specifies the number of timeshift bars. I 
> would like to use the value corresponding to 13 weeks in the past on the 
> week chart.
>
> Can this be done?
>
> Many thanks,
> Paul
>
>
>
> ------------------------------------
>
> **** IMPORTANT PLEASE READ ****
> This group is for the discussion between users only.
> This is *NOT* technical support channel.
>
> TO GET TECHNICAL SUPPORT send an e-mail directly to
> SUPPORT {at} amibroker.com
>
> TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
> http://www.amibroker.com/feedback/
> (submissions sent via other channels won't be considered)
>
> For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
> http://www.amibroker.com/devlog/
>
> Yahoo! Groups Links
>
>
>

Reply via email to