Re: [R-SIG-Finance] from a list of array to tibble

2023-10-17 Thread Enrico Schumann
the > wanted tibble. > > Thank you for help > Do you mean something like this? data.frame(my.ret.lst) ## BTCUSDT ETHUSDT TRXUSDT ## Annualized Return 15.364.0610.9 (I don't use tibbles, but there is probably an 'as.tibble' method or similar.

Re: [R-SIG-Finance] Data

2021-03-21 Thread Enrico Schumann
-0.49%") NA > #3 c("SWT 0.50% fwd", " 0.05%") NA > #4 c("CAP ATM Fwd", " -0.46%") NA > #5 c("SWT 0.50% fwd", " 0.08%") NA > #6 c("CAP ATM Fwd", " -0.40%") NA > #7 c("SWT 0.50% fwd&

Re: [R-SIG-Finance] Data

2021-03-20 Thread Enrico Schumann
M Fwd: -0.46%\", \"" > > #[3] " 0.08%\", \"CAP ATM Fwd: -0.40%\", \"" > > #[4] " 0.11%\", \"CAP ATM Fwd: -0.32%\", \"" > > #[5] " 0.14%\", \"CAP ATM Fwd: -0.23%\", \"" >

Re: [R-SIG-Finance] Data

2021-03-19 Thread Enrico Schumann
n.) As I said, please provide a reproducible example: use ?dput to provide example data, and also describe what you want to achieve. Perhaps this helps: txt <- c("CAP ATM Fwd: -0.49%", "CAP ATM Fwd: -0.49%") spl <- strsplit(txt, ":", fixed = TRUE) #

Re: [R-SIG-Finance] Data

