![]() |
Back-testing trade data
Hi all,
I've had no luck with a formula to calculate profit and loss based on a strategy in the market all the time either long or short. Column A is market position: 1 or -1 Column B is the entry price: Column C is the profit (difference between sell and buy price or buy and sell price: For instance: Market position, price: -1, 98 12/32 1, 99 14/32 -1, 99 3/32 1, 99 2/32 -1, 97 16/32 1, 99 1/32 Therefo (98 12/32 -(99 14/32) + ( 99 3/32 - 99 14/32) + (99 3/32 - 99 2/32) + (97 16/32 - 99 2/32) = Thanks, Scott |
Can you explain the logic of the formula you show at the bottom? If you label
the data points A through F, your formula is A-B + C-B + C-D + E-D You could also write this as: A-B - (B-C) + (C-D) - (D-E) Why no segment that deals with E and F? What determines whether you add or subtract the difference between 2 consecutive entries? Which entries are buys and which are sells? Is this in fact paired data, so that A is a buy and B the corresponding sell (or vice-versa)? If you used just one column with a negative sign meaning a buy and positive meaning a sell, you could just sum the column, no? On Tue, 15 Mar 2005 05:59:06 -0800, Dismal wrote: Hi all, I've had no luck with a formula to calculate profit and loss based on a strategy in the market all the time either long or short. Column A is market position: 1 or -1 Column B is the entry price: Column C is the profit (difference between sell and buy price or buy and sell price: For instance: Market position, price: -1, 98 12/32 1, 99 14/32 -1, 99 3/32 1, 99 2/32 -1, 97 16/32 1, 99 1/32 Therefo (98 12/32 -(99 14/32) + ( 99 3/32 - 99 14/32) + (99 3/32 - 99 2/32) + (97 16/32 - 99 2/32) = Thanks, Scott |
All times are GMT +1. The time now is 11:15 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com