Directional-Change와 Intrinsic Time

1.
Richard Olsen이라는 이름은 생소합니다. 그런데 이력은 보니까 어떤 분인지 짐작이 갑니다. Retail FX 시장에서 유명한 OANDA의 공동창업자이고 암호통화거래소와 관련한 비지니스를 하고 있는 Lykke Group의 창업자입니다. 물론 관심을 가진 사람은 아닙니다. 몇 일전 Quantnews에 올라온 The Alpha Engine: Designing an Automated Trading Algorithm을 읽으면서 접했습니다. 초록을 보면 30여년전부터 연구해왔던 트레이딩모델이라고 합니다. 81년 발표한 졸업논문이 시작이고 1993년에 발표한 A geographical model for the daily and weekly seasonal volatility in the foreign exchange market 에 뿌리는 두고 있는 듯 합니다. The Alpha Engine: Designing an Automated Trading Algorithm 에 올라온 논문중 Alpha Engine이 기반한 모델입니다.

The building blocks of the efficient trading model include:

– An endogenous time scale, also called intrinsic time, that dissects the price curve continuously and allows for determination of position sizes by identifying market activity that deviates from normal behavior. Rather that action based on a specific time, action is more accurately measured by events.
– Patterns, called scaling laws (also observed in physics, biology, earth and planetary sciences, economics, finance, etc.), that measure an immense number of natural processes and adjust for them.
– Skewing of cascading and de-cascading coastline innovation to mitigate the risk of large inventory size during trending markets.
– Introduction of asymmetric thresholds by eliminating static and rigid guide points that arbitrarily limit directional change thresholds.

Download (PDF, 1.2MB)

위 모델을 자세히 설명한 3장 Guided by an Event-Based Framework을 보면 세가지 개념을 설명합니다.

첫째는 Intrinsic Time.
둘째는 Directional Change
셋째는 Scaling Law

셋중 가장 생소한 개념이 Intrinsic Time입니다. Intrinsic은 파생상품을 설명할 때 자주 등장하는 내재적 가치(Intrinsic value)의 ‘내재적’으로 번역하는 단어입니다. 다른 논문에서 보지 못한 개념이 등장입니다. 내재적 시간으로 해석할 수 있지만 저자가 말하고자 하는 바를 온전히 담지 못합니다. 그래서 시간을 표현할 때 사람들이 언급하는 두가지 개념, 카이로스와 크로노스로 이해하면 어떨까 합니다.

그리스어에는 “시간”을 뜻하는 단어가 두 종류가 있습니다. “크로노스 Chronos”와 “카이로스 Kairos”가 바로 그 것이지요. “크로노스”는 자신의 자녀를 다 먹어 치웠던 원시 시대의 신神을 가르킵니다. 따라서 “크로노스”는 우리를 집어삼키는 시간, 곧 우리가 쫓기듯 보내는 시간, 이런저런 일을 더 빨리 처리하도록 재촉받는 시간이라 할 수 있습니다. “재촉하다”라는 뜻을 지닌 독일어 단어 “헷첸 hetzen”은 “미워하다”라는 뜻을 지닌 독일어 단어 “하센 hassen”에서 왔습니다. 이런저런 일을 기한 내에 처리하도록 자신을 재촉하는 것은 결국 자기 자신을 미워하는 행위로, “크로노스”는 곧 자기 증오의 시간으로 해석할 수 있습니다…. 이에 반해 유쾌한 시간을 가리키는 “카이로스”가 있습니다…. 다른 한 편으로, “카이로스”는 “꼭 알맞은 순간”을 뜻합니다. 카이로스는 앞머리에 머리카락이 풍성하기에 제때라면 쉽게 붙잡을 수 있지만 뒤통수에는 머리카락이 하나도 없기에 지나간 뒤에는 잡을 수가 없지요. 이 비유를 통해 그리스인들은 기회를 제 때 잡아야 한다는 점을 말하려 했습니다.
시간에 대한 두 관점 : 카이로스 Kairos와 크로노스 chronos중에서

Intrinsic Time은 투자자를 중심으로 판단하는 시간입니다. 투자라는 내적인 가치를 온전히 담아내는 시간이라는 뜻입니다. 전통적으로 많이 사용하는 시계열 데이타는 일정한 기준으로 일정한 시간(Interval)단위로 정의한 데이타인데 Intinsic Time은 투자자가 보유하고 있는 자산의 손익에 영향을 주는 요소(Element, Event)을 기준으로 한 시간을 사용하자고 합니다.

