# Tag Info

## New answers tagged r

0

BookMap seems cool, indeed. Jigsaw trading has something good, similar, less expensive http://www.jigsawtrading.com/order-flow-software/ The owner is a trader This tool is used by profitable traders: http://www.nobsdaytrading.com/free-info/for-inexperienced-traders/ DB Vaello from OrderFlow Analytics offers another great tool ...

0

R package TTR has rolling window algorithms and understands day counting etc. It stands on the shoulders of xts (which extends zoo) and quantmod

1

There are two answers to your question If you want to use the Neston-Nandi model, you can use it directly with the parameters that you already show above: model = list(omega = 0.000001, alpha = 0.5, beta = 0.4) In r, the fOptions package has an HN model that can use them: HNGOption(TypeFlag, model, S, X, Time.inDays, r.daily) If you want to calculate ...

0

You might take a look at the PortfolioAnalytics package. It's optimize.portfolio function does require asset returns but the momentFUN argument allows you to provide your own function for using these returns to calculate the moments used in the optimization. Overall it provides a great deal of flexibility for specifying constraints and optimization methods. ...

2

Similar to Juan Gil's answer but a bit differently I would say the following based on this: The OU process $$dX_t = \kappa(\theta-X_t)dt + \sigma dW_t$$ can be (Euler-Maryuama discretization) discretized at times $n \Delta t,n=1,\ldots,\infty$ which gives with $t = k \Delta t$ $$X_{k+1} - X_k = \kappa \theta \Delta t -\kappa X_k \Delta t + \sigma (W_{k+1} ... 2 For a Ornstein-Uhlenbeck process, the maximum likelihood parameters are the ones from least squares regression. If your process is:$$ dX=\kappa (\theta-X)dt+\sigma dW $$you can do a linear regression in the form$$ \frac{dX}{dt}=a+bX+\epsilon $$So your parameters will be:$$ \kappa=-b  \theta=-\frac{a}{b}  \sigma=std(\epsilon dt) 

1

In addition to the above answers - You should be very careful that you do not introduce survivorship bias in your creation of indices and choose your data source carefully to remove such bias. For example, Yahoo Finance only contains currently-listed securities.

2

Both R and Python can do this very nicely. For Python you would need the pandas package and its dependencies. pandas has a lot of basic statistics, but for more advanced statistics like it looks like you want to do, you can use the statsmodels package, which can work directly with pandas data types. It can also download the csv files directly off the ...

0

It is essentially a statistical exercise, so I would choose R.

0

I am not a particularly big fan of fPortfolio. My first thought was to estimate a mean and covariance matrix accounting for the missing data (should be discussed several times on this site or other places) and pass that. However, looking at the manual, it looks like the relevant functions only take time series data. Based on that limitation, you have a few ...

1

Looking at your code, you seem to be mixing the risk minimization formulation of the mean-variance problem with the risk aversion formulation. Both formulations include the "budget" constraint, that the sum of the weights equal 1, and can require that each of the weights be greater than zero, the "long-only" inequality constraints. In the risk minimization ...

0

You can try: daily.fit=ugarchspec(variance.model = list(model = "sGARCH", garchOrder = c(1, 1)), mean.model = list(armaOrder = c(35, 7), include.mean = T, arfima=F), fixed.pars=list(ar9=0,ar10=0,...,ar13=0,ar15=0,...,ar20=0,ar22=0,...,ar27=0,ar29=0,...,ar34=0,ma1=0,...,ma6=0)) from rugarch package.

0

You can do this using the optim function in R. One possible solution is as follows: base <- c(0.9190, 0.0739, 0.0072, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0113, 0.9126, 0.0709, 0.0031, 0.0021, 0.0000, 0.0000, 0.0000, 0.0010, 0.0256, 0.9119, 0.0533, 0.0062, 0.0021, 0.0000, 0.0000, 0.0000, 0.0021, 0.0536, 0.8794, ...

1

You'll want the ibrokers package, its very good and built on the c++ api. Also check out quantmod, performanceanalytics, and highfrequency package. And a comprehensive list, http://cran.r-project.org/web/views/Finance.html

Top 50 recent answers are included