Questions tagged [rolling]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
89 views

Annualized rolling volatility? [closed]

I have 600 days of closing prices of a stock. I want to calculate the annualized volatility for 6 day window. How do i do that? If I calculate the std dev of the first 6 days, i get, say 1%. This is ...
user avatar
0 votes
1 answer
38 views

rolling 24-hr time series volume data - how to back out minute level volume?

I have data (trading volume) that is tracked on a rolling 24-hour basis approximately 1 minute or so. Here are some sample timestamps that highlight why I say approximately: I am trying to use this ...
user avatar
0 votes
1 answer
458 views

Rolling Calculation of Slope in Python

I am trying to calculate Slope for the rolling window of 5 and 20 periods and append it to the existing data frame. The length of the total dataset would be let's say 30 days. I have two columns "...
user avatar
  • 1,317
1 vote
1 answer
202 views

Backtest: Fast Reconstruction of Order Book using Order Creation/Completion Data in Python

I am looking for a quick way to reconstruct the order book at the time of each new limit order creation. The data I have is order creation and completion: OrderID time_created time_completed price a ...
user avatar
  • 11
0 votes
2 answers
132 views

Estimating distribution of rate of return

Let $f[t]$ be the price of a stock at time $t$. We can calculate the rolling rate of return of the stock in a window of length $n$ by computing: $$r[t] = \frac{f[t] - f[t-n]}{f[t-n]}$$ $r[t]$ is ...
user avatar
0 votes
1 answer
304 views

Pandas rolling mean not working properly [closed]

I have the following dataframe df on which I want to compute a 4-window moving average : ...
user avatar
  • 1
0 votes
1 answer
57 views

What is the duration of a rolling 5 year investment?

I have difficulty with the duration of a 5 year investment (like GIC). In such an investment, the investment (GIC) rate is reset as the current market rates. So the market value is equal to the face ...
user avatar
  • 1
0 votes
1 answer
88 views

Rolling to a non-front month future contract?

I hedge my US positions with M6B, a GBP/USD future. Every time I roll my contracts, I ask myself "why is there so little liquidity beyond the next three months?" Surely there are people that ...
user avatar
  • 15
3 votes
0 answers
246 views

Does the Shannon entropy of stock returns change over time?

Shannon entropy, $H(X) = -\sum_{i=1}^n p(x) \ln p(x)$ is a probabilistic measure of randomness or disorder within a random variable's probability distribution or histogram. If we take rolling window ...
user avatar
  • 2,815
0 votes
0 answers
101 views

Volatility of multimodal distribution of returns

Take $x_1, x_2, \ldots, x_T$ to be the price of a stock, indexed by $t=1, 2, \ldots, T$. Define rate of return at time $t>W$ for a window size of $W$ to be $$r_t = \frac{x_t - x_{t-W}}{x_{t-W}}$$ ...
user avatar
2 votes
1 answer
96 views

How can I convert rolling annual returns back to quarterly returns?

I have a series of rolling annual returns and would like to convert these back to quarterly returns, which have not been provided. Is this possible formulaically, or is something like Excel's solver ...
user avatar
  • 23
0 votes
0 answers
67 views

Rolling Hedge Performance

So I have Time Series data for Gas Spot and Futures Prices (first 6 front quarters and first 3 front years) from 2009-2019 and I want to evaluate the performance of a 3- year static hedge vs. 3- year ...
user avatar
0 votes
0 answers
169 views

Correct way to calculate the S&P500 average CAGR of earnings over 10 years rolling periods

Let's say we have only the following data for the earnings (e) and we calculated for each 10 years period the total earnings growth (G) and its Compounded Annual Growth Rate (AG) \begin{equation} \\...
user avatar