Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Calculating volatility

    Hi,

    I'm trying to calculate volatility. I have a not so straightforward dataset and I'm looking for 'rolling' volatility. My dataset has 2 columns one with the hourID (so 60 times the number 1 underneath each other, than 60 times number 2, etc) and next to that I have a column with a price this price is the same as every same number:
    column 1 column 2
    1 505
    1 505
    1 505
    etc
    2 750
    2 750
    etc

    I need the volatility (rolling) of the price from the last 24 hours (24 times column 1). So I need to know the volatility of 24 numbers (of the price at each hourID) each calculation.

    Thank you in advance

  • #2
    Given some definition of volatility, you can use rangestat (SSC) or possibly even egen for this. Search the forum for mentions of key terms.

    Comment

    Working...
    X