Directional Change — mlfinlab 1.5.0 documentation (2024)

  • »
  • Directional Change

The Directional Change module contains functions and classes related to the detection of general price movement and featuregeneration based on direction split. It is planned to later build a Regime Change module on top of Directional Change tools.

These include:
  • signal

  • total_price_movement

  • time_for_completion

  • time_adjusted_return

Is Directional Change

Directional Change (DC) is a metric which samples data points at their peaks and troughs in their movement.Price movements are defined by two types of events: Directional Change (DC) Event and Overshoot (OS) Event.With a pre-defined Threshold, every price curve can be dissected by these two components.

The value of the threshold needs to be pre-defined by the observer. It represents how big of a price changethe observer considers as significant.

A DC Event will be confirmed when the price change reaches the threshold. A DC Event is not usually immediatelyfollowed by an opposite DC Event, but by an OS Event. An OS Event records the price movement from one DC Event to the next.

Price movements are partitioned into uptrend and downtrend. When the price changes from Point A to Point B,the price change reaches a threshold \(\theta\), then a DC Event is confirmed. Point A is then considered asan Extreme point (EXT). And Point B is considered as a Directional Change Confirmation (DCC) point.Similarly, the next DC Event is confirmed at Point D. The price movement between two DC Events is consideredan OS Event (from Point B to C).

Directional Change — mlfinlab 1.5.0 documentation (2)

Figure 1: Directional Change Event. (Jun Chen & Edward P K Tsang 2020)

Implementation

This is an implementation of the is_directional_change function over a time series.

Example

Total Price Movement

This indicator measures the absolute percentage of the price change in a trend. As shown in Figure 1,Total Price Movement (TMV) is used to measure the percentage change from Point A to Point C, normalized by the threshold.It usually measures the total price change of a DC event and an OS event. It is defined as:

\[TMV_{EXT}(n) = (P_{EXT}(n) - P_{EXT}(n-1)) / P_{EXT}(n-1) * \theta\]

Implementation

Example

Time for Completion

This indicator measures the amount of the physical time (T) that it takes to complete a TMV trend. As shown in Figure 1,it measures the time from Time 3 to Time 9. It is defined as:

\[T(n) = t_{EXT}(n) - t_{EXT}(n - 1),\]

where \(t_{EXT}(n)\) represents the time at \(n-th\) extreme point.

Implementation

Example

Time Adjusted Return

This indicator measures the absolute return (R) in a trend. It is calculated by dividing the absolute TMV bythe time interval T. It measures the percentage of price change per time unit:

\[R(n) = TMV_{EXT}(n) / T(n) * \theta\]

where \(R(n)\) represents the value of the time-adjusted return of DC at the \(n-th\) extreme point.

Implementation

Example

Directional Change — mlfinlab 1.5.0 documentation (2024)
Top Articles
How to Close a Bank Account: Savings & Checking Accounts | SoFi
Crypto Exchange vs. Crypto Wallet — What's the Difference?
English Bulldog Puppies For Sale Under 1000 In Florida
Katie Pavlich Bikini Photos
Gamevault Agent
Pieology Nutrition Calculator Mobile
Hocus Pocus Showtimes Near Harkins Theatres Yuma Palms 14
Hendersonville (Tennessee) – Travel guide at Wikivoyage
Compare the Samsung Galaxy S24 - 256GB - Cobalt Violet vs Apple iPhone 16 Pro - 128GB - Desert Titanium | AT&T
Vardis Olive Garden (Georgioupolis, Kreta) ✈️ inkl. Flug buchen
Craigslist Dog Kennels For Sale
Things To Do In Atlanta Tomorrow Night
Non Sequitur
Crossword Nexus Solver
How To Cut Eelgrass Grounded
Pac Man Deviantart
Alexander Funeral Home Gallatin Obituaries
Energy Healing Conference Utah
Geometry Review Quiz 5 Answer Key
Hobby Stores Near Me Now
Icivics The Electoral Process Answer Key
Allybearloves
Bible Gateway passage: Revelation 3 - New Living Translation
Yisd Home Access Center
Pearson Correlation Coefficient
Home
Shadbase Get Out Of Jail
Gina Wilson Angle Addition Postulate
Celina Powell Lil Meech Video: A Controversial Encounter Shakes Social Media - Video Reddit Trend
Walmart Pharmacy Near Me Open
Marquette Gas Prices
A Christmas Horse - Alison Senxation
Ou Football Brainiacs
Access a Shared Resource | Computing for Arts + Sciences
Vera Bradley Factory Outlet Sunbury Products
Pixel Combat Unblocked
Movies - EPIC Theatres
Cvs Sport Physicals
Mercedes W204 Belt Diagram
Mia Malkova Bio, Net Worth, Age & More - Magzica
'Conan Exiles' 3.0 Guide: How To Unlock Spells And Sorcery
Teenbeautyfitness
Where Can I Cash A Huntington National Bank Check
Topos De Bolos Engraçados
Sand Castle Parents Guide
Gregory (Five Nights at Freddy's)
Grand Valley State University Library Hours
Hello – Cornerstone Chapel
Stoughton Commuter Rail Schedule
Nfsd Web Portal
Selly Medaline
Latest Posts
Article information

Author: Lakeisha Bayer VM

Last Updated:

Views: 6106

Rating: 4.9 / 5 (69 voted)

Reviews: 84% of readers found this page helpful

Author information

Name: Lakeisha Bayer VM

Birthday: 1997-10-17

Address: Suite 835 34136 Adrian Mountains, Floydton, UT 81036

Phone: +3571527672278

Job: Manufacturing Agent

Hobby: Skimboarding, Photography, Roller skating, Knife making, Paintball, Embroidery, Gunsmithing

Introduction: My name is Lakeisha Bayer VM, I am a brainy, kind, enchanting, healthy, lovely, clean, witty person who loves writing and wants to share my knowledge and understanding with you.