Excel/VBA Backtesting

This is a discussion on Excel/VBA Backtesting within the Trading Software forums, part of the Commercial category; Hi guys, Was wondering if anyone would be interested in using this Excel/VBA backtesting spreadsheet I've made...I'd like to see ...

Reply
 
LinkBack Thread Tools Search this Thread
Old Mar 18, 2014, 3:02pm   #1
Joined Feb 2013
Excel/VBA Backtesting

Hi guys,

Was wondering if anyone would be interested in using this Excel/VBA backtesting spreadsheet I've made...I'd like to see if I should clean this up and release it for people to download, learn and test different strategies they have.

Basically it'll pull online data from yahoo finance and create statistics to measure your strategy's effectivenss on stocks. It also has pre-made functions that do things for you like calculate trailing standard deviation, averages, median, etc. Also, it has a screener functionality that basically screens the market for your patterns that you program. This'll be an upgrade to people who like to use FINVIZ, like myself.

But I think the best thing is that you can customize your code and interface any way you want....so you're not limited to what a backtesting software gives you, but you can create anything! Below is an example of a code for a simple moving average golden-cross/dead-cross strategy:

'[ENTRY SIGNALS]
'Filter #1: Uptrend --> 20-SMA above 60-SMA
If i < UBound(c) Then
If ma20(i) > ma60(i) Then
signal_filters(i) = signal_filters(i) + 1
End If
End If


'[EXIT SIGNALS]
'Exit #1: Downtrend --> 20-SMA below 60-SMA
If i <= UBound(c) Then
If ma20(i) < ma60(i) Then
exit_signals(i) = exit_signals(i) + 1
End If
End If

Here is a YouTube video demonstrating the functionalities:


And here is what the result looks like:
Click the image to open in full size.

And here is the interface:
Click the image to open in full size.

Here is the result of a screener that screens stocks on your strategy:
Click the image to open in full size.

And here is a large-scale backtester that will check your strategy against all the stocks you selected with a single click of a button:
Click the image to open in full size.

Would just like to gauge the demand before I dive into this, debug everything and write a manual for people to use...

The target audience would be people who are familiar with excel/vba but are frustrated with the lack of resources to do a healthy backtest of their strategies without paying for it.

Let me know what you guys think!! PM me/reply here if interested!
Oh, and please let me know if something like this already exists.

Last edited by hyunski; Mar 18, 2014 at 7:23pm.
hyunski is offline   Reply With Quote
Old Mar 29, 2014, 10:41pm   #2
 
3 Posts
Joined Mar 2014
Hi

I would be very interested in seeing this developed further.

Thanks for your efforts.

Jhet
Jhet is offline   Reply With Quote
Old Mar 30, 2014, 12:04am   #3
Joined Feb 2013
hyunski started this thread Here's the current version: http://adf.ly/hztRa

Feel free to play around with it, but don't flip it and try to sell it
You need to edit "Strategy" module in VBA to write your strategy. Comments should explain most things.

I'll get serious when there are more people but this should be enough to get started!
*Hint: haven't found any good trend following strategies that outperform buy and hold...but mean reversion does substantially better
hyunski is offline   Reply With Quote
Old Mar 30, 2014, 1:34am   #4
 
3 Posts
Joined Mar 2014
Thank you very much.

I code a little in vba sometimes for work. I can see a huge amount of work has gone into this! This is really quite powerful.

Thanks again.
Jhet is offline   Reply With Quote
Old May 9, 2014, 8:02am   #5
 
1 Posts
Joined Mar 2010
dear hyunski may i please have a copy of this file? stuck on a project and this looks amazing.cheers
au2037 is offline   Reply With Quote
Old Aug 1, 2014, 6:03pm   #6
 
8 Posts
Joined Jan 2012
VBA backtesting

Hi,

I do most of my backtesting work in MATLAB and would be interested to see how VBA performs for similar functions.

I'll be moving to a new job that wouldn't grant me the request to a matlab license - would be great if I could have a look at your file. Would be more than happy to provide comments or help you with development!



Quote:
Originally Posted by hyunski View Post
Here's the current version: http://adf.ly/hztRa

Feel free to play around with it, but don't flip it and try to sell it
You need to edit "Strategy" module in VBA to write your strategy. Comments should explain most things.

I'll get serious when there are more people but this should be enough to get started!
*Hint: haven't found any good trend following strategies that outperform buy and hold...but mean reversion does substantially better

Last edited by $oro$; Aug 1, 2014 at 6:04pm.
$oro$ is offline   Reply With Quote
Old Aug 1, 2014, 11:19pm   #7
Joined Feb 2013
hyunski started this thread Hey, just PM me with your e-mail I'll send a copy.

Matlab is superior to VBA in terms of dealing with data and in-built functions, but I'm sure you'll get used to it!

Good luck!
hyunski is offline   Reply With Quote
Old Apr 18, 2016, 6:42pm   #8
 
2 Posts
Joined Apr 2016
Hi Hyunski,

Request you to share the latest excel to me. rameshb345(at)gmail.com.

Please help me on this to use it for back testing.

Appreciate your help.

Thanks,
Ramesh
rameshb345 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel VBA Developer job??? gurm Home Trader 6 Nov 2, 2016 10:08pm
Backtesting in excel Option1 Trading Software 1 Apr 15, 2007 11:12am
Backtesting in Excel Option1 Trading Software 3 Oct 24, 2005 11:06am
any techies able to help Excel Vba V. III Techies Corner 3 Sep 19, 2003 9:51am

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)