Automating and Backtesting w Kase Bars

Questions about MultiCharts and user contributed studies.
Doctor Al
Posts: 24
Joined: 15 Aug 2019
Has thanked: 4 times

Automating and Backtesting w Kase Bars

Postby Doctor Al » 04 Mar 2020

Hello,

I was told that there can be slippage issues when using market orders with Kase Bars. Nevertheless, I developed a strategy for trading coffee futures
using Kase Bars [resolution 1 minute, box size of 34 points] for the time period 1/8/2010 to 3/3/2020. I did Not check the box for "break on session".
My chart uses merged historical and real time data. The historical data is from TS while the real-time data is from CQG. However, I did make sure to use the correct symbols and corresponding contract months, so the chart set-up should be correct, and certainly appears correct.
I use entry stop orders in this strategy hoping to mitigate to a degree the slippage issues with market orders. Unfortunately, I decided to automate this strategy. My 2 most recent trades lost a total of 4.55 (commission excluded) while the subsequent back-test of the strategy only shows 2.30 in losses for the two trades involved. This represents a very large discrepancy of 2.25 [equates to over $800]. Where did I go wrong in my assumption that I could automate this strategy and expect that the back-test would look something like the real time results?

Mydesign
Posts: 177
Joined: 15 Feb 2017
Has thanked: 32 times
Been thanked: 39 times

Re: Automating and Backtesting w Kase Bars

Postby Mydesign » 04 Mar 2020

Hi,

You might want to have a look at this thread in order to save you time and efforts:
viewtopic.php?f=1&t=52326&p=134088&hili ... ar#p134088

Kase bars backtest is definetly inaccurate compared to realtime trading when using a base resolution different than 1 tick. Reported execution prices by the backtest are not actual prices at the time they actually occur, but the last known close price of the base resolution, back in the past ! (1min in your case, so your backtest is "accurate" within a 1min margin of error :roll: ),

Good luck with Kase bars !

Doctor Al
Posts: 24
Joined: 15 Aug 2019
Has thanked: 4 times

Re: Automating and Backtesting w Kase Bars

Postby Doctor Al » 04 Mar 2020

Hello Mydesign and thank you,

So it would seem that if I want to design strategies for automation that use Kase Bars and to be sure that I have adequately tested the strategy over several years of data, I would need to purchase tick data (or in some way acquire tick data for several years) from which the Kase Bars would be charted with 1 tick resolution. Then I would also automate the strategy on a chart with the same 1 tick resolution. Do you agree?

Mydesign
Posts: 177
Joined: 15 Feb 2017
Has thanked: 32 times
Been thanked: 39 times

Re: Automating and Backtesting w Kase Bars

Postby Mydesign » 04 Mar 2020

That is indeed what is required to have a realistic backtest with Kase bars (1 tick base res), but beware that backtest results might not look as nice (read much worse) as it is with larger base resolution (which tends to give an undue advantage to your strategy, with indsight bias).

Having said that, this is only based on my experience and attempts with market orders strategies.

Doctor Al
Posts: 24
Joined: 15 Aug 2019
Has thanked: 4 times

Re: Automating and Backtesting w Kase Bars

Postby Doctor Al » 12 Mar 2020

I am wondering if any MultiCharts users are successfully using Kase Bars for either discretionary or automated trading. If so, what is your experience with slippage? Do you use the session break option for your charts? Any other advice or comments would be appreciated.

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Automating and Backtesting w Kase Bars

Postby TJ » 12 Mar 2020

This is my personal observation, YMMV:

Due to the nature of the variable and temperamental beast, it is difficult to implement autotrading on non-time-based bars.

Again, YMMV.

Mydesign
Posts: 177
Joined: 15 Feb 2017
Has thanked: 32 times
Been thanked: 39 times

Re: Automating and Backtesting w Kase Bars

Postby Mydesign » 13 Mar 2020

I succesfully autotrade classic range bars (x points resolution). They are close to realistic in backtest (based on tick by tick) and are able to depict real movement despite volatility variation (which btw has proven quite usefull for my strategies in the last couples days :roll: ).

As for the session break question, this is tricky: it all depends on your strategy logic. it is usually better to leave it off for a smooth "continous" calculation (specially with cycle based logic), but beware that the backtest might show unrealistic signals if they occur during a gap.

Doctor Al
Posts: 24
Joined: 15 Aug 2019
Has thanked: 4 times

Re: Automating and Backtesting w Kase Bars

Postby Doctor Al » 14 Mar 2020

Mydesign,

I am under the impression that when there is a gap, range bars will be inserted into the chart to fill the gap and some range bars will display prices that never actually traded. It would seem that this would make auto trading with Range Bars very difficult to accomplish. (With Kase Bars I don't think that happens). What am I missing?

Mydesign
Posts: 177
Joined: 15 Feb 2017
Has thanked: 32 times
Been thanked: 39 times

Re: Automating and Backtesting w Kase Bars

Postby Mydesign » 16 Mar 2020

You are correct Doctor Al. Range bars are filling gaps with virtual bars. Again, it all depends on your needs, traded instrument and strategy logic.
In order to see real gaps you can indeed use Kase Bars, preferably with a 1 tick base resolution for backtest accuracy.


Return to “MultiCharts”