[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: RE: Rolling Returns and simple loop
It is bad, not good, Statalist psychology to
claim a "simple question". I know that some
gurus have a habit of immediately deleting emails
with similar preambles.
First, the question may seem simple to you,
but the answer may not be, so you gain nothing
by an appeal to your expectation that an expert
should be able to give an instant answer.
Second, if you think it's that simple,
what's stopping you from solving it?
What code did you try?
That said, I have no idea of what "rolling returns" are,
but I guess that no program is needed here.
-rolling- should yield (I), while a standard
-foreach- loop around variables should yield
your second (II).
> Suppose I have data liek the following:
> A, B, C are closing prices for stocks A,B, and C respectively.
> How can I write a simple program to do the following:
> (I) calculate the 10 day rolling returns
> (II) caclulate a ratio=10day rollign returns/std. dev.
> (II) loop so as to repeat this caclulation across other
> variables (B,C, etc.)
* For searches and help try: