SPECTRAL DILATION Codifying the Fractal Nature of Market Data Impact on Technical Indicators StockSpotter.com John Ehlers

Slides:



Advertisements
Similar presentations
The webinar slides (including code) can be found at:
Advertisements

Activities Tab – Charles H. Dow Award
Digital Signal Processing
Copyright 2001, Agrawal & BushnellVLSI Test: Lecture 181 Lecture 18 DSP-Based Analog Circuit Testing  Definitions  Unit Test Period (UTP)  Correlation.
Digital Coding of Analog Signal Prepared By: Amit Degada Teaching Assistant Electronics Engineering Department, Sardar Vallabhbhai National Institute of.
Not Rocket Science – An Intuitive New Display
Lecture 7 Linear time invariant systems
Analog-to-digital Conversion and Digital-to-analog Conversion (with DSP) ES-3.
So far We have introduced the Z transform
Digital Signal Processing
Sampling and quantization Seminary 2. Problem 2.1 Typical errors in reconstruction: Leaking and aliasing We have a transmission system with f s =8 kHz.
CHE 185 – PROCESS CONTROL AND DYNAMICS
Sound Synthesis CE 476 Music & Computers. Additive Synthesis We add together different soundwaves sample-by-sample to create a new sound, see Applet 4.3.
Copyright © 2011 by Denny Lin1 Simple Synthesizer Part 2 Based on Floss Manuals (Pure Data) “Building a Simple Synthesizer” By Derek Holzer Slides by Denny.
Overview of Adaptive Multi-Rate Narrow Band (AMR-NB) Speech Codec
JF 12/04111 BSC Data Acquisition and Control Data Representation Computers use base 2, instead of base 10: Internally, information is represented by binary.
Department of EECS University of California, Berkeley EECS 105 Fall 2003, Lecture 2 Lecture 2: Transfer Functions Prof. Niknejad.
Chapter 2 Fundamentals of Data and Signals
SWE 423: Multimedia Systems Chapter 7: Data Compression (3)
Chapter 2: Fundamentals of Data and Signals. 2 Objectives After reading this chapter, you should be able to: Distinguish between data and signals, and.
1 Chapter 2 Fundamentals of Data and Signals Data Communications and Computer Networks: A Business User’s Approach.
SWE 423: Multimedia Systems Chapter 7: Data Compression (5)
Measurement of Sound Decibel Notation Types of Sounds
Spectra of random processes Signal, noise, smoothing and filters.
Your Name Your Title Your Organization (Line #1) Your Organization (Line #2) Week 4 Update Joe Hoatam Josh Merritt Aaron Nielsen.
Chapter 25 Nonsinusoidal Waveforms. 2 Waveforms Used in electronics except for sinusoidal Any periodic waveform may be expressed as –Sum of a series of.
Over-Sampling and Multi-Rate DSP Systems
DSP. What is DSP? DSP: Digital Signal Processing---Using a digital process (e.g., a program running on a microprocessor) to modify a digital representation.
Ni.com Data Analysis: Time and Frequency Domain. ni.com Typical Data Acquisition System.
UNIT - 4 ANALYSIS OF DISCRETE TIME SIGNALS. Sampling Frequency Harry Nyquist, working at Bell Labs developed what has become known as the Nyquist Sampling.
Module 2: Representing Process and Disturbance Dynamics Using Discrete Time Transfer Functions.
Lecture 1 Signals in the Time and Frequency Domains
Data Communications & Computer Networks, Second Edition1 Chapter 2 Fundamentals of Data and Signals.
Kent Bertilsson Muhammad Amir Yousaf. DC and AC Circuit analysis  Circuit analysis is the process of finding the voltages across, and the currents through,
1 The Instantaneous Trendline AfTA 20 May 2003 John Ehlers.
Filtering. What Is Filtering? n Filtering is spectral shaping. n A filter changes the spectrum of a signal by emphasizing or de-emphasizing certain frequency.
Copyright © 2011 by Denny Lin1 Computer Music Synthesis Chapter 6 Based on “Excerpt from Designing Sound” by Andy Farnell Slides by Denny Lin.
The Physical Layer Lowest layer in Network Hierarchy. Physical transmission of data. –Various flavors Copper wire, fiber optic, etc... –Physical limits.
Week 11 Introduction A time series is an ordered sequence of observations. The ordering of the observations is usually through time, but may also be taken.
Effect of Noise on Angle Modulation
FE8113 ”High Speed Data Converters”. Course outline Focus on ADCs. Three main topics:  1: Architectures ”CMOS Integrated Analog-to-Digital and Digital-to-
ECE 4710: Lecture #7 1 Overview  Chapter 3: Baseband Pulse & Digital Signaling  Encode analog waveforms into baseband digital signals »Digital signaling.
Tom.h.wilson Department of Geology and Geography West Virginia University Morgantown, WV.
1 Conditions for Distortionless Transmission Transmission is said to be distortion less if the input and output have identical wave shapes within a multiplicative.
revision Transfer function. Frequency Response
GG313 Lecture 24 11/17/05 Power Spectrum, Phase Spectrum, and Aliasing.
ECE 8443 – Pattern Recognition ECE 3163 – Signals and Systems Objectives: Stability Response to a Sinusoid Filtering White Noise Autocorrelation Power.
Lecture 2: Measurement and Instrumentation. Time vs. Frequency Domain Different ways of looking at a problem –Interchangeable: no information is lost.
Week 9 Frequency Response And Bode Plots. Frequency Response The frequency response of a circuit describes the behavior of the transfer function, G(s),
Feedback Filters n A feedback filter processes past output samples, as well as current input samples: n Feedback filters create peaks (poles or resonances)
Z Transform The z-transform of a digital signal x[n] is defined as:
0/31 Data Converter Basics Dr. Hossein Shamsi. 1/31 Chapter 1 Sampling, Quantization, Reconstruction.
Signal Analyzers. Introduction In the first 14 chapters we discussed measurement techniques in the time domain, that is, measurement of parameters that.
Introduction to Data Conversion EE174 – SJSU Tan Nguyen.
Measurement and Instrumentation
LECTURE 30: SYSTEM ANALYSIS USING THE TRANSFER FUNCTION
MTI RADAR.
Predictive Indicators
CSI-447: Multimedia Systems
ECET 345 Competitive Success/snaptutorial.com
ECET 345 Education for Service-- snaptutorial.com.
ECET 345 Teaching Effectively-- snaptutorial.com.
Fundamentals Data.
Fourier Transform Analysis of Signals and Systems
Digital Control Systems Waseem Gulsher
Signals Prof. Choong Seon HONG.
8.6 Autocorrelation instrument, mathematical definition, and properties autocorrelation and Fourier transforms cosine and sine waves sum of cosines Johnson.
Uses of filters To remove unwanted components in a signal
Geology 491 Spectral Analysis
Geol 491: Spectral Analysis
Presentation transcript:

SPECTRAL DILATION Codifying the Fractal Nature of Market Data Impact on Technical Indicators StockSpotter.com John Ehlers

Theoretical Basis of Market Data Structure Measured Market Data Structure Measuring Market Data Spectrums The Need to Think in Terms of Frequency –Frequency is the Dual of Conventional Time Waveforms Filter Basics Indicator Dynamics –The Impact of Spectral Dilation and What to Do About it An Introduction to OUTLINE StockSpotter.com John Ehlers

Described in “MESA and Trading Market Cycles” –Drunk steps right or left with each step forward Random Variable is position Results in the famous Diffusion Equation Describes the shape of a plume of smoke (or a trend) –Drunk steps in the same or opposite direction as the last step with each step forward Random Variable is momentum Results in the famous Wave Equation Describes a meandering river (or a cycle) The 2 nd Order Partial Differential Equations are nearly identical Results are that cycles and trends can coexist in a complex mixture Drunkards Walk StockSpotter.com John Ehlers

Peter Swerling statistically described radar echoes –Pulses were noisy over time – due to complex airplane shapes and changes in aspect from the fixed radar site. –Model described as pure noise with memory I have synthesized market data as noise with an EMA –Not bad for a simple model Swerling Model StockSpotter.com John Ehlers

The Hurst Exponent describes the randomness of a data series Hurst Exponent StockSpotter.com John Ehlers “Hurst Exponent and Financial Market Predictability” By Bo Qian and Khaled Rasheed University of Georgia

Market spectrum amplitude models as 1/F  2*(1 – Hurst Exponent)=  Spectral Dilation increases approximately 6 dB/Octave 1/F Noise is apparently universal Model shows two mandates for Technical Analysis 1)We must stay several octaves away from the Nyquist Frequency due to Quantization Noise 2)Indicators must compensate for spectral dilation to get an accurate frequency response Measured & Modeled Market Spectrum StockSpotter.com John Ehlers “Modelling Share Volume Traded in Financial Markets” By V. Gontis Lithuanian Journal of Physics, 2001, 41, No. 4-6, Quantization Noise Spectral Dilation

Highest possible frequency has two samples per cycle (Nyquist Frequency) –2 day period on daily bars Quantization Noise StockSpotter.com John Ehlers

Why not reduce quantization noise by sampling more often? –For example – hourly data to trade daily bars What is a day? 6 hours? 24 hours? Gap openings are a data issue Spectral dilation becomes an even larger issue because several more octaves range is included in the data OverSampling StockSpotter.com John Ehlers

Correlates a waveform with itself lagged in time SwamiCharts Autocorrelation of a theoretical 20 Bar Sine Wave Vertical Scale also shows periodicity Autocorrelation StockSpotter.com John Ehlers

Autocorrelation Periodogram produces spectrum amplitudes that are range bound by the correlation coefficient All other spectrum measurements must compensate for Spectral Dilation for a true picture of the Measured Spectrum This is really how I “discovered” spectral dilation Autocorrelation Periodogram StockSpotter.com John Ehlers

Filter Basics StockSpotter.com John Ehlers Let Z -1 represent one bar of delay 4 Bar Simple Moving Average: Output = (1/4 + Z -1 /4 + Z -2 /4 + Z -3 /4)*(Input Data) Transfer Response = H(z) = Output / (Input Data) More Generally:H(z) = b0 + b1*Z -1 + b2*Z -2 + b3*Z -3 + b4*Z -4 + ……….+ bN*Z -N An EMA uses a previously calculated value, so with still more generality: Therefore, filter transfer response is just a ratio of polynomials The polynomials can be factored into their zeros Zeros in the denominator are called poles The rate of filter rolloff is 6 dB / Octave per Pole Since we must use simple filters in trading we have only a few poles in the transfer response - BUT – the data are increasing at the rate of 6 dB / Octave. The result is there is no real filtering. I’m sorry! I just have to do this

