Bac-testing

Rugby Trader

Established member
Messages
951
Likes
12
I’ve been back-testing a simple strategy recently.

Take the close of the 12-12.15 candle add 50 onto the high as an entry price and set the target price 20 above that and the stop loss 20 below that.
I’ve been doing that on the mid-price chart, however because of spreads and bid and ask, the results won’t turn out like that will they?

How do you take into account the spread and bid and ask prices?
 
If you're spreadbetting then no because your test will assume a certain amount of spread but when you open real positions this spread may/will differ. If you were trading the real market then your test might be more realistic, why dont you get a demo from a non spreadbetting broker and do some quick visual backtesting to see if you idea looks plausible or not, my guess is that it wont be profitable, it seems nothing that simple ever is.
 
oh yes, i doubt it will be profitable.
I was just using that simple system as an example.
I just wanted to know how to backtest properly on a graph.

At the moment I look on a mid-price graph.
Let's say i'm looking at Oil on IG which has a 4 pip spread and the high of the 12-12.15 candle is 1000.

Now I want to put some lines on my chart
Do I put my entry target at 1000 + 50 + 2 to reflect the spread
Then do I put the TP line on like this 1000 + 50 + 20 + 2
The the Stoploss line like this 1000 + 50 - 20 -2

I just get the feeling that when I put a line 50 above 1000 with TP and SL 20 either side of it it's not reflecting the spread and bid/ask properly.

I hope that makes sense
 
The point I made about spreadbetting spreads will, I believe, ensure that you never have a relevant backtest. Even if the spread looks the same the price may be manipulated downward, unless you try this on proper market data, not SB, you're probably wasting your time.
 
I use IG spreadbet and backtest facility.

The backtest facility allows you to trigger your entries and exits on either open close or I think even midprice at various timeframes. This keeps your strategy implementation simple.

To include the spread there is a seperate secion in the backtest setup window where you declare your trade cost. for example I am continually backtesting on the ftse and recently changed all the money sections from minimum 1 per trade to 0.5 per trade in line with the IG cut in spread.

The result probacktest comes in three windows the price is shown in the bottom window with each buy and sell price arrowed in and a figure. Your ongoing equity is in the top window. To check the correct money setup look at a buy price say 5500 in the bottom window followed by a sell price of 5510, these do not include the spread so when you look at the comensurate area of the equity graph you will not see a 10 point uplift but 9, ie less .5 on entry and 0.5 on exit.

I only need a strategy now!

KD
 
Krapdad - thanks muchly, i will try it out this evening

Pboyles - thanks also, i'll take a look at proper brokers to get better information.
 
I use IG spreadbet and backtest facility.

The backtest facility allows you to trigger your entries and exits on either open close or I think even midprice at various timeframes. This keeps your strategy implementation simple.
KD

Is there any material out there on how to program a strategy into pro-backtest?
 
Is there any material out there on how to program a strategy into pro-backtest?

I learnt the high level language by first using the facility to program using the option to simply add conditions, this is the first option when you select new probacktest. For example put in some simple conditions like buy when close crosses over 20 period MA and Sell when it crosses under. It then writes the code for you and allows you to alter it.

There is a manual which I think is hard to find under the new help menus. It is probably easier to find the manual which includes all the command definitions and examples on the IT Finance web site. The Proreal website also has many examples you can take and modify but I think there is a slight difference between the Pro real and the IG command list.
 
Top