A time series is a series of data points indexed (or listed or graphed) in time order. Most commonly, a time series is a sequence taken at successive equally spaced points in time. Thus it is a sequence of discrete-time data.

논문 3장을 보면 아래와 같이 설명합니다. 이벤트에 기반한 접근법입니다.

We all experience time as a fundamental and unshakable part of reality. In stark contrast, the philosophy of time and the notion of time in fundamental physics challenges our mundane perception of it. In an operational definition, time is simply what instruments measure and register. In this vein, we understand the passage of time in financial time series as a set of events, i.e., system interactions. In this novel time ontology, time ceases to exist between events. In contrast to the continuity of physical time, now only interactions, or events, let a system’s clock tick. Hence this new methodology is called intrinsic time. This event-based approach opens the door to a modelling framework that yields selfreferential behavior which does not rely on static building blocks and has a dynamic frame of reference.

논문의 저자인 Olsen이 대표로 있는 Lykke의 Pairs trading in forex market with respect to intrinsic time를 보면 Intrinsic Time을 이렇게 정의합니다.

Intrinsic Time

At Lykke, we’re in the process of redefining the way how time is looked upon in financial markets. Leading to a long-needed paradigm change, namely from observed physical time to an activity based timescale, called intrinsic time. In contrast to the continuity of physical time, now only interactions, or events, let a system’s clock tick. This event-driven paradigm defines focal points by blurring out irrelevant details of the price evolution with the help of defining fixed event thresholds of different sizes.

With these events, every price curve can be dissected into components that represent a change in the price trend (Directional Change) and a trend component (Overshoot). For a Directional Change to be detected, first an initial direction mode needs to be chosen. As an example, in an up mode, an increasing price move will result in the extremal price being updated and continuously increased. If the price goes down, the difference between the extremal price and the current price is evaluated. If this distance (in percent) exceeds the predefined Directional Change threshold, a Directional Change is registered. Now the mode is switched to down and the algorithm continues correspondingly.

2011년에 발표한 A Directional-Change Events Approach for Studying Financial Time Series은 Intrinsic Time을 다음과 같이 정의합니다.

Intrinsic time adopts an event-based system in contrast to physical time which adopts a point-based system. In intrinsic time, time is defined by events.

Download (PDF, 720KB)

Intrinsic Time을 코드로 표현하면 어떻게 될까요? Intrinsic time for cryptocurrency data 이 소개한 Instrinic Time의 개념을 R 코드화한 소스입니다. 이벤트접근법이라고 했는데 코드를 보면 이벤트를 2%의 가격등락입니다. 이를 기준으로 시계열데이타를 재생합니다.

2.
Directional Change Project라고 하는 생소한 프로젝트가 있습니다. 논문 저자인 Olsen과 Lykke가 후원하는 프로젝트입니다. 여기서 정의하는 DC입니다.

Market prices are traditionally sampled in fixed time-intervals to form time series. Directional change (DC) is an alternative approach to record price movements. DC is data-driven: price changes dictate when a price is sampled and recorded. DC allows us to observe features in data that may not be observable in time series. Time series and DC-based summaries should complement each other: they allow us to see data from two different angles (like seeing things with two eyes instead of one). Our research agenda is to develop ways under DC to turn data into information, knowledge and applications.

단순히 생각해 보면 Trend Following이라고 할 때의 Trend (Momentum)와 헷갈립니다. Event와 Monemtum의 차이인데 솔직히 미묘합니다.

What is Trend Trading

Trend trading is a trading strategy that attempts to capture gains through the analysis of a security’s momentum in a particular direction.

What Is Momentum?

Momentum is the rate of acceleration of a security’s price or volume – that is, the speed at which the price is changing. Simply put, it refers to the rate of change on price movements for a particular asset and is usually defined as a rate. In technical analysis, momentum is considered an oscillator and is used to help identify trend lines.

앞서 Directional Change Project와 SSRN에 올라온 R. Olsen의 논문을 보면 오랜 동안 다양한 영역에서 검증하려고 노력한 흔적이 역력합니다.

Agent-Based Model in Directional-Change Intrinsic Time
Instantaneous Volatility Seasonality of Bitcoin in Directional-Change Intrinsic Time

