[R] Profit calculation
Joshua Ulrich
josh.m.ulrich at gmail.com
Wed Jun 20 01:18:12 CEST 2012
On Tue, Jun 19, 2012 at 6:07 PM, Bert Gunter <gunter.berton at gene.com> wrote:
> 1. Don't double post. (obviously belongs on finance list)
> 2. Homework? (we don't do homework on r-help)
>
We don't do homework on R-SIG-Finance either...
> -- Bert
>
Best,
--
Joshua Ulrich | FOSS Trading: www.fosstrading.com
> On Tue, Jun 19, 2012 at 3:54 PM, Raghuraman Ramachandran <
> optionsraghu at 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 at 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 at 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.
More information about the R-help
mailing list