Precise Backtesting . Ask and Bid OR Trade, ask & bid??

Questions about MultiCharts and user contributed studies.
wilkinsw
Posts: 662
Joined: 21 Apr 2013
Has thanked: 154 times
Been thanked: 104 times

Precise Backtesting . Ask and Bid OR Trade, ask & bid??

Postby wilkinsw » 23 Oct 2014

Hi,

https://www.multicharts.com/trading-sof ... acktesting

The above link implies running an extended backtest on just ask and bid data streams.

In another post Henry mentions something different. He says:
Hello Don,

The strategy calculation results are different when it is applied to different data streams (which are asks and bids in your case).

If you want to base your strategy calculation on the Trade data series and get precise backtesting order fill price please create a chart with three data series:
Data1=Trade data;
Data2=Ask data;
Data3=Bid data.

On Extended Backtesting tab select Ask data=data2 of your chart;
Bid data=data3 of your chart/

Now extended backtesting is configured properly.
So if I am using a 1 second chart and want to only have my limit orders filled when ask<=buy limit and when bid>=sell limit and want all variables to calculate as if running on "trade" data, how should I set my chart up? I assume it is as Henry has instructed Don to do in the above quote?

A chart with just ask and bid is giving very different results to a trade,ask,bid chart.

Many thanks!

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Precise Backtesting . Ask and Bid OR Trade, ask & bid??

Postby Henry MultiСharts » 24 Oct 2014

Hello wilkinsw,

You need to configure the chart the way it was described in the quote.

TA100
Posts: 54
Joined: 10 Feb 2014
Has thanked: 39 times
Been thanked: 9 times

Re: Precise Backtesting . Ask and Bid OR Trade, ask & bid??

Postby TA100 » 31 Oct 2014

Hi Henry,

It seems there are multiple ways to configure data streams in order to sell at bid and buy at ask. But which one will give more accurate fills. If referencing trade data and bid and ask is part of a strat does it really matter whether ask data is data 2 or 3 provided the advanced backtest engine is told which is bid and ask and the strat sells or buys at the right data num?

Secondly, since trade data would likely lag bid and ask is this why your 'Backtesting' guide suggests using ask as data1 and bid as data2? And if a strat then references trade data as part of its conditions (say a close of actual trada data) that is NOT TICK is the strat introducing lag in the signal since the signal would need to wait for the trade bar to close? Similarily, does this account for a sell next bar at market order or sell next bar at Open appearing on a chart midway through the bar or worse at the open of the next bar a full bar away from CURRENT PRICE.

I see multiple results from the same strat applied in a number of ways and it is unfortunate that only by comparison of the setups and live observation of the orders and entryprices on the chart compared to where bid and ask were at the time that one can understand which settings may work and which won't. When you introduce IOG and multiple data the task becomes ever more complex.

Thanks,

Michael

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Precise Backtesting . Ask and Bid OR Trade, ask & bid??

Postby Henry MultiСharts » 06 Nov 2014

Hello Michael,

When you do not reference additional data series in the code - there should be no difference in the calculation results depending on the ask / bid series serial numbers.
When you do reference the additional data in the code - there can be additional calculations and the ask / bid series serial numbers can affect the results, but it depends on the code logic.

We do not suggest any particular data series serial numbers - you can configure it the way you need it.

Backtesting strategy results are dependent from the configuration. If you have Bar Magnifier turned on - the orders can be filled on detailed prices of ask/bid series (bar magnifier is turned on for all series - main and extended backtesting). Please see How Signals are Calculated for more details.


Return to “MultiCharts”