Download (PDF, 6.02MB)


Download (PDF, 1.25MB)

이상을 보면 Directional Change는 Intrinsic Time과 짝을 이루는 개념입니다. 그래서 directional-change intrinsic time 라고 표현으로 사용합니다.

Download (PDF, 830KB)

3.
마지막으로 제안한 개념이 Scaling Law입니다. 스케일(SCALE) : 생물 도시 기업의 성장과 죽음에 관한 보편 법칙이 말하는 스케일의 법칙입니다.

저자는 생물학을 공부하다 ‘스케일링의 법칙’을 발견했다. 생물의 크기 변화에서 발견되는 규모 증감의 법칙이다. 어떤 동물의 몸집이 다른 동물보다 2배 크다면, 필요로 하는 에너지양은 75% 늘어난다. 즉 크기가 2배 늘어날 때마다 25%의 에너지가 절약된다. 몸집의 차가 커질수록 에너지 효율의 격차는 더 벌어진다. 예를 들어 코끼리는 쥐보다 1만배 무겁지만, 필요한 에너지의 양은 쥐의 1000배면 된다. 코끼리의 에너지 효율이 쥐보다 10배 더 좋은 셈이다. 이른바 ‘규모의 경제’가 나타나는 것이다.

앞서 DC Intrinsic Time을 이용하여 스케일의 법칙을 발견하는 것이고 이것이 투자전략의 기초를 이룹니다.

Scaling-law relations characterize an immense number of natural processes, prominently in the form of

1. scaling-law distributions;
2. scale-free networks;
3. cumulative relations of stochastic processes.

Scaling-law relations display scale invariance because scaling the function’s argument x preserves the shape of the function f(x) [27]. Measurements of scaling-law processes yield values distributed across an enormous dynamic range, and for any section analysed, the proportion of small to large events stays constant.

이를 FX시장에 적용한 Patterns in high-frequency FX data:Discovery of 12 empirical scaling laws입니다. 12가지 패턴을 발견했다고 합니다.

Download (PDF, 812KB)

Olsen이 이를 교과서식으로 정리한 High Frequency Finance: Using Scaling Laws to Build Trading Models

Download (PDF, 1.91MB)

4.
이상에서 설명한 논문의 모델 (Framework)는 Github에서 확인할 수 있습니다. 논문의 공저자인 Anton Golub가 만든 The Alpha Engine: Designing an Automated Trading Algorithm입니다.

그리고 이상의 DC Intrinsic Time을 설명한 논문들이 다른 논문들과 비교하여 좋은 점은 관련한 논문에 사용한 방법을 Java 소스로 공개한 점입니다. Vladimir Petrov의 Risk management Tools based on Intrinsic Time and Scaling Laws을 보면 아래와 같이 공개하고 있습니다. 구글링을 해보면 DC Intrinsic Time을 주제로 한 트레이딩모델을 많이 볼 수 있습니다. ZeroAOS를 이용하여 구축해보면 어떨까 상상해봅니다.

The root directory contains several methods which can be directly employed for high-frequency real-time data analysis:

  • LiquidityIndicator_Analysis.java – computes liquidity of historical time series represented by tick-by-tick price data using the multiscale interpretation of liquidity based on the directional change and scaling laws. It is a wrapper for the “LiquidityIndicator” class from the “ievent” folder. To run the program one needs to specify the path to the analysed file and set up several parameters described at the header of the code.
  • InstantaneousVolatilityActivity_Analisys.java – this class is the extension of the “ievents/VolatilitySeasonality” class modifies to be applicable to the set of historical or real-time high-frequency price data.
  • VolatilityEstimatorMovingWindow_Analysis.java – this class is designed to perform the volatility analysis of high-frequency data computed in two ways: using the sum of squared return function which calculates the aggregated standard deviation of the time series over fixed and equal intervals and using the method based on the directional-change intrinsic time approach in detail described in the RealizedVolatility.java class.

