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]]

