The resource loading... loading...

Time and Cycle

Author: Inventors quantify - small dreams, Created: 2017-03-24 11:48:37, Updated: 2019-07-31 18:36:46

Time and Cycle

Today we're going to talk about some of the issues involved in quantitative investing regarding time and cycle. In the previous explanation, we should also remember that there are two main types of data in quantization: one is tick data and the other is bar data. The simplest way to understand bar data is to include the highest, lowest, opening, closing and other data contained in the diagonal graph in the K line. The bar data is related to cycles, such as a bar seen in day K is a cycle with 1d.

  • What is Tick?

    Domestically, a tick is a snapshot of the transaction flow data taken at very short intervals (milliseconds). The tick data also contains the fields opening price, highest price, lowest price, latest price, volume of transactions, volume of transactions. Note that these data are calculated from the opening as the starting time point.

    A true tick is a snapshot of the result of each change in the order book near the transaction price, which generates a tick data whenever there is a change in the state of the best buy or sell order in the order book.

  • The transformation of the Bars cycle

    Bars data is related to cycles, so naturally a problem arises, how to convert short cycle bars to long cycle bars data.

    We describe the process of cyclic transformation using the example of the dayline and the circle line, and the relationship between each data indicator in the circle line and the dayline indicator is as follows:

    The closest day of the week is the closest day.

    The last trading day of the week.

    Circle-high curve = max ((All day-high curve this week)

    The round line's low is = min (all day lines are low this week)

    The volume of the circle line is sum (all dayline volume lines this week)

    The inventor quantified the Bars cycle conversion:

    Convert_Record_CycleThis is the first time I've seen this video.Convert any k-line cycle

  • Time cycle coding

    We know from the previous discussion that any bar data contains cycles, so a problem arises: how to distinguish between bar data of the same time but different cycles. We need a general method for encoding time cycles so that the same transaction varieties have unique data in different time cycles. The encoding method can be done in the form of time series + cycle custom id.

    Using the time stamp, we can easily set up some timing functions, such as how many time cycles trigger an operation. For example, to determine whether new cycle K line data is generated. There are many other techniques for using time and cycle, which need to be summarized in the process of writing the strategy.


More

xiahaohuan001A 1m Kdata can be generated with (tick time stamp - tick time stamp at 0 o'clock on the day) /60 without any other Kdata being generated.