2021-03-19 Thread Enrico Schumann
"CAP ATM Fwd: 0.07%" "SWT 0.50% fwd: 0.25%" > > Many thanks > Emmanuel > Please provide a reproducible example, so that people can help you. (It's not what you have written, but did you mean "the numbers after the colons"? Then

Re: [R-SIG-Finance] PairTrading package

2020-09-21 Thread Enrico Schumann
2:38, Alec Schmidt wrote: >> >> I used to have R version 3.6.0 and tried to install PairTrading but got a >> message that the package is not available for that version. >> Now I've updated R to 4.0.2. but still have the message: >> >> package �PairTrading�

Re: [R-SIG-Finance] Valuation of FID

2020-06-23 Thread Enrico Schumann
t; ___ >> > > >> > > R-SIG-Finance@r-project.org >> > > >> > > >> > > mailing list >> > > >> > > https://stat.ethz.ch/mailman/listinfo/r-sig-finance >> >

Re: [R-SIG-Finance] query on adjRatios() function from TTR package

2020-06-08 Thread Enrico Schumann
split_adjust(x = c(100, 25, 25), ## prices t = c(2, 2), ## index when split occurs ratio = c(2, 2)) ## split ratio ## [1] 25 25 25 split_adjust(x = c(100, 25, 49), t = c(2, 2), ratio = c(2,2), backward = FALSE) ## [1] 100 100 100 -

Re: [R-SIG-Finance] Using optimize.portfolio

2020-06-06 Thread Enrico Schumann
t;portfolio = pspec, >optimize_method = "DEoptim", ) > data.frame(optimize.portfolio = opt$weights, portfolio.optim = > round(popt$pw, 3)) > If all else fails, and supposing that 'PortfolioAnalytics' per default computes means and covaria

Re: [R-SIG-Finance] Partitioning approach towards portfolio construction - ensemble models/weights based on parameter sets

2019-07-24 Thread Enrico Schumann
ion, add.distribution.constraint, ... Sam> Original message was not delivered due to attachments, I guess. Sam> -- Sam> Best regards, Sam> Sam Perhaps the examples in https://ssrn.com/abstract=3374195 are of interest (though they do not use PortfolioAnalytics). kind regards

Re: [R-SIG-Finance] Lo catches slow

2019-03-13 Thread Enrico Schumann
ch for the Low column which might cause a dimnames error >> down the line. >> Joshua> -- Joshua> Joshua Ulrich | about.me/joshuaulrich Joshua> FOSS Trading | www.fosstrading.com Joshua> R/Finance 2019 | www.rinfinance.com -- Enrico Schumann Lucerne, S

Re: [R-SIG-Finance] Mixed integer programming

2019-02-19 Thread Enrico Schumann
oducible example. Also, please do not post in HTML, as code examples get scrambled and become unreadable. (If I had to venture a guess, I'd think you've forgotten one of those `%>%` before 'solve_model'.) -- Enrico Schumann Lucerne, Switzerland http://enricoschumann.net __

[R-SIG-Finance] Alternative solvers in rugarch (was: GARCH parameter estimation with rugarch: estimates seem inaccurate)

2019-02-01 Thread Enrico Schumann
things right. I heard once that >> others could not replicate my results; that is, they have reliable >> estimates for GARCH parameters. But I never found out who those people >> were and they did not give me their code to see what

Re: [R-SIG-Finance] the package nmof

2019-01-27 Thread Enrico Schumann
'c()' or 'drop()' to drop the dimension and create a vector. kind regards Enrico m> On 26/01/2019, Enrico Schumann wrote: >>>>>>> "m" == mmm ammm writes: >> m> Dear all, m> i'm hoping that one of you can help me in the following

Re: [R-SIG-Finance] the package nmof

2019-01-26 Thread Enrico Schumann
g to the columns of the population matrix. However, since the user specifies the objective function, 'DEopt'/'PSopt' cannot know automatically in what way the objective function is written; so you need to tell the functions by setting 'loopOF' to TRUE (the default) or to FALSE. kind regards

Re: [R-SIG-Finance] corrections vs drawdowns

2019-01-08 Thread Enrico Schumann
also https://stats.stackexchange.com/questions/354157/determining-up-down-market-trends-in-timeseries-data/373622#373622 https://cran.r-project.org/web/packages/PMwR/vignettes/Drawdowns_streaks.pdf -- Enrico Schumann (maintainer of PMwR) Lucerne, Switzerland http://enricoschumann.net

Re: [R-SIG-Finance] problem with reqMktData

2018-10-18 Thread Enrico Schumann
ibrary("IBrokers") | tws <- twsConnect() | contract1 <- twsContract( | local = "ZS NOV 18", | sectype = "FUT", | exch = "ECBOT", | currency = "USD", | include_expired = "1", | conId = "",

Re: [R-SIG-Finance] xts 'order.by' cannot contain 'NA', 'NaN', or 'Inf' in optimize.portfolio.rebalancing

2018-09-25 Thread Enrico Schumann
order.by=as.Date(paste(returns$Dato, > "%m/%d/%Y"))) > and run the optimization but summary(opt) again returned > > xts(x, order.by = order.by, frequency = frequency, ...) :’order.by' cannot > contain 'NA', 'NaN', or 'Inf' > > > [[alternative HTML versi

Re: [R-SIG-Finance] R and Bloomberg Data License

2018-01-31 Thread Enrico Schumann
, for daily data I found an ad-hoc storing/updating in CSV-files sufficient (https://github.com/enricoschumann/tsdb) HTH -- Enrico Schumann Lucerne, Switzerland http://enricoschumann.net ___ R-SIG-Finance@r-project.org mailing list https://stat

Re: [R-SIG-Finance] R packages/resources for Financial Risk Management

2017-10-16 Thread Enrico Schumann
-98397-11444http://in.linkedin.com/in/pankajkagarwal/ As a starting point, you could look at the packages listed here: https://cran.r-project.org/web/views/Finance.html -- Enrico Schumann Lucerne, Switzerland http://enricoschumann.net ___ R-SIG-Fin

Re: [R-SIG-Finance] Fteching options data using package IBrokers and interactivebrokers

2017-06-25 Thread Enrico Schumann
ect() reqContractDetails(tws, c) ## List of 18 ## $ version : chr "8" ## $ contract :List of 16 ## ..$ conId : chr "271618757" ## ..$ symbol : chr "HDFC" ## ..$ sectype: chr "OPT" ## ..$ exch

Re: [R-SIG-Finance] getting a subset corresponding to a list element

2017-05-29 Thread Enrico Schumann
ndex","MXWO Index","MXEA Index"), fields = "PX_LAST", start.date = as.Date("2017-01-01"), end.date = as.Date("2017-01-05")) do.call("merge", lapply(res, function(x) zoo(x[[2]], x[[1]]))) -- Enri

Re: [R-SIG-Finance] Performanceanalytics -- table.calendarreturns question

2017-04-07 Thread Enrico Schumann
;Calendar Year Returns.csv") > Do you mean the output of print(returns) or of print(cal.list)? In either case, if you want to store the results as they show up in the console, you could use ?capture.output, as in capture.output(cal.list, file = "returns.txt") -- Enrico Schum

Re: [R-SIG-Finance] Syntax - symbol problem

2017-03-01 Thread Enrico Schumann
tabase of contracts with the four mentioned attributes, and then refer to this list when contract information is needed. -- Enrico Schumann Lucerne, Switzerland http://enricoschumann.net ___ R-SIG-Finance@r-project.org mailing list https://stat.et

Re: [R-SIG-Finance] Jegadeesh & Titman Strategy Implementation

2017-02-19 Thread Enrico Schumann
-01"), as.Date("2016-12-31"), by = "1 day") timestamp <- aggregate(timestamp, by = list(format(timestamp, "%Y-%m")), FUN = tail, 1)[[2]]

Re: [R-SIG-Finance] comparing solve.pq and nloptr for min variance portfolio

2016-03-19 Thread Enrico Schumann
e thing to check is your implementation of the objective function for 'nloptr'. Kind regards (and good luck) Enrico > ________ > From: Enrico Schumann <e...@enricoschumann.net> > Sent: Friday, March 18, 2016 11:08 AM > To: Alec Schmidt >

Re: [R-SIG-Finance] comparing solve.pq and nloptr for min variance portfolio

2016-03-19 Thread Enrico Schumann
Alec [...] Unless your covariance matrix is 'broken' in some way, a minimum-variance portfolio with only a budget constraint should be fairly easy to compute (no multiple local minima, smooth objective function, ...). Please provide a reproducible example. Kind regards, Enrico --

Re: [R-SIG-Finance] comparing solve.pq and nloptr for min variance portfolio

2016-03-19 Thread Enrico Schumann
Alec. But you will need to simplify it if people are to help you. [My bad: I should have said _minimal_ reproducible example: https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example ] > ________ > From: Enrico Schumann <e...@e

Re: [R-SIG-Finance] Failure of solve.QP in portfolio modeling

2015-09-22 Thread Enrico Schumann
have an example of a solver. A lengthier discussion is in Section "13.2.5 Repairing Matrices" in this book @BOOK{Gilli2011b, title= {Numerical Methods and Optimization in Finance}, publisher= {Elsevier/Academic Press}, year = 2011, author = {Gilli, Manfred an

Re: [R-SIG-Finance] assetsLPM from fAssets and 0.moment

2015-05-18 Thread Enrico Schumann
. Second, on raising negative numbers to the zeroth power: you need to consider operator precendence. The ^ binds more tightly than -, hence -1^0 is -1. But (-1)^0 will give 1. -- Enrico Schumann Lucerne, Switzerland http://enricoschumann.net

Re: [R-SIG-Finance] Finding the strike price of an option from all other data

2015-05-17 Thread Enrico Schumann
. -- Enrico Schumann Lucerne, Switzerland http://enricoschumann.net ___ R-SIG-Finance@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance -- Subscriber-posting only. If you want to post, subscribe first. -- Also note

Re: [R-SIG-Finance] DEoptim and guarantees

2014-08-25 Thread Enrico Schumann
On Sun, 24 Aug 2014, alexios ghalanos alex...@4dscape.com writes: On 24/08/2014 19:24, Enrico Schumann wrote: On Fri, 22 Aug 2014, alexios ghalanos alex...@4dscape.com writes: 1. DEoptim is a nonlinear global optimization solver. Global optimization is usually reserved for hard to solve non

Re: [R-SIG-Finance] Calibration of Heston Model in R

2014-07-15 Thread Enrico Schumann
[1] Disclosure: I am the package author. [2] http://enricoschumann.net/NMOF.htm#Book [3] http://enricoschumann.net/NMOF.htm#NMOFmanual [4] http://cran.r-project.org/web/views/Optimization.html -- Enrico Schumann Lucerne, Switzerland http://enricoschumann.net

Re: [R-SIG-Finance] Errors in assetsFit function of fPortfolio package

2014-01-30 Thread Enrico Schumann
fBasics_3010.86timeSeries_3010.97 timeDate_3010.98 [9] robustbase_0.9-10 MASS_7.3-29 loaded via a namespace (and not attached): [1] quadprog_1.5-5 Rglpk_0.4-1 slam_0.1-28 stabledist_0.6-6 -- Enrico Schumann Lucerne, Switzerland http://enricoschumann.net

Re: [R-SIG-Finance] Range intersections

2013-07-27 Thread Enrico Schumann
, by = 0.5) s - ind(x, Pred2[ ,1], Pred2[ ,2]) plot(x, s, type = S) range(ca - x[s == max(s)])## consensus area all.equal(max(diff(ca)), diff(x)[1L]) ## single area? Regards, Enrico -- Enrico Schumann Lucerne, Switzerland http://enricoschumann.net

Re: [R-SIG-Finance] Warning: timeLastNdayInMonth gets Fridays one week off

2013-06-12 Thread Enrico Schumann
the 'timeLastNdayInMonth' function is from a package? Then you should also contact directly the package's maintainer. -- Enrico Schumann Lucerne, Switzerland http://enricoschumann.net ___ R-SIG-Finance@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r

Re: [R-SIG-Finance] Passing variables...

2013-05-20 Thread Enrico Schumann
Grigonis [[alternative HTML version deleted]] Please send plain-text messages to this mailing list. -- Enrico Schumann Lucerne, Switzerland http://enricoschumann.net ___ R-SIG-Finance@r-project.org mailing list https://stat.ethz.ch/mailman

Re: [R-SIG-Finance] euro call by integration

2013-04-13 Thread Enrico Schumann
your code, but shouldn't you discount the result? -- Enrico Schumann Lucerne, Switzerland http://enricoschumann.net ___ R-SIG-Finance@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance -- Subscriber-posting only. If you want

Re: [R-SIG-Finance] ibrokers - problems retrieving Indices/ETFs

2013-03-20 Thread Enrico Schumann
Technology, Stockholm, Sweden matti.zem...@gmail.com -- Enrico Schumann Lucerne, Switzerland http://enricoschumann.net ___ R-SIG-Finance@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance -- Subscriber-posting only. If you want

Re: [R-SIG-Finance] Portfolio construction with integer constraints

2013-02-15 Thread Enrico Schumann
yourself. There has been some discussion of such methods on this list in the past; Patrick Burns has also had some blog posts about R implementations (there you could get some pointers to R packages). Best regards, Enrico -- Enrico Schumann Lucerne, Switzerland http://enricoschumann.net

Re: [R-SIG-Finance] Automatically sending .Rmd - html files

2012-06-12 Thread Enrico Schumann
appreciated. I know this isn't strictly finance, but I can imagine the finance community probably has the most amount of use for something like this on a daily basis (emailing automated analysis to yourself / desk etc) n. -- Enrico Schumann Lucerne, Switzerland http://nmof.net

Re: [R-SIG-Finance] Are there genetic algorithm for trading strategy evolution in R?

2012-03-08 Thread Enrico Schumann
for regular optimizers; but using Genetic Algorithms to evolve trading strategies seem to be different. Anywhere we could find such an example in R? What you probably mean is Genetic Programming, not Genetic Algorithms. Regards, Enrico -- Enrico Schumann Lucerne, Switzerland http://nmof.net

Re: [R-SIG-Finance] American option sensitivities

2012-02-10 Thread Enrico Schumann
https://stat.ethz.ch/mailman/listinfo/r-sig-finance -- Subscriber-posting only. If you want to post, subscribe first. -- Also note that this is not the r-help list where general R questions should go. -- Enrico Schumann Lucerne, Switzerland http://nmof.net

Re: [R-SIG-Finance] American option sensitivities

2012-02-10 Thread Enrico Schumann
Am 10.02.2012 15:24, schrieb J Toll: On Fri, Feb 10, 2012 at 3:18 AM, Enrico Schumann enricoschum...@yahoo.de wrote: Hi all, (comments below) Am 10.02.2012 01:02, schrieb J Toll: On Thu, Feb 9, 2012 at 5:17 PM, Dirk Eddelbuettele...@debian.orgwrote: On 9 February 2012 at 17:06, J

Re: [R-SIG-Finance] Monte Carlo Option Pricing formula R code vs Matlab

2012-02-03 Thread Enrico Schumann
investments referred to herein. In the case of certain securities Commonwealth Bank is or may be the only market maker. -Original Message- From: Enrico Schumann [mailto:enricoschum...@yahoo.de] Sent: Thursday, 2 February 2012 8:45 PM To: Roupell, Darko Cc: r-sig-finance@r-project.org

Re: [R-SIG-Finance] Monte Carlo Option Pricing formula

2012-02-02 Thread Enrico Schumann
note that this is not the r-help list where general R questions should go. -- Enrico Schumann Lucerne, Switzerland http://nmof.net/ ___ R-SIG-Finance@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance -- Subscriber-posting

Re: [R-SIG-Finance] The challenge to fit the greek gov curve with termstrc R Package!

2011-12-08 Thread Enrico Schumann
that this is not the r-help list where general R questions should go. -- Enrico Schumann Lucerne, Switzerland http://nmof.net/ ___ R-SIG-Finance@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance -- Subscriber-posting only

Re: [R-SIG-Finance] The challenge to fit the greek gov curve with termstrc R Package!

2011-12-08 Thread Enrico Schumann
/listinfo/r-sig-finance -- Subscriber-posting only. If you want to post, subscribe first. -- Also note that this is not the r-help list where general R questions should go. -- Enrico Schumann Lucerne, Switzerland http://nmof.net/ ___ R-SIG-Finance@r

Re: [R-SIG-Finance] Constrained Regression with Intercept in pcls

2011-12-01 Thread Enrico Schumann
-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance -- Subscriber-posting only. If you want to post, subscribe first. -- Also note that this is not the r-help list where general R questions should go. -- Enrico Schumann Lucerne, Switzerland http://nmof.net

Re: [R-SIG-Finance] options profit/loss graph (beginner question)

2011-11-25 Thread Enrico Schumann
. -- Also note that this is not the r-help list where general R questions should go. -- Enrico Schumann Lucerne, Switzerland http://nmof.net/ ___ R-SIG-Finance@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance

Re: [R-SIG-Finance] Currency data from GOOGLE/Yahoo finance.

2011-09-22 Thread Enrico Schumann
-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance -- Subscriber-posting only. If you want to post, subscribe first. -- Also note that this is not the r-help list where general R questions should go. -- Enrico Schumann Lucerne, Switzerland http://nmof.net

Re: [R-SIG-Finance] Currency data from GOOGLE/Yahoo finance.

2011-09-22 Thread Enrico Schumann
hm, the last words were actually check on finance.yahoo.com ;) but they have been cut away. Am 22.09.2011 11:50, schrieb Enrico Schumann: It seems a convention that if the rate is USDCCY, you get it from Yahoo with CCY=X. At least I have had this with JPY=X, GBP=X. But I am not sure how

Re: [R-SIG-Finance] Sharpe's algorithm for portfolio improvement

2011-08-02 Thread Enrico Schumann
[comments inline] -Ursprüngliche Nachricht- Von: Brian G. Peterson [mailto:br...@braverock.com] Gesendet: Dienstag, 2. August 2011 14:37 An: Enrico Schumann Cc: 'John P. Burkett'; R-SIG-Finance@r-project.org Betreff: Re: [R-SIG-Finance] Sharpe's algorithm for portfolio

Re: [R-SIG-Finance] problem with getting Historical data for futures using I Brokers package

2011-06-13 Thread Enrico Schumann
try adding include_expired = '1' to the contract definition; see ?twsContract regards, enrico -Ursprüngliche Nachricht- Von: r-sig-finance-boun...@r-project.org [mailto:r-sig-finance-boun...@r-project.org] Im Auftrag von Gautam Garg Gesendet: Montag, 13. Juni 2011 11:53 An: