[R-SIG-Finance] blotter updatePortf

Michael Chen mwc4120 at hotmail.com
Wed Nov 9 07:41:08 CET 2016


Reading these answers reminded me to inquire the same about Quantstrat.  I looked into the code for applyStrategy, I don't see any explicit calls to updatePort.  Is this because in my runs of quanstrat, I didn't use "real time" re-balancing? So, no update was necessary?  Usually, l  just run updatePortf (strategy) which updates every symbol and calculates PnL for each period prices available after I ran applyStrategy in quantstrat.   Please let me know if I am missing something.

thanks as always,



________________________________
From: R-SIG-Finance <r-sig-finance-bounces at r-project.org> on behalf of Brian G. Peterson <brian at braverock.com>
Sent: Sunday, November 6, 2016 11:15 AM
To: r-sig-finance at r-project.org
Subject: Re: [R-SIG-Finance] blotter updatePortf

On 11/06/2016 12:10 PM, Cameron McLean wrote:
> Is there example code you can share or an existing demo in quantstrat
> that shows how to update the portfolio equity curve and size future
> orders based on the current amount?

Look at any of the rebalancing demos.  There are rebalancing versions of
the Faber and macd demos, at least.

These rebalance (adjust max trade size) periodically based on current
portfolio equity.

> A simple example would be something similar to the faber demo where he
> invests 20% of equity in each of the 5 asset classes (currently the
> faber demo buys and sells lots of 500 shares) or a more complex
> example could be using a indicator such as ATR to size trades based on
> risk.

Sizing based on risk would be done via a custom order sizing function
that used the indicator value to adjust trade size.  I believe Ilya has
examples of this on his blog.

Regards,

Brian

--
Brian G. Peterson
http://braverock.com/brian/
Brian G. Peterson<http://braverock.com/brian/>
braverock.com
BRIAN G. PETERSON 773-459-4973. brian at braverock.com. download resume as PDF SUMMARY. Senior quantitative trader, financial analyst, technical architect, and project ...



Ph: 773-459-4973
IM: bgpbraverock

_______________________________________________
R-SIG-Finance at 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 HTML version deleted]]



More information about the R-SIG-Finance mailing list