Re: [R-SIG-Finance] PerformanceAnalytics

2021-09-08 Thread Brian G. Peterson via R-SIG-Finance
On Wed, 2021-09-08 at 09:14 +, Pankaj K Agarwal via R-SIG-Finance wrote: > Dear AllIn the PerformanceAnalytics package, there is a function that > computes annualized Sharpe Ratios. However, the same is not available > for computing annualized values of other metrics like Treynor's > Ratio,

Re: [R-SIG-Finance] Indicator as histogram or rectangle boxes instead of line

2021-04-05 Thread Brian G. Peterson
plot.xts was based on chart_Series, so adding panels with plot.xts should work. Also, you can absolutely use 'h' plots with add_TA.  See e.g. chart.Posn in the blotter package: https://github.com/braverock/blotter/blob/master/R/chart.Posn.R Regards, Brian On Mon, 2021-04-05 at 14:28 +0200,

Re: [R-SIG-Finance] Retrieving corporate event information for listed companies

2021-04-02 Thread Brian G. Peterson
On Fri, 2021-04-02 at 21:59 -0400, H wrote: > > I don't know how quickly this database is updated and therefore the > delay but if possible i would like to use a primary source rather > than a secondary source. It might be that parsing XBRL information > from SEC EDGAR filings is workable - too

Re: [R-SIG-Finance] Retrieving corporate event information for listed companies

2021-04-02 Thread Brian G. Peterson
Factset is probably much cheaper than CRSP/Compustat/WRDS. For free data, I don't really think there are any 'best' sources.  All the data is public, but the collation of that data into a easily parsed dataset is not. Regards, Brian -- Brian G. Peterson ph: +1.773.459.4973 im: bgpbraverock On Fri

Re: [R-SIG-Finance] PnL data - PerformanceAnalytics /

2021-02-04 Thread Brian G. Peterson
VaR/ES should work with a distribution of cash P as well as a distribution of returns. Can you present an example that isn't behaving as you expect it to? Regards, Brian  On Wed, 2021-02-03 at 17:58 +, Johan Palleschitz wrote: > Good evening all, > > I have PnL data in EUR that i want use

Re: [R-SIG-Finance] Quantstrat Position Accounting System: Netting vs Hedging Systems

2020-11-12 Thread Brian G. Peterson
-- Brian G. Peterson ph: +1.773.459.4973 im: bgpbraverock On Thu, 2020-11-12 at 13:43 +0300, Ayhan yuksel wrote: > One more question to solve my case > > We can access the parent rule’s order price using chain.price > argument  in > rule functions. > > Is it also possible to

Re: [R-SIG-Finance] How can I calculate annualized log returns when the year is different from a calendar year

2020-11-09 Thread Brian G. Peterson
I don't use tidyquant, but you can easily use endpoints() in xts to get the end of March timestamps and calculate your period return that way. Brian On Mon, 2020-11-09 at 13:45 +0530, Maulik Bhatt wrote: > Dear all, > > I want to calculate annualized log return for a security. But the > issue

Re: [R-SIG-Finance] periodReturn at the acutual day

2020-08-10 Thread Brian G. Peterson
e data returned is from Friday, the 7th's close, not from Monday, the 10th, for me. I assume that Yahoo probably updates their data once a day, sometime after the official close is published, and their vendor updates. The joys of trying to use free data. Brian -- Brian G. Peterson ph: +1.773.459

Re: [R-SIG-Finance] hist from a data frame that is a list

2020-07-30 Thread Brian G. Peterson
____ > 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 that this is not the r-help list where general R > questions should go. -- Brian G. Pet

Re: [R-SIG-Finance] Select best worst

