Re: [R-SIG-Finance] Rugarch for EWMA/VaR

2012-05-03 Thread alexios ghalanos
Thomas, You need to read the documentation more carefully (you forgot to declare the n.roll option). Example: library(rugarch) data(sp500ret) spec= ugarchspec (variance.model = list(model = "iGARCH", garchOrder = c(1,1)), mean.model=list(armaOrder=c(0,0),include.mean=TRUE), distribution.model

Re: [R-SIG-Finance] Rugarch for EWMA/VaR

2012-05-03 Thread ThomasF
Hello Alexios, thank you for your quick reply. I'm going to download the newest version from R-Forge. Concerning 4) I still have problems. I tried something like: forc2=ugarchforecast(spec=spec2, data=sp500returns, n.ahead=1, out.sample=500, calculate.VaR=TRUE, VaR.alpha=c(0.01, 0.05)) and

Re: [R-SIG-Finance] Rugarch for EWMA/VaR

2012-05-03 Thread alexios ghalanos
Thomas, 1. The problem with the iGARCH model (related to a bad default setting) was fixed some time ago in the r-forge version (will be available on CRAN when I next update it there...since it is frowned upon to update a CRAN package more than 12 times in a year, you should look to r-forge fo

Re: [R-SIG-Finance] Generating a front month only Time Series for Futures Prices

2012-05-03 Thread G See
note that if you adjust by adding back roll costs and then try to calculate returns, your returns will be "off" (read:wrong) On Thu, May 3, 2012 at 3:32 PM, G See wrote: > On Thu, May 3, 2012 at 3:28 PM, G See wrote: >> If you just want to combine 2 series together, no problem:  use rbind. >>  B

Re: [R-SIG-Finance] Generating a front month only Time Series for Futures Prices

2012-05-03 Thread G See
On Thu, May 3, 2012 at 3:28 PM, G See wrote: > If you just want to combine 2 series together, no problem:  use rbind. >  But, then you'll have a gap in your data on the roll date, and you'll > be back asking how to adjust for it. ;-)  That's where the minefields > come into play. > > I look at rol

Re: [R-SIG-Finance] Generating a front month only Time Series for Futures Prices

2012-05-03 Thread G See
If you just want to combine 2 series together, no problem: use rbind. But, then you'll have a gap in your data on the roll date, and you'll be back asking how to adjust for it. ;-) That's where the minefields come into play. I look at roll cost like a dividend (which is often negative). You ca

[R-SIG-Finance] Rugarch for EWMA/VaR

2012-05-03 Thread ThomasF
Dear R-Users, dear Alexios, I am trying to use rugarch to forecast volatiliy and do VaR-backtests using the Exponentially weighted moving average. To achieve this I used the iGarch, set omega to 0 and either estimate or fix alpha1 and beta1. Example code is provided at the end of my post. Some is

Re: [R-SIG-Finance] Generating a front month only Time Series for Futures Prices

2012-05-03 Thread gussinsky
Hey Garrett, thank you for this, I had a read through this page in the book you referenced. And looking at Agricultural Commodities this makes a lot of sense. And if you look at Wheat and Corn on the CBOT, I think you only have 5 deliveries per year, hence the massive gaps when each contract roll

Re: [R-SIG-Finance] Generating a front month only Time Series for Futures Prices

2012-05-03 Thread G See
I'm not sure if this link will work; if not, I'm trying to point you to page 75 of "Market Risk Analysis: Pricing, Hedging and Trading Financial Instruments" http://books.google.com/books?id=3Xg4pO1PEpUC&pg=PR13&lpg=PR13&dq=carol+alexander+constant+maturity+future&source=bl&ots=ArlAbn7XPW&sig=1WGn

Re: [R-SIG-Finance] Generating a front month only Time Series for Futures Prices

2012-05-03 Thread G See
Gussinsky, Since you are looking to test for cointegration, and you say you're looking at energy products (which have liquidity in more than just the front contract), I'd suggest creating a constant maturity future (CMF) that is the interpolated price between the 2 lead contracts (see Carol Alexan

Re: [R-SIG-Finance] Generating a front month only Time Series for Futures Prices

2012-05-03 Thread BBands
Beware, this is a mine field! For example, one problem you will need to deal with is that different commodities roll on different dates. Then there is the nightmare quagmire of back adjusting, which is best skipped altogether in my opinion. In short, there are many ways to get hurt here. There is a

[R-SIG-Finance] Generating a front month only Time Series for Futures Prices

2012-05-03 Thread gussinsky
Hello All, I am struggeling to find a method which would enable me to generate a historical time series which only contains a commodities front month price, and after expiry automatically rolls over to the next month. I suspect one has to code the roll over rule from the respective exchange into

Re: [R-SIG-Finance] SMA and TTR

2012-05-03 Thread G See
Just a slightly different approach: getSymbols("AAPL", src='yahoo') # 50 day moving average for last 10 days tail(SMA(tail(Ad(AAPL), 59), 50), 10) Garrett On Thu, May 3, 2012 at 8:03 AM, Brian G. Peterson wrote: > On Thu, 2012-05-03 at 08:47 -0400, Gordon Erlebacher wrote: >> I wish to compute

Re: [R-SIG-Finance] quantstrat with intraday data

2012-05-03 Thread G See
Jim, So, on any day that there is a dividend or a split, you want to back adjust your data that you're using to calculate the next signal. Every time you back-adjust, you have to recreate your signals. If that's how you want to do it, then I think that in quantstrat world, you're better off runni

Re: [R-SIG-Finance] SMA and TTR

2012-05-03 Thread Brian G. Peterson
On Thu, 2012-05-03 at 08:47 -0400, Gordon Erlebacher wrote: > I wish to compute trading criteria only for past 10 days. That > involves, > say, a 50 day moving average. The SMA function does not allow me to > only > compute the 50 day moving average over the past 10 days, even if I > have the > sym

[R-SIG-Finance] SMA and TTR

2012-05-03 Thread Gordon Erlebacher
Hi, I wish to compute trading criteria only for past 10 days. That involves, say, a 50 day moving average. The SMA function does not allow me to only compute the 50 day moving average over the past 10 days, even if I have the symbol series for the past 200 days! getSymbols("AAPL") SMA(AAPL, 10)