Yesterday's price change in percentage

Hi,

I am writing a formula where I need to calculate yesterday's price change (in percentage). Could anyone guide me how to write the AFL. The formula would be as below:

Yesterday's Price Change = (Yesterday Close Price - Yesterday Open Price) / Yesterday Open Price * 100

Thanks in advance.

Dewdrops

@sandeeppanja, you can easily translate your pseudo code to AFL using the Ref() function to get the "yesterday" Close and Open prices.

Your formula, applied to the Close and Open time series, will return an array. If for any reason, you only need the last value of such array use the LastValue() function.

1 Like

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.