convert real-time tick data to historical for backtesting

Questions about MultiCharts and user contributed studies.
johnnykf88
Posts: 5
Joined: 07 Mar 2017
Has thanked: 2 times
Been thanked: 1 time

convert real-time tick data to historical for backtesting

Postby johnnykf88 » 18 Aug 2017

hello,

i'm using MC10 build 14352, with IB and Portfolio trader to trade ES NQ futures...

as per the subject, is it possible to make use of the real-time data collected for backtesting? i tried to run backtest with tick, but it still request to get historical data (Due to some missing data in part of the ticks? :roll: ). since i'm using IB feed which is known to have problem getting even only 1 day tick of historical data. it's a bit wasting resource as i do keep collecting real-time every trading day.

Thanks for your attention.

User avatar
Henry MultiСharts
Posts: 8503
Joined: 25 Aug 2011
Has thanked: 1213 times
Been thanked: 2731 times

Re: convert real-time tick data to historical for backtesting

Postby Henry MultiСharts » 18 Aug 2017

Hello johnnykf88,

There are three base data resolutions: Tick, Minute and Daily. Once data is downloaded from the data feed server and plotted on the chart - it is stored in the cache. When you close MultiCharts, QuoteManager and Portfolio Trader - cached data is saved to the local database. You do not need to manually save any data, it is done automatically. Next time you plot a chart - the data is loaded from the cache or data base first, then missing historical data and realtime data are requested from the data provider. For more information please see Collecting and Saving Data to MultiCharts Database.

If you are building the chart with the same resolution/quote field/sessions/data range as you already have plotted - the historical data should be loaded from the cache and not requested from your data provider.

But there is a hitch - IB datafeed does not provide realtime minute data. In MultiCharts realtime minutes are built from ticks. They are not saved to the database because the bar can be different from the actual historical minute bar. But IB provides historical minute data. So MultiCharts requests the minute data from IB server next time you request this information.
These users thanked the author Henry MultiСharts for the post:
Fabrice

Zheka
Posts: 87
Joined: 13 Jan 2016
Has thanked: 3 times
Been thanked: 13 times

Re: convert real-time tick data to historical for backtesting

Postby Zheka » 22 Aug 2017

Starting from recently released IB API v973.04, it becomes possible to request historical tick data.

https://interactivebrokers.github.io/tw ... #gsc.tab=0

This would potentially allow building and saving a 1 min bar almost in RT (building it from the regularly requested and saved historical ticks)- and that bar will be equal to the historical bar 1 min bar.
I guestimate the delay will be comparable to that of 5-sec True RT data - i.e. 270-330ms.

This would probably make my PM request obsolete.
https://www.multicharts.com/pm/public/m ... es/MC-2261

User avatar
Henry MultiСharts
Posts: 8503
Joined: 25 Aug 2011
Has thanked: 1213 times
Been thanked: 2731 times

Re: convert real-time tick data to historical for backtesting

Postby Henry MultiСharts » 22 Aug 2017

Zheka, saving RT 1 min bar to the database requires 1 min RT bar updates to be provided by data feed API directly. If 1 min RT bar is built out of RT ticks/seconds (which is the case for IB) then historical minute bars will be downloaded from the datafeed to replace what was built in RT by the platform. Constantly requesting historical ticks and building realtime bars out of them won't be an efficient solution and this is not something that MultiCharts is designed to do. There are options that already exist in the platform that allow saving RT minute bars to the database, they are described in the links provided above.
These users thanked the author Henry MultiСharts for the post:
Fabrice

Zheka
Posts: 87
Joined: 13 Jan 2016
Has thanked: 3 times
Been thanked: 13 times

Re: convert real-time tick data to historical for backtesting

Postby Zheka » 02 Oct 2017

Henry,

it is of course not necessary to "constantly" request historical data. Making a request just 1 time, 50-200ms before 1-min bar "closure" would be enough to accurately capture O and H / L, saving both ticks AND 1min bars (both are historical except the last 200-300ms) straight into QM database.

Actually, for FX, 5ms snapshots should be very,very close to true RT.
https://interactivebrokers.github.io/tw ... #gsc.tab=0


Return to “MultiCharts”