Excel spreadsheet of Portfolio Backtester

Discussion in 'Excel' started by hylt, Aug 20, 2005.

  1. 下载:
    http://f5.grp.yahoofs.com/v1/sJwGQ4...OxBamsXi1yRwRVAUGnMA/Portfolio Backtester.zip

    说明:
    Hello,

    I have attached a zipped spreadsheet which is a multi-security portfolio backtesting spreadsheet. Given the results of an AB scan (ticker, date, buy/sell, price), it will scan through the results and record trades based on your desired position size and initial total capital. It will then show you the trades, ending capital, profit, etc.

    Note: I have only started learning VBA in Excel. When you experienced programmers look at the VBA code, you will realized that there are probably much better ways to do what I'm trying to do. Any suggestions are more than welcome.

    To use it:
    - run a scan in AB
    - sort by ascending date
    - copy the results into the worksheet labelled "Data" starting from cell A1
    - specify your initial capital and max postion size (fixed $ amount, for now) in the worksheet labelled "Results"
    - click the Apply Backtest button on the "Data" worksheet
    - once it's done, you can see the results in the "Results" worksheet. you must enter the current price for open positions

    The spreadsheet simply runs through the chronological list in Data and records a buy/sell based on the price, desired position size, max number of shares, and the current balance of your account. If you do not have enough funds, it
    obviously does not record a trade.

    Assumptions:

    - It currently only handles going long, no short selling.

    - You DO want to accumulate a stock you already own. If there is a buy signal for a ticker which you already own, the macro currently accepts that buy signal (i.e. accumulates more shares). However, this is relatively easy to change so that it will not accumulate shares of a ticker you already own. Which method is more realistic in your (and anyone else's) view ? I could probably add an option where you specify whether or not you want to accumulate shares of a currently owned ticker.

    - If a sell for a certain ticker occurs before any buy, I simply ignore the trade since you don't own any shares yet.

    - If there are multiple buys on the same day, the spreadsheet process them in the order they appear in the spreadsheet. If you copy/paste from an AB scan, AB does not do any type of sorting within the same day. So, the spreadsheet will process them in the order that AB gives them. You can alway do another sort in Excel based on date and ticker.

    - It currently only process approximately 10,000 rows of Data.

    If anyone has any suggestion for this spreadsheet, please respond to the thread.

    HB
    hmab@hotmail.com
     
  2. 不如找个FTP服务器上传
     
  3. 哪位帮忙把它编成OpenOffice Calc的?谢谢!