Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I need an MS Excel formula that backtests a set of prices and computes loss/gain using specific price stops. I have downloaded historical stock prices into an Excel spreadsheet. I need a formula that computes the potential gain or loss for a stock using specific price stops based on an initial entry point. For instance, if I buy IBM @ 100, using a price stop of +/- 5%, I want the formula to compute whether the position realized a gain or loss over a specific time period using end of day price data. Ideally the formula will identify and compute the gain/loss based on the first price stop during a given time period. For example, with an entry price of 100, if IBM hits 105 at the beginning of a time period, and falls to 95 later in the time period, the formula should recognize the first price stop – at a profit of 5%. Ideally, I would also like the formula to compute a series of pre-defined stop prices, let’s say sell half the position at a stop of +/- 5%, and the other half when the price hits +/- 10%. Thank you. -- ExcelKat ------------------------------------------------------------------------ ExcelKat's Profile: http://www.excelforum.com/member.php...o&userid=35169 View this thread: http://www.excelforum.com/showthread...hreadid=549384 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
=IF(INDEX(A1:A365,SMALL(IF(ABS(A1:A365-StartPricesheet!A1)=5,ROW(A1:A365)),1),1)-StartPricesheet!A10,"gain","Loss")
entered with Ctrl+shift+enter should get you started. -- Regards, Tom Ogilvy "ExcelKat" wrote: I need an MS Excel formula that backtests a set of prices and computes loss/gain using specific price stops. I have downloaded historical stock prices into an Excel spreadsheet. I need a formula that computes the potential gain or loss for a stock using specific price stops based on an initial entry point. For instance, if I buy IBM @ 100, using a price stop of +/- 5%, I want the formula to compute whether the position realized a gain or loss over a specific time period using end of day price data. Ideally the formula will identify and compute the gain/loss based on the first price stop during a given time period. For example, with an entry price of 100, if IBM hits 105 at the beginning of a time period, and falls to 95 later in the time period, the formula should recognize the first price stop €“ at a profit of 5%. Ideally, I would also like the formula to compute a series of pre-defined stop prices, lets say sell half the position at a stop of +/- 5%, and the other half when the price hits +/- 10%. Thank you. -- ExcelKat ------------------------------------------------------------------------ ExcelKat's Profile: http://www.excelforum.com/member.php...o&userid=35169 View this thread: http://www.excelforum.com/showthread...hreadid=549384 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I stop "global" hyperlinks changing to "local" links? | Excel Worksheet Functions | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
If changed array formula reduce ""\""\""\ - signs to #Missing, will it make ... | Excel Programming | |||
Can I automaticly figure "cost" and sale price in Excel? | Excel Worksheet Functions | |||
Stop users from accessing "Protection" option from "Tools" menu | Excel Programming |