how to backtest equities

johnlvs2run

Member
Messages
87
Likes
8
I'm using interactive brokers and thinkorswim demos, and am looking for guidance on how to backtest a strategy, over either 10 days or a month, then to tweak the strategy and test it again. Below is part of a chat with a tos rep today.
me: is there a faq for doing back testing for equities - i have seen the option thinkback video and it's not much help for equities - how do i find how to test a strategy for equities - not options

tos: backtesting is simply a compilation of historical prices
tos: use a chart
tos: for an equity

me: backtest with a chart?

tos: you want to backtest an equity?

me: yes
me: to backtest a strategy for equities
me: is there a way to do this?

tos: find out when your startegy would have triggered, get a price from the charts, see what happens

me: what i mean is to plug in a strategy and have it backtest
me: for example... for the month of november 2008

tos: what strategy/
tos: ?

me: for example... buying at 11am with a 3% trailing stop

tos: then go to a chart, create the position
tos: and analyze with the data

me: analyze it with the chart?

tos: that is the data
tos: how else would you analyze it?

me: to have it run and see what the results would be
me: wins/losses... gains etc

tos: do you understand that back testing consists of testing results with historical data? A chart is simply historical data

me: yes
me: to test the strategy with historical data
me: with entry and exit points to get gains... wins/losses etc

tos: it's all in the chart

me: ok... is there a guide for how to do that
me: or just play around with it

tos: I guess you just play around with it
tos: stockcharts.com
tos: or prophet.net for charting info

I've since looked entirely through the prophet section of tos, and didn't see anything there about backtesting a stock. It would be much appreciated if someone could provide some direction on how to backtest with either tos demo, ib trader workstation demo or something else that is relatively easy to use. Thanks.
 
Hi John,
It appears from the transcript that the TOS rep' is just referring to a manual backtest whereby you eyeball a chart to see what price does following the set up / strategy that you're testing. The charting facilities offered by many brokers tends to be rather basic and may not support the sort of mechanical backtesting facility that you seek.This is more likely to be provided by vendors of bespoke charting software - such as eSignal or Tradestation. You would only need this if you're looking to backtest over a very long period and / or your strategy produces too many trades to make it impractical to backtest manually. If you are a discretionary trader, then this ought not to be necessary and a manual backtest along the lines that the TOS rep' describes should be more than sufficient. However, if you're a mechanical trader wanting to go down an automated 'black box' route, then you may need a programmer or, if you have a head for computers and technology, learn how to do it yourself. Rather you than me is all I can say! Good luck.
Tim.
 
Hi Tim,
Thanks for your reply.
The manual testing sounds like what I am looking for.
Is the eyeball method the best way to go about doing this?

So far what I've done is pasted daily ranges in a spreadsheet, but this leaves a lot
to be desired, compared to the realtime movements of an equity. It would be more
helpful to see where stops would be or would not be removed, prior to testing with cash.

Any other suggestions for testing a strategy?
 
charts in thinkorswim

Could someone provide guidance if the following in thinkorswim can be used to test or use a basic strategy?
thinkorswim demo > charts > studies > edit strategies > new strategy

large box to the left
declare long_entry;

upper box to the right
functions
tech analysis
mathematical
look & feel
constants
declarations

each of the above has numerous choices underneath, for example mathematical
absvalue
acos
asin
average
between
ceil
cos
if
isnan ..... etc

lower box to the right
absvalue(double value)

returns the absolute value of a value .... etc

usage in:
trix; swingindex; accumulationswingindex; .... etc

Suggestions are much appreciated.
 
If you want to backtest your strategies in thinkorswim platform, plot the strategy on the chart then right click on it, choose "Shoe Report" and voila :)
 
Top