+ Reply to Thread
Results 1 to 2 of 2

Backtesting strategies with historical data using Excel VBA

  1. #1
    Registered User
    Join Date
    12-20-2019
    Location
    Arlington, TX
    MS-Off Ver
    2010
    Posts
    27

    Backtesting strategies with historical data using Excel VBA

    I'm brand new to using Excel VBA. I've been having trouble with finding a platform/service that allows me to have accurate backtesting results. I notice that the results for profit are skewed because the entry and exit prices are both incorrect. I've been importing historical data (Open, High, Low and Close) onto Excel and manually calculating profit for quite some time now. This is incredibly tedious and time consuming. I want a more efficient way to do this.

    The backtesting strategies I've developed aren't based on moving averages or crossovers. Just simple patterns that I've come up with. The strategy is pretty simple.
    There must be a series of at least three rising 'low' values in consecutive order. (This would be in column D)
    The last 'low' of the rising series must be greater than the proceeding low.

    In regards to price entry and exit. The price entry would be the 'low' of the last of the rising 'low' series and the price exit would be the 'close' value of the day that follows the end of the rising 'low' series.

    If low[0] is the current day and the low[1] is the previous day. Price entry would be at low[1] (This would be the last 'low' of the rising 'low' series) and price exit would be close[0].

    I've coded for the strategy before, but I'm having trouble achieving accurate profit results when it comes to backtesting.



    Any advice/help would be greatly appreciated!

  2. #2
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,544

    Re: Backtesting strategies with historical data using Excel VBA

    Hello chkn89 and Welcome to Excel Forum.
    This is not to suggest that I can help with the question, but to say that it may help others who can if you attach a sample workbook to a new post in this thread following the directions in the yellow banner at the top of the page.
    Please pay particular attention to "manually calculated results" as seeing incorrect or skewed results of a formula are not generally useful in resolving an issue.
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Excel macro for backtesting trading strategies
    By Trader_Test in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-29-2021, 05:38 PM
  2. Extract historical weather data into Excel
    By PaulM100 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-27-2019, 09:43 PM
  3. Saving historical data on Excel
    By sareena in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-03-2017, 01:52 AM
  4. [SOLVED] How to prevent excel from adding historical data in its memory?
    By omega0010 in forum Excel General
    Replies: 4
    Last Post: 09-25-2016, 06:23 AM
  5. Retaining historical data in excel
    By jodie.brown04 in forum Excel General
    Replies: 0
    Last Post: 05-29-2013, 07:35 AM
  6. Replies: 2
    Last Post: 05-24-2012, 02:14 AM
  7. Downloading historical stock data from MSN Money to Excel via VBA
    By alui in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-29-2006, 06:50 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1