The ievents folder contains classes and methods related to the directional-change intrinsic time concept proposed and described in work “A geographical model for the daily and weekly seasonal volatility in the foreign exchange market” (available online):

  • DcOS.java – Directional-Change dissection algorithm splits a historical price time series into a collection of directional-change and overshoot points defined as the sequence of alternating trend changes of selected size.
  • IE.java – is an auxiliary class to keep information on the properties of each observed intrinsic event such as time and price levels.
  • IntrinsicNetwork.java – is an example of the Intrinsic Network introduced in the “Multi-scale Representation of High Frequency Market Liquidity” paper (available online).
  • LiquidityIndicator.java – is a realization of the liquidity indicator proposed in the research work “Multi-scale Representation of High Frequency Market Liquidity” (available online).
  • InstantaneousVolatility.java – is the method used to translate the number of observed directional-change intrinsic events into the value of the instantaneous volatility. The approach is outlined in the research paper “Instantaneous Volatility Seasonality of Bitcoin in Directional-Change Intrinsic Time” (available online).
  • MovingWindowVolatilityEstimator.java – is the instantaneous volatility estimator based on the number of Directional Changes observed over given period of time (set as a parameter of the method) and described in the paper “Instantaneous Volatility Seasonality of Bitcoin in Directional-Change Intrinsic Time” (available online).
  • RealizedVolatility.java – is the class where the realized volatility is computed using the number of observed directional-change intrinsic events combined with the variability of overshoots proceeding each directional change. The main idea of the approach is in details described in the paper “Bridging the gap between physical and intrinsic time” (work in progress).
  • RealizedVolatilitySeasonality.java – based on the RealizedVolatility.java method this class provides a novel way of computing weekly seasonality of the realized volatility considering the evolution of the price curve from the point of view of directional-change intrinsic events.
  • InatantaneousVolatilitySeasonality.java – based on the InstantaneousVolatility.java method this class provides a novel way of computing weekly seasonality of the instantaneous volatility considering the evolution of the price curve from the point of view of directional-change intrinsic events.
  • DcOSmultiD.java – is the extension of the originally one-dimensional version of the directional-change intrinsic time algorithm (class DcOS.java) to the multidimensional space. The space is formed by orthogonally placed independent exchange rates. The description of the multidimensional approach is provided in the paper “Multidimensional Directional-Change Intrinsic Time” (work in progress).

Folder scalinglaws contains tools which allow extracting scaling laws based on the directional-change intrinsic time as described in the paper “Patterns in high-frequency FX data: Discovery of 12 empirical scaling laws” (available online). Numbers of scaling laws follow the same order selected in the paper. The code has been validated using high-frequency data from Forex and Bitcoin markets (work in progress):

Folder market contains a set of auxiliary tools nucessarily to perform the real application of risk management tools presented in the repository:

  • Price.java – is a simple class for elementary prices corresponding to some given moment of time. These are tick prices by default. Each class instance holds information on the bid and ask price levels as well as the time of when the new tick was registered.
  • SpreadInfo.java – this method, applied to a historical (or real-time streamed) time series, returns Median, Mean, Min and Max spread characteristics characterised some given period of time.
  • PriceMultiD.java – is the class to keep information on the multidimensional structure of prices used for the multidimensional version of the directional-change intrinsic time algorithm. Collections of bid and ask prices composing each instance of the class are formed by individual components of exchange rates used in an experiment.

Folder tools is a collection of some traditional data management tools employed to analyse historical and real-time streams of high-frequency data:

  • BM.java – is the class used to generate time series of given lengths properties of which coincide with properties of simple Brownian Motion process.
  • GBM.java – is the class used to generate time series of given lengths following Geometrical Brownian Motion process.
  • TraditionalVolatility.java – this class is traditional volatility estimator. Computes volatility of a given time series using the sum of squared returns.
  • MovingWindowVolatilityEstimator.java – is the classical volatility estimator which performs over a moving window the length of which is defined as a parameter of the code. The algorithm is based on the sum of squared returns computed over equal time intervals.
  • Tools.java – is a class containing a subset of simple methods used over the whole research work on the scaling laws and intrinsic time risk-management tools. The class is crucial for the stable work of almost all related experiments.
  • ThetaTime.java – is the class the idea of which is to perform as theta-time presented in work of “A geographical model for the daily and weekly seasonal volatility in the foreign exchange market” (available online).

2 Comments

  1. Kyle

    좋은 글 감사합니다

    Reply
    1. smallake (Post author)

      감사합니다…

      Reply

Leave a Comment

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다

이 사이트는 스팸을 줄이는 아키스밋을 사용합니다. 댓글이 어떻게 처리되는지 알아보십시오.