The real reason to use averages or smoothing filters is to remove quantization noise SMOOTHING FILTERS StockSpotter.com John Ehlers 10 Bar SMA and EMA10 Bar SuperSmoother EMA (1 pole) SMA 2 double zeros Take Your Pick

SuperSmoother Filter Code StockSpotter.com John Ehlers SuperSmoother Filter © 2013 John F. Ehlers a1 = expvalue(-1.414* / 10); b1 = 2*a1*Cosine(1.414*180 / 10); c2 = b1; c3 = -a1*a1; c1 = 1 - c2 - c3; Filt = c1*(Close + Close[1]) / 2 + c2*Filt[1] + c3*Filt[2]; Code Conversion Notes: 1)Filter is tuned to a 10 Bar Cycle (attenuates shorter cycle periods) 2)Arguments of Trig functions are in degrees 3)[N] means value of the variable “N” bars ago

HighPass Filters are “detrenders” because they attenuate low frequency components HighPass Filter StockSpotter.com John Ehlers One pole HighPass and SuperSmoother does not produce a zero mean Because low frequency spectral dilation components are “leaking” through The one pole HighPass Filter response

Comprised of a two pole HighPass Filter and a SuperSmoother Roofing Filter StockSpotter.com John Ehlers The Roofing Filter guarantees only the desired frequency components will be passed for analysis

Roofing Filter Code StockSpotter.com John Ehlers Roofing Filter © 2013 John F. Ehlers //Two Pole Highpass filter passes cyclic components whose periods are shorter than 48 bars alpha1 = (Cosine(.707*360 / HPPeriod) + Sine (.707*360 / 48) - 1) / Cosine(.707*360 / 48); HP = (1 - alpha1 / 2)*(1 - alpha1 / 2)*(Close - 2*Close[1] + Close[2]) + 2*(1 - alpha1)*HP[1] - (1 - alpha1)*(1 - alpha1)*HP[2]; //Smooth with a Super Smoother Filter a1 = expvalue(-1.414* / 10); b1 = 2*a1*Cosine(1.414*180 / 10); c2 = b1; c3 = -a1*a1; c1 = 1 - c2 - c3; Filt = c1*(HP + HP[1]) / 2 + c2*Filt[1] + c3*Filt[2]; Code Modification Notes: 1)HP Filter is tuned to a 48 Bar Cycle (attenuates longer cycle periods) 2)SuperSmoother is tuned to a 10 Bar Cycle (attenuates shorter cycle periods) 3)Arguments of Trig functions are in degrees 4)[N] means value of the variable “N” bars ago

Impact of Spectral Dilation On Traditional Indicators StockSpotter.com John Ehlers Spectral Dilation has impacted (distorted?) the interpretation of virtually all indicators Conventional Stochastic Stochastic preceded by a Roofing Filter

Roofing Filter Can Be An Indicator Itself StockSpotter.com John Ehlers Cycle Period is about twice the desired trade duration 2 week nominal trade duration 3 month nominal trade duration

Even better DSP indicators DO exist StockSpotter.com John Ehlers

Analyzes over 5000 Stocks & ETFs each day Free indicator analysis –Includes Advanced SwamiCharts Free and Premium Screeners Watchlists Swing Trading signals called – IN ADVANCE –Performance is transparently tracked Monte Carlo Analysis of Performance Technical Presentations (this webinar is there) StockSpotter.com John Ehlers This QR code will take you to this presentation at StockSpotter.com