1. Don't double post. (obviously belongs on finance list) 2. Homework? (we don't do homework on r-help)
-- Bert On Tue, Jun 19, 2012 at 3:54 PM, Raghuraman Ramachandran < optionsra...@gmail.com> wrote: > Dear guRus > > Say I have a price vector, P which is P = c(20,50,40,50) for four > consecutive days. > > My initial equity is say $100 and I re-invest the profits made in each > transaction so my equity curve increases. > > If I go Long on day 1, short and short on day 2, long and long on day 3 and > finally short on day 4, how do I calculate the total profits using R? > Basically I stay invested at all times. > > I have simplified a larger problem by giving a small example. > > Thanks for your kind guidance in advance. > > Raghu > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > -- Bert Gunter Genentech Nonclinical Biostatistics Internal Contact Info: Phone: 467-7374 Website: http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.