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.

Reply via email to