2020-07-29 Thread Brian G. Peterson
easily use this to get the order of the columns that you want. Regards, Brian -- Brian G. Peterson ph: +1.773.459.4973 im: bgpbraverock On Wed, 2020-07-29 at 15:37 +0200, Pedro páramo wrote: > Hi all, > > I have differente stocks > > AAcciona<- tq_get("ANA.MC",from

Re: [R-SIG-Finance] Save a plot

2020-07-28 Thread Brian G. Peterson
gt; [[alternative HTML version deleted]] > ___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 that this

Re: [R-SIG-Finance] A Simple Estimation of Bid-Ask Spreads from Daily Close, High, and Low Prices

2020-07-28 Thread Brian G. Peterson
Ajay, The method you are proposing is easy to write, the authors flat out say that they didn't really bother to check how accurate their measure is, but what little checking they do gives highly *implausible* results. They also say that it only makes sense for liquid instruments (for which

Re: [R-SIG-Finance] A Simple Estimation of Bid-Ask Spreads from Daily Close, High, and Low Prices

2020-07-28 Thread Brian G. Peterson
On Tue, 2020-07-28 at 19:40 +0200, diego peroni wrote: > I’m looking for a function in R to estimate Bid/Ask Spreads of stocks using > Daily candlesticks. > > Can anyone suggest some implemetations? Diego, I would like to help you, but what you are asking for is simply impossible. Daily

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

2020-06-22 Thread Brian G. Peterson
lly have a "buyer" who pays the > issuer/sponsor when the deal is entered. > By contrast, swaps generally have a value of zero at initiation. (Pre > the 'big bang' in the CDS market, this was true of CDS swaps also.) > > > On Mon, Jun 22, 2020 at 3:44 PM Brian G. Peterson <

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

2020-06-22 Thread Brian G. Peterson
This sounds more like a swap contract than a bond. The principal is some quantity of S (futures, index value* some initial capital, something). Perhaps look at pricing swaps. On Sun, 2020-06-21 at 23:16 +0300, Eric Berger wrote: > Hi Christofer,For this instrument its value today would be the sum

Re: [R-SIG-Finance] Back testing Expected Shortfall

2020-06-10 Thread Brian G. Peterson
On Wed, 2020-06-10 at 20:08 +0200, Daniel Cegiełka wrote: > śr., 10 cze 2020 o 19:23 Brian G. Peterson < > br...@braverock.com > > napisał(a): > > So, to backtesting... the newest Basel standard replaces VaR with > > ES, > > and requires that banks justify t

Re: [R-SIG-Finance] Back testing Expected Shortfall

2020-06-10 Thread Brian G. Peterson
es by Ardia et. al. GAS: https://journal.r-project.org/archive/2018/RJ-2018-064/RJ-2018-064.pdf and MSGARCH: https://www.sciencedirect.com/science/article/pii/S0169207018300840 Regards, Brian -- Brian G. Peterson ph: +1.773.459.4973 im: bgpbraverock ___

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

2020-06-07 Thread Brian G. Peterson
quadratic approach. DEoptim (or 'random' or 'GEnSA', or 'pso') make sense for more complex objectives that aren't amenable to convex solvers. Regards, Brian -- Brian G. Peterson ph: +1.773.459.4973 im: bgpbraverock On Sun, 2020-06-07 at 20:14 -0400, Roger Bos wrote: > Thank you to every

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

2020-06-06 Thread Brian G. Peterson
On Sat, 2020-06-06 at 14:33 +0200, Enrico Schumann wrote: > On Fri, 05 Jun 2020, Roger Bos writes: > > > All, > > > > I am comparing optimize.portfolio from the PortfolioAnalytics > > package to > > portfolio.optim from the tseries package. portfolio.optim seems a > > bit > > easier to use, but

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

2020-06-05 Thread Brian G. Peterson
/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. https://cran.r-project.org/web/packages/PortfolioAnalytics/vignettes/custom_moments_objectives.pdf You can simply pa

Re: [R-SIG-Finance] effects of events that happened at the same time

2020-05-21 Thread Brian G. Peterson
ly, e.g. all macroeconomic announcements in some country > are published on the last days of the month.Thanks! Alec The usual way of dealing with intreaday events is to use intraday data. tick, minute, or hourly data is widely available globally. Regards, Brian -- Brian G. Peterson ph: +1.

Re: [R-SIG-Finance] Portfolio Composition Forecasting

2020-02-29 Thread Brian G. Peterson
On Sat, 2020-02-29 at 09:06 -0500, G Mac wrote: > Is there an R-package (or other software) that can be used to > forecast the next period's portfolio composition? There are many > portfolio optimization packages, but this is not the same > question. Say I take the past* x* periods, each period

Re: [R-SIG-Finance] data differs

2020-01-21 Thread Brian G. Peterson
They are different symbols with different tenors, so yes, it is normal for them to differ. iirc, IR is a 90-day interbank rate, and YT is a 3-yr bond It's been a while, so I might have those tenors wrong, but either way they are futures for different rates. Why would you expect them to be

Re: [R-SIG-Finance] R in Finance 2020

2019-10-09 Thread Brian G. Peterson
R/Finance 2020 is currently scheduled for June 5-6, 2020 As usual, we expect that it will be held on the UIC campus in Chicago, IL, USA. Jeff Ryan is currently working on a new website framework, and we hope to launch the new website and the Call for Presentations 'soon'. Regards, Brian On

Re: [R-SIG-Finance] Resources for AI/ML in Risk Management

2019-09-24 Thread Brian G. Peterson
doesn't give anyone here any guidance on how to help you. Regards, Brian -- Brian G. Peterson ph: +1.773.459.4973 im: bgpbraverock ___ R-SIG-Finance@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance -- Subscriber-post

Re: [R-SIG-Finance] Mothly Returns of Mutual funds

2019-08-04 Thread Brian G. Peterson
ur broker, or a service that sells that data. > Also pls share the process document for Portfolio Optimisation and > which R packages are required to achieve the above goal. PortfolioAnalytics can do the optimization. There is lots of documentation in the package and elsewhere online. -- Brian

Re: [R-SIG-Finance] [PortfolioAnalytics] optimize.portfolio.rebalancing with changing stock universe

2019-08-04 Thread Brian G. Peterson
portf, > > optimize_method="DEoptim" > , > > rebalance_on="quarters", > > trainin

Re: [R-SIG-Finance] Free financial data - equities, equity options and ETFs - for quantmod package (or other packages)

2019-04-04 Thread Brian G. Peterson
quantmod supports multiple data sources, both paid and free. The documentation is installed with the package or you can find a pdf here: https://cran.r-project.org/web/packages/quantmod/quantmod.pdf The code is here: https://github.com/joshuaulrich/quantmod/blob/master/R/getSymbols.R For free

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

2019-04-01 Thread Brian G. Peterson
> I'll greatly appreciate your comments. > > > > > > Alec > > > > > > > > From: Brian G. Peterson > > Sent: Tuesday, January 8, 2019 11:55 AM > > To: Alec Schmidt; r-sig-finance@r-project.org > > Subject: Re: [R-SIG-

Re: [R-SIG-Finance] Fit skewed-t distribution

2019-04-01 Thread Brian G. Peterson
On Mon, 2019-04-01 at 13:56 +0300, Данир Зулькарнаев wrote: > Could someone suggest any package to estimates parameters of skewed-t > distribution? > I didn't manage to find any. > My personal favorite for the skewed Student's-t distribution family is the 'sn' package. There is also the 'skewt'

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

2019-01-08 Thread Brian G. Peterson
[31 Days] > 05/02/2011 - 06/17/2011 (-7.59%) [34 Days] > 02/22/2011 - 03/16/2011 (-6.54%) [17 Days] > 07/18/2000 - 10/09/2002 (-97.34%) [559 Days] > Alec > > > > From: Brian G. Peterson > Sent: Tuesday, January 8, 2019 11:17 AM > To: Alec Schmidt; r-sig-finance

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

2019-01-08 Thread Brian G. Peterson
. Regards, Brian -- Brian G. Peterson http://braverock.com/brian/ Ph: 773-459-4973 IM: bgpbraverock On Tue, 2019-01-08 at 16:09 +, Alec Schmidt wrote: > I tried to use the function findDrawdowns() to compile NASDAQ (^IXIC) > corrections. For the sample starting on > > 2007-

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

2018-09-26 Thread Brian G. Peterson
reproducible example (including data e.g. using dput function the or reprex package). Regards, Brian -- Brian G. Peterson http://braverock.com/brian/ Ph: 773-459-4973 IM: bgpbraverock On Tue, 2018-09-25 at 17:03 -0400, Simon Hovmark wrote: > I am trying to run the follow

Re: [R-SIG-Finance] bitbucket code

2018-08-29 Thread Brian G. Peterson
what you need e.g. to test a proposed patch. Regards, Brian > On Wed 29 Aug, 2018, 21:34 Brian G. Peterson, > wrote: > > This question really belongs on R-help or a forum like Stack > > Overflow, > > as it has nothing to do with finance. I understand that this is > > rel

Re: [R-SIG-Finance] bitbucket code

2018-08-29 Thread Brian G. Peterson
This question really belongs on R-help or a forum like Stack Overflow, as it has nothing to do with finance. I understand that this is related to the thread on rmgarch, but it could have been asked in that thread with more specificity. On Wed, 2018-08-29 at 15:32 +0530,

Re: [R-SIG-Finance] Quantstrat - running applyStrategy in a loop

2018-08-20 Thread Brian G. Peterson
er won't allow it. In the 'should work' camp are several variations of splitting your computational problem so that it is amendable to looping and/or parallelization, described above. Regards, Brian -- Brian G. Peterson http://braverock.com/brian/ Ph: 773-459-4973 IM: bgpbraverock __

Re: [R-SIG-Finance] R/Finance 2018 Registration

2018-05-18 Thread Brian G. Peterson
-- Brian G. Peterson http://braverock.com/brian/ Ph: 773-459-4973 IM: bgpbraverock On Fri, 2018-05-18 at 10:59 -0500, Adam Ginensky wrote: > Hi Josh, > > I have a few details that I need corrected. I signed up for the > Bayesian > pre-conference course and I see that now has been

Re: [R-SIG-Finance] Using quantstrat with options

2018-03-29 Thread Brian G. Peterson
and multipliers are set correctly for the root symbol, then the accounting should work. Regards, Brian -- Brian G. Peterson http://braverock.com/brian/ Ph: 773-459-4973 IM: bgpbraverock On Thu, 2018-03-29 at 12:17 -0500, Sal Abbasi wrote: > Has anyone used quantstrat with options? I’ve found l

Re: [R-SIG-Finance] Any news about the R/Finance 2018 conference?

2018-03-26 Thread Brian G. Peterson
', hopefully this week. We are looking forward to the tenth year of R/Finance, which attracts more than 300 people each year. I hope you can make it. Regards, Brian -- Brian G. Peterson http://braverock.com/brian/ Ph: 773-459-4973 IM: bgpbraverock ___ R

Re: [R-SIG-Finance] Error using Performance Analytics package

2018-03-13 Thread Brian G. Peterson
Well, your code is completely mangled by posting in HTML, as Josh told you would likely happen. In any case, You haven't provided a reproducible example. require(PerformanceAnalytics) data(edhec) # also monthly data VaR(edhec, p=0.95, method='modified') # the last two parameters are defaults,

Re: [R-SIG-Finance] Minimizing tracking error with restricted number of stocks

2018-03-08 Thread Brian G. Peterson
ject.org> on behalf > of Jason Hart <jasonha...@icloud.com> > Sent: Thursday, March 8, 2018 9:46 AM > To: Brian G. Peterson > Cc: R-SIG-Finance > Subject: Re: [R-SIG-Finance] Minimizing tracking error with > restricted number of stocks > > Great presentation, tha

Re: [R-SIG-Finance] Minimizing tracking error with restricted number of stocks

2018-03-07 Thread Brian G. Peterson
Error example starts on slide 29, though you should find the rest of the tutorial useful. - Brian From: R-SIG-Finance <r-sig-finance-boun...@r-project.org> on behalf of Brian G. Peterson <br...@braverock.com> Sent: Wednesday, March 7,

Re: [R-SIG-Finance] Minimizing tracking error with restricted number of stocks

2018-03-07 Thread Brian G. Peterson
this. -- Brian G. Peterson http://braverock.com/brian/ Ph: 773-459-4973 IM: bgpbraverock ___ 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

Re: [R-SIG-Finance] Stop Loss orders in quantstrat

2018-02-10 Thread Brian G. Peterson
* reproducible example and enter an issue on the quantstrat github. Regards, Brian -- Brian G. Peterson http://braverock.com/brian/ Ph: 773-459-4973 IM: bgpbraverock ___ R-SIG-Finance@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r

Re: [R-SIG-Finance] PortfolioAnalytics Package Questions on Initial Weights & Group Constraints

2018-01-28 Thread Brian G. Peterson
tfolio=pspec, type="position_limit", max_pos=3) Is there a reason that a minimum position constraint was not/cannot be implemented? I think a minimum position box constraint will do what you want, but otherwise no, we'd need to look at the code and think about it some more as to why it was i

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

2017-10-16 Thread Brian G. Peterson
On Mon, 2017-10-16 at 05:43 -0500, Brian G. Peterson wrote: > On 10/16/2017 04:35 AM, Pankaj K Agarwal via R-SIG-Finance wrote: > > Dear allCan someone suggest some good resources/package on > > Financial Risk Management based on R? I would like to use them for > > a graduate

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

2017-10-16 Thread Brian G. Peterson
includes a number of more fundamental resources, such as PerformanceAnalytics and rugarch. Regards, Brian -- Brian G. Peterson http://braverock.com/brian/ Ph: 773-459-4973 IM: bgpbraverock ___ R-SIG-Finance@r-project.org mailing list https

Re: [R-SIG-Finance] Accessing "row names" in an object created by quantmod

2017-09-12 Thread Brian G. Peterson
Ilya has already pointed out the index function. Slightly more information is that xts objects don't have row names, they have a time/date based index, and facilities to subset using that index. For the most part, you can do this as you would with a data.frame, by exact index or by row number,

Re: [R-SIG-Finance] Some problems while reading Diethelm Würtz's Portfolio Optimization with R book

2017-08-27 Thread Brian G. Peterson
at.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. -- Brian G. Peterson http://braverock.com/brian/ Ph: 773-459-4973 IM: bgpbraverock _

Re: [R-SIG-Finance] Return.portfolio issue

2017-05-29 Thread Brian G. Peterson
On 05/29/2017 02:32 AM, ROUX, Nicolas wrote: Hello all, I am trying to backtest a long/short portfolio using Return.Portfolio but am running into some sort of error, or I do not fully understand how to use return.portfolio. For a quarterly rebalancing of shorts, I am providing monthly

Re: [R-SIG-Finance] Adding "Stoploss disabled" to the parameter distribution for apply.paramset

2017-05-26 Thread Brian G. Peterson
On Fri, 2017-05-26 at 10:34 +, Atakan Okan wrote: > Is it possible to add a "disabled" option to the parameter > distribution (for stoploss, stoptrailing, takeprofit)? So the typical > parameter distribution contains a vector of integers, but how would I > go about adding the "disabled

[R-SIG-Finance] [Fwd: Re: Fwd: Re: [Fwd: Performance Analytics internal multivariateMoments calculations]]

2017-05-23 Thread Brian G. Peterson
"Joe W. Byers" <ecjb...@aol.com> To: Brian G. Peterson <br...@braverock.com>, Dries Cornilly , r-sig-finance@r-project.org Subject: Re: [R-SIG-Finance] Fwd: Re: [Fwd: Performance Analytics internal multivariateMoments calculations] Date: Tue, 23 May 2017 10:50:37 -0400

