Recommend backtesting software/programs

Discussion in 'Strategy Development' started by p5485, Nov 25, 2019.

  1. p5485

    p5485

    Hi there
    I have developed 4 equally weighted portfolios, say, Portfolio A, B, C and D
    Portfolio A has mostly US stocks (33 in number)
    Portfolio B has mostly US stocks and few European and Asian stocks (25 stocks)
    Portfolio C has mostly US Stocks and few European and 1 Asian stock (27 stocks)
    Portfolio D has a combination of all stocks (34 stocks)

    I want to backtest these portfolios since 12/30/2005 onwards. I want to compute Sharpe and Sortino ratios, along with Drawdown % for that time period.

    Can you please recommend a free backtesting resource that will accomplish my goal?
    Thanks so much.
     
  2. You can use https://www.portfoliovisualizer.com/ to backtest and optimize a portfolio (it's free). If you want something more write a detailed description of what you are looking for and I will post a backtested and optimized result for you using PortfolioAnalytics in R (I might not have access to the Asian/European stocks from Quandl/Yahoo).

    In regards to general backtesting, you probrably want to pick up some programming. That way you can customize and implement any idea! I use quantstrat in R for backtesting strategies and it works great! There is lots of help online for it and I would not mind helping you out along the way. You can also pick up some python and easily use some of their free tools.
     
  3. p5485

    p5485

    Thanks for your suggestion. I did try portfoliovisualizer. However, they don't have any non-US stock data, so I can't test out portfolios B, C, and D. For example, you cannot use Samsung in any of your portfolios as it is traded overseas.

    I am not looking for anything fancy. I generally use "Adjusted closing" prices available on yahoo finance or morningstar. Strangely, morningstar allows me to use foreign stocks but there is no backtesting option available.
    I am sure there is something free out there that can help me (without having to learn programming). It's not that I don't want to learn, I just want to show that my portfolios can beat sp500 with superiod Sharpe and Sortino ratios since 2005. Thanks!
     
  4. Metamega

    Metamega

    If you can get the data free from say something like Yahoo or Quandl, Excel or a bit of python be a cheap/easy route.

    To be honest though, with a portfolio of 33 stocks, your going to look a lot like any index. If this is just a buy and hold from 2005 of the same stocks(never rotating).

    Your roughly looking at a sharpe ratio of .2. a 57% drawdown in 2008. And a yearly return of roughly 7%. Mind you I didn't have dividend adjusted data so the annual return probably somewhere between 10/12%.

    Just plugged in a buy and hold for SnP500 in Amibroker.
     
  5. p5485

    p5485

    Yes, it looks like a buy and hold strategy. But I have discovered that, with portfolio A, the sharpe ratio is 2.5 times that of SP500. But I need to do that with Portfolios B, C and D since they have foreign stocks.
     
  6. It looks like you can get some Asian stocks on yahoo finance. I just took a brief look. Can you attach an excel file with the stocks in each portfolio and their weights? I'll post a backtest for you and send you an html doc.

    2.5 sharpe vs the markets .5? Did you just pick a list of the best-performing companies over the past 14 years?
     
  7. Metamega

    Metamega

    Out of curiosity how was this portfolio built. Very easy to use hindsight bias and build a great portfolio that will never be replicated.

    Did you go back to 2005 and just look at all the previous data and build there. Even doing that it’s pretty easy to have survivorship bias knowing which stocks have done the best up to today if you look at stock charts regularly.

    Seems like a lot of work to prove something that’s not replicable.
     
  8. p5485

    p5485

    Many thanks for the offer to do backtesting. Unfortunately, I can't disclose the composition of those portfolios as I have signed an NDA. That is why i have to do this backtesting on my own.
     
  9. p5485

    p5485

    No, the start date was selected to show that the portfolio is resilient to significant ups and downs in the market (namely, the down period of 2008). It is based on rules, and companies in this portfolio have to be in existence at least since 2005 to be included. I can understand your argument re: hindsight bias, and replicability.
     
  10. I misread your original post. I thought you wanted to optimize a portfolio.

    Top secret eh! In that case, you can do something like yahoo finance -> historical data -> download to Excel -> Arrange Data in columns [Date, Stk1,Stk2..] -> calculate the returns [Date, Ret1, Ret2...] -> multiply the returns by their weights -> Run a row sum of the weighted returns [Date, Ret1*weight1, Ret2*weight2,.. RowSum] -> Run a cummulative sum of the row sums. Last but not least calculate the standard sharpe and sortino ratio. It should take you an hour.
     
    #10     Nov 25, 2019