% Return in Jupyter/Pandas

Discussion in 'App Development' started by deltastrike, May 17, 2018.

  1. Just wanted to reach out to others who use Jupyter and/or Pandas in their research. When analyzing the viability of an indicator, it's probably common to have % return associated with the indicator value in a time series. However, it makes sense to me that you have to shift the % Return n amount of index values to get an accurate reading on the value of the indicator.

    Ex.
    DateTimeIndex|Value|%R
    2018-05-10 | 32 | 6%

    For example, when using the pct_change(periods=5) method, I'm fairly certain that it's the % return [n-5:n]. Therefore, you would have to shift the '% Returns' column "up" by five ([n:n+5]) to get the true '% Return' from the date/time of that particular indicator value. Has anyone else found this to be the case?