Re: [R-SIG-Finance] blotter package funciton addTxns

2017-05-16 Thread Brian G. Peterson
The code and documentation for the addTxns function are in the addTxn.R file (lines 167-201). On Tue, 2017-05-16 at 20:03 +, Bos, Roger wrote: > All, > > I cloned the blotter package on github and took a look at the > amzn_test.R demo file and I see a call to addTxns, but I don't see > that

Re: [R-SIG-Finance] Quantstrat - extracting current symbol

2017-05-12 Thread Brian G. Peterson
dd.indicator - I did a poor job explaining what I was trying > to achieve, but it's exactly what you're saying. I will create a new > indicator function, which will get some metadata from the instrument > and all of that will be handled inside the indicator function, there > is no need to p

Re: [R-SIG-Finance] Quantstrat - extracting current symbol

2017-05-12 Thread Brian G. Peterson
). If this hasn't answered your question, perhaps you could follow up with something more specific including a *minimal* example. Regards, Brian -- Brian G. Peterson http://braverock.com/brian/ Ph: 773-459-4973 IM: bgpbraverock ___ R-SIG-Finance@r-project.org

Re: [R-SIG-Finance] Luxor Demo Question

2017-04-24 Thread Brian G. Peterson
On 04/24/2017 12:38 PM, John Klingensmith wrote: Hi, Does anyone know the purpose behind why the parameters in the Luxor demo are preceded by dots? # optimization range .FastSMA = (1:30) .SlowSMA = (20:80) It seems to make them hidden, which also makes them difficult to remove. They're

Re: [R-SIG-Finance] quanstrat exit rules

2017-04-18 Thread Brian G. Peterson
in a specific order, as described in the documentation for add.rule and other places. exits are evaluated before entries. Regards, Brian -- Brian G. Peterson http://braverock.com/brian/ Ph: 773-459-4973 IM: bgpbraverock On Tue, 2017-04-18 at 10:31 -0400, Jon Golenbock wrote: > Hi, trying to

Re: [R-SIG-Finance] A quick custom data question

2017-04-08 Thread Brian G. Peterson
need for a custom indicator function at all. In any case, from your non-reproducible example, and just reading the code, the main problem appears to be your call to OHLC(), which will strip your other columns. Skip that, and things should be fine. Regards, Brian -- Brian G. Peterson http

Re: [R-SIG-Finance] Rblpapi package data limits?

2017-04-05 Thread Brian G. Peterson
On Wed, 2017-04-05 at 08:54 -0400, Jon Golenbock wrote: > Hi, I was hoping somebody might be a regular user of this package to > interact with Bloomberg terminal. I've been having an issue pulling > historical data, it seems to cut off at a seemingly arbitrary point > -- > > > library(rRblpapi)

Re: [R-SIG-Finance] random portfolios

2017-03-21 Thread Brian G. Peterson
Rcpp would be time well spent or you think there must be a smarter way to get around it still using R? I really appreciate your help on this thread. Regards, Kshitij Dhingra On Mon, Mar 20, 2017 at 7:21 PM, Brian G. Peterson <br...@braverock.com> wrote: For this type of problem, I

Re: [R-SIG-Finance] random portfolios

2017-03-20 Thread Brian G. Peterson
On Mon, Mar 20, 2017 at 3:17 PM, Brian G. Peterson <br...@braverock.com> wrote: On Mon, 2017-03-20 at 15:09 -0400, Kevin Dhingra wrote: I have been using the random_portfolios function from the `PortfolioAnalytics` package to simulate the range of possibilities for return paths at each st

Re: [R-SIG-Finance] random portfolios

2017-03-20 Thread Brian G. Peterson
On Mon, 2017-03-20 at 15:09 -0400, Kevin Dhingra wrote: > I have been using the random_portfolios function from the > `PortfolioAnalytics` package to simulate the range of possibilities > for return paths at each step under various portfolio constraints / > mandates for evaluating mutual fund

Re: [R-SIG-Finance] apply.paramset stopping on condition

2017-03-14 Thread Brian G. Peterson
seen tests that take hours or even days to run here, but those are over massive amounts of data. Have you profiled a single run of the backtest to see where it is spending its time? Regards, Brian -- Brian G. Peterson http://braverock.com/brian/ Ph: 773-459-4973 IM: bgpbraverock On Tue, 2017-03

Re: [R-SIG-Finance] Parallelizing applyStrategy to multiple symbols

2017-03-06 Thread Brian G. Peterson
doesn't seem to be worth the cost in programming and testing time. Regards, Brian -- Brian G. Peterson http://braverock.com/brian/ Ph: 773-459-4973 IM: bgpbraverock On Mon, 2017-03-06 at 18:53 +, Atakan Okan wrote: > Hello, > > I am trying to parallelize applyStrategy() to make

Re: [R-SIG-Finance] Custom Indicator and apply.paramset problem

2017-02-25 Thread Brian G. Peterson
, portfolio=strategy.st, account=strategy.st, nsamples=0, verbose = TRUE, audit=paramsetenv, calc = "slave") snow::stopCluster(cl)

Re: [R-SIG-Finance] Custom Indicator Problem

2017-02-25 Thread Brian G. Peterson
list(mktdata=quote(mktdata))) apply.indicators.df <- applyIndicators(strategy.st, mktdata=GARAN.IS) #testing indicator calculations -Atakan Okan ___ R-SIG-Finance@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance -- Subscriber-posti

Re: [R-SIG-Finance] Portfolio management in R for private use

2017-01-12 Thread Brian G. Peterson
, Brian -- Brian G. Peterson http://braverock.com/brian/ Ph: 773-459-4973 IM: bgpbraverock ___ 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

Re: [R-SIG-Finance] Clarification on trailing stop.

2016-12-28 Thread Brian G. Peterson
nd something like a VWAP price if you have the data available. in any case, the prefer= argument is a pass-through to getPrice. quantstrat will make reasonable guesses based on your data if it is not set. see ?getPrice for more information on how getPrice works to extract price data. Regards

Re: [R-SIG-Finance] Clarification on trailing stop.

2016-12-27 Thread Brian G. Peterson
uld be 'High' +/- threshold (depending on whether you are buying or selling) Regards, Brian --  Brian G. Peterson  http://braverock.com/brian/  Ph: 773-459-4973  IM: bgpbraverock ___ R-SIG-Finance@r-project.org mailing list https://stat.ethz.ch/mai

Re: [R-SIG-Finance] Quantstrat - applystrategy on subset of mktdata

2016-12-15 Thread Brian G. Peterson
On Thu, 2016-12-15 at 06:31 +, Mayank Singhal via R-SIG-Finance wrote: > I am interested in backtesting the strategy on subset of mktdata  but > somehow the below approach is resulting into errors. > # yy="2016"out<-applyStrategy(strat.st , > portfolios=portfolio.st, mktdata =

Re: [R-SIG-Finance] Quantstrat to backtest portfolio strategy. User Defined Weights

2016-12-14 Thread Brian G. Peterson
On Wed, 2016-12-14 at 14:28 +, Vineet Gupta wrote: > I am trying to use Quantstrat to backtest a portfolio strategy with > user defined weights at each re-balance date. The user defined > weights, are given in a matrix (example shown below) > >  Date ABC.UN   ABT.UN ACN.UN ADBE.UW

Re: [R-SIG-Finance] Basket stop loss implementation quantstrat

2016-12-13 Thread Brian G. Peterson
ntstrat applications, are you able to provide some sketch code as > to how such an operation would be managed? I'm more than happy to > have a dig at this myself but somewhere to start would be nice. > > > Cheers, > > Aaron > > > &g

Re: [R-SIG-Finance] Need help with replication of a strategy using 'Quantstrat' & 'IKTrading' packages

2016-12-12 Thread Brian G. Peterson
On Mon, 2016-12-12 at 23:27 +0530, Adarsh KP wrote: > I am trying to replicate core strategy (for a single instrument) from > the book 'Following the trend' by Andreas Clenow. Details about the > strategy are in the picture in this link (https://drive.google.com/fi >

Re: [R-SIG-Finance] Basket stop loss implementation quantstrat

2016-12-12 Thread Brian G. Peterson
On Mon, 2016-12-12 at 17:17 +, Aaron wrote: > Is it possible to implement a basket or portfolio stoploss in > quantstrat? That is, I would like to trade a number of symbols > simultaneously and use accumulated p/l across all symbols as a global > stoploss/take profit. > > I have not seen any

Re: [R-SIG-Finance] blotter updatePortf

2016-11-11 Thread Brian G. Peterson
again, Michael From: R-SIG-Finance <r-sig-finance-boun...@r-project.org> on behalf of Brian G. Peterson <br...@braverock.com> Sent: Wednesday, November 9, 2016 3:13 AM To: r-sig-finance@r-project.org Subject: Re: [R-SIG-Finance] blotter updatePortf On 11/0

Re: [R-SIG-Finance] blotter updatePortf

2016-11-09 Thread Brian G. Peterson
quantstrat for rebalancing, for paramsets, and for walk.forward. It will only be called by the default applyStrategy call if wrapup=TRUE and you're using the (experimental, incomplete?) wrapup code. Regards, Brian on Sunday, November 6, 2016 11:15 AM, Brian G. Peterson wrote: On 11/06/2016 12:10 PM, Came

Re: [R-SIG-Finance] blotter updatePortf

2016-11-06 Thread Brian G. Peterson
, Brian -- Brian G. Peterson http://braverock.com/brian/ Ph: 773-459-4973 IM: bgpbraverock ___ 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

Re: [R-SIG-Finance] CVaR and Penalty Augmented objective function

2016-10-13 Thread Brian G. Peterson
be to handle it in dots, and make sure those get merged correctly. I think it would be much more challenging to process it from the argument=list() for an individual objective. Regards, Brian -- Brian G. Peterson http://braverock.com/brian/ Ph: 773-459-4973 IM: bgpbraverock On Thu, 2016-10-13

Re: [R-SIG-Finance] CVaR and Penalty Augmented objective function

2016-10-12 Thread Brian G. Peterson
__ 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 that this is not the r-help list where general R questions should go. [[alternative HTM

Re: [R-SIG-Finance] Search Function

2016-10-09 Thread Brian G. Peterson
method B and Googling 'r-sig-finance search' Regards, Brian -- Brian G. Peterson http://braverock.com/brian/ Ph: 773-459-4973 IM: bgpbraverock ___ R-SIG-Finance@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance -- Subscriber

Re: [R-SIG-Finance] Error:subscript out of bounds: no column name containing "Close

2016-10-09 Thread Brian G. Peterson
On 10/08/2016 10:55 PM, Ramesh wrote: I have downloaded the time series of crude oil in to R ( from a local excel file(csv/text tab delimited) in C drive)and the data ( OHLC) is being displayed in my R.Studio. Am able to ascertain the Fibonacci pivot levels ( using a custom program that I have

Re: [R-SIG-Finance] Constrained portfolio optimization with DEoptim

2016-10-04 Thread Brian G. Peterson
u really want is *portfolio* shortfall. I would be concerned that the loss of dimensionality suggested by your description would make it difficult to get a realistic solution. There are several more things that could cause this to fail to converge. I've covered the most likely ones, but further in

Re: [R-SIG-Finance] PortfolioAnalytics: unused argument error

2016-09-20 Thread Brian G. Peterson
On Mon, 2016-09-19 at 23:08 +, Jason Hart wrote: > I've never been able to get portfolioanalytics to work for me. It > looks like a nice little addition to the R arsenal but we just weren't > meant to work together. I figured what the heck I'll try this code > and I got the same error

Re: [R-SIG-Finance] PortfolioAnalytics: Custom Constraint

2016-09-20 Thread Brian G. Peterson
d plot the difference between the unconstrained search space and the constrained search space to sort out whether this is really what you want to do. Regards, Brian -- Brian G. Peterson http://braverock.com/brian/ Ph: 773-459-4973 IM: bgpbraverock On Tue, 2016-09-20 at 07:18 -0500, Ross Bennett wrote

Re: [R-SIG-Finance] PortfolioAnalytics: Custom Constraint

2016-09-19 Thread Brian G. Peterson
ing optimization. Regards, Brian -- Brian G. Peterson http://braverock.com/brian/ Ph: 773-459-4973 IM: bgpbraverock ___ R-SIG-Finance@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance -- Subscriber-posting only. If you want to p

Re: [R-SIG-Finance] Fwd: Multi-Asset Portfolio Performance Attribution

2016-08-25 Thread Brian G. Peterson
install.packages("PortfolioAttribution",repos="http://R-Forge.R-project.org;) Regards, Brian On Thu, 2016-08-25 at 02:50 +0200, Olasunkanmi Obanubi via R-SIG-Finance wrote: > Hi all, > > I am interested in knowing if there are any packages that deal with > performance attribution for a

Re: [R-SIG-Finance] Backtesting without long-only constraint

2016-08-19 Thread Brian G. Peterson
On Fri, 2016-08-19 at 18:31 +0100, d.ind...@iee.org wrote: > Are there any libraries enabling the portfolio back testing a la > PortfolioAnalytics's Portfolio.return() with -ve weightings, or relaxed > leverage constraint? Return.portfolio in PerformanceAnalytics supports whatever you want for

Re: [R-SIG-Finance] Multi Asset portfolio failing at applyStrategy with 'data' must be of a vector type, was 'NULL'

2016-08-10 Thread Brian G. Peterson
f of your question is to take your data and put it into R, where there are many many packages available for doing the analysis. -- Brian G. Peterson http://braverock.com/brian/ Ph: 773-459-4973 IM: bgpbraverock ___ R-SIG-Finance@r-project.org mailing l

Re: [R-SIG-Finance] Help required in getting SMA triggered entry with quantstrat add.rule

2016-08-01 Thread Brian G. Peterson
me parameters of slippage. From your reply should I presume > that a day late execution from signal date is deliberate and you have > a mechanism of making it on signal date execution? > > > thanks > > > Golam > > On Mon, Aug 1, 2016 at 2:22 PM, Brian G. Pet

Re: [R-SIG-Finance] Help required in getting SMA triggered entry with quantstrat add.rule

2016-08-01 Thread Brian G. Peterson
On 08/01/2016 05:07 AM, golam sakline wrote: In Quantstrat, is it possible to use add.rule that can pick the crossover between SMA and the price as entry rather than the bar close price? Is there a way I can add buy-stop and sell-stop order types using limits that look into the SMA figures.

Re: [R-SIG-Finance] Imputing Missing Values

2016-06-26 Thread Brian G. Peterson
On Sun, 2016-06-26 at 12:53 +, Pankaj K Agarwal via R-SIG-Finance wrote: > This might be a very basic query for this erudite group. However, i am > hopeful some help will be forthcoming nevertheless.I have a monthly > time series of annualized t-bill rates on Indian markets. For some > months,

Re: [R-SIG-Finance] rule delays

2016-05-29 Thread Brian G. Peterson
that takes place if the normal rule doesn't produce a sale before. I added this rule at line 127 of the file 3. strategy.R: add.rule(strategy.st, name = "ruleSignal", arguments = list(sigcol = "longExit", sigval = TRUE, orderqty = "all", delay = 691200,

Re: [R-SIG-Finance] Exit Order By Current Position Info

2016-04-22 Thread Brian G. Peterson
es. The demo scripts are updated to adjust for changes in R and the required packages, the slides are obviously static. Regards, Brian -- Brian G. Peterson http://braverock.com/brian/ Ph: 773-459-4973 IM: bgpbraverock ___ R-SIG-Finance@r-project.org

Re: [R-SIG-Finance] adjustOHLC.R issues

2016-04-12 Thread Brian G. Peterson
The output of adjustOHLC and {yahoo}.Adjusted will only rarely, if ever, agree, since we don't know when they are starting the adjustment, or how they are doing the adjustment. There are many threads over the years on this list about this issue which I'm sure Google can locate for you.

Re: [R-SIG-Finance] Processing time of backtests on a single computer

2016-04-09 Thread Brian G. Peterson
those who are interested. /pkg/quantstrat/sandbox/paramtest201604/ -- Brian G. Peterson http://braverock.com/brian/ Ph: 773-459-4973 IM: bgpbraverock ___ R-SIG-Finance@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance -- S

Re: [R-SIG-Finance] rbind and duplicates in monthly futures

2016-04-07 Thread Brian G. Peterson
for %-returns space. Very few of them presume monthly summaries except for the few standardized fund returns tables. Regards, Brian -- Brian G. Peterson http://braverock.com/brian/ Ph: 773-459-4973 IM: bgpbraverock On Thu, 2016-04-07 at 12:25 +0100, Peter Neumaier wrote: > I agree, I could h

Re: [R-SIG-Finance] Processing time of backtests on a single computer

2016-04-06 Thread Brian G. Peterson
On Wed, 2016-04-06 at 23:58 +0300, Jersey Fanatic wrote: > I will try running the same code without trailing stops and see what > effect > it has on the processing time. I will report back as soon as it is > finished. Running the macd demo code over 10 years of daily data on my machine (no

Re: [R-SIG-Finance] Processing time of backtests on a single computer

2016-04-06 Thread Brian G. Peterson
expectation of your resulting signal process? Most of the validation of your indicator and signal processes should be possible long before you get to parameter optimization. Regards, Brian -- Brian G. Peterson http://braverock.com/brian/ Ph: 773-459-4973 IM: bgpbraverock On Wed, 2016-04-06 at 23:20

Re: [R-SIG-Finance] Processing time of backtests on a single computer

2016-04-06 Thread Brian G. Peterson
On Wed, 2016-04-06 at 20:58 +0300, Jersey Fanatic wrote: > Hi everyone, > > I am trying to backtest a simple strategy of mine, but it took approx 10 > hours of processing so I was wondering if it is normal. > > My computer has an i7 core 2.10 GHz, 8GB RAM with Windows 7 Ultimate OS. My > code

Re: [R-SIG-Finance] Remove first two weeks of data in half hourly resolution

2016-03-31 Thread Brian G. Peterson
(zs))) ## Regards, Brian -- Brian G. Peterson http://braverock.com/brian/ Ph: 773-459-4973 IM: bgpbraverock On Thu, 2016-03-31 at 11:50 +0100, Peter Neumaier wrote: > Hi all, > > I am doing some analysis on monthly futures contracts from 2011-2016. > Each monthly contract

  1   2   3   4   5   >