About Tick bar algorithm

Hello everyone,

Ask about the algorithm of tick bar

I want to have a picture that is 100Tick bar char

In the original K-bar algorithm, it is possible that the same K bar will cross the date because the number of tick is not exactly 100 Tick. We hope that the first K-bar of the day will be counted from the first tick of the day. How to set

Hello @junjun,

It appears that you are after some guidance on how to set the periodicity of a chart to n-Ticks (trades) per bar, but with the condition that the first bar of the day doesn't have any Ticks from the prior day.

Is that correct?

At the moment, I don't know if that's technically feasible, as you've already hinted in your post, ie some Ticks from yesterday are added to some from today, in order to form a 100-Tick bar, for example.

But, it's not clear how you define the start/end of day. For example, trading of the S&P 500 on CME's Globex system has some quirky startrt/finish times: stop at 4:15pm EST, re-start at 4:30pm, stop at 5:00pm, and begins again at 6:00pm, till the calendar day's 4:15pm - these "breaks" appear to be for internal "adjustments".

Based on the above, logically, yesterday ends at 5:00pm, and today begins at 6:00pm, but the "day session" (when the huge volume appears) begins at 9:30am and ends at 4:15pm.

Refer to the CME website for correct times.

To confuse things even further, each data provider seems to have their own specification for time and price of the Open and Close for end-of-day data, eg compare the data from finance.yahoo.com with the CME's website.

Once you've sorted out the time of day that you want the trading day to start on, you might need to investigate/create a data plugin.

Hello @sinecospi ,

First of all, thank you for your guidance

My situation is like this. I wrote a realtime data plugin myself, which is tick interval, so it can solve your problem.
Second, my idea is to recalculate the number of ticks starting at each trading time, for example, starting at each opening time. This has a very important advantage.
That is, no matter when you start to look at your chart, the tick chart will be the same every day, and there will be no different tick bar chart because the tick spans trading days.

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.