10.1007@978 981 32 9796 8
10.1007@978 981 32 9796 8
Lee
Quantum
Finance
Intelligent Forecast and Trading Systems
Quantum Finance
Raymond S. T. Lee
Quantum Finance
Intelligent Forecast and Trading Systems
123
Raymond S. T. Lee
Division of Science and Technology
Beijing Normal University-Hong Kong
Baptist University United International
College (UIC)
Zhuhai, Guangdong, China
This Springer imprint is published by the registered company Springer Nature Singapore Pte Ltd.
The registered company address is: 152 Beach Road, #21-01/04 Gateway East, Singapore 189721,
Singapore
This book is dedicated to all readers and
students in UIC taking Quantum Finance
course; your enthusiasm for learning new
concepts and seeking knowledge prompts me
to write this book.
Preface
Everything happens for a reason. Anything that might be happened with a cause.
These two sentences seem to be very simple, but they are major motivations to
drive the advances in science and technology of human history.
However, modern cosmology tells us that we live in a multiverse, the world we
all experience is just one of the many realities. Quantum theory tells us that all
fundamental particles in the subatomic world coexist in a particle–wave duality
state. Heisenberg’s uncertainty principle even tells us that we can never 100%
correctly measure both the position and momentum of any quantum particle
simultaneously. Chaos theory shapes the world as complex systems with all pre-
dictions are highly sensitive to its initial conditions; only a tiny observation error
will lead to a totally different future. Fuzzy logic tells us to accept this as nature of
reality; all we can do is to model the world as a collection of fuzzy linguistics and
events.
Does it mean that we cannot predict the future?
The answer is definitely … NO.
The motivation of this book—quantum finance, a cross-discipline of financial
engineering with the integration of quantum field theory, classical finance theory,
computer science, and AI technology—is to find a scientific path to resolve this
grant puzzle.
This book is also about an over 30-year journey of knowledge seeking on financial
prediction.
The idea of using quantum field theory and AI to solve financial problems (now
called quantum finance) emerged when I was an undergraduate physics student at
vii
viii Preface
the Hong Kong University (HKU) in 1986 studying quantum mechanics and
general relativity courses. At that time, I was deeply impressed by all great minds
and innovative ideas for the interpretation of the world in two totally different
perspectives: the subatomic world of quantum mechanics versus the cosmic world
of general relativity. Since then, I strongly believe that both the Schrödinger
equation and Feynman’s path integrals hold the keys to unlock the dynamics of
everything—to truly observe the past and predict the future. They also hold the keys
to resolve two major forecasting challenges in human history: weather forecast in
meteorology and worldwide financial prediction in finance.
After graduation from HKU in 1989, I joined the Hong Kong Observatory of the
Government of Hong Kong Special Administrative Region and worked as exper-
imental office on weather prediction and in the building of computational weather
prediction model known as numerical weather prediction (NWP) system using
Fortran. Although at that time it was still based on Newton’s laws of motion, fluid
dynamics, and thermodynamics equations to predict weather, it gave me an
opportunity to realize two important facts: (1) In order to ultimately unlock the
mystery of prediction using Schrödinger equation by computer system, we need to
convert (model) the Schrödinger equation wisely into other formats such that it can
be easily computed by digital computers using numerical computation techniques;
(2) Only Schrödinger equation and Feynman’s path integral are not adequate to
predict the future. In Chaps. 3–5, these two mathematical models are the keys to
model the quantum dynamics of quantum financial particles (QFPs) and to evaluate
the quantum price levels (QPLs), but they are not the ideal tools to predict future. In
order to predict the financial market wisely and effectively, we need some other
intelligent tools. Such motivation precipitated me to pursue M.Sc. and Ph.D. studies
at Hong Kong Polytechnic University in 1994 and 1997, respectively.
During this period, I have learned and explored all different kinds of artificial
intelligence (AI) technologies including artificial neural network (ANN), fuzzy
logic (FL), genetic algorithms (GAs), and chaos and fractals theories. Among them,
I realized in order to solve this grant puzzle, one must look for four puzzle pieces
first:
(1) All these AI tools and technologies are not only closely related but also each
of them has its own advantages and shortcomings. If we can integrate these AI
tools and techniques wisely, we might have an opportunity to solve more
complex and fundamental problems, worldwide financial prediction—for
instance;
(2) All these AI tools and techniques are in fact different faces of the same coin;
how to integrate them wisely and effectively should not only focus on the
methodology but rather the fundamental structure of the AI tools themselves;
(3) How to model quantum finance effectively is another important issue. In
Chap. 3, we will see that traditional Feynman’s path integral although can
provide a feasible solution to model quantum dynamics of financial markets, the
computational complexity of this method hinders us to apply it for real-time
financial market prediction. In other words, we need a totally new idea to model
Preface ix
quantum finance effectively, not only at the analytical level but also at the
numerical computation level;
(4) Even though if we can model financial markets using quantum finance effec-
tively, how to integrate such model with AI is another problem. In order to
integrate quantum finance model and AI technologies nicely to implement
worldwide financial prediction and intelligent quantum trading system, we need
a common ground to link up these two worlds. Again, not at the methodology
level, but rather at the core model structure itself.
Not until 2004, I proposed the Lee-oscillator—a chaotic time-discrete neural
oscillator with profound transient-chaotic property, which gave us some new hopes
to resolve part of this puzzle. The interesting thing is that, when the Lee-oscillators
are used to replace the neurons in any time series neural networks, such as tradi-
tional feedforward backpropagation networks (FFBPNs), they would convert the
neural networks into powerful chaotic neural oscillatory networks (CNONs) with
promising prediction and machine learning capabilities. In Chap. 9, such chaotic
neural oscillators can be served as the missing link to integrate all different kinds of
AI technologies effortlessly, which sheds light on the resolution of the first two
puzzle pieces to model complex time series prediction problems such as real-time
worldwide financial forecast. After that, it leaves us with the last two puzzle pieces.
In 2007, Dasgupta et al. published their paper titled as Simple systematics in the
energy eigenvalues of quantum anharmonic oscillators in the Journal of Physics A
(Chap. 3) which explained how to model Schrödinger equation as quantum
anharmonic oscillators (QAHOs). More importantly, this paper nicely described
how to resolve a special type of QAHO so-called kx2m AHO in which at the same
time I had derived the quantum finance Schrödinger equation (QFSE) as an AHO of
order 4 (i.e., m = 2) quantum dynamic model (Chap. 4). By the integration of this
kx4 AHO mathematical model and the finite difference method (FDM) learnt for the
implementation of the NWP model in Hong Kong Observatory years ago, I can
finally construct a numerical computation model with the integration of AHO (to
model quantum financial particles) and CNON (to model chaotic time series pre-
diction) into the so-called quantum finance forecast system (QFFS).
In order to prove the applicability of this totally new AI-fintech invention in
real-world financial markets, during 2012–2017, I joined Leanda Investment Group
(one of the major commodity investment and trading companies in China) as the
chief analyst and group CTO for the implementation and national promotion of
QFFS in China. With the success of the implementation of QFFS in commodity
product forecast for over 5 years in China and Hong Kong, in Mar 2017, I set up the
quantum finance forecast center (aka QFFC, website QFFC.org), a nonprofit
making, AI-fintech R&D, and worldwide financial forecast center aims at the R&D
and the provision of an open platform for worldwide traders and individual
investors to acquire free worldwide real-time financial prediction. QFFS now
provides daily (weekly) financial forecasts for over 120 worldwide financial
products including 9 major cryptocurrencies, 17 worldwide financial indices, 84
forex, and 19 major commodities. As of March 2019, QFFC has over 10,000+
x Preface
This book is the collection of my past 20 years (1999–2019) of R&D works and
practical implementation of quantum finance and related AI technology including
chaotic neural networks, fuzzy logics and genetic algorithms (GAs) in financial
market modeling, time series financial prediction, and intelligent agent-based
quantum trading techniques and methodologies.
This book consists of two parts: Part I describes the basic concept and theory of
quantum finance and related AI technology. Part II describes the current and
ongoing R&D projects for the application of quantum finance technology on
intelligent real-time financial prediction and intelligent agent-based quantum trad-
ing systems.
This book is organized as follows:
• Chapter 1—Introduction to Quantum Finance
This chapter introduces the origin of quantum finance and the two different
perspectives to see the world. It investigates the wave–particle duality and
Heisenberg’s uncertainty principle in quantum mechanics and how these phe-
nomena are related to quantum finance, which leads to our study on the phi-
losophy of quantum finance. After that, it introduces the major components of
quantum finance and the quantum finance four-tier concentric sphere model.
• Chapter 2—Quantum Field Theory for Quantum Finance
To avoid complex mathematical derivation, the chapter mainly focuses on the
basic concept and physical meaning of how quantum field theory can be applied
to financial engineering for the modeling of worldwide financial markets.
• Chapter 3—An Overview of Quantum Finance Models
This chapter investigates two main branches of quantum finance models—the
Feynman’s path integral model and the quantum anharmonic oscillator model. It
also explores the future of quantum finance which relates to intelligent finance
systems’ development.
• Chapter 4—Quantum Finance Theory
This chapter starts with a basic concept of quantum finance theory—quantum
anharmonic oscillator model. It focuses on the complete mathematical deriva-
tion of the author’s original work of quantum finance Schrödinger equation
(QFSE). It also investigates the quantum dynamics in financial markets, the
notion of quantum price levels (QPLs) and their relationship with quantum
finance energy levels (QFELs).
• Chapter 5—Quantum Price Levels—Basic Theory and Numerical
Computational Technique
Preface xi
This book can be served as both textbook and research monograph for various
undergraduate and postgraduate courses on quantum finance and related
AI/AI-fintech courses.
Basically, Part I (Chaps. 1–9) covers all basic concepts and theory about
quantum finance and related AI technology can be conducted as a self-contained
undergraduate/postgraduate course on quantum finance.
Part II (Chaps. 10–14) covers all advance studies and applications of quantum
finance, which can be adopted as the selected topics on various advanced AI/fintech
courses for postgraduate and research studies.
In UIC, starting from early 2019, the author launched a new free elective course,
namely, “Quantum Finance” for Year 3/4 undergraduate students of different dis-
ciplines including computer science, financial mathematics, data science, and
statistics. In terms of course syllabus, this course covers Chaps. 1–9 in the 14-week
study, and Chaps. 10 and 11 as workshops and term projects for the implementation
of QPL-based quantum finance forecast systems. Besides, students and course
instructors can use MQL workshops provided by QFFC.org enabling students to
learn MQL programming and how to develop simple program trading programs.
For advanced studies such as postgraduate AI courses or M.Phil./Ph.D. studies,
Chaps. 11–13 provide advanced topics on how to combine quantum finance theory
with contemporary type-2 fuzzy logic, chaotic neural oscillators, and reinforcement
learning agent theories for further R&D on quantum finance and related studies.
Last but not least, for quantum finance application developers such as quants and
financial analysts make use of the QFSDK provided by QFFC.org to develop
quantum finance applications. They can directly read Chaps. 10 and 11 first as
technical reference for QPLs’ calculation to implement quantum finance forecast
system for their own interesting financial products and revert to Part I to learn the
basic concepts and theories.
While it only required around 6 months to write this book, the whole journey of
quantum finance—from seeking concepts and knowledge to the actual implemen-
tation—took me almost 30 years, started when I was still an undergraduate at HKU
since 1986 studying quantum mechanics and general relativity courses to currently
teach quantum finance to my fellow students at UIC.
I would like to express my gratitude to the following people for their support and
assistance.
To my wife Iris for her patience, encouragement, and understanding, especially
during my time spent on research and writing in the past 30 years.
To Ms. Celine Cheng, executive editor of Springer Nature and her editorial team
members including Jane Li and Haiying Li, for their support, valuable comments,
and advice.
To Prof. James Liu, my M.Sc. and Ph.D. mentor, for his support to led me to the
sacred land of artificial intelligence.
To Jim He, my TA, and all my lovely research students in UIC including Turing
Qiu, Henry Liang, Alex Yuan, and Peter Chen, for their help and assistance for the
development of Quantum Finance Software Development Kit and online tutorials,
labs, and workshops.
To Prof. Tang Tao, President of UIC, for the provision of excellent environment
for the research, teaching, and the writing of this book.
To Prof. Hua Xiong Huang, Dean of Division of Science and Technology of
UIC, and Prof. Weifeng Su, Program Director of Computer Science and
Technology of UIC, for their support for the opening of new course in quantum
finance in UIC.
To all fellow colleagues in UIC, for their support and fruitful advice in course design.
To UIC, for the prominent support on research grant # R201948; and for the
provision of an excellent environment, facilities for system development, testing,
and evaluations.
xv
Contents
xvii
xviii Contents
3.7 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
4 Quantum Finance Theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
4.1 Quantum Finance Theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
4.1.1 The Concept . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
4.1.2 The Notion of Quantum Price . . . . . . . . . . . . . . . . . . 67
4.1.3 Revisit of Schrödinger Equation . . . . . . . . . . . . . . . . 69
4.2 Quantum Finance Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
4.2.1 The Mathematical Model . . . . . . . . . . . . . . . . . . . . . 70
4.2.2 Physical Meaning of Wave Function w . . . . . . . . . . . 71
4.3 Financial Dynamics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
4.3.1 Key Players in Secondary Financial Markets . . . . . . . 72
4.3.2 Market Maker (MM) . . . . . . . . . . . . . . . . . . . . . . . . 72
4.3.3 Arbitrageurs (ARs) . . . . . . . . . . . . . . . . . . . . . . . . . . 73
4.3.4 Speculators (SPs) . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
4.3.5 Hedgers (HGs) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
4.3.6 Investors (IVs) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
4.4 Financial Dynamics and the Notion of Excess Demand . . . . . . . 77
4.5 Quantum Dynamics in Financial Markets . . . . . . . . . . . . . . . . . 79
4.5.1 Market Makers (MMs) . . . . . . . . . . . . . . . . . . . . . . . 79
4.5.2 Arbitrageurs (ARs) . . . . . . . . . . . . . . . . . . . . . . . . . . 80
4.5.3 Speculators (SPs) . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
4.5.4 Hedgers (HGs) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
4.5.5 Investors (IVs) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
4.5.6 Overall Dynamics for All Different Parties . . . . . . . . . 82
4.6 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
5 Quantum Price Levels—Basic Theory and Numerical
Computation Technique . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
5.1 Quantum Price Levels (QPLs) . . . . . . . . . . . . . . . . . . . . . . . . . 90
5.1.1 The Concept . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
5.1.2 The Quantum Dynamics . . . . . . . . . . . . . . . . . . . . . . 91
5.1.3 QPLs Versus S & R Levels . . . . . . . . . . . . . . . . . . . 92
5.2 Schrödinger Equation Revisit . . . . . . . . . . . . . . . . . . . . . . . . . . 93
5.3 Quantum Finance Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
5.4 Physical Meaning of Wave Function W . . . . . . . . . . . . . . . . . . 95
5.5 Solving Quantum Finance Schrödinger Equation . . . . . . . . . . . 97
5.6 Numerical Computation of Quantum Anharmonic
Oscillators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .......... 97
5.7 Evaluate Quantum Price Levels Using Numerical
Computation Technique . . . . . . . . . . . . . . . . . . . .......... 99
xx Contents
Dr. Raymond S. T. Lee founder of quantum finance forecast center with over 20
years of IT consultancy, R&D experiences in AI, chaotic neural networks, intelli-
gent fintech system, quantum finance, and intelligent e-commerce systems, had
successfully commercialized his AI-fintech invention at business sectors in China
and Hong Kong.
He attained his B.Sc. (Physics) from Hong Kong University in 1989, and M.Sc.
(Information Technology) and Ph.D. (Computer Science) from Hong Kong
Polytechnic University in 1997 and 2000, respectively.
After graduation from Hong Kong University, he joined the Hong Kong
Observatory of the Government of the Hong Kong Special Administrative Region
as a meteorological scientist on weather forecasting and developing numerical
weather forecast system from 1989 to 1993.
From academic perspective, he had worked at the Department of Computing of
Hong Kong Polytechnic University (HKPolyU) as Lecturer, and promoted as
Assistant Professor in 2000 and Associate Professor in 2005, respectively. During
this time, he had published over 90+ publications and author of six textbooks and
monographs covering the fields at AI, chaotic neural networks, AI-based fintech
systems, intelligent agent technology, chaotic cryptosystems, ontological agents,
neural oscillators, biometrics, weather simulation, and forecasting systems.
From commercial perspective, he was invited to join Leanda Investment Group
in China (2012–2017) as Group CTO and Chief Analyst to implement his
self-invented and patented AI-fintech invention—quantum finance forecast system
on major commodities in China for 1,000+ investors.
In March 2017, he set up the quantum finance forecast center (aka QFFC) (http://
qffc.org), a nonprofit making, AI-fintech R&D, and worldwide financial forecast
center, that aims at the R&D and provision of a wholly FOC and open platform for
worldwide traders and individual investors to acquire free knowledge of worldwide
129 financial product forecasts based on the state-of-the-art AI, chaotic neural
networks and quantum finance technologies. At present, QFFC has over 10,000+
registered worldwide members, which consists of worldwide professional traders,
xxix
xxx About the Author
quants, and independent investors from major fund houses and financial institutions
using the free quantum finance daily forecasting services.
Upon the completion of the fully automated quantum finance forecast system, he
joined Beijing Normal University-Hong Kong Baptist University United
International College (UIC) in China as Associate Professor in 2018 to further
his R&D works on quantum finance and to contribute his knowledge on quantum
finance, AI-fintech, chaotic neural networks, and related intelligent forecast systems
to the fellow students and the community in China.
Abbreviations
xxxi
xxxii Abbreviations
MT4 MetaTrader4
NGPSM New Generation Population Selection Module
PCA Principal Component Analysis
QAOM Quantum Anharmonic Oscillatory Model
QFFS Quantum Finance Forecast Centre
QPL Quantum Price Level
RMSE Root Mean Square Error
STR State Transition Region
SVM Support Vector Machine
T2FL Type-2 Fuzzy Logic
T2FLS Type-2 Fuzzy Logic System
T2FMF Type-2 Fuzzy Membership Function
TOP10-FFSSM TOP-10 Fitness FFS Selection Module
Part I
Quantum Finance Theory
Chapter 1
Introduction to Quantum Finance
particles, and how such phenomena are related to quantum finance. After that, we
will study quantum field theory and the birth of quantum finance followed by the
Heisenberg’s uncertainty principle in quantum mechanics, and how it relates to two
important theories in AI—chaos theory and fuzzy logic. Lastly, we will explore major
components of quantum finance—the four-tier concentric sphere quantum finance
model.
General relativity (GR, also known as the general theory of relativity) is the geo-
metric theory of gravitation coined by Professor Albert Einstein (1879–1955) at the
presentation of his work The Field Equations of Gravitation at the Prussian Academy
of Science in November 1915 (Einstein 1915), and The Foundation of the General
Theory of Relativity published by Annalen der Physik in 1916 (Einstein 1916), which
set the cornerstone of general relativity along with quantum mechanics as the two
pillars of modern physics (Woodhouse 2007). He is best known to the general public
6 1 Introduction to Quantum Finance
for his groundbreaking mass–energy equation E = mc2 , which has been considered
as “the world’s most famous equation” after Newton’s second law of motion F =
ma.
Different from centuries of beliefs that time as a special one-way, linear, and non-
reversible quantity, the groundbreaking idea of general relativity is the consideration
of time as a dimension identical to the three dimensions of space we are known
of. General relativity generalizes Einstein’s special relativity and Newton’s law of
universal gravitation, providing a unified description of gravity as a geometric prop-
erty of space and time, known as spacetime—a critical mass of modern cosmology
(Woodhouse 2007; Böhmer 2016; Carroll 2016).
In Einstein’s world of general relativity, space, time, and matters are inter-
connected to each other. Even his early work on special relativity already introduced
the notion of time dilation—in which time is not an absolute constant quantity but
can vary according to the observer’s so-called frame of reference (Chaturvedi et al.
2006). In layman’s term, to describe matters and objects with normal mass and veloc-
ity (i.e., much slower than the speed of light), Newton’s laws of motion are good
enough to do the job. But, when matters and objects with normal mass move close
to the speed of light, it is the time to apply special relativity. In case that matters and
objects are extremely massive, such as planets and black holes in which even light
and time can be distorted by their massive gravitational fields as visual interpretation
is shown in Fig. 1.1a, general relativity should be applied. In fact, general relativity
is the basis of current cosmological models of a consistently expanding universe and
Big Bang Theory.
4. Heisenberg’s uncertainty principle states that there are natural limits of preci-
sion for paired quantity of every quantum particle, for example, position and
momentum of any quantum particle.
5. Quantum entanglement—a unique phenomenon in quantum mechanics—states
that multiple quantum particles are linked (interacted) together in a way such
that the measurement of one particle’s quantum state determines the possible
quantum states of the other particles, even they are separated by very far distance
(Sen 2017).
As a groundbreaking theory to describe all fundamental particles and their events,
quantum mechanics believes to be a perfect tool to model any fundamental phenom-
ena in the physical world such as finance, for example. Figure 1.1c shows a visual
interpretation of Heisenberg’s subatomic world of quantum mechanics.
Photoelectric
Detectors
light photon projection were randomly distributed as every photon path is a particle
motion-independent event. Part 2’s experiment that did not use photoelectric detector
showed that alterative bright-and-dark bands are similar in any typical wave interfer-
ence phenomena. What do they mean? What we watch (observe) can really affect the
experimental results? How can light particles (photon) be sometimes particle-like
and sometimes wave-like?
Quantum mechanics provides a simple but extraordinary explanation: first, all
quantum particles coexist in two totally different states: wave and particle states,
we called it wave–particle duality. Second, how they behave all depend on how we
observe (detect) their motions (phenomena). In other words, if we use photoelectric
detector to detect light, it will behave as photon particles, that is, photoelectric detec-
tor can only detect photons. On the other hand, if we don’t use any photoelectric
detector, it will behave as its usual state, that is, light waves with typical interference
phenomena, which means that the observer oneself (or the detector itself) will affect
the experimental results; it is rather against the traditional beliefs in science in which
the observer should not be part of the experiment. Is it true?
Despite the notion that was extraordinary among science community in the early
twentieth century, it was not a novel concept in philosophy. Professor Immanuel
Kant’s (1724–1804) remarkable work Critique of Pure Reason published in 1781
(Kant 2008) stated that: the world of reality we percept is just the model reality
shaped by the senses and mind. In layman’s term, it can be interpreted as wearing
1.2 Two Sides of the Same Coin—Wave–Particle Duality … 9
a pair of colored spectacles to see the world. Different colors of the world naturally
depend on the color of the spectacles we wear. As mentioned at the beginning of this
chapter, humans are good at creating models to reflect everything we see and percept
in our minds, and the observation results we obtain naturally depend on the model
we create.
In fact, the major significance of the wave–particle duality is that all behaviors of
light and matter can be explained through a single equation which relates quantum
particle’s wave dynamics with its particle dynamics—the Schrödinger equation. This
ability to describe reality in the form of waves is the core of quantum mechanics and
is also the quintessence of this book.
161.8% or 261.8%
3 of Wave 1
161.8%, 100%,
A
1 61.8%, or 50.0%
4 38.2%, 50.0% , of Wave 5
61.8% of Wave 4
C 100%, 161.8%
of Wave A, or
2 50.0% or 61.8%
161.8% of Wave B
of Wave 1
In other words, in the financial world at any particular instance, when we can
observe (or measure) the price (or index value) of any financial product such as the
Dow Jones index (DJI), we treat this as a particle, and use technical analytical tools
to study and analyze it. At the same time, we can also observe not only on price
but also the entire financial time series as waves and patterns; use chart analysis to
discover the embedded waves and patterns.
In quantum finance, can we model financial market using quantum mechanics and
quantum field theory?
In 1927, German physicist Professor Werner Heisenberg stated that the more pre-
cisely the position of some particle is determined, the less precisely its momentum—
the famous Heisenberg’s uncertainty principle (Gribbin 1984).
σx σ p ≥ (1.1)
2
where is the reduced Planck constant.
Unlike classical physics, uncertainty principle states that all events occur in quan-
tum states and will (only will) collapse into a particular reality when the observer
takes the measurement (or observe the event).
This phenomenon is associated with the famous Schrödinger’s cat paradox
(Gribbin 1984; Monroe et al. 1996).
• In this paradox as shown in Fig. 1.5, a cat, a flask of poison, and a radioactive
source are placed in a sealed box.
• If an internal monitor (e.g., GM counter) detects radioactivity (i.e., a single atom
decaying), the flask is shattered and releases poison which kills the cat.
• The interpretation of quantum mechanics implies that after a while, the cat is
simultaneously alive and dead. Yet, when one looks in the box, the cat is either
alive or dead (Bhaumik 2017).
• This poses the question of when exactly quantum superposition ends and reality
collapses into one possibility or the other (Stamper-Kurn et al. 2016).
12 1 Introduction to Quantum Finance
One may wonder, does uncertainty principle (phenomena) occur in financial markets?
The answer is: always.
Any experienced traders can tell us that there is no 100% sure in financial market.
Anything can happen in every second. The only thing we are 100% sure and confirm
is the time when we look at the market, which is similar to what Einstein said in his
famous quote:
I like to think that the moon is there even if I am not looking at it
Albert Einstein (1879–1955)
In other words, without actually observing the market, anything can occur.
If that is the case, how can we model it by using the technology we have? Or, is
it merely a fancy thought?
In fact, there are two technologies that provide an excellent analog to uncertainty
principle in modern AI (Russell and Norvig 2015).
They are fuzzy logics and chaos theory.
Fuzzy logics (FLs): In the world of fuzzy logic, everything is uncertain. Fuzzy
logic (Zadeh and Aliev 2019) provides an easy-to-implement solution to model mul-
tiple attributes that can be occurred at the same time the so-called fuzzy variables
(FVs).
Chaos theory (CT): In the world of chaos theory, everything is a complex sys-
tem, so-called deterministic chaos (Schuste 2005) (Fig. 1.6). Chaos theory provides
a framework and mathematical model to simulate highly chaotic or random-like
phenomena, such as weather patterns and financial markets (Lee 2005).
1.4 Heisenberg’s Uncertainty Principle in Finance and Modern AI Technology 13
We will study these two fascinating and useful topics in Chap. 7—AI powerful
tools in quantum finance.
In this book, we will explore how quantum mechanics and quantum field theory can
be used to model financial markets. More importantly, we will study how modern
AI technologies such as artificial neural networks, fuzzy logics, genetic algorithms,
chaos theory, and fractals can be integrated with quantum finance model to design
and implement intelligent real-time financial forecast and quantum trading systems.
Figure 1.7 shows the concentric sphere model of quantum finance.
1. First Tier—Energy Field Layer
• The core,
• Provides quantum field—quantum price field (QPF).
2. Second Tier—Chaotic Neural Network Layer
• Provides the neural dynamics in quantum finance,
• Supports neural oscillators and chaotic neural networks.
3. Third Tier—AI-fintech Layer
Provides AI-finance technology tools,
14 1 Introduction to Quantum Finance
Fuzzy
Logics
Chao c Neural
Networks
QUANTUM
Chaos
PRICE Fractals
Theory FIELD
Neural
Oscillators
Gene c
Algorithms
Supports fuzzy logics (FLs), genetic algorithms (GAs), chaos theory (CT),
fractals, support vector machine (SVM), etc.
4. Fourth Tier—Application Layer
• Quantum price levels (QPLs),
• Short-term price prediction,
• Long-term trend prediction, and
• Intelligent multiagent-based trading systems.
1.6 Conclusion
Problems
1.1 What is quantum finance? State and explain briefly the major difference
between quantum finance and traditional finance theory.
1.2 What is the four-tier concentric sphere model of quantum finance? How can
it relate to contemporary AI technology?
1.3 What is wave–particle duality phenomenon in quantum theory? Give an exam-
ple of wave–particle duality phenomenon in financial market and explain how
it works.
1.4 State and explain the three major components of quantum field theory and
discuss how they are related to quantum finance.
1.5 State and explain the difference between quantum mechanics and quantum
field theory.
1.6 What are the basic limitations of Newtonian classical mechanics?
1.7 Why the understanding of nature of time is critical in modern finance?
1.8 State and explain the five characteristics of quantum mechanics, and how they
are related to quantum finance.
1.9 State and explain the double-slit experiment in quantum mechanics, and its
analog to the financial market.
1.10 State and explain how Kant’s theory provides a probable explanation to
wave–particle duality in quantum theory, and hence quantum finance.
1.11 What are technical analysis and chart analysis in finance engineering? Discuss
and explain how these analytical techniques are related to wave–particle duality
in quantum finance.
1.12 State and explain the Schrödinger’s cat paradox in quantum mechanics. So, at
any moment, is the cat alive or die? why? and how it relates to the financial
markets?
1.13 What are Elliot waves in finance? Discuss and explain how Elliot waves can
be interpreted by quantum finance.
1.14 If everything is uncertain according to uncertainty principle, how can we
predict the future such as financial prediction?
1.15 What are the roles of fuzzy logics and chaos theory in quantum finance?
16 1 Introduction to Quantum Finance
References
Lastly, we will study four main topics in quantum field theory: classical field
versus quantum field, Feynman’s path integral, and quantum oscillators which are
related to our study of quantum finance theory.
In Chaps. 4 and 5, basic understanding of quantum mechanics and quantum field
theory are vital not only to realize the motivation in acquiring quantum theory to
model the dynamics of financial markets but also to set out a concrete foundation for
further study and research on quantum finance theory with related theoretical and
mathematical models.
Fig. 2.1 Wave functions of the electron in a hydrogen atom at different energy levels (PoorLeno
2019). Note Quantum mechanics cannot predict the exact location of a particle in space, only the
probability of finding it at different locations. The brighter areas represent a higher probability of
finding the electron
Table 2.1 shows a snapshot of distinguished figures in the course of quantum mechan-
ics since 1800s.
∂B
∇ ×E =− (2.1)
∂t
(2) Maxwell electromagnetic wave equation, given by
F = m · ẍ (2.2)
∂
i ψ(x, t) = Ĥ ψ(x, t) (2.3)
∂t
Such important property is clearly demonstrated by three important findings and
experiments in the history of quantum mechanics, and they are as follows:
(1) Planck’s blackbody radiation (Planck 1901) and the discovery of Planck’s law:
E = hv (2.4)
Observing
Double-slit screen
Electron
Electron Gun
Interference
paƩern
p · x = (2.5)
2
where is the reduced Planck’s constant = /2π .
As explained in his famous quote:
The uncertainty principle refers to the degree of indeterminateness in the possible present
knowledge of the simultaneous values of various quantities with which the quantum theory
deals; it does not restrict, for example, the exactness of a position measurement alone or a
velocity measurement alone.
Werner Heisenberg (1901–1976)
In fact, uncertainty principle is an inherent property of matter due to its own wave
property. It must be emphasized that measurement does not mean only a process in
24 2 Quantum Field Theory for Quantum Finance
which a physicist observer takes part but rather any interaction between classical and
quantum objects regardless of any observer.
This principle has profound influence in modern physics (especially experimental
physics) such as mesoscale numerical weather prediction (NWP) in computational
meteorology, superconductivity, and quantum optics.
In quantum finance, principle of uncertainty provides a way to describe the natural
limit of precision for the observation of intrinsic pair in financial market, which will
be revealed in Chap. 4.
• Medical and images’ research such as magnetic resonance imaging (MRI) and
DNA editing.
Quantum field theory is a theoretical framework that combines three important the-
oretical physics theories (Padmanabhan 2016).
They are
1. Quantum mechanics—provides basic mathematical, physical and philosophical
framework;
2. Classical field theory—provides mathematical, physical model, and framework
on quantum fields’ composition and dynamics;
3. Special relativity—provides mathematical, physical model and framework
regarding interchange between quantum particles and their intrinsic energies,
the creation and annihilation mechanisms of subatomic particles, and their math-
ematical interpretations.
4. Einstein’s famous mass–energy formulation:
E = mc2 (2.6)
Note: This formulation not only explains the intrinsic energy of a matter with mass
m or its mass–energy equivalent property, but more importantly it provides a way
to describe and interpret how fundamental (quantum) particles can be created or
annihilated to/from pure energy. The interpretation is not only the central concept of
special and general relativity but also is an important component in quantum field
theory to explain the existence and dynamics of various subatomic particles.
As there are a great deal of topics and phenomena in quantum field theory, this
book will focus on key topics which are essential for constructing the mathematical
and physical framework on quantum finance.
They are
• Classical field versus quantum field,
• Feynman path integral, and
• Quantum oscillators.
Before we learn more in-depth understanding of what is quantum field theory, let’s
have a look on what is the major difference between a classical field versus quantum
field.
28 2 Quantum Field Theory for Quantum Finance
GM
g(r) = − (2.7)
r2
where G = gravitational constant, M = mass of the massive body (e.g., Earth)
exerts on a comparably small object with mass m, and r = distance.
2. Maxwell’s electromagnetic field (EM field)
1 q
E=− (2.8)
4π 0 r 2
where q = charge of the test charged object, 0 = permittivity of free space, and
r = distance.
In quantum field theory, particles are described by quantum fields that satisfy the
Schrödinger equation, which is given by (nonrelativistic):
∂ 2 2
i (r, t) = − ∇ + V (r, t) (r, t) (2.9)
∂t 2μ
Figure 2.7 shows the 2D illustration of a classical field, in which there are discrete
numbers at every point of the space, whereas in a quantum field, the field value at
single point in the space is not an exact number but rather some sort of distribution—
probability density function (pdf) or wave function in terms of quantum mechanics
in Fig. 2.8.
O1
F
S
O2
O1
O3 F
S
O2
n n
ψF = ψF S − O1i − O2j − F (2.11)
j i
In fact, it is what Feynman did in 1948 during his famous Feynman’s lectures on
path integral and quantum mechanics.
Now then, what would happen if we add infinite number of layers; at the same
time drill infinite number of openings onto it?
Figure 2.12 shows all layers between S and F will simply disappear into empty
space. Why do they behave like this?
The answer is: photons emit from point source S and arrive at detector F through
empty space. The wave function detected at F is the sum of infinite paths begin-
ning from source S to detector F—known as path integral formulation proposed by
Feynman in 1948.
ψF = ψAll Path (S − F) (2.12)
i
F
S
In quantum field theory (Padmanabhan 2016), the wave function value detected the
path from point source qS to a final point qF in time T which is governed by the
unitary operator e−iHT where H is the Hamiltonian.
Using Dirac’s bra and ket notation, we have
qF |e−iHT |qS (2.13)
After relative calculation, we obtain the famous path integral formulation of QFT:
T
qF |e−iHT |qS = ∫ Dq(t)ei 0 dt [ 2 mq̇ −V (q)]
1 2
(2.16)
T
qF |e−iHT |qS = ∫ Dq(t)ei 0 dt L(q̇,q) (2.17)
In quantum finance, path integral formulation (Baaquie 2018) plays an important role
in the modeling of the most fundamental financial instrument—worldwide interest
rate (r) modeling.
Image the following scenario:
If we consider worldwide interest rate, say, US interest rate r as the propagation
of quantum particle Qr.
The change of interest rate Qr during a period of time T from state QrS to QrF
can be formulated by Feynman path integral formulation:
2.4 Feynman’s Path Integral 33
T .
i dtL Qr,Qr
QrF e−iHT QrS = ∫ DQr(t)e 0 (2.19)
In fact, it is one of the major applications of QFT in finance for the past 15 years.
Besides path integral formulation, are there any other similar financial instru-
ment(s) can be used?
Figure 2.13 shows the US federal interest rate from 1955 to 2015 in four different
timeframes. In Chap. 3, we will explore how to model forward interest rates in differ-
ent timeframes with quantum finance by using Feynman’s path integral technique.
p̂2 1 p̂2 1
Ĥ = + k x̂2 = + mω2 x̂2 (2.22)
2m 2 2m 2
where m = mass ofthe quantum particle; k is the force constant; x̂ is the position
operator; p̂ = −i∂ ∂x is the momentum operator; and ω is the angular frequency.
The solution of 1D-QHO is given by
mω 1/4
1 mω
ψn (x) = √ · · e−iωt · Hn x (2.23)
2n n! π
n = 0, 1, 2, …
where n = 0, 1, 2, …; ψn is the wave function and n is the quantum number.
The corresponding discrete energy levels are given by
1
En = ω n + = (2n + 1) ω, n = 0, 1, 2, . . . (2.24)
2 2
Note that E0 corresponds to the ground state and all n > 0 are discrete excited
states.
Figure 2.14 shows the different dynamics in classical versus quantum har-
monic oscillators. Figure 2.14A and B illustrate the classical harmonic oscillators;
Fig. 2.14C–H illustrate the quantum harmonic oscillators—solutions according to
Schrödinger equation, where the horizontal axis is particle position, and the vertical
axis is the real part (blue) or imaginary part (red) of the wave function.
Using the same logic of 1D QHO, the N-dimensional QHO is exactly analogous to
N independent one-dimensional harmonic oscillators with identical mass and spring
constant.
In this case, the quantities x1 , …, xN would refer to the positions of each of the N
quantum particles.
The Hamiltonian is given by
N p2 1
H= i
+ mω xi
2 2
(2.25)
i=1 2m 2
For a particular set of quantum numbers (n), the energy eigenfunctions for the N-
dimensional oscillator are expressed in terms of the one-dimensional eigenfunctions
as
2.5 Quantum Oscillators 35
N
x|ψn = xi |ψn (2.26)
i=1
Even though quantum harmonic oscillator (QHO) can explain many quantum phe-
nomena and wave–particle dualities for simple quantum particles, however, for real-
world applications, many quantum particles and quantum phenomena involve the
anharmonic oscillations (Gilyarov and Slutsker Slutsker 2010).
Figure 2.16 shows an HCl molecule as an anharmonic oscillator (Padilla and Pérez
2012) vibrating at energy level E3 . D0 is the dissociation energy, r0 is the bond length,
and U is the potential energy. Energy is expressed in wavenumbers. The hydrogen
chloride molecule is attached to the coordinate system to show bond length changes
on the curve.
The Hamiltonian of a typical quantum anharmonic oscillator (QAHO) is given by
p2 1
H= + mω2 x2 + λxk (2.28)
2m 2
where λ is the damping coefficient and k is the order of QAHO.
Commonly found QAHOs include
Cubic QAHO with k = 3:
p2 1
H= + mω2 x2 + λx3 (2.29)
2m 2
Quartic QAHO with k = 4:
p2 1
H= + mω2 x2 + λx4 (2.30)
2m 2
Sextic QAHO with k = 6:
2.5 Quantum Oscillators 37
p2 1
H= + mω2 x2 + λx6 (2.31)
2m 2
λx2m -class QAHO—a special class of QAHO which provides a genius way of
solving these high-order AHO equations.
p2 1
H= + mq ω2 x2 + λx2m (2.32)
2mq 2
In quantum finance theory, we have deduced that the quantum dynamics of price
return (r) for any financial market is in fact a kind of quartic quantum anharmonic
oscillations, which is also a special case of λx2m -class QAHO with m = 2. Detail
mathematical derivation along with numerical analysis to solve important quantum
finance equation will be studied in Chaps. 4 and 5.
38 2 Quantum Field Theory for Quantum Finance
2.6 Conclusion
In this chapter, we introduced a general overview of four major concepts and models
in quantum theory: (1) quantum mechanics, (2) quantum field theory, (3) Feynman’s
path integral, and (4) quantum anharmonic oscillators.
These four concepts with models in quantum theory form critical mass to estab-
lish the basic theoretical and mathematical models in quantum finance theory in
next chapter, namely, (1) Feynman’s path integral model of quantum finance (also
known as first generation of quantum finance); and (2) quantum anharmonic model
of quantum finance (also known as second generation of quantum finance).
To avoid complex mathematical derivations, this chapter focused on the basic
concepts of quantum theory with its related models which are critical to understand
the mathematical and quantum model in quantum finance. For readers who are inter-
ested to explore in-depth mathematical models and quantum theory, please refer to
the reference section at the end of this chapter.
Problems
2.1 Before quantum mechanics, what are the two main streams of theories govern
the laws of physics and how quantum mechanics are difference with these
theories?
2.2 We always say 1920s are the key years for the birth of quantum mechanics. Who
are the two key figures in the course of the development of the basic concepts
and theories in quantum mechanics and discuss their major contributions?
2.3 What is the physical importance of Schrödinger equation in terms of the inter-
pretation of wave–particle duality phenomena?
2.4 What are the three most important experiments in the 1920s for the interpreta-
tion and illustration of wave–particle duality in quantum mechanics? Discuss
and explain their findings and importance. Can they be interpreted in financial
markets? How?
2.5 Discuss and explain briefly Heisenberg’s uncertainty principle in quantum
mechanics. How can such phenomena relate to modern finance?
2.6 What is the basic difference between a quantum field and classical field? How
can quantum field be interpreted in terms of financial markets?
2.7 Discuss and explain quantization phenomena in quantum theory. How can it
have been related to quantum finance? What are the ground-state and various
excited energy levels in quantum finance?
2.8 Discuss and explain quantum entanglement in quantum theory. How can it be
interpreted in quantum finance?
2.9 What is quantum computing? Discuss and explain briefly the basic concept and
how it is related to quantum finance.
References 39
References
Assche, G. (2006) Quantum Cryptography and Secret-Key Distillation. Cambridge University Press;
1 edition.
Baaquie, B. (2018) Quantum Field Theory for Economics and Finance. Cambridge University Press.
1st edition.
Becherrawy, T. (2012) Electromagnetism: Maxwell Equations, Wave Propagation and Emission.
Wiley-ISTE; 1 edition, 2012.
Blaise, P. and Henri-Rousseau O. (2011) Quantum Oscillators. Wiley.
Bohr, N. (1913) On the Constitution of Atoms and Molecules, Part I” (PDF). Philosophical Maga-
zine. 26 (151): 1–24.
Davisson, C. J. and Germer, L. H. (1928) Reflection of Electrons by a Crystal of Nickel. Proceedings
of the National Academy of Sciences of the United States of America. 14 (4): 317–322.
Einstein, A. (1905) Über einen die Erzeugung und Verwandlung des Lichtes betreffenden heuristis-
chen Gesichtspunkt [On a Heuristic Viewpoint Concerning the Production and Transformation
of Light]. Annalen der Physik (Berlin) (in German). Hoboken, NJ (published 10 March 2006).
322 (6): 132–148.
Einstein, A., Podolsky, B., Rosen, N. (1935) Can Quantum-Mechanical Description of Physical
Reality Be Considered Complete? Physical Review 47 (10): 777–780.
Feynman, R. P. (1948) Space-Time Approach to Non-Relativistic Quantum Mechanics. Reviews of
Modern Physics. 20 (2): 367–387.
Feynman, R. P.; Hibbs, A. R. (1965) Quantum Mechanics and Path Integrals. New York: McGraw-
Hill.
Gilyarov V. L. and Slutsker, A. I. (2010) Energy features of a loaded quantum anharmonic oscillator.
Physics of the Solid State 52(3): 585–590.
Heisenberg, W. (1925) Über quantentheoretische Umdeutung kinematischer und mechanischer
Beziehungen. Zeitschrift für Physik. 33 (1): 879–893.
Laloë, F. (2012) Applications of quantum entanglement. In Do We Really Understand Quantum
Mechanics? Cambridge University Press, 150–167.
PoorLeno (2019) Hydrogen Density Plots. https://commons.wikimedia.org/w/index.php?title=File:
Hydrogen_Density_Plots.png&oldid=343305978. Accessed 21 Aug 2019.
Padmanabhan, T. (2016) Quantum Field Theory: The Why, What and How (Graduate Texts in
Physics). Springer.
Padilla A. and Pérez, J. (2012) A Simulation Study of the Fundamental Vibrational Shifts of HCl
Diluted in Ar, Kr, and Xe: Anharmonic Corrections Effects. International Journal of Spec-
troscopy, 2012: 1–7.
Planck, M. (1901) Ueber das Gesetz der Energieverteilung im Normalspectrum [On the law of the
distribution of energy in the normal spectrum]. Annalen der Physik. 4 (3): 553–563.
Plotnitsky, A. (2010) Epistemology and Probability: Bohr, Heisenberg, Schrödinger, and the Nature
of Quantum-Theoretical Thinking (Fundamental Theories of Physics). Springer.
Sen, A. (1926) Quantum Entanglement and its Applications. Current Science 112(7): 1361, 2017.
Schrödinger, E. An Undulatory Theory of the Mechanics of Atoms and Molecules. Physical Review
28: 1049–1070.
Schrödinger, E. (1935) Discussion of probability relations between separated systems. Mathematical
Proceedings of the Cambridge Philosophical Society. 31 (4): 555–563.
Yanofsky, N. S. and Mannucci, M. A. (2008) Quantum Computing for Computer Scientists. Cam-
bridge University Press; 1 edition.
Young, T. (1802) The Bakerian Lecture: On the Theory of Light and Colours. Philosophical Trans-
actions of the Royal Society of London. 92: 12–48.
Chapter 3
An Overview of Quantum Finance
Models
Second, we will study the two main branches of quantum finance models—Feyn-
man’s path integral model and the quantum anharmonic oscillator model.
Lastly, we will explore the future of quantum finance, and how it relates to the
development of intelligent finance systems.
In respect of quantum finance R&D of the past decades, there are basically two main
quantum models with significant impacts and research results in financial modeling
and applications. They are
1. Feynman’s path integral approach (Zee 2011; Swanson 2014) and
2. Quantum anharmonic oscillator approach (Bloch 1997).
44 3 An Overview of Quantum Finance Models
Fig. 3.1 Feynman’s path integral approach in quantum finance for government bond and interest
rate modeling
In the next two sections, we will review the basic concept and framework of
these two approaches in quantum finance. Figures 3.1 and 3.2 show the typical
applications of these two mathematical models on the modeling of forward interest
rate and quantum price levels in secondary financial markets, respectively.
Before we study the Feynman’s path integral approach in quantum finance for the
modeling of forward interest rate, let’s have an overview of forward interest rate in
finance.
From computational finance perspective, forward interest rate f (t, x) is the interest
rate fixed at time t ≤ x for an instantaneous (overnight) loan taken at future time x.
So, at any instant t, f (t, x) is a function of x (not t) that can be visualized as a 1D
path in the future time domain (x) satisfy (x ≥ t), as shown in Fig. 3.3.
3.4 Feynman’s Path Integral Approach in Quantum Finance 45
Fig. 3.2 Quantum anharmonic model in quantum finance for quantum price level modeling (QFFC
2019)
Calendar Time
Future Time
With the initial condition f (tS , x) is fixed by the financial market, each point (t, x)
manifests itself in the functional domain (green area) and corresponds to one forward
interest rate incidence f (t, x).
Treasury bond is a risk-free financial instrument which has a single cash flow con-
sisting of a fixed payoff of, say, $1 at some future time T; its price at time t < T is
denoted by P(t, T ), with P(T , T ) = 1.
So, for a bond maturing at time T, its value P(t, T ) before maturity is given by
discounting P(T , T ) = 1 to the time t by the spot interest rate, given by
T T
P(t, T ) = E e− t dsr(s) P(T , T ) = E e− t dsr(s) (3.1)
where
1. E[] is the expectation value;
2. r(s) = f (s, s) is the spot interest rate.
Figure 3.4 shows the forward interest rate of Eurodollar futures from 1990 to 1996
with eight different maturities, ranging from 3 months up to 7 years.
To model the interest rate in respect of quantum field theory using Feynman’s path
integral, first take a look at the forward interest rate of Eurodollar futures from 1990
to 1996 with eight different maturities, ranging from 3 months up to 7 years as shown
in Fig. 3.5.
If we look carefully, we can find certain interesting features from this chart:
1. All these forward interest rate time series appeared to be highly chaotic but have
a certain shared pattern. In Chap. 8—chaos and fractals in quantum finance—we
will study such kind of chaotic phenomena—so-called deterministic chaos, a
vital feature and phenomena in financial engineering.
2. All these curves are basically randomly evolved in time, but in a highly co-related
manner, basically without any line crossings.
In other words, the interest rate function f (t, x) can be assumed to be independent
variable w.r.t. to all x and t values.
Let A(t, x) be a two-dimensional quantum field, and the quantum interest rate
model is given by Baaquie (2004)
3.4 Feynman’s Path Integral Approach in Quantum Finance 47
Fig. 3.4 Forward interest rate of Eurodollar Futures from 1990 to 1996
Interest Rate ψr
tS tF
Time (t)
∂f (t, x)
= α(t, x) + σ (t, x)A(t, x) (3.2)
∂t
48 3 An Overview of Quantum Finance Models
The Feynman’s path integral for the forward interest rate is given by Baaqie (2013)
1
∫ DAeS[A] F[A]
E(F[A]) = (3.3)
Z
+∞
where DA = −∞ dA(t, x) and Z = DAeS[A]
(t,x)∈B
The time-dependent Hamiltonian is given by
∞ ∞
−1 δ2 δ
H (t) = dxdx M x, x ; t
− dxα(t, x) (3.4)
2 t δf (x)δf (x ) t δf (x)
where M x, x ; t = σ (t, x)D x, x ; t σ t, x
Note:
1. S[A] is the stiff action function, given by Baaqie (2013)
2
+∞ +∞
1 1 ∂A 2 1 ∂ 2A
S[A] = − dt dz A (t, z) + 2
2
(t, z) + 4 (t, z)
2 tS 0 μ ∂z λ ∂z 2
(3.5)
3.5.1 Motivation
One of the major characteristics of quantum theory is the wave–particle duality which
can be described by the Schrödinger equation.
Time-dependent Schrödinger equation:
∂ 2 ∂ 2
i Ψ (x, t) = − + V (x, t) Ψ (x, t) (3.6)
∂t 2m ∂ 2 x
Instead of solving quantum dynamics’ problem by integrating all (in fact is infin-
ity) the possible paths from starting point S to end point F, why not focus on solving
the Schrödinger equation directly using numerical method (numerical approxima-
tion)?
Imagine: if we can solve this equation numerically (i.e., instead of analytically),
say, into an n-order polynomial with differential operators, together with the inte-
gration of finite difference method (FDM). Technically speaking, we can implement
such algorithm into a computer program for actual implementation (not simulation).
Actually, such notion is more important to tackle real-world problems with numer-
ous time series data such as weather and finance.
As we will see, anharmonic oscillation (AHO) provides an excellent analog of
Schrödinger equation for the modeling of quantum dynamics (3.6) and quantum
energy levels (3.7).
In fact, many atomic/subatomic particles’ dynamics in the real world can be
described in terms of quantum anharmonic oscillation (QAHO) as shown in Fig. 3.6.
It shows the quantum anharmonic oscillator model for HCI molecules and their
corresponding quantum energy well.
trading such as commodities, financial indices, and forex between market maker
(MM) and investors.
In other words, the objective of QAHO modeling in quantum finance targets at
quantum dynamics and quantum energy levels for market instruments involve in the
secondary markets, forex market, for example (Fig. 3.7).
So, the natural and most fundamental question is: What market instrument(s) we
should model? Prices, indices, price returns, price deviations…?
To answer this question, we should ask this vital question:
If financial market is really a quantum phenomenon, that is, the motions, fields,
and dynamics of quantum particles, what are the financial particles we are talking
about? Or what is the best analog of the displacement x (from the equilibrium state)?
Price or price returns or …?
Why?
If we want to make the best analog of quantum particle displacement from the
equilibrium position, naturally we should choose price return (r) with two major
reasons:
1. Return (r) in finance is an important financial instrument to reflect the relative
change of financial behavior (say stock price) within a fixed period of time (say,
daily returns), which directly analog to physical meaning of quantum theory for
the definition of x which relates to displacement to the equilibrium position; and
2. Use of return (r) to model financial market in quantum finance is totally coherent
classical and statistical finance theories which all use price return for financial
market modeling and statistical analysis.
So how about Prices? Is there any significance of price in quantum finance?
The answer is: very important.
As analog to gravitational field, one can imagine if all financial instruments are
quantum financial particles, what will be the quantum field?
52 3 An Overview of Quantum Finance Models
The natural logic should be the quantum financial energy field, QFEF (or quantum
energy field in short) created by itself (just like gravitation field created by graviton)
and/or QFEF created by other financial particles (in other financial markets).
So, to analog the potential energy in gravity and electromagnetic field (EM field),
quantum price energy levels (or quantum price levels, QPLs in short) are the quantum
finance quantity to describe the quantized energy field acting onto the quantum
financial particles.
where p(t) is the price (say stock price) at time t and Δt denote the time interval.
The analog motions and dynamics of (stock) price to a quantum particle (namely,
quantum financial particles, QFPs), price return (r) will be a direct analog to the
displacement (x) of a quantum particle from its equilibrium state, assuming they are
performing anharmonic oscillation (as we will see shortly).
So, quantum dynamics of the quantum financial particle are given by Schrödinger
equation:
∂
i ψ(r, t) = H ψ(r, t) (3.9)
∂t
H is the Hamiltonian operator given by
2 ∂ 2
H =− + V (r, t) (3.10)
2m ∂ 2 r
2 ∂ 2
H =− + V (r, t) (3.10)
2m ∂ 2 r
3.5 Quantum Anharmonic Oscillator Approach in Quantum Finance 53
consists of two parts, K.E. (first part) and P.E. (second part). K.E. corresponds to
quantum motion of the quantum financial particle (QFP), and P.E. corresponds to
potential energy (well) generated by the quantum energy field of QFP itself (or other
QEF generated by other QFPs in multidimensional financial markets).
The reduced Planck’s constant can be considered as the uncertainty of irrational
transaction and m represents the intrinsic properties of financial market such as
market capital in a stock market.
Corresponding to the stationary market environment in classical computational
finance theory (CFT), we can analog such quantum dynamics as time-independent
Schrödinger equation, given by
Or
2 ∂ 2
− + V (r) ϕ(r) = Eϕ(r) (3.12)
2m ∂ 2 r
where Q(r, t) is the probability density function for a series of observations (mea-
surements) of a financial market.
Figure 3.8 shows the statistics (i.e., probability density function) of XAUUSD
(gold w.r.t. USD) daily returns in the past 2048 time series observations. We will
study in detail quantum price level (QPL) evaluation in Chap. 5.
In an efficient market with stationary market environment, the probability density
function should behave as normal distribution coherent classical statistical finance
theory. The distribution itself should be characterized by its statistical indicators such
as mean, variance, and kurtosis.
What is the physical meaning of distribution in terms of quantum theory?
54 3 An Overview of Quantum Finance Models
0.045
0.04
0.035
0.03
Q(r)
0.025
0.02
0.015
0.01
0.005
0
0.97 0.98 0.99 1 1.01 1.02 1.03
Daily Return (r)
Δz = z+ − z− (3.14)
dp
= r(t) = F(Δz) (3.15)
dt
3.5 Quantum Anharmonic Oscillator Approach in Quantum Finance 55
Δz
r(t) = (3.16)
γ
where γ represents market depth, the excess demand z required to move quantum
price p by one single quantum.
So we have
dr d 2p 1 d (Δz)
= 2 = (3.17)
dt dt γ dt
d 2r dr d V (r)
mr = −η − (3.19)
dt 2 dt dr
where
mr mass of the financial particle p;
η damping force factor;
V (r) time-independent quantum potential.
d 2r
For overdamping case where dt 2
= 0, we have
d V (r) dr
− = η = −γ ηδr + γ ηυr 3 (3.20)
dr dt
γ ηδ 2 γ ηυ 4
V (r) = −γ ηδr + γ ηυr 3 dr = r − r (3.21)
2 4
− d 2 γ ηδ 2 γ ηυ 4
+ r − r ϕ(r) = Eϕ(r) (3.22)
2m dr 2 2 4
CONS • To calculate expectation value of wave function, integrations of all • As QAHO is based on polynomial approximation of differential
the possible paths are required equation(s) of QM and QFT, calculation results are basically the best
• Technically possible, but mathematically too complex to calculate approximation of these quantum finance instrument values
and implement for commercial use • Owing to the polynomial approximation nature and sensitivity to
initial conditions (which is approximation in natural), error-prone for
market forecast, especially when the time horizon extends
57
58 3 An Overview of Quantum Finance Models
The comparison chart listed in Sect. 3.6.1 showed that both Feynman’s path integral
approach and quantum anharmonic oscillator approach have pros and cons. Further,
both approach methods head to different area applications in finance engineering.
Owing to its intrinsic property of modeling the detail paths with their dynamics of
every quantum financial particle, Feynman’s path integral approach is well suited for
modeling quantum dynamics on primary financial markets (PFMs) such as interest
rates, forward interest rates of contracts and bonds, plus issue new securities in
stock markets. It is the first generation of quantum finance modeling technique being
studied and explored in the finance engineering realm, also known as first-generation
quantum finance. However, the intrinsic property of its computational complexity
entails Feynman’s path integral method, especially when dealing with financial big
data which consist of infinite numbers of possibility (i.e., paths), such methods are
difficult to be applied to real-time worldwide financial engineering (Fig. 3.9).
Quantum anharmonic oscillator approach, on the other hand, models quantum
financial world as anharmonic oscillations of quantum financial particles. The major
breakthrough is the conversion of classical Schrödinger equation into simpler quan-
tum anharmonic equations. Thus, the equations can be solved by simple numerical
calculation using digital computational method to be revealed in Chaps. 4 and 5. Such
major breakthrough leads us to apply quantum finance technology into real-world
financial engineering, with the integration of contemporary AI tools to implement
real-time financial prediction and quantum trading systems. This approach is the
latest mathematical technique for quantum finance modeling, also known as second
generation of quantum finance. However, since this model is tailored for solving
QFSE and the evaluation of all related quantum financial energy level known as
quantum price levels (QPLs) to be revealed in Chaps. 4 and 5, it is well suited for the
application to all financial products in secondary financial markets (SFMs) such as
worldwide forex markets, commodity markets, financial indices, and cryptocurrency
market.
Like any other theory and technology, quantum finance—as a newly emerging
theory—should and ought to adopt any possible and workable theory, methodology,
and technology to make it more useful, practical, and comprehensible, not solely on
research but also for public and financial community.
Especially for the exponential growth of program trading, there are tremendous
needs for intelligent financial forecasting and trading tools, not solely for the insti-
tutional clients and fund houses but more importantly for independent traders and
investors—to provide an open and fair environment for worldwide investment.
As one would expect, the implementation of quantum price levels calculation is
a good start, but it is also just the beginning of the journey.
The major challenges we are facing are how to make use of it, together with other
AI tools and technology, and to design and build intelligent financial forecast and
smart trading programs, which will be studied in the following chapters.
3.7 Conclusion 59
3.7 Conclusion
Every discipline of technology has its own course and history. In this chapter, we
discussed the brief history of quantum finance, from Professor L. Bachelier’s Theory
of Speculation in 1900 to the latest works on quantum anharmonic oscillator theory of
quantum finance. We also studied the latest research and studies of quantum finance
in the past 30 years.
Through these, we focused on the discussion of two major mathematical
approaches and models of quantum finance—(1) Feynman’s path integral approach
and (2) quantum anharmonic oscillator approach. We reviewed their basic concepts,
principal features, and financial and mathematical implications with their signifi-
cances in the modeling of real-world financial markets.
The applicability of any new theory and technology must fulfill three challenges:
1. physically sound,
2. mathematically logical, and
3. computationally feasible.
60 3 An Overview of Quantum Finance Models
Physically sound means that such model and theory must be aligned with the
physical world of reality it represents, in our case, the quantum world of worldwide
financial markets.
Mathematically logical means that all the mathematical models and frameworks
should be aligned with contemporary theoretical, mathematical research and studies.
Computationally feasible means that the new model and theory must be practically
feasible to be adopted as computer models, algorithms, and computer systems for
real-time modeling of financial market.
In next chapter, we will study how quantum anharmonic oscillator of quantum
finance can be physically and mathematically sound for the modeling of worldwide
secondary financial markets. In Chap. 5, we will further explore how such technology
is computationally feasible and effective to model and evaluate quantum price levels
(QPLs), which provides a critical mass to implement real-time worldwide financial
predication and quantum trading systems.
Problems
3.1 Why Richard Feynman in his famous quotation said the two apparently dissim-
ilar approaches in quantum mechanics (1) differential equation formulation of
Schrödinger and (2) matrix algebra formulation of Heisenberg are in fact to
be mathematically equivalent?
3.2 What is computational finance? Discuss and explain what are the major dif-
ferences between computational finance and classical finance.
3.3 State and explain the two major branches of quantum finance models and how
they are related with quantum field theory and modern quantum mechanics.
3.4 What is econophysics? Discuss and explain how modern physics affect and
contribute to the development of modern economic and finance theories. Give
three modern economic/finance theories as example.
3.5 What is/are the major contribution(s) of L. Bachelier in modern finance?
3.6 Why mainstream econophysicists traditionally considered finance as an appli-
cation of Brownian motion? And how such notion is important to the devel-
opment of finance and economic theories in the past century?
3.7 State and discuss three applications and R&D works of quantum finance done
in the past two decades.
3.8 What is Feynman’s path integral approach in quantum finance? And how it
can be applied to forward interest rate modeling?
3.9 What are the differences between primary versus secondary financial markets?
Discuss and explain why Feynman’s path integral approach is best to be applied
in primary financial markets instead of secondary financial markets.
3.10 What is forward interest rate? Why is it important to financial markets?
3.11 Figure 3.5 shows the forward interest rates of Eurodollar futures from 1990 to
1996, with eight different maturities ranging from 3 months to 7 years. State
and explain three characteristics found from Fig. 3.5 in terms of
(i) the coherence of the eight chart patterns;
3.7 Conclusion 61
(ii) the ordering of these patterns in terms of the period of maturity; and
(iii) the crossings of chart patterns.
3.12 State and explain the formulation of forward interest rate modeling using
Feynman’s path integral in quantum finance.
3.13 Describe and explain the physical meaning and logic behind interest rate mod-
eling using Feynman’s path integral in quantum finance.
3.14 What are the major pros and cons for the modeling of forward interest rate
using Feynman’s path integral in quantum finance?
3.15 In addition to the modeling of forward interest rate, what are the other potential
applications of Feynman’s path integral in quantum finance?
3.16 What is quantum anharmonic oscillator approach in quantum finance? State
and explain how it works.
3.17 For financial markets modeling, we usually use price returns (r) instead of
price (p) directly, why? Give two examples of financial markets to support
your explanation.
3.18 What is the major difference between quantum anharmonic oscillator approach
versus Feynman’s path integral approach in quantum finance?
3.19 Discuss and explain why quantum anharmonic oscillator approach is tailored
for the modeling of secondary financial markets instead of primary financial
markets.
3.20 Discuss and explain physical and mathematical meanings of price (p), price
returns (r), and quantum price levels (QPLs) in quantum finance using anhar-
monic oscillator model, using Dow Jones Index (DJI) as example to support
your explanation.
3.21 What is the physical meaning of Hamiltonian (H) in Schrödinger equation of
quantum finance? What are K.E. and P.E. parts? And how they are related in
financial market’s dynamics in quantum finance?
3.22 What is the physical meaning and importance of eigenenergy values of the
time-independent Schrödinger equation in quantum finance?
3.23 What is the physical meaning and importance of probability density function
(and its values) in quantum finance? And how can we observe/ measure it in
real-world financial markets?
3.24 How can we interpret classical statistical finance theory using quantum finance
theory? And how it is related to wave–particle duality phenomena in quantum
theory?
3.25 What is market depth in modern finance? What is its importance? What is the
mathematical interpretation of market depth in quantum finance?
3.26 State and explain the formulation and physical meaning of each mathematical
term of Langevin equation in quantum finance.
3.27 State and explain the main characteristics of quantum finance Schrödinger
equation (QFSE).
3.28 What are the significances of quantum finance Schrödinger equation (QFSE)?
Give two examples of how to apply QFSE for the modeling of financial mar-
kets.
62 3 An Overview of Quantum Finance Models
3.29 Discuss and explain the pros and cons for the modeling of quantum finance
using (1) Feynman’s path integral approach and (2) quantum anharmonic oscil-
lator approach.
3.30 For the modeling of forex/cryptocurrency market, such as short-term financial
prediction, which approach is more referable? Why?
References
Ataullah, A., Davidson I. and Tippett, M. (2009) A wave function for stock market returns. Physica
A: Statistical Mechanics and its Applications. 388(4): 455–461.
Baaquie, B. E. (2004) Quantum Finance. Cambridge University Press.
Baaquie, B (2007) Quantum Finance: Feynman’s Path Integrals and Hamiltonians for Options and
Interest Rates. Cambridge University Press, 1st edition.
Baaquie, B. E. (2013) Financial modeling and quantum mathematics. Computers and Mathematics
with Applications. 65(10): 1665–1673.
Baaquie, B. (2018) Quantum Field Theory for Economics and Finance. Cambridge University Press.
1st edition.
Bachelier, L. (1900) Théorie de la speculation. Annales Scientifiques de l’École Normale Supérieure,
3(17): 21–86.
Bagarello, F. (2009) A quantum statistical approach to simplified stock markets. Physica A: Statis-
tical Mechanics and its Applications. 388(20): 4397–4406.
Bloch, S. C. (1997) Introduction to Classical and Quantum Harmonic Oscillators. Wiley, 1st edition.
Cotfas, L. (2013) A finite-dimensional quantum model for the stock market. Physica A: Statistical
Mechanics and its Applications. 392(2): 371–380.
Gao, T. and Chen, Y. (2017) A quantum anharmonic oscillator model for the stock market. Physica
A: Statistical Mechanics and its Applications. 468: 307–314.
Kim, M. J., Kim, S. Y. Hwang, D. I., Lee, S. Y. (2011) The sensitivity analysis of propagator for
path independent quantum finance model. Physica A: Statistical Mechanics and its Applications.
390(5): 847–863.
Mantegna, R. M. and Stanley, H. E. (1999) Introduction to Econophysics: Correlations and Com-
plexity in Finance. Cambridge University Press, 1st edition.
Meng, X., Zhang, J. and Guo, H. (2015) Quantum spatial-periodic harmonic model for daily price-
limited stock markets. Physica A: Statistical Mechanics and its Applications. 438: 154–160.
Nakayama, Y. (2009) Gravity dual for Reggeon field theory and nonlinear quantum finance. Inter-
national Journal of Modern Physics A. 24(32): 6197–6222.
Nasiri, S., Bektas, E. and Jafari, G. R. (2018) The impact of trading volume on the stock mar-
ket credibility: Bohmian quantum potential approach. Physica A: Statistical Mechanics and its
Applications. 512: 1104–1112.
Piotrowski, E. W. and Sładkowski, J. (2005) Quantum diffusion of prices and profits. Physica A:
Statistical Mechanics and its Applications, 345(1–2): 185–195.
QFFC (2019) Official site of Quantum Finance Forecast Center. http://qffc.org. Accessed 22 Aug
2019.
Schaden, M. (2002) Quantum finance. Physica A: Statistical Mechanics and its Applications.
316(1–4): 511–538.
Shi, L. (2006) Does security transaction volume-price behavior resemble a probability wave? Phys-
ica A: Statistical Mechanics and its Applications. 366: 419–436.
Swanson, M. S. (2014) Feynman’s Path Integrals and Quantum Processes (Dover Books on Physics).
Dover Publications.
References 63
Fig. 4.1 Illustration of quantum financial field for worldwide financial products
4.1 Quantum Finance Theory 67
QPLs of worldwide financial markets using quantum mechanics and quantum field
theories. Such quantum finance model must be logically sound and should be a
coherent body of classical finance concepts and models.
If dynamics and motions of all fundamental particles found in the physical world
are governed by quantum mechanics and quantum field theory as mentioned in
Chap. 3, it is reasonable and rational to say that the worldwide financial markets—
more precisely—are the price/index movements of all different financial instruments
in every single time step, which are believed as results of the collective conscious,
behavior, and decision-making of all participants in the markets that can also be
modeled by quantum theory without exception.
The only problem is: How can we model them in terms of quantum mechanics
and quantum field theory?
More importantly, how to implement these mathematical models in a logical,
sensible, and effective manner so that they can apply and implement them in any
digital computers?
There is one pivotal analog of quantum finance theory and classical quantum theory
is the notion of the fundamental particles in quantum finance—quantum price.
From the finance perspective, we are all familiar with that the current price (spot
price) of any financial product not only represents instantaneous price value but also
the price level (a kind of energy level in finance) that resides at every particular
moment as shown in Fig. 4.2.
In other words, in classical finance, price itself is not only a scalar value, but in
some way; it also represents the intrinsic energy it possesses (analog to the potential
energy in classical mechanics). In terms of classical finance, the meaning of price
for any financial market has three different interpretations:
1. It represents the instantaneous price value of that particular financial product at
a particular time;
2. It represents the time of the particular financial product which reaches that par-
ticular price value. That’s why when we say the price of a particular financial
product (e.g., stock), we also speak about the time;
3. It represents that intrinsic energy of that financial product at a particular time,
which similar to the interpretation for the potential energy of objects and matters
in the physical world.
As analog to quantum theory, it is similar to the particle existed and influenced
by its own quantum potential well (Harrison and Valavanis 2016). Figure 4.3 shows
a typical example of the quantum potential energy well generated by a quantum
particle (e.g., an atom).
The truth is: the analog of financial particles in quantum finance theory using
quantum theory is even more sensible and understandable in the finance community
than the notion of quantum particles in its quantum field. The only concern is: How
can we make use of classical finance concepts and beliefs to establish quantum
dynamics of quantum finance particles?
Fig. 4.3 Quantum potential energy level well generated by a quantum particle (e.g., an atom)
4.1 Quantum Finance Theory 69
It was recalled that in quantum theory, any quantum particle shown in Fig. 4.4 at
position x, the time-dependent Schrödinger equation (Zee 2011) is given by
∂
i ψ(x, t) = Ĥ ψ(x, t) (4.1)
∂t
where ψ(x, t) is the wave function, Ĥ is the Hamiltonian operator, and is the
reduced Planck constant, whereas the corresponding time-independent counterpart
is given by
where
− ∂ 2
Ĥ = + V (x) (4.3)
2m ∂x2
where Ĥ comprises kinetic energy, K.E. (first term) + potential energy, P.E. (second
term).
Fig. 4.4 Illustration of quantum particle in the subatomic world (Tuchong 2019b)
70 4 Quantum Finance Theory
Let r be the price return of a particular quantum financial particle (QFP) at time t
(say USD/CAD or simply US Index).
We can rewrite Schrödinger equation in (4.1) as
∂
i ψ(r, t) = Ĥ ψ(r, t) (4.4)
∂t
− ∂ 2
Ĥ = + V (r, t) (4.5)
2m ∂r 2
where
1. Ĥ comprises K.E. (kinetic energy, the first term) and P.E. (potential energy, the
second term);
2. is the Planck constant representing the uncertainty of financial behavior;
3. m is the mass representing the intrinsic potential of financial market, such as the
market capitalization of a particular financial product in financial market.
As mentioned in Chap. 3, the usage of price returns (r) instead of price (p) itself
is threefold:
1. Use price returns (r) instead of price (p) on mathematical and statistical modeling
is a kind of de facto standard in classical financial and statistical finance theory;
2. It is more sensible and easier to implement, especially if we want to compare
the performance of two (or more) financial products. By using price return (r)
instead of price (p), even when the two financial products have totally different
orders of magnitude, e.g., Dow Jones Index versus CADUSD, one is at order
1 × 104 and the other at order of 1 × 101 ;
3. In terms of quantum theory, the physical meaning of x in time-dependent
Schrödinger equation (4.1) is the displacement of quantum particle relative to its
equilibrium position, and not the distance of travel in classical mechanics as in
Newton’s laws of motion. Therefore, it is obvious and more sensible to use price
return (r) instead of price (p) as physical interpretation of r (say daily return) can
be considered as the relative price change of that particular financial product at
present compared with its closing price of the previous trading day.
4.2 Quantum Finance Model 71
Wave function (ψ) is the most important component in the entire quantum theory. It is
the realization of wave–particle duality of quantum particles, which can be considered
as the bridge to link up between particle and wave realms in the subatomic world as
shown in Fig. 4.5.
What is the wave function (ψ) in quantum finance?
Can we observe it, or measure it?
As recalled that in the “double-slit experiment” (Aharonov et al. 2017), what we
saw in the backdrop screen is the realization of wave function from quantum particle
projections.
However, if we measure it “closely”, all wave-like phenomena will disappear. Can
we also recall that?
So, what shall we do?
Fig. 4.5 Solution of Schrödinger’s equation for quantum harmonic oscillators (left) with their
amplitudes (right)
72 4 Quantum Finance Theory
The wave function in quantum finance can be observed by using similar method.
For example, for a time series of 1000 trading days, we measure the closing price
return of these 1000 time steps and plot the probability density function (pdf ) of
price return r versus pdf of occurrence [0, 1] in order to analog ψ.
That is,
Once we have the financial model, the next step is to explore the dynamics which
means all motions and activities occur inside the model. That is: what are the dynam-
ics in a typical secondary financial market such as forex, commodity, or cryptocur-
rency?
In other words, what are the major participants in a financial market? What are
their behaviors?
For example, in forex market—the biggest OTC (over the counter) market in the
worldwide finance (Hull 2016), what are the key participants?
Figure 4.6 shows a framework in a typical secondary financial market (SFM) such
as worldwide forex markets (Strumeyer 2017).
The most common type of market maker is brokerage houses that provide purchase
and sale solutions for investors, in an effort to keep financial markets liquid.
Market maker can also be an individual intermediary, but due to the size of secu-
rities needed to facilitate the volume of purchases and sales, the vast majority of
market makers work on behalf of large institutions.
They sell to and also buy from clients, compensated by means of price differentials
for services in providing liquidity, reducing transaction costs, and facilitating trade.
They earn profit by the difference between the price at which they are willing to
buy a stock and the price that the firm is willing to sell it, also known as the market
spread or bid-ask spread.
Market maker also provides liquidity to their own firm’s clients, for which they
earn a commission.
In terms of investment dynamics, the main function is to maintain healthy market
liquidity or facilitate the efficient absorption of buy/sell orders (Fig. 4.7).
Arbitrageurs are traders that take advantage of a price difference between two or
more markets.
They look for an imbalance in the pricing of a security in two different markets
and buy it at the cheap price in one market to immediately sell it at the higher price
in the other market, making a profit on the difference (Hong et al. 2012; Matsushima
2013).
This kind of operation is called arbitrage.
74 4 Quantum Finance Theory
Speculators are important to market because they bring liquidity besides assume
market risk and, conversely, they can also have a negative impact on markets when
their trading actions result in a speculative bubble that drives up an asset’s price
to unsustainable levels. If a speculator believes that a particular asset is going to
increase in value, they may choose to purchase as much of the asset as possible.
This activity, based on the perceived increase in demand, drives up the price of the
particular asset. If this activity is seen across the market as a positive sign, it may
cause other traders to purchase the asset as well, further elevating the price. This can
result in a speculative bubble, where the speculator activity has driven the price of
an asset above its true value.
In terms of investment behavior, speculators differ from common investors in
the sense that they don’t have any risk control mindset. In other words, there is no
damping factor against market volatility in their investment strategies (Fig. 4.9).
hedging attempts to reduce the amount of risk, or volatility, associated with a secu-
rity’s price change (Yung and Liu 2009; Lin et al. 2009).
Hedging involves taking an offset position in a derivative in order to balance any
gains and losses of the underlying asset. Hedging attempts to eliminate the volatility
associated with an asset price by taking offset positions contrary to what the investor
currently has. The main purpose of speculation, on the other hand, is to profit from
betting on the direction in which an asset will be moving.
For example, taking a long position on a stock and a short position on another
stock with inverse price behavior or the portfolio risk control strategy we have just
mentioned (Fig. 4.10).
An investor is a person who allocates capital with the expectation of a future financial
return.
Types of investments include equity, debt securities, real estate, currency, com-
modity, token, derivatives such as put and call options, futures, forwards, etc.
That is, someone who provides a business with capital and someone who buys a
stock are both investors.
There are two types of investors, individual (independent) investors and institu-
tional investors.
Individual investor is a nonprofessional investor who buys and sells securities,
mutual funds, or exchange-traded funds (ETFs) through traditional or online broker-
age firms or savings accounts. Retail investors invest much smaller amounts than large
institutional investors, such as mutual funds, pensions and university endowments,
4.3 Financial Dynamics 77
and trade less frequently. But wealthier retail investors can now access alternative
investment classes like private equity and hedge funds.
Institutional investors (Davis and Steil 2004; Gabaix et al. 2006) are major players
in the financial market. They are the pension funds, mutual funds, and also some
private equity investors. Institutional investors account for about three-quarters of
the volume of trades on the New York Stock Exchange. They move large blocks of
shares and have tremendous influence on stock market’s movements.
In terms of investment dynamics, investors normally act as Trend Followers
together with certain degree of sense of risk control (i.e., certain degree of damping
factor against market volatility in their investment strategies) (Fig. 4.11).
Once we have the key player in financial market, how can we model their financial
dynamics?
The notion of excess demand (z).
In classical finance and microeconomics, excess demand is a function express-
ing excess demand for a product—the excess of quantity demanded over quantity
supplied—in terms of the product’s price and possibly other determinants. In a math-
ematical perspective, it is the product’s demand function minus its supply function.
78 4 Quantum Finance Theory
In a pure exchange economy, the excess demand is the sum of all agents’ demands
minus the sum of all agents’ initial endowments (Tian 2016; Momi 2010).
The price of the product is said to be the equilibrium price if it is such that the
value of the excess demand function is zero: which means, when the market is in
equilibrium, the quantity supplied equals the quantity demanded. In this case, it is
said that the market clears. If the price is higher than the equilibrium price, excess
demand will normally be negative, meaning that there is a surplus (positive excess
supply) of the product, and not all of it being offered to the marketplace is being
sold. If the price is lower than the equilibrium price, excess demand will normally
be positive, meaning that there is a shortage of demand in the financial market.
Mathematical Derivations
At any time t, z+ (t) and z− (t) denote the instantaneous demand and supply for the
financial asset.
The excess demand (z) at any instance is given by
Δz = z+ − z− (4.8)
dp
= r(t) = F(Δz) (4.9)
dt
For small Δz, F can be approximated by a scaling factor γ and become
Δz
r(t) = (4.10)
γ
4.4 Financial Dynamics and the Notion of Excess Demand 79
where γ can be used to represent the market depth, the excess demand z required
to move the quantum price p by one single quantum. Note that, when γ is high, it
means that the market has a higher absorbability to excess demand z against price
changes.
So, we have
dr d 2p 1 d (Δz)
= 2 = (4.11)
dt dt γ dt
According to the investment behaviors of all these five key participants in financial
markets, their corresponding quantum dynamics can be interpreted as follows.
Note:
1. Market makers (MMs) provide market facilitator services to absorb ALL out-
standing excess order z+ and z− .
2. α+ and α− are the market absorbability factors.
3. In terms of quantum dynamics, basically it is a quantum harmonic oscillator
(QHO) with ż± ∝ z± .
Combining with Eq. (4.8), we have
d Δz d (z+ − z− )
=
dt MM dt
MM
dz+ dz−
= −
dt MM dt MM
= −α+ z+ + α− z− (4.13)
α+ = α− = αMM (4.14)
So, we have
d Δz
= −αMM Δz (4.15)
dt MM
of the same product between different markets synchronize to their equilibrium states
at every moment.
Since speculators have no idea of risk control, their quantum dynamics only
contain the harmonic oscillator term (the delta term, δSP r), without any higher order
volatility term.
Note that, although speculators might happen to be trend follower (+δSP ), most
of the time their risk-taking nature will drive them to irrational speculation of market
reversals and act against the market (−δSP ).
As shown in Eq. (4.17), the existence of the only first-order return r means that
the entire quantum dynamics of speculators (SPs) is a simple quantum harmonic
oscillator (QHO) without any anharmonic component.
From the physical meaning perspective, the existence of the only first order of
return (r) in Eq. (4.17) means that dynamics of the speculators only exist the force
constant which is the same as the force constant for spring in Newton’s mechanics.
Hedgers (HGs) represent experienced and skillful traders (also known as sophisti-
cated traders) that apply sophisticated hedging strategies across different products
and markets. Further will be studied in Chap. 6.
Although they do not always act against the trend, their skills usually demonstrated
by reverse trading or prediction of market reversal and act before common investors.
So, their quantum dynamics are given by
d Δz
= − δHG − υHG r 2 r (4.18)
dt HG
Note that the quantum dynamics for a hedger has two terms: (1) quantum harmonic
oscillatory term (delta term)—proportion to return (r) and (2) quantum anharmonic
term (υ) stands for the market volatility, risk control factor proportional to r 2 .
82 4 Quantum Finance Theory
Note that, similar to hedgers, the quantum dynamics of an investor has two terms:
(1) quantum harmonic oscillatory term (delta term)—proportion to return (r) and
(2) quantum anharmonic term (υ) stands for the market volatility, risk control factor
proportional to r 2 .
But different from hedgers, common investors are usually trend followers (TFs),
so they are basically acting toward returns (r).
By combining quantum dynamics of all key participants in the financial market, the
overall quantum dynamics in a typical financial market is given by
d Δz d Δz d Δz d Δz d Δz
= + + + (4.20)
dt dt MM dt SP dt HG dt I V
d Δz
= −γ αMM r − δSP r − δHG − υHG r 2 r + δI V − υI V r 2 r (4.21)
dt
That is,
d Δz
= −δr + υr 3 (4.22)
dt
Combining Eq. (4.11), we have
dr d Δz
=γ = −γ δr + γ υr 3 (4.23)
dt dt
4.5 Quantum Dynamics in Financial Markets 83
where
δ = γ αMM + δSP + δHG − δI V (damping term) and
υ = υHG − υI V (volatility term)
The Brownian price return can be described by Langevin equation:
d 2r dr d V (r)
mr 2
= −η − (4.24)
dt dt dr
where
mr mass of the financial particle p;
η damping force factor;
V (r) time-independent quantum potential.
For the consistency of Eqs. (4.23) and (4.24), i.e., overdamping case where
d 2r
dt 2
= 0, we have
d V (r) dr
− = η = −γ ηδr + γ ηυr 3 (4.25)
dr dt
γ ηδ 2 γ ηυ 4
V (r) = −γ ηδr + γ ηυr 3 dr = r − r (4.26)
2 4
Note:
1. The time-independent Schrödinger equation of a quantum finance contains both
KE and PE terms.
2. Different from classical quantum harmonic oscillator, the quantum finance oscil-
lator is a quantum anharmonic oscillator which consists of two high-order PE
terms that represent (1) damping (trading restoration and market absorption)
potential and (2) volatility (risk control) potential.
3. Although the market is visualized (observed) as price, the quantum dynamics
4.6 Conclusion
In this chapter, we introduced the main theme of this book: quantum finance theory
using quantum anharmonic oscillator (QAOH) model. We began with quantum finan-
cial particles (QFPs) concept and their intrinsic quantum energy fields, the so-called
quantum price field (QPF). We also studied the notion of quantum price in quantum
finance and its relationship with quantum energy level. After that, we examined the
Schrödinger equation and explored the physical meaning of wave function (ψ).
We then studied the core of this chapter—the five key players in secondary
financial markets (SFMs)—market makers, arbitrageurs, speculators, hedges, and
investors. First, we analyzed their roles, characteristics, and behaviors in the finan-
cial market. After that, we introduced classical financial dynamics and the notion of
excess demand.
Based on the definition of excess demand, we derived quantum dynamics of
these five key parties and deduced the overall quantum dynamic equation of their
combined behaviors in secondary financial market. By combining with Eq. (4.11) and
the assumption of overdamping case, we derived the quantum finance Schrödinger
equation (QFSE) in form of an order-4 quantum anharmonic oscillator system.
An important issue of our step-by-step derivation of the QFSE is that we began
the entire mathematical modeling quantum dynamics of secondary financial market
based on classical belief and understanding in terms of classical finance and microe-
conomic theory. By doing so, we can ensure that the QFSE derived can be consistent
with basic financial concept and theory, despite we are now using completely new
perspective and tool to model the dynamics for secondary financial markets.
In the next chapter, we will explore how to use QFSE, in conjunction with numeri-
cal computational technique and finite difference method (FDM) to derive and evalu-
ate quantum finance energy level (QFEL), together with quantum price levels (QPLs)
for any financial products in secondary financial markets.
Problems
4.1 In the past, quantum theory including quantum mechanics and quantum field
theory are queried by many mainstream scientists and believed to be some
sort of “spooky” science. However, nowadays many scientists and general
community accept the general idea of quantum theory and the existence of
subatomic world. Why?
4.2 What is quantum computer? What is the major difference between quantum
computer and the contemporary computers we are using?
4.3 What is the analog between quantum particles in quantum theory and the
dynamics of the financial particles in financial markets? Give a live example
such as forex market for illustration.
4.6 Conclusion 85
(i) Write a MATLAB program to solve the Schrödinger’s equation for quan-
tum harmonic oscillators and plot these figures;
(ii) Describe their physical meanings in terms of quantum finance theory of
financial particles such as Dow Jones index (DJI);
(iii) Can we simply model quantum finance particles such as DJI using quan-
tum harmonic oscillators in reality? Why?
4.12 What is a secondary financial market (SFM)? What are the major differences
between primary financial market (PFM) and SFM? In each case, please give
two examples for illustration.
4.13 What is a market maker (MM)? Discuss and explain the role(s) and importance
of market maker in financial markets.
4.14 What are arbitrageurs? What are the major differences between arbitrageurs
and common investors in terms of (1) trading/investment strategy; (2) risk
control? Give two examples of financial markets for illustration.
4.15 What are speculators? What are the major differences between speculators and
common investors in terms of (1) trading/investment strategy; (2) risk control?
Why speculators are important in financial markets? Give two examples of
financial markets for illustration.
4.16 What are hedgers? What are the major differences between hedgers and com-
mon investors in terms of (1) trading/investment strategy; (2) risk control? Why
hedgers are important in financial markets? Give two examples of financial
markets for illustration.
4.17 Can an investor be both a hedger and speculator at the same time? Why or
why not? Give two examples of financial markets for illustration.
4.18 What are common investors (or investors in short)? What are the characteris-
tics of investors in terms of (1) trading/investment strategy; (2) risk control?
Why common investors are vital in financial markets? Give two examples of
financial markets for illustration.
4.19 Discuss and explain excess demand (z) in terms of (1) physical meaning in
financial markets; (2) mathematical formulation. How can it relate to quantum
finance?
4.20 State and explain the quantum finance formulations of the five key participants
in a typical financial market.
4.21 State and explain the principle of no arbitrage. Explain why it is important in
the formulation of the quantum dynamics of arbitrageurs in quantum finance.
4.22 What is an efficient market? Explain why it is important in the formulation of
the quantum dynamics of market maker in quantum finance.
4.23 What is quantum anharmonic oscillator (QAHO)? What is the major difference
between quantum harmonic oscillator (QHO) and its anharmonic counterpart
QAHO in terms of (1) quantum dynamics and (2) energy levels?
4.24 For the formulation of real-world financial market, should we choose quantum
harmonic oscillator (QHO) or quantum anharmonic oscillator (QAHO) for
system modeling and mathematical formulation? Why?
4.6 Conclusion 87
4.25 Combine the quantum finance mathematical formulation of all five key partici-
pants in a typical financial market and derive the quantum finance Schrödinger
equation.
4.26 State the time-independent quantum finance Schrödinger equation (QFSE).
(i) Describe and explain the physical meaning of each term in QFSE;
(ii) What is the physical meaning of (1) Planck constant, (2) mass, (3) damp-
ing factor η, gamma γ , and (4) delta δ terms in QFSE?
4.27 Discuss and explain the importance of quantum finance Schrödinger equation
(QFSE) in terms of (1) modeling of secondary financial markets and (2) real-
time financial prediction. Give two examples of secondary financial markets
as explanation.
References
Aharonov, Y. et al. (2017) Finally making sense of the double-slit experiment. Proceedings of the
National Academy of Sciences of the United States of America 114(25): 6480–6485.
Bhargava, V.T.A. et al. (1989) Anharmonic oscillators in higher dimension: Accurate energy eigen-
values and matrix elements. Pramana 32(2): 107–115.
Brunetti, C. et al. (2016) Speculators, Prices, and Market Volatility. Journal of Financial and
Quantitative Analysis 51(5): 1545–1574.
Čekauskas, K. et al. (2012) The Effects of Market Makers and Stock Analysts in Emerging Markets:
Market Makers and Stock Analysts. International Review of Finance 12(3): 305–327.
Davis, E. P. and Steil, B. (2004) Institutional Investors (The MIT Press). MIT Press.
Gabaix, X. et al. (2006) Institutional Investors and Stock Market Volatility. The Quarterly Journal
of Economics 121(2): 461–504.
Gao, T. and Chen, Y. (2017) A quantum anharmonic oscillator model for the stock market. Physica
A: Statistical Mechanics and its Applications. 468: 307–314.
Harrison, P. & Valavanis, A. (2016) Quantum Wells, Wires and Dots: Theoretical and Computational
Physics of Semiconductor Nanostructures, John Wiley & Sons.
Hong, H. et al. (2012) Do arbitrageurs amplify economic shocks? Journal of Financial Economics
103(3): 454–470.
Hull, J. C. (2016) Fundamentals of Futures and Options Markets. Pearson, 9th edition.
Lin, B. et al. (2009) Who bets against hedgers and how much they trade? A theory and empirical
tests. Applied Economics 41(27): 3491–3497.
Malkiel, B.G. (2003) The Efficient Market Hypothesis and Its Critics. The Journal of Economic
Perspectives 17(1): 59–82.
Matsushima, H. (2013) Behavioral aspects of arbitrageurs in timing games of bubbles and crashes.
Journal of Economic Theory 148(2): 858–870.
Momi, T. (2010) Excess demand function around critical prices in incomplete markets. Journal of
Mathematical Economics 46(3): 293–302.
Radalj, K.F. (2006) Hedgers, speculators and forward markets: Evidence from currency markets.
Environmental Modelling and Software 21(9): 1381–1386.
Röthig, A. (2011) On speculators and hedgers in currency futures markets: who leads whom?
International Journal of Finance & Economics 16(1): 63–69.
Schrödinger, E. (1926) An Undulatory Theory of the Mechanics of Atoms and Molecules. Physical
Review 28: 1049–1070.
88 4 Quantum Finance Theory
Strumeyer, G., Swammy, S. (2017) The Capital Markets: Evolution of the Financial Ecosystem
(Wiley Finance). Wiley.
Tian, G. (2016) On the existence of price equilibrium in economies with excess demand functions.
Economic Theory Bulletin 4(1): 5–16.
Tuchong (2019a) Stock Market Price Movement. http://stock.tuchong.com/image?imageId=
455757697366360685. Accessed 21 Aug 2019.
Tuchong (2019b) Illustration of quantum particle in the subatomic world. http://stock.tuchong.com/
image?imageId=488506530928001038. Accessed 21 Aug 2019.
Tuchong (2019c) Hedgers. http://stock.tuchong.com/image?imageId=75952820146313693.
Accessed 21 Aug 2019.
Yi, M. (2017) Speculator-triggered crisis and interventions. Journal of Macroeconomics 52:
135–146.
Yung, K. & Liu, Y. (2009) Implications of futures trading volume: Hedgers versus speculators.
Journal of Asset Management 10(5):318–337.
Zee, A. (2011) Quantum Field Theory in a Nutshell. Princeton University Press, 2nd edition.
Zhu, M. et al. (2009) Does the market maker stabilize the market? Physica A: Statistical Mechanics
and its Applications 388(15): 3164–3180.
Chapter 5
Quantum Price Levels—Basic Theory
and Numerical Computation Technique
In his famous quotation, Immanuel Kant pointed out that the important relation-
ship between concepts and ideas versus experiences and experimental observations
is that although concepts, ideas, and theories are the foundation and critical mass for
new knowledge, without solid objective experimental observations and experiences,
they are merely intellectual fantasies.
The merit of science against pseudoscience is that scientific theories and concepts
can be proved, deduced, and observed in the form of mathematical proven, deduction,
and tested objectively through experiments. Thus, scientific attitude is even more
critical in quantum theory because basic concept and theory of subatomic world and
its quantum phenomena are very different from our general belief of this physical
world.
The truth is: the mathematical framework of quantum theory has passed countless
successful tests with experiments and is now accepted universally as a uniform and
accurate description of all quantum phenomena in the subatomic world.
In this book, we follow the same footsteps.
In Chaps. 1–3, we introduced the world of quantum finance and studied its basic
concept and theory. Based on the quantum anharmonic oscillator (QAOH) model
learnt in Chap. 4, we examined its quantum dynamics and mathematical formulation
in a typical secondary financial market.
In this chapter, we discuss how such mathematical formulation can be applied
in terms of objective experimental results with distribution to evaluate the quantum
finance energy levels (QFELs) and quantum price levels (QPLs).
First, we will begin with the investigation of QPL as an analog to quantum energy
levels (QELs) in classical quantum world.
Next, we will explore Schrödinger equation and the physical meaning of wave
function in this equation. From that, we will study the experiments (time series trading
results) of financial products for over 2000 trading days and obtain the observation’s
statistical distributions. By repeating such series of experiments onto various financial
products, we can arrive at objective statements concerning these distributions. After
that, we will combine these observation results with finite difference method (FDM)
to derive the value of λ in the quantum finance Schrödinger equation (QFSE).
Finally, we will employ the latest research on λ2m QAOH model, together with
Cardano’s depressed cubic equation solver to solve quantum finance Schrödinger
equation (QFSE) and calculate all quantum finance energy levels (QFELs); and hence
the corresponding QPL using numerical computation method.
CADUSD, AUDEUR, JPYUSD) will automatically exist and generate their quantum
energy field instantaneously, visualized as quantum price levels (QPLs) shown in
every financial market and start their quantum finance anharmonic oscillations and
motions.
More importantly, these QPLs exist in discrete states with level 0 as the ground
states (E 0 ) (during market open) and all excited states E n in discrete energy levels.
In terms of quantum dynamics, these energy states are eigenenergy levels described
in Schrödinger equation of quantum financial particles—the Quantum Finance
92 5 Quantum Price Levels—Basic Theory and Numerical Computation …
Like an electron in an atom, without external force in action, the electron will
remain in its stable ground-state orbit.
Similarly, without external financial stimulus such as financial events, major finan-
cial news, significant worldwide events, the release financial index figures such as
PMI, CPI, PPI, etc., these financial particles will remain in their stable and equilib-
rium states (so-called ground states) and vibrates in the form of random-like quantum
anharmonic oscillations as described by QFSE.
However, when there is a significant financial stimulus (either positive or negative
events and stimulus), these financial particles will jump to another higher or lower
energy levels (i.e., QPLs), not continuous, but in the form of discrete jumps.
After that, market makers (MMs) will absorb the stimulus and financial particles
will be back to equilibrium states but reside at a new QPL.
As recalled in quantum dynamics (Zee 2011; Schmitz 2019), for a particle at position
x, the time-dependent Schrödinger equation is given by
∂
where ψ(x, t) is the wave function, H is the Hamiltonian operator, and is the reduced
Planck constant.
Note that the position x in Schrödinger equation is the displacement of quantum
particle from its equilibrium states, rather than the displacement stated in the classical
94 5 Quantum Price Levels—Basic Theory and Numerical Computation …
H is given by
− ∂ 2
H= + V (x) (5.4)
2m ∂ x 2
where H composes of kinetic energy, K.E. (kinetic energy, the first term) + potential
energy, P.E. (potential energy, the second term).
Let r be the price return of a particular quantum financial particle (QFP) at time t
(say USD/CAD or simply US Index).
In typical secondary financial markets such as forex or stock market with over
2000-trading day historical records. Normally, we can use the daily returns to repre-
sent r in QFSE. In that case, the daily return r will be given by
∂
− ∂ 2
H= + V (r, t) (5.7)
2m ∂r 2
Note:
In quantum mechanics and quantum field theory, wave function (ψ) is the most
important component in the complete mathematical model, as it is the realization of
wave–particle duality of quantum particles in this unique subatomic world of reality.
What is the corresponding wave function in quantum finance?
Can we observe it, or measure it?
Remember in the double-slit experiment of quantum particle, what we have seen
in the backdrop screen is the realization of the wave function of quantum particle
projections.
However, if we measured it closely at every single path of motion of these quantum
particles, all the wave-like phenomena will disappear. Remember that?
In other words, if finance particles really possess such quantum duality property,
technically speaking, we cannot observe or measure these discrete quantum energy
levels (quantum price levels, QPLs, in our case) intentionally and directly. What we
can observe is the random-like price fluctuations in market movement chart.
So, what should we do?
The answer is to
1. follow Professor Heisenberg’s suggestion in his famous quote cited at the begin-
ning of this chapter; and
2. do the experiment many times and observe wave functions’ distribution.
When we studied classical quantum mechanics in Chap. 2, remember we talked
about evaluating the quantum wave function of a quantum particle; all we can do is
by measuring pdf (probability distributed function, ρ) of the observations instead,
which is given by
In quantum finance, wave function can be observed and evaluated by using similar
method.
For example, for a time series of 2048 trading days of Gold versus US Dollar
(XAUUSD), we measure the daily closing price returns (r) of these 2048 time step
and plot the pdf of r versus pdf of occurrence
[0, 1] to analog the quantum finance
wave function ψ of XAUUSD.
That is,
96 5 Quantum Price Levels—Basic Theory and Numerical Computation …
0.045
0.04
0.035
0.03
Q(r)
0.025
0.02
0.015
0.01
0.005
0
0.97 0.98 0.99 1 1.01 1.02 1.03
Daily Return (r)
Fig. 5.4 Quantum price return wave function Q(r) of XAUUSD for the past 2048-trading day (As
of January 6, 2019 market information)
Figure 5.4 shows the quantum price return wave function Q(r) of XAUUSD for
the past 2048 trading days (as of January 6, 2019 market information).
It is calculated by evaluating the distribution function of daily price returns (r)
and plot against the total number of occurrences, given by
where E is the total number of events, 2046 events in our case (with the exclusion of
the boundary cases).
Several features can be found:
1. The wave function falls into a standard normal distribution.
2. Maximum (also the mean) occurrence of r is close to 1, which is also the ground
state (without any stimulus). Such finding is quite surprising in the financial per-
spective. As one may think of the returns with the most frequency events should
be either greater than or less than 1, it won’t be 1 which means no change from
yesterday’s price. But the truth is, after calculating all the 129 worldwide finan-
cial products, almost all of them have similar patterns, in which the maximum
returns occur when r is close to (or equal to) 1.
3. Basically, the wave function is symmetric with the central axis which corresponds
to the mean (which is also the maximum) wave function value that can be reflected
5.4 Physical Meaning of Wave Function Ψ 97
by the fact that quantum finance Schrődinger equation (QFSE) is symmetric with
respect to the ground state. In other words, once we evaluate the excited states
of quantum finance energy levels (E1 , E2 , E3 , …) which corresponds to positive
QPL (the QPLs above the ground-state QPL when market open), all negative
QPL (the QPL below the ground-state QPL) can be deducted automatically, as
we will see in the upcoming numerical calculations.
Once we have the method to evaluate ϕ(r ) (i.e., Q(r) in the last section), the center
question is to find all corresponding quantum price levels (QPLs).
That is, all the eigenenergy values in QFSE.
Numerous physicists and mathematicians in the past 50 years had devised many
methods and techniques to solve this important equation, such as the Hill determi-
nant, Bargmann representation, coupled-cluster method, and variation–perturbation
expansion (Grosse and Martin 2005; Muller-Kirsten 2012; Popelier 2011; Bouard
and Hausenblas 2019; Rampho 2017; Kisil 2012; Witwit 1996; Rohwedder 2013;
Carbonnière 2010).
However, most of them are either technically or mathematically complex in numer-
ical computations.
In 2007, Dasgupta et al. in their paper Simple systematics in the energy eigen-
values of quantum anharmonic oscillators published in the Journal of Physics A:
Mathematical and Theoretical provided a genius numerical method to solve a class
of Schrődinger equations known as “λx 2m quantum anharmonic oscillators.”
In the next section, let’s take a look at how we can adopt this numerical calculation
method to solve QFSE within seconds by simple PC computers.
We will be surprised by how genius and simple numerical methods can be by
changing the reference horizon.
d 2ψ 2
H (m) (λ)ψ = − + x + λx 2m ψ = Eψ (5.12)
dx2
in which the excited energy levels can be closely approximated by the following
polynomials:
(m+1) (m−1)
(m+1)
E (m,n) E (m,n)
− = K 0(m,n) λ (5.13)
2n + 1 2n + 1
where E (m,n) is the nth excited state energy of λx 2m AHO and K 0(m,n) are constants.
If we look QFSE closely, it is in fact a typical quartic anharmonic oscillator in
Chap. 2 (Sect. 2.5.3) with a quartic term in P.E. dynamics.
So, we can convert QFSE (5.11) into a λx 2m AHO:
d 2 ϕr 2
2
+ r + λr 2m ϕr = Eϕr (5.14)
dr
Put m = 2, we have
d 2 ϕr 2
2
+ r + λr 4 ϕr = Eϕr (5.15)
dr
Note: We normalize quadratic term r 2 with quartic term r 4 and combine it to coeffi-
cient λ. Note that this λ is different from the previous one in the original QFSE. Put
in order to honor with Dasgupta’s work, the author intends to keep it in here (and
also in the book). Besides, K.E. is also normalized with coefficient set to 1, which is
a usual practice in numerical derivation of Schrödinger equation as one may find out
that we can discard K.E. during the course of evaluation of different energy levels.
Once we have QFSE in the form of (5.15), we can make use of numerical solution
of quantum energy levels in (5.13) by setting m = 2 and further simplify the equation
into
3
E(n) E(n)
− = (K 0 (n))3 λ or
2n + 1 2n + 1
3
E(n) E(n)
− − (K 0 (n))3 λ = 0 (5.16)
2n + 1 2n + 1
where
1/3
1.1924 + 33.2383n + 56.2169n 2
K 0 (n) = (5.17)
1 + 43.6196n
Note:
5.6 Numerical Computation of Quantum Anharmonic Oscillators 99
The numerical Eqs. (5.16) and (5.17) can be easily calculated by using MATLAB
(Chapra 2017; Marghitu and Dupac 2012) and any other computational packages,
and of course, using MQL (Young 2015) and integrated with MT (metatrader) plat-
forms—the biggest international online trading and program development platform
for real-world financial applications. Details can be found from the education corner
of quantum finance forecast center official site, QFFC.org.
In summary, once we know coefficient λ, all the quantum energy levels (or quan-
tum price levels) can be found (Fig. 5.5).
The question is: How can we find λ?
d 2 ϕr 2
+ r + λr 4
ϕr = Eϕr (5.15)
dr 2
As mentioned, this quantum finance Schrödinger equation (QFSE) has four char-
acteristics:
100 5 Quantum Price Levels—Basic Theory and Numerical Computation …
With the advance of computer technology, finite difference method (aka FDM) pro-
vides an intuitive practical method to solve complex differential and high-order equa-
tions by numerical approximation and implemented by computer algorithms (Dimov
et al. 2004; Duffy 2006; Tavella and Randdall 2000).
Although the technique is using numerical approximation, when the number of
samplings/observations is sufficiently large, the finite step (x) is sufficiently small
(as compared with sampling/observation horizon x). Such method can give a very
close approximation to the “actual” analytical solution.
In fact, FDM is commonly used in many large-scale real-time problems such as
worldwide weather prediction (also known as numerical weather prediction), earth-
quake modeling, traffic control systems, and naturally worldwide financial analysis.
The finite difference method is a threefold process:
1. For any function y = Q(x), subdivide the x-axis into N subdivisions, i.e., x1 , x2 ,
x3 , … x N .
2. Set the value of y at xi as yi .
3. The finite difference formulations for all differential operators will be
d x = x (5.18a)
dy yi+1 − yi
(xi ) = (5.18b)
dx x
d2 y yi+1 + yi−1 − 2yi
(xi ) = (5.18c)
dx2 x 2
5.8 Finite Difference Method (FDM) 101
X0 = 0 X1 X2 X3 X4 X5 = 1
Fig. 5.6 Basic concept of FDM
Let’s take a look at how we can apply FDM to solve our QFSE. Figure 5.6
illustrates the basic idea of FDM.
Figure 5.7 illustrates the quantum price return wave function Q(r) (ϕr in our QFSE)
mentioned in Sect. 5.4, that is, the wave function distribution statistic of XAUUSD
by plotting the pdf of daily returns in the past 2048 trading days.
But the difference is that this time we display this pdf function by dividing the
x-axis (r) into 100 equal divisions, with each width x given by
3σ
x = (5.19)
50
where σ is the standard deviation of r for the past 2048 trading days (totally, we have
2046 r sample observations by excluding the boundary records).
This figure also shows the regression curve of the wave function for illustration
purpose.
As mentioned, when the number of observations/sampling is sufficiently large,
all four characteristics of QFSE mentioned in Sect. 5.7 hold.
Besides, certain important findings can be concluded from Fig. 5.7:
1. ϕ Max at r ∼
= 1 (ground state, denotes as r0 ).
2. ϕr = ϕ(r0 ) is symmetric with r ∼
= 1 as symmetry axis, especially when r-segment
close to the symmetry axis.
3. So, we can take the first left and right r-segment for calculation, denoted as
r−1 and r+1 , respectively.
102 5 Quantum Price Levels—Basic Theory and Numerical Computation …
0.045
0.04
0.035
0.03
Q(r)
0.025
0.02
0.015
0.01
0.005
0
0.97559986
0.97657587
0.97755187
0.97852788
0.97950388
0.98047989
0.9814559
0.9824319
0.98340791
0.98438391
0.98535992
0.98633592
0.98731193
0.98828793
0.98926394
0.99023994
0.99121595
0.99219196
0.99316796
0.99414397
0.99511997
0.99609598
0.99707198
0.99804799
0.99902399
1
1.00097601
1.00195201
1.00292802
1.00390402
1.00488003
1.00585603
1.00683204
1.00780804
1.00878405
1.00976006
1.01073606
1.01171207
1.01268807
1.01366408
1.01464008
1.01561609
1.01659209
1.0175681
1.0185441
1.01952011
1.02049612
1.02147212
1.02244813
1.02342413
Daily Return (r)
Figure 5.8 shows three major r-segments in the QF wave function of r; they are
r0 , r−1 , and r+1 .
It also corresponds to ground state ϕ(r0 ) and first +ve and –ve r states, ϕ(r−1 )
and ϕ(r+1 ), respectively.
According to QFSE (5.15), the wave function is symmetric with r0 as the symmetry
axis and ϕ(r0 ) is the max wave function values.
Since we have all 2046 r observations and also their distribution, i.e., ϕ(r’s),
technically we have sufficient information to evaluate λ for every financial product.
To evaluate λ using finite difference method, we have two options:
1. Using FDM to evaluate the boundary continuously of r0 and r+1 segments (i.e.,
The rightmost approximation of ϕ(r0 ) ∼
= leftmost approximate of ϕ(r+1 )).
2. Using FDM and symmetric property of ϕr , we make use of the symmetric prop-
erty of r−1 -segment and r+1 -segment to “cancel out” the K.E. term, and then
using FDM to evaluate λ using the symmetric property of their P.E. component.
Which option we could choose? Why?
For the 2048 trading days of XAUDUSD (as of January 16, 2019), we have the
following statistics information in Table 5.1.
As recalled from the QFSE, we have
d 2 ϕr 2
2
+ r + λr 4 ϕr = Eϕr (5.15)
dr
Since QFSE (5.15) is symmetric with respect to the central axis r0 , when we con-
sider quantum dynamics for r+1 and r−1 segments, their K.E. terms can be canceled
out, so we have
2 2
r+1 + λr+1
4
ϕr+1 = r−1 + λr−1
4
ϕr−1 or
Table 5.1 Statistic results of the quantum price return wave function Q(r) of XAUUSD (as of
January 16, 2019)
Product: XAUUSD
No. of r = 2046 r0 = 0.999604 ϕ(r0 ) = 0.047785
r = 0.000793 r+1 = 1.000396 ϕ(r+1 ) = 0.038825
Max(ϕ) = 0.047785 r−1 = 0.998811 ϕ(r−1 ) = 0.039821
Max(ϕ) N o = 50 μ = 0.999821 σ = 0.013213
Data source Forex.com MT4 system
104 5 Quantum Price Levels—Basic Theory and Numerical Computation …
2
r−1 ϕr−1 − r+1
2
ϕr+1
λ= 4 (5.20)
r+1 ϕr+1 − r−1
4
ϕr−1
Note that (5.16) is a typical cubic polynomial which can be easily solved by
MATLAB using “root” command.
For XAUUSD, by using λ = 1.16813758, we can write a simple MATLAB
program (in the next section) to calculate all first 21 energy levels. Table 5.3 shows
the experimental results for the calculation of the first 21 quantum finance energy
levels (QFELs) of XAUUSD.
In this MATLAB program shown in Fig. 5.9, we use λ value 1.16813758 to calculate
the first 21 K and quantum finance energy levels (QFELs) of XAUUSD.
To solve the cubic equation, MATLAB command roots() is used to evaluate the
solution set. Since (5.21) is a typical cubic equation, normally it will have solution
set of three values, with one real number and two complex solutions.
So, we set the real number solution as QFEL value.
5.12 Numerical Computation of Quantum Finance Energy Levels (MATLAB Version) 105
Table 5.2 λ values for ALL 120 forex products using MQL program
CODE λ values CODE λ values CODE λ values
XAGUSD 1.16813758 US2000 1.01691648 GBPDKK 0.50015095
CORN 0.98147439 AUDCAD 0.99800233 GBPHKD 0.49946476
US30 1.00927814 AUDCHF 1.00650666 GBPJPY 1.02721719
AUDUSD 1.01090471 AUDCNH 0.99788161 GBPMXN 1.00743969
EURCHF 0.9922947 AUDJPY 1.01297607 GBPNOK 0.97866528
GBPCAD 0.98033867 AUDNOK 1.01297576 GBPNZD 1.01766392
NZDJPY 0.99409385 AUDNZD 0.99883417 GBPPLN 0.98982647
USDCNH 1.00129406 AUDPLN 0.99972703 GBPSEK 1.00541074
XAUAUD 0.97310053 AUDSGD 0.99145652 GBPSGD 0.99543469
XAUCHF 1.28307613 CADCHF 1.05615292 GBPUSD 0.99737283
XAUEUR 1.03339416 CADJPY 0.97655725 GBPZAR 0.99672306
XAUGBP 1.10858157 CADNOK 0.9981341 HKDJPY 1.01256568
XAUJPY 1.20798503 CADPLN 1.02762915 NOKDKK 1.00723481
XAUUSD 0.87114449 CHFHUF 0.99232627 NOKJPY 1.00878002
COPPER 0.98546677 CHFJPY 0.94512371 NOKSEK 0.99266368
PALLAD 0.97495035 CHFNOK 1.00053241 NZDCAD 1.0105619
PLAT 0.93898709 CHFPLN 1.00582673 NZDCHF 0.97178881
UK_OIL 1.01219635 CNHJPY 1.00000253 NZDUSD 1.00708451
US_OIL 1.07644811 EURAUD 1.00721165 SGDHKD 1.0028679
US_NATG 1.76511177 EURCAD 0.96576866 SGDJPY 0.95994849
HTG_OIL 0.90630263 EURCNH 1.01233192 TRYJPY 0.5018959
COTTON 1.02930805 EURCZK 0.99233097 USDCAD 1.00299693
SOYBEAN 0.50226883 EURDKK 0.99994162 USDCHF 0.96609929
SUGAR 0.99525331 EURGBP 0.99797319 USDCZK 0.99456678
WHEAT 0.99615377 EURHKD 1.00358691 USDDKK 0.99719426
IT40 1.01850019 EURHUF 0.98265533 USDHKD 1.00178794
AUS200 0.99426146 EURJPY 0.91939902 USDHUF 1.01153898
CHINAA50 0.9806911 EURMXN 1.02025986 USDILS 1.0047121
ESP35 0.93834053 EURNOK 0.99508525 USDJPY 0.50079764
ESTX50 1.00351004 EURNZD 0.50156959 USDMXN 0.99266275
FRA40 1.00704187 EURPLN 1.06863464 USDNOK 0.9984592
GER30 1.03777101 EURRON 0.99952845 USDPLN 1.01260473
HK50 0.99188819 EURRUB 0.99533066 USDRON 1.00335247
JPN225 0.9884408 EURSEK 1.03002348 USDRUB 0.98921247
N25 0.98915404 EURSGD 1.00701412 USDSEK 1.0196364
NAS100 0.99279678 EURTRY 1.01094015 USDSGD 1.00527642
(continued)
106 5 Quantum Price Levels—Basic Theory and Numerical Computation …
Table 5.3 K values and QFEL values of the first 21 quantum finance energy levels
Product: XAUUSD (λ = 1.16813758)
Energy level K QFEL
0 1.060410426 1.409932766
1 1.266594551 4.744287679
2 1.491211949 8.908118719
3 1.663522514 13.59094957
4 1.806129863 18.6925368
5 1.929228428 24.15086474
6 2.038364753 29.92294434
7 2.136927359 35.97686567
8 2.227155031 42.28781818
9 2.310613024 48.8358504
10 2.388443595 55.60450183
11 2.4615088 62.57991521
12 2.530477086 69.75023292
13 2.595878459 77.10517084
14 2.658141083 84.635708
15 2.717616385 92.33385484
16 2.77459678 100.1924762
17 2.829328496 108.2051536
18 2.882021043 116.3660765
19 2.932854345 124.6699548
20 2.981984198 133.1119479
Source Experimental results using MATLAB development tool, 2019
5.13 Depressed Cubic Equation Solver—Gerolamo Cardano 107
% *****************************************************************************************************************
%
% Date: 5.1.2019
% Subject: Calculation of Quantum Price Level using QFSE
% Author: Dr. Raymond LEE
% Version; 1.0
%******************************************************************************************************************
% Define parameters
Maxj = 10000; % Max no. of iteration (approx of infinity)
MaxN = 21; % Max Quantum Price Energy Levels
l = 1.16813758; % Lambda value for the QFSE of XAUUSD
oldE = 0.0; % Aux E variable
%
% Define and initialize K and Energy Level arrays
%
E = zeros(3,MaxN); % Energy levels array
K = zeros(1,MaxN); % K parameter array
Fig. 5.9 MATLAB program for the numerical computation of QFEL for XAUUSD
He was one of the most influential mathematicians of the Renaissance and was one
of the key figures in the foundation of probability as well as the earliest introducer
of binomial coefficients and binomial theorem in the western world.
Cardano was the first mathematician to make systematic use of negative numbers.
One of his most influential discoveries is the solution to one particular case of
the cubic equation, so-called “depressed cubic equation” (cubic equation without
quadratic term):
ax 3 + bx + c = 0 (5.23)
Published in his book Ars Magna in 1545, Cardano devised a genius way to solve
the depressed cubic equation as follows:
Given a depressed cubic equation:
t 3 + pt + q = 0 (5.24)
u+v =t (5.25)
3uv + p = 0 (5.26)
u 3 + v 3 = −q and (5.28a)
p3
u 3v3 = − (5.28b)
27
The tricky point is that the combination of (5.28a and 5.28b) will lead to the
following quadratic equation where u 3 and v 3 are the roots of the equation:
p3
z 2 + qz − =0 (5.29)
27
5.14 Cardano’s Method for Calculating QFEL 109
Finally, we have
3 q q2 p3 3 q q2 p3
E(n) = − + + + − − + (5.31)
2 4 27 2 4 27
where
1/3
1.1924 + 33.2383n + 56.2169n 2
K 0 (n) = (5.32c)
1 + 43.6196n
Figure 5.10 shows the program section in MQL for the calculation of first 21
energy levels of a financial product (with given λ determined in the previous section).
Once all QF energy levels are calculated, the determination of the quantum price
levels will be a straightforward scaling problem.
110 5 Quantum Price Levels—Basic Theory and Numerical Computation …
//******************************************************************************************************************
// 6. Using Quantum Finance Schrődinger EQT to find the first 21 Quantum Energy Levels
//
// By solving the Quartic Anharmonic Oscillator as cubic polynomial equation of the form
// a*x^3 + b*x^2 + c*x + d = 0
//
// Using (Dasqupta et. al. 2007) QAHO solving equation:
// (E(n)/(2n+1))^3 - (E(n)/(2n+1)) - K(n)^3*L = 0
//
// and Solving the above Depressed Cubic Eqt using Cardano's Method
//******************************************************************************************************************
for (eL=0;eL<21;eL++)
{
p = -1 * pow((2*eL+1),2);
q = -1 * L * pow((2*eL+1),3) * pow(K[eL],3);
// Apply Cardano's Method to find the real root of the depressed cubic equation
u = MathPow((-0.5*q + MathSqrt(((q*q/4.0) + (p*p*p/27.0)))),p3);
v = MathPow((-0.5*q - MathSqrt(((q*q/4.0) + (p*p*p/27.0)))),p3);
Fig. 5.10 Program section in MQL for the calculation of first 21 energy levels of a financial product
Figure 5.11 shows the overall algorithm for the determination of first 21 quantum
finance energy levels (QFELs) and hence the quantum price levels for 120 financial
products using MQL.
For details, please visit the programming workshop at the Education Corner of
QFFC.org.
Q F E L(n)
QPR(n) = (5.34)
Q F E L(0)
where n = [1 … 20]
• Calculate normalized QPR(n)
where n = [1 … 20]
• Save two level of data files:
– For each financial product, save the QPL table contains QPE, QPR, and NQPR
for the first 21 energy levels
– For all financial product, create a QPL summary table containing NQPR for all
FP, which will be used for financial prediction using recurrent neural networks.
Table 5.4 shows QPE, QPR, and NQPR for the first 21 energy levels of XAUUSD
by using the 2048 daily time series data from Forex.com.
According to quantum finance theory and the symmetric property of QFSE, at the
beginning of each trading day, the first 21 QPL+ is calculated by
In real application, every day at 08:00 HKT/UTC0, QFFC will calculate the fore-
cast H/L for worldwide 129 financial products, together with daily eight closest QPLs
for each FP, upload onto QFFC official site for public access.
5.18 Conclusion 113
5.18 Conclusion
In this chapter, we studied the basic theory of quantum price level (QPL).
More crucially, this chapter shows how to evaluate the quantum finance energy
level (and hence the QPL) by solving quantum finance Schrödinger equation (QFSE)
using simple numerical computation methods.
Prior to this book, quantum finance and path integral analysis seem to be a mathe-
matically complex and far-reaching techniques for data scientists, quants, and finan-
cial analysts to comprehend; let’s alone with the actual calculation/ program design
of QPL.
But now, quantum finance and hence QPL can be easily and practically applied
to real-world financial situation by using common PC systems.
Any quants and analysts can now use their own PC/MAC systems to program and
calculate any QPL, and QPL they want to integrate into their own trading systems.
114 5 Quantum Price Levels—Basic Theory and Numerical Computation …
In fact, quantum price level (QPL) evaluation is only the first step of quantum
finance.
More important is how to make use of it, together with other AI tools to design
and implement real-time financial prediction and intelligent trading systems.
Problems
5.1 Why experiments and experimental results are key factors in quantum theory?
And how can we do that in quantum finance? Give two examples in financial
markets in your explanation.
5.2 What is pseudoscience? What is the major difference between science and
pseudoscience? Give two examples of pseudoscience examples in finance and
explain why they are not scientific methods.
5.3 What are the three major similarities and differences between quantum energy
levels (QELs) in quantum theory versus quantum price level (QPL) in quantum
finance?
5.4 What are support and resistance levels (S & R) in technical analysis? Why
they are important in modern finance and financial trading?
5.5 Discuss and explain the similarities and differences between quantum price
levels (QPLs) and support and resistance levels (S & R). Give two examples
in financial markets in your explanation.
5.6 What is the physical meaning of wave function (ψ) in quantum finance? And
how wave function can be interpreted by double-slit experiment?
5.7 What is a λx 2m quantum anharmonic oscillator? What is the major difference
between a typical quantum anharmonic oscillator and a λx 2m quantum anhar-
monic oscillator? What is the mathematical significance of λx 2m quantum
anharmonic oscillator?
5.8 State and explain the physical meaning of each term in the mathematical
formulation of excited energy levels in a λx 2m quantum anharmonic oscillator.
5.9 State and explain the mathematical derivation of the quantum finance
Schrödinger equation (QFSE) with the integration of λx 2m quantum anhar-
monic oscillator formulation. Explain how it can be used to evaluate quantum
price levels (QPLs) in quantum finance.
5.10 How can we evaluate the wave function (ψ) of any financial product in quan-
tum finance? The following figure shows the wave function distribution of
Gold (XAUUSD) using the past 2048-trading day time series.
5.18 Conclusion 115
(i) Using MQL (tutorials can be found in QFFC.org official site) or R to plot
wave function distribution of (1) CORN; (2) Dow Jones Index (DJI) and
crude oil (US Oil);
(ii) Compare these three wave function distribution charts with XAUUSD,
what are the major similarities and difference between these four distri-
bution charts? Why?
5.11 Given the following experiment results for the wave function distribution of
Silver (XAGUSD) in 2046-trading days:
And today opening price for XAGUSD is 14.31, calculate the 21 closest quan-
tum price levels (QPLs) for XAGUSD today.
5.14 Below given the quantum finance Schrödinger equation in QAHO format.
d 2 ϕr 2
2
+ r + λr 4 ϕr = Eϕr
dr
(i) State and explain the physical meanings of each term in terms of quantum
finance theory;
(ii) What is importance of the anharmonic term in the QFSE?
(iii) Discuss and explain the major characteristics of QFSE in QAHO format;
(iv) What is the importance of QFSE in QAHO format in terms of (1) model-
ing of quantum financial markets; (2) computational and implementation
perspective for the evaluation of QPL?
(v) Using the opening price of these financial products, modify your MQL
to calculate the first 41 quantum price levels (i.e., QPL−20 , QPL−19 , …,
QPL0 , …, QPL+19 , QPL+20 ).
(vi) State and explain how you can test the accuracy and performance of
using these QPLs to replace support and resistance levels (S & R) for
financial analysis.
(vii) Modify your MQL to implement (vi) for the performance evaluation
of these QPLs for CORN, DJI, and US Oil and compare their overall
performance.
(viii) Perform the same procedure as (vii) to write an MQL program to cal-
culate and evaluate the performance of QPLs for ALL forex products
in your MT4 platform. Check for any patterns and characteristics you
can find out and explain why.
References
Bouard, A. & Hausenblas, E. (2019) The nonlinear Schrödinger equation driven by jump processes.
Journal of Mathematical Analysis and Applications 475 (1): 215–252.
Carbonnière, P. et al. (2010) The VCI-P code: an iterative variation–perturbation scheme for effi-
cient computations of anharmonic vibrational levels and IR intensities of polyatomic molecules.
Theoretical Chemistry Accounts 125(3): 543–554.
Chapra, S. C. (2017) Applied Numerical Methods with MATLAB for Engineers and Scientists.
McGraw-Hill Education, 4th edition.
Dasgupta, A. et al. (2007) Simple systematics in the energy eigenvalues of quantum anharmonic
oscillators. Journal of Physics A: Mathematical and Theoretical 40(4): 773–784.
Dimov, I. et al. (2014) Finite difference methods, theory and applications. Lecture Notes in Computer
Science book series (LNCS, volume 9045), Springer.
Duffy, D. J. (2006) Finite Difference Methods in Financial Engineering: A Partial Differential
Equation Approach. Wiley.
Grosse, H. and Martin, A. (2005) Particle Physics and the Schrödinger Equation (Cambridge Mono-
graphs on Particle Physics, Nuclear Physics and Cosmology). Cambridge University Press.
Kisil, V. V. (2012) Hypercomplex Representations of the Heisenberg Group and Mechanic. Inter-
national Journal of Theoretical Physics 51(3): 964–984.
Marghitu, D. B. and Dupac, M. (2012) Advanced Dynamics: Analytical and Numerical Calculations
with MATLA. Springer.
Muller-Kirsten, H. J. W. (2012) Introduction to Quantum Mechanics: Schrödinger Equation and
Path Integral. World Scientific.
Murphy, J. J. (1999) Technical Analysis of the Financial Markets: A Comprehensive Guide to
Trading Methods and Applications. New York Institute of Finance.
Popelier, P. (2011) Solving the schrodinger equation: has everything been tried? World Scientific
Pub Co Pte.
QFFC (2019) Official site of Quantum Finance Forecast Center. http://qffc.org. Accessed 21 Aug
2019.
Rampho, G. J. (2017) The Schrödinger equation on a Lagrange mesh. Journal of Physics: Confer-
ence Series 905: 12037.
Rohwedder, T. (2013) The continuous Coupled Cluster formulation for the electronic Schrödinger
equation. ESAIM: Mathematical Modelling and Numerical Analysis 47(2): 421–447.
118 5 Quantum Price Levels—Basic Theory and Numerical Computation …
Schmitz, W. (2019) Particles, Fields and Forces: A Conceptual Guide to Quantum Field Theory
and the Standard Model (The Frontiers Collection). Springer.
Tavella, D. & Randall, C. (2000) Pricing financial instruments: the finite difference method. John
Wiley & Sons, New York.
Witwit, M. R. M. (1996) Energy Levels for Nonsymmetric Double-Well Potentials in Several
Dimensions: Hill Determinant Approach. Journal of Computational Physics, 123(2): 369–378.
Young, A. R. (2015) Expert Advisor Programming for MetaTrader 4: Creating automated trading
systems in the MQL4 language. Edgehill Publishing.
Zee, A. (2011) Quantum Field Theory in a Nutshell. Princeton University Press, 2nd edition.
Chapter 6
Quantum Trading and Hedging Strategy
backup and evidence, even though the market goes to the opposite direction, we tend
to always find evidence either from market charts or financial news to support our
judgement that “the market will go down very soon, just wait for a couple of hours”,
until we have already lost a fair amount.
The merits of scientific trading strategy and hence program trading is that we
won’t let our subjective opinions affect our trading activities. If the market goes to
the opposite direction, we simply follow the objective trading strategy to stop loss
or trigger the hedging algorithm.
In this chapter, quantum finance forecast center (QFFC.org) provides a more
preferable solution—daily/weekly financial forecast for worldwide 120+ financial
products. Every day at 00:00UTC (08:00 HKT), QFFC will compute the daily
high/low of worldwide 120+ financial product including worldwide forex, major
commodity, international financial indices, major cryptocurrencies, and broadcast via
QFFC official site QFFC.org. Worldwide investors and traders can base on these fore-
cast results, which together with quantum trading and hedging strategies is revealed
in this chapter to perform their quantum trading.
This chapter is organized as follows: First, we begin with basic concept of finan-
cial trading and hedging strategies, with an overview of latest R&D on AI-based
trading and hedging strategies. Second, we introduce seven major classical trading
the hedging strategies, which is the author’s collection of over 20 years of experi-
ences on financial analysis and trading in various financial markets. In fact, they are
also the building blocks of quantum trading methodology. Third, we explore basic
concepts and techniques on quantum trading—the main theme of this chapter. In the
conclusion section, we study investment attitude and the importance of objectivity
in trading and investment.
Traditional finance involved trading and hedging strategies in 70s–80s (i.e., before the
age of online and program trading) on investment funds, bonds, and stocks which was
mainly performed by major fund houses and financial institution in major financial
markets.
Conventional trading and hedging strategies include the following:
1. Single-product trading/hedging strategy—long buy/short sell of stocks, or com-
position of these actions with their options counterparts.
2. Mutual product trading/hedging strategy—also known as pair-trading—is the
long buy/short sell of one particular stock (e.g., Coca-Cola) with the counter-
direction buy/sell or a mutual stock (highly correlated stock with different
expected returns/variance returns) as safeguards and risk controls (e.g., Pepsi
in this example).
122 6 Quantum Trading and Hedging Strategy
Over the years, financial engineering ranging from financial signals, chart patterns
study for the modeling of financial prediction and trading systems is one of the most
stimulating topics for both academia and financial community. Not only because of
its utmost importance in terms of financial and commercial values, but it vitally poses
a real challenge to worldwide researchers and quantitative analysts (a.k.a. quants)
throughout the world.
The flourishing of AI technology in the past 30 years such as various hybrid
intelligent financial trading and hedging systems with the integration of various AI
and related technology was proposed. Latest R&D on intelligent trading and hedging
system include the following:
1. Artificial neural network (ANN) was proposed by Li et al. (2017) for the devel-
opment of quantitative trading strategy.
6.3 Latest R&D on Trading and Hedging Strategies 123
2. AI clustering technique was proposed by Hsu et al. (2009) for the design of
profit refiner on futures trading strategy.
3. Genetic algorithm (GA) technology was proposed by Allen and Karjalainen
(1999) for the determination of technical trading rules and Shiau (2009) using
multi-objective GA for the optimization of reservoir hedging rules.
4. Principle component analysis (PCA) technology was proposed by Byun et al.
(2015) for multi-currencies trading in the forex market.
5. Fuzzy logic system (FLS) was proposed by Naranjo et al. (2015) for the devel-
opment of fuzzy capital management and trading system; Vella and Ng (2015)
used dynamic fuzzy money management approach for controlling the intraday
risk-adjusted performance of AI trading algorithms.
6. Data mining system was proposed by Pauna (2019) for time price series for
algorithmic trading systems.
7. Decision support system (DSS) was proposed by Schmidt et al. (2010) for
experimental analysis of online trading algorithms.
8. Reinforcement-learning system (RLS) was proposed by Yang et al. (2018) for
the design of investor sentiment reward-based trading systems.
9. Stochastic technique was proposed by Helseth (2016) for the design of linearized
progressive hedging algorithm on secondary financial markets.
10. Hybrid AI system was proposed by Chang and Lee (2017) with the integration
of Markov decision process (MDP) and GA to formulate trading strategies for
stock markets; Evan et al. (2013) with the integration of ANN and GA developed
algo-trading model for intraday foreign exchange speculation; Liu et al. (2017)
with the integration of fuzzy logic rules and GA developed a method to quantify
moving average strategy of crude oil future markets; Zhang and Maringer (2016)
integrated recurrent reinforcement learning (RRL) with GA for equity trading.
Although both fundamental and technical analyses are the most popular and com-
monly used in financial analysis, the design of trading algorithm, technical analytical
tools—indicators such as RSI, MA, and MACD are commonly used for program
trading because they are
1. Easy to implement and program for program trading;
2. Fully integrated to time series financial data which are now openly provided
by many online trading platforms (e.g., MT platform—the largest forex online
trading platform in the world with over hundreds of financial service plat-
forms/operators);
3. Easy to understand and learn, only basic financial and statistical knowledge is
required to understand technical analysis;
124 6 Quantum Trading and Hedging Strategy
Fig. 6.3 Program trading using technical indicators on MT4 trading platform
4. Easy to program and visualize on the trading platform. Unlike traditional stock
market in 60s–70s, only financial analysts and brokers can access real-time fig-
ures (patterns) of financial markets. Nowadays, every investor and trader with
basic computing (programming) knowledge can not only visualize the financial
markets, but can also design and program their own trading and hedging algo-
rithms into their investment portfolio. The additional knowledge they require are
methods and techniques such as financial forecasts, AI-based trading algorithms,
etc. which is also the aim of this book (Fig. 6.3).
Price movements are simply the reflection of changes in supply and demand
without concern of their underlying forces. Technical analysts are only interested in
what happens to the price according to supply and demand. Say, if demand is greater
than supply, price will increase. On the other hand, if supply is greater than demand,
price will decline. The study of market prices is all that is necessary.
The components of technical analysis are as follows:
• Major market patterns (e.g., major reversal patterns),
• Trend lines and channels,
• Supports and resistance (S & R) analysis, and
• Technical indicators and oscillators (e.g., MA, RSI, MACD, stochastics, Bollinger
Bands).
Nowadays, the design of trading and hedging algorithms (and hence programs)
mainly makes use of technical indicators, oscillators, supports, and resistance lines
for easy implementation, since most of them have already built-in functions bundled
with the program trading development platform, such as MQL trading indicator
function library in MT platform.
In previous chapters, we have studied basic concepts and theory of quantum finance,
especially on how to apply quantum finance theory to model and evaluate quantum
price (energy) levels (QPLs) which is an important tool in technical analysis.
Before we move on to learn how to design and implement AI-based quantum
financial forecast and trading system, let’s study a practical financial investment
topic—trading and hedging strategy.
First, we will review seven major trading and hedging techniques—which is the
author’s collection of over 20 years of trading experience in stock, commodity, and
forex trading, along with the numerous technical trading courses conducted in China
and Hong Kong.
Traders study various kinds of trading techniques and strategies throughout the
years which are summarized into following seven types:
1. Trend trading strategy,
2. Breakout trading strategy,
3. Reversal trading strategy,
4. Channel trading strategy,
5. Averaging trading strategy,
6. Stop-loss trading strategy, and
7. Hedge trading strategy.
126 6 Quantum Trading and Hedging Strategy
Note that these seven trading strategies despite are independent in nature, and most
of the time they can be combined to use in order to produce the best performance.
Figure 6.4 shows the snapshot of program trading using RSI oscillator.
Trend trading is also known as forward trading. The main concept is to trade following
the market trend, if exists. Trend trading is a trading strategy that attempts to capture
gains through the analysis of a security’s momentum in a particular direction. Trend
traders enter into a long position when a security is trending upward and/or enter a
short position when a security is trending downward.
Trend trading strategy assumes that a financial instrument will continue to move
along its current trend and often contain a take-profit or stop-loss provision if there
are any signs of a reversal. It can be used by short-, intermediate-, or long-term
trading. Regardless of their chosen timeframe, traders will remain in their position
until they believe the trend has reversed, although reversals may occur at different
times for each timeframe.
In technical analysis, we have studied all major patterns and trends identification
techniques.
Trend trading strategy #1 using major key patterns include the following:
• Nine major reversal patterns such as head-and-shoulder patterns, round-top/bottom
patterns, ascending/descending triangles, rectangles, etc.;
6.6 Seven Major Financial Trading and Hedging Algorithms 127
In technical analysis, most of the time financial patterns are moving in trends, either
bullish or bearish (or oscillation in some cases).
In other words, once we have identified the current pattern is bullish/bearish, we
can trigger the buy/sell command according to the trend.
Typical example is moving average (MA) trend identification.
The decision of using MA crossing is simple:
1. If day-line down-crossing MA line is bearish, trigger sell signal;
2. If day-line up-crossing the MA line is bullish, trigger buy signal.
Again, one should place the selling signal at the price at least 10% below the
down-cross point as a kind of buffer.
Same cases apply to other technical indicators and oscillators.
Figure 6.6 shows a typical example of the price (S&P 500) bar chart down-cross
the 200-day MA line. It shows the fast signal line (i.e., the day-line) down-crossing
128 6 Quantum Trading and Hedging Strategy
the slow 200-day simple moving average (SMA)—means bearish, trigger the sell
signal.
As an exercise, based on what we have learnt here, try to figure out other
bullish/bearish trends from any market chart and determine the buy/sell thresholds.
Instead of single technical indicator up-/down-crossing, many TAs are using multiple
technical signal crossing method, in which one short-term indicator acts as fast-
moving signal and the other long-term indicator acts as slow-moving signal.
The decision of using signal crossing is simple:
1. If a fast signal line down-crossing a slow signal line—bearish, trigger sell signal
and
2. If a fast signal line up-crossing a slow signal line—bullish, trigger buy signal.
Figure 6.7 shows two MA signal lines: 5-day MA (fast-moving) versus 20-day
MA (slow-moving) lines. When 5-day fast-moving MA line down-crosses a 20-day
slow-moving MA line from above, a bearish trend appears.
6.6 Seven Major Financial Trading and Hedging Algorithms 129
Again, can place a sell command 10% below the down-cross point.
One may wonder: For MA signal lines crossing, what are the two MA lines being
used?
Actually, there is no definitive answer. But many TAs prefer to use the Fibonacci
number sequence (i.e., 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144…) to select the MA lines.
For example, the signal crossing of MA-5 versus MA-21 (or MA-20 for simplicity)
is used to simulate the comparison between weekly (short-term) trend with monthly
(mid-term) trend.
Fig. 6.8 M2.1 Breakout trading strategy—key patterns (e.g., flag consolidation)
Figure 6.9 shows two typical cases of breakouts from support and resistance lines.
Note that, once we identify the support/resistance lines, we can execute the buy/sell
command when the price breakout from breakout thresholds of, say, 10% buffer.
In fact, breakout trading using supports and resistance lines is commonly exercised
on stock and commodity trading using the day chart to identify support and resistance
lines by applying standard technical analysis techniques. However, it may be difficult
6.6 Seven Major Financial Trading and Hedging Algorithms 131
to identify at forex and cryptocurrency trading as they are more chaotic, especially
during US trading time zone, i.e., US time 09:00–16:00.
Reversal trading as its name is executed at least at one of these three scenarios:
1. Clearly identify the key reversal pattern(s);
2. Clearly identify effective support/resistance; and
3. Reversal occurs in over-buy/over-sell regions of technical indicator such as RSI.
Naturally, reversal trading strategy is a perfect tool once we have identified the
eight key reversal patterns by technical analysis, which include key reversals, head-
and-shoulders tops and bottoms, rounding tops and bottoms (saucers), ascending and
descending triangles, rectangles, double and triple tops and bottoms, diamond, rising
and falling wedges, V-shape formations (spikes).
132 6 Quantum Trading and Hedging Strategy
Reversal trading strategy using support and resistance lines (S & R lines) is exactly
the counterpart of breakout trading strategy #2—S & R lines in the sense that the S
& R lines continue as an effective price level to support or resist from price breakout.
In many worldwide financial products trading such as forex and commodity trad-
ing, this situation usually occurs during Asia market period, i.e., 09:00 HKT–16:00
HKT in which the financial markets are oscillating within the daily S & R lines.
Figure 6.11 shows a typical reversal trading based on S & R Lines.
Once the S & R lines are identified, buy/sell command can be triggered after third
reversal from the S & R. (Note: at least two times of reversals are required for S/R
confirmation).
Again, a 10% threshold is required to dispatch signal.
6.6 Seven Major Financial Trading and Hedging Algorithms 133
for a trend reversal or corrective pullback in price. RSI reading values of 30 or below
indicate an oversold or undervalued condition.
The fact is: most TAs believe that 70–30 is sufficient to reflect the over-buy/over-
sell in the market.
Figure 6.12 shows the daily bar chart of Dow Jones Index, DJI (top) versus 14-day
RSI (bottom).
It is apparent in using 70–30 as selling/buying threshold is an acceptable choice.
For experienced traders, they usually trigger selling signal only when RSI rise to
above 70, reach the max RSI, and return back to 70 RSI line. It is called second-
time-hit-top.
Similar to RSI 30 case, it is called second-time-touch-base.
A trend channel (or channel in short) is a channel drawn on a security price series
chart by graphing two trend lines drawn at resistance and support levels. Trading
channels can be drawn using a variety of methodologies. Generally, traders believe
that security prices will remain within a trading channel. Therefore, traders use
trading channels to develop buy-and-sell trading signals.
In many instances, prices repeatedly move about the same distance away from
a trend line before returning to the trend line. In these cases, a straight line can be
drawn connecting the peaks of rallies in an uptrend or the bottoms of declines in
a downtrend. That line is often parallel to the trend line and is called a return or
channel line. Between the channel line and trend line creating a trend channel is a
range within which prices move.
6.6 Seven Major Financial Trading and Hedging Algorithms 135
of Forex.com.
We can clearly identify an effective S-R line pair to trigger two buy/sell signals.
However, at the third time of oscillation, a breakout occurs in which the previous
support line now becomes the resistance (i.e., support → resistance). In this case, a
sell signal can be triggered when the price arrived at the breakthrough 10% threshold
of the breakout line.
The fact is: in traditional technical analysis, support and resistance lines are com-
pletely two different kinds of trading patterns. In other words, a support cannot turn
into resistance lines (or vice versa). However, due to the popularity of program and
algorithm trading, support and resistance lines mentioned in previous chapter are
now considered as some sorts of discrete energy levels, similar to quantized energy
levels in an atom. In other words, a support line for a financial product at a particular
moment can become a resistance line at another moment due to the change of market
stimulus.
Bollinger Bands technique (BB in short) was developed by Mr. John Bollinger in
1980s for the purpose of factoring in price volatility. Bollinger Bands are effective
for virtually any security or market and for any investment time horizon. Rather
than placing bands at a certain percentage distance from a moving average line as is
done with trading bands, Bollinger Bands are placed two moving standard deviations
above and below a simple moving average line.
6.6 Seven Major Financial Trading and Hedging Algorithms 137
More specifically, the bands are placed above and below a simple moving average
at a distance of 1.5–2.0 times the root mean square of the deviations (σ) from the
average. The amount of data used in the calculation is equal to the number of periods
used for the simple moving average.
For example, if we use a 20-day simple moving average, all calculations should
be based on 20 days of data. Similar to moving average, Bollinger Bands are so
important and commonly used that almost all financial trading software/systems are
bundled with the BB tools.
In fact, Bollinger Bands are very reliable with effective technical signal and trading
tool, especially in day trade of forex products which are usually oscillating between
upper–lower Bollinger Bands (so-called Bollinger channel).
Figure 6.15 is the same H1 chart of AUDCAD with period-20 Bollinger Band.
Note that it provides least three chances (maybe more) to trigger buy/sell signals.
But remind that such channel always breakthrough during Europe–US trading period.
It is wise to set stop-loss as risk control.
Averaging method (or averaging in short) is a very important and commonly used
trading strategy for experienced traders and hedge fund traders.
The logic is very simple: instead of putting 100% of investment at a single price
(either buy or sell), we divide the investment into at least two (or more, usually three)
batches, each of equal amount (or different proportion, according to the trader’s
preference).
138 6 Quantum Trading and Hedging Strategy
So even when the price moves in reverse direction, the overall execution price
will be the average of two (or three) triggering prices.
The merits of averaging trading are threefolds:
1. Provide risk sharing especially during adverse market situation;
2. Provide more chances for investors and traders to enter market at one hand, and
locate a good averaging position even the market swings sideway; and
3. Provide a good trading strategy with the integration of S & R lines or/and quantum
price levels (we will discuss that in detail in the upcoming section—quantum
trading strategy).
Figure 6.16 shows a realistic case of forex trading chart of AUDCAD using aver-
aging trading strategy. As shown in Fig. 6.15, if we use S1 and S2 as support lines,
we can execute 50% buy at T1-S2 price. When price reaches S1 at T2, at this “better
position”, we trigger the other 50% buy. Once it reaches S3, we close the order. In
that case, the average gain will be S3 − (S2 + S1)/2, which is much better than solely
investing 100% at S2-T1. Same method can be applied and through a combination
to any kind of trading strategy.
In fact, professional traders and investors usually combine averaging trading strat-
egy with other trading and hedging methods to provide a more flexible, dynamic
trading and risk control strategy.
6.6 Seven Major Financial Trading and Hedging Algorithms 139
Stop-loss strategy seems to be very simple, but it is the most important trading
strategy especially for derivatives trading and margin trading products such as forex
and cryptocurrency trading.
Usually, stop-loss strategy is combined with target profit in which the ratio is
normally 1:2. For example, if the target profit is 240 pts, the stop-loss should be
around 120–150 pts.
How to set stop-loss?
Traditionally, there are two methods:
1. Fixed stop-loss according to the investor’s risk control preference. It varies for
different products. For forex trading, normally we set 150–200 points. It can also
be the proportion of the average daily range (i.e., range between day-high and
day-low) and
2. Dynamic stop-loss according to some technical indices such as S & R lines.
In the next section, we will see quantum trading to provide a third solution for
stop-loss strategy using quantum price levels (QPLs).
Using previous example on AUDCAD trading in Fig. 6.15, if we trigger a buy
order at time T1 0.96251, we set the stop loss of 125 pts (i.e., 0.96126). So even
though price finally drops 464 pts to S1 0.95787 at time T2, the loss is controlled to
125 pts only. Figure 6.17 shows another example based on the trading of Dow Jones
Index (DJI) in MT platform. As shown, DJI breakouts at T1-S2 level (23180) and
drop 1728 points to S1 (21452) before it finally rebound. So, if we set the stop loss
with 200 points, we can control the potential loss to an acceptable level.
As an old saying in Wall Street: The best and most successful trader is not the one
that can always win, but the one that has self-discipline to follow stop-loss strategy
in every trading battle.
Hedge trading (or hedging in short) is the second kind of risk control-based trading
strategy. A hedge is an investment position intended to offset potential losses or
gains that may be incurred by a companion investment. A hedge can be constructed
from many types of financial instruments including stocks, forex, insurance, forward
contracts, swaps, and options.
Technically speaking, hedging is the practice of taking a position in one market
to offset and balance against the risk adopted by assuming a position in a contrary
or opposing market or investment.
It is a common tool for experienced traders as it involves more technical skill to
so-called release the hedge.
Hedge trading basically is of three types as given below:
1. single-product hedging,
2. multi-product hedging, and
3. cross-trading-platform hedging.
First, let’s have a look at a basic case: single-market single-product (SM-SP)
hedge.
In a single-product trading, when we execute a buy/sell order at a certain price P,
we execute the same amount of reverse order at a price “P” at the stop-loss level to
control loss when the market goes in opposite direction.
Same example of AUDCAD trading is used for illustration in Fig. 6.18. Instead
of using stop loss, we set a sell hedge at the stop-loss level below S2. When price
drops to S1 and rebound, we harvest the hedge order and release the hedge.
With the advance in computer technology and online trading, real-time calculation
of co-relation and co-variance between different financial products under the same
trading platform, e.g., forex, is no more a reverie.
Single-platform multi-product (financial products) hedging strategy is a kind of
composite hedging strategy with market momentum evaluation of two (or more)
similar products in a financial platform. It is commonly used in forex platform which
contains over 100+ forex products to study.
6.6 Seven Major Financial Trading and Hedging Algorithms 141
SP-MP hedge ranging from simple two products hedge (i.e., traditional paired-
hedge) to multi-product hedge with a portfolio of products (so-called portfolio-hedge)
with the help of AI tools such as fuzzy logics, neural networks, and genetic algorithms
for portfolio weighting factor “ω” evaluation (we will study all major AI tools in the
next chapter).
Figure 6.19 shows a typical five-product cyclic hedge (5PC-hedge) for the cyclic
hedge of top five foreign currencies: AUD, CAD, EUR, GBP, and USD. Try to figure
out how it works and the logic behind.
Note that most often such kind of high-level and composite hedging strategy
can only be valid and effective within a period of time and restricted to number of
CAD USD
EUR GBP
142 6 Quantum Trading and Hedging Strategy
financial products. That’s why all major fund houses and laboratories recruited top
mathematicians and AI scientists to develop complex trading and hedging algorithms.
In the same way that the author always mentioned in investment talks; nowadays,
the design and implementation of trading and hedging algorithms resemble more to
mathematical and AI problems than classical financial problems.
Considering the complexity of world financial market, one of the most important and
complex hedging systems is the multi-platform multi-product (MP-MP) hedge which
involves multiple-financial products across different financial trading platforms.
The logic behind came from the fundamental concept of financial theory that all
financial markets are the currency flow, e.g., USD behind different major worldwide
financial markets. So, in the perfect case of hedging for risk control, the best solution
should be the hedging across different products and platforms to protect adverse
market change of a particular product/financial market.
Traditional wisdom tells us that USD currently remains as major clearance cur-
rency for three types of worldwide major financial and commodity markets which
include (a) US Index, (b) crude oil, and (c) precious and colored metals gold (or
silver) along with agricultural products such as cotton and sugar that they are of
great consideration as shown in Fig. 6.20.
Many fund houses and financial institutions have active research for the mining of
such golden combination using various AI techniques such as fuzzy-neuro networks,
hybrid EC (evolutionary computing) systems, deep neural networks, etc. Active R&D
on this challenging topic is being carried out at worldwide fund houses, financial
institutions, and universities (Iba and Aranha 2012).
In previous chapters, we have learnt that basic concepts of quantum finance stem
from two different aspects:
• Path integral approach and
• Quantum anharmonic oscillator approach.
Path integral approach is based on Feynman’s path integral by the modeling and
integration of all possible paths of the quantum financial particles. Major applications
are exercised on the modeling and primary financial markets evaluation such as
forward interest rate and option pricing.
Quantum anharmonic oscillator (QAHO) approach is based on the modeling and
numerical approximation of the quantum finance Schrödinger equation (QFSE) into
quantum anharmonic oscillation—a quartic polynomial equation that can be solved
numerically by simple numerical computational model. Major applications are exer-
cised on the evaluation of quantum finance energy levels (so-called quantum price
(energy) levels, QPL) for any financial products in the secondary financial markets
(Fig. 6.21).
Which one should we employ to design quantum trading and hedging strategy?
and why?
Since December 1, 2017 with patented quantum finance technology, quantum finance
forecast center (QFFC.org) provides daily (and weekly) free financial forecasts for
worldwide 120+ financial products which include the following:
• 9 major cryptocurrencies,
• 84 forex,
• 19 major commodities, and
• 17 worldwide financial indices.
Up to December 31, 2018, QFFC has over 10000+ registered users which include
worldwide professional traders and investors.
Figures 6.23 and 6.24 show snapshots of daily forecast results of BTCUSD (Bit-
6.7 Quantum Trading and Hedging Strategy 145
coin versus USD) and forex pair USDCAD on April 15, 2019. At 08:00 HKT (UTC
00:00), QFFC calculates the following for 120+ worldwide financial products:
• Forecast high/low and
• Eight closest QPLs.
Professional traders and investors can base on these forecasts with QPLs and
integrate with their program trading strategies for intelligent trading.
QFFC members can also make use of QFFC’s API to integrate the daily fore-
casts/QPLs into their MT4 EA programs for intelligent trading.
In the next section, we will study some basic quantum trading and hedging tech-
niques/strategies.
6.7 Quantum Trading and Hedging Strategy 147
In comparison with technical and fundamental analysis used in the past 50 years, the
major breakthroughs of quantum finance technology are the scientific computations
of
• Daily (weekly) high/low for day-trade and mid-term trading, with
• QPLs to replace subjective evaluation of support and resistance lines that can be
used for breakout analysis and mid-term/long-term trading/market trend analysis.
The following quantum trading and hedging techniques/strategies are the theoret-
ical characteristics collection of these quantum financial instruments (i.e., forecast
high/low and QPLs) and feedbacks from professional traders and investors using
QFFC forecast services in the past 2 years.
As a friendly advice, for any new trading and hedging, please study carefully and
thoroughly, together with sufficient simulations and test run (at least 100 trading days
as industrial norm) before putting into actual practice.
Different from the major seven trading and hedging strategies, at quantum finance
trading, since we already have scientific daily forecasts and QPLs, the quantum
trading (includes hedging) techniques are categorized in terms of users’ trading
experiences, which is also the way we have conducted investment seminars in the
financial community nowadays.
Just like driving, financial trading is a kind of practical activity that not only require
professional knowledge but also practical experience. Any experienced investor with
over decades of trading experience must realize that trading (and especially “fail-
ure”) experiences are very important elements for every investor and trade. Espe-
cially nowadays program trading is accompanied by monitoring and handling trading
strategies of multiple products in multiple-financial markets.
As an industrial norm, we set 3–5 years (around 1000 transactions) to define
whether an investor is experienced or inexperienced.
For inexperienced investors who don’t have sufficient skills on high-level trading
techniques such as breakout trading, hedging, and release-hedge skills, they are
suggested to perform basic quantum forecast oscillation trading strategy (QT#1-
QFOTS).
QT#1-QFOT are based on daily forecasts, together with daily calculated QPLs as
SL (stop loss) and TP (target profit) to perform day trade.
The logic behind is: for any financial market, over 80% of time are undergoing so-
called oscillation between the day-high and day-low. Since we already have evaluated
the forecast high/low, we can simply use them as approximation of the day-high/low
148 6 Quantum Trading and Hedging Strategy
for reversal trading. That is, set the buy limit at the forecast low and sell limit at the
forecast high.
Also, for SL and TP, we can simply use daily QPLs as reference levels as example
shown in Fig. 6.25 for XAUUSD on April 15, 2019.
As we have learnt from the beginning of this chapter, averaging is a simple and good
technique not only as risk control but also for investment diversification.
Naturally, we can adopt averaging technique into our quantum forecast oscillation
trading strategy.
Just like working S/R lines as averaging levels, we can now employ QPLs for
averaging levels, which, in fact, is entirely inherent to quantum theory and quantum
field concepts also learnt in previous chapters.
6.7 Quantum Trading and Hedging Strategy 149
Use UK oil forecast on April 15, 2019 as example shown in Fig. 6.26. If we set first
buy limit at the forecast low 7149, we can set the second buy limit at the lower QPL,
i.e., 7128, and the third one at 7069, each with one-third of the day-trade investment.
Of course, remember to set SL, say, at the fourth QPL 6997.
By doing so, we can, on one hand, self-guard investment with a reasonable level
of oscillations for the financial product, and on the other hand, provide a reasonable
investment diversification with reasonable level of stop-loss mechanism.
In fact, not only inexperienced investors, many professional traders usually per-
form this strategy when they identify a particular financial market has a very high
chance of oscillation that always occurs during Asia trading period.
150 6 Quantum Trading and Hedging Strategy
Among the seven major trading and hedging techniques, breakout trading is an
important trading skill for experienced traders and investors.
In actual fact, the success in identifying financial market whether it is an oscillating
market or high chance of market breakout defines whether one is an experienced or
inexperienced trader.
According to quantum finance theory, if a financial market undergoes severe
excitations, either by some financial news outbreaks or some important financial
figures/indices (e.g., GDP, PMI, etc.) announcement, the financial quantum particle
should jump from one QPL to another one, in a discrete manner. In fact, the author
customarily observed this phenomenon while working as chief analyst in a fund
house and conducting R&D on quantum finance.
The truth is: The more excited the stimulus is, the more accurate and precise is the
quantum jump. That’s why breakout trading is so important in financial investment.
Use UK100 index forecast on April 15, 2019 as example shown in Fig. 6.27. For a
day-low breakout, we can use the lower three QPLs (or more) for breakout strategy,
i.e., 7395.2, 7364.6, and 7330.5. Similar case for day-high breakout.
One important reminder, according to quantum finance theory, the range between
day-high and day-low is the ranging of normal daily oscillation of the financial
market. We should determine the market as breakout if the market jump/fall beyond
the oscillating region.
Fig. 6.27 Quantum finance forecast of UK100 index on April 15, 2019
The truth is: once market breakout, anything can occur. So, for those use breakout
strategy, all we need to do (and should) is to choose a good position to harvest the
gain. That’s all. Nothing else (traditional wisdom).
In fact, this also differentiates between an experienced versus inexperienced
trader. For an experienced trader, one will know that statistically speaking it is very
difficult to harvest a good breakout gain and followed by a reversal gain. So, one will
harvest the big gain and take a rest. But for inexperienced investor, one will make a
usual human mistake, hubris—thinking one is invincible and continue with reverse
trading until a huge loss had incurred.
152 6 Quantum Trading and Hedging Strategy
Fig. 6.28 Quantum finance forecast of HSI (Heng Seng Index) on April 15, 2019
• To capture the 80% oscillation market, set buy limit and sell limit at the forecast
low and forecast high, respectively, such as 1.57314 and 1.59218, respectively, as
shown in Fig. 6.29.
• To cater for the 20% breakout scenario, do the SP hedging, i.e., set sell at each
QPL beyond the forecast low, combine with averaging and hedging techniques for
breakout market. Similar for buy-side breakout.
Depends on the trading skills and/or actual market movement, professional traders
can have some variations of QFSPHS. For example, one can release the hedge using
QPL(s), i.e., do a hedge at each breakout QPL, and partial cut-loss (release the hedge)
simultaneously. That is to conform with quantum finance theory and is a wise move
to partial release the hedge.
By using the same technique, one can naturally design and implement more com-
plex, cleverness multi-product and multi-platform quantum hedging strategies.
As an old saying, anything is possible. It all depends on our imagination.
154 6 Quantum Trading and Hedging Strategy
6.8 Conclusion
In this chapter, we have studied seven major trading strategies which can be applied
to financial products and trading platform.
Also, we have studied how to apply quantum finance to design quantum trading
and hedging strategy.
Note that these methods can be applied effectively only if one has sufficient
knowledge and actual experience of technical analysis and quantum finance.
In addition, trading activities can be (and should be) carried out by a combination
of these techniques and strategies to yield the best performance.
A final reminder: risk control strategy is the most important strategy that we
must always bear in mind. The fact is: The biggest failure is always the one at most
confident and lack of risk awareness.
Problems
6.16 Discuss and explain why portfolio trading becomes a popular strategy for the
design of trading and hedging strategy. How it works?
6.17 Discuss and explain any three latest R&D of trading and hedging strategies
using AI and related technology.
6.18 Why AI technologies such as fuzzy logic and genetic algorithms are commonly
used in the design of intelligent trading and hedging systems?
6.19 What are the major limitations of using technical analytical techniques and
tools for the design of trading strategies? and how quantum finance provides
an alternative solution?
6.20 In the old days, financial trading and hedging are totally two different concepts
and methodologies, but now the distinction between them becomes obscure.
Why? Is it related to the popularity of program trading?
6.21 What are Bollinger Bands? Discuss and explain how to use Bollinger Bands
to design trading strategy. What are the major limitations and how quantum
finance can be applied to resolve these problems?
6.22 What is stop-loss strategy? Why it is important especially for the design of
program trading strategies?
6.23 State and discuss three major hedging strategies. Give an example of financial
product for explanation.
6.24 Discuss and explain the major concepts and approach of quantum trading.
Which one is more preferable for the application to program trading? Why?
6.25 Discuss and explain the major similarities and differences between QPL and
S & R in technical analysis. How we can use QPL to replace S & R for the
design of program trading and hedging algorithms?
6.26 State and explain three levels of quantum finance trading and hedging strate-
gies. Why they are divided into three levels? Each of them uses a financial
product as example to explain how it works.
6.27 For inexperienced investors, it is preferable to use daily forecasts together with
simple stop-loss strategy instead of hedging technique. Why?
6.28 Quantum trading program.
(i) Study MQL workshop from QFFC.org to learn the basic skill of design
and writing MQL-based trading programs.
(ii) Finish workshop #1 to learn how to design and implement an MQL
program to calculate all the QPR and QPL of any financial product
based on the past (says) 2000-trading day time series.
(iii) Finish workshop #2 to learn how to design and implement quantum
finance forecast system to calculate the daily forecast high/low of any
financial product.
(iv) Based on the level 1 quantum trading strategies to implement: (1)
QT#1.1 quantum forecast oscillation trading strategy (QFOTS) and (2)
QT#1.2 quantum forecast oscillation trading with averaging strategy
(QFOTAS) using QPL for at least five forex products (e.g., AUDCAD,
EURJPY, USDCAD, EURGBP, etc.).
6.8 Conclusion 157
(v) First, use MT4 simulator to test for the trading performances of these
five products for at least 1 year.
(vi) Second, use demo account to perform the mock trading for at least 20
trading days (i.e., 1 month) and compare their trading performance and
overall monthly returns.
(vii) Once you are experienced in quantum trading, implement the level 2
and level 3 quantum trading strategies and compare their trading per-
formances.
References
Allen, F. and Karjalainen, R. (1999) Using genetic algorithms to find technical trading rules. Journal
of Financial Economics. 51(2): 245–271.
Byun, H. W. et al. (2015) Using a principal component analysis for multi-currencies-trading in the
foreign exchange market. Intelligent Data Analysis. 19(3): 683–697.
Chang, Y. and Lee, M. (2017) Incorporating Markov decision process on genetic algorithms to
formulate trading strategies for stock markets. Applied Soft Computing. 52: 1143–1153.
Evans, C. et al. (2013) Utilizing artificial neural networks and genetic algorithms to build an algo-
trading model for intra-day foreign exchange speculation. Mathematical and Computer Mod-
elling. 58(5–6): 1249–1266.
Helseth, A. (2016) Stochastic network constrained hydro-thermal scheduling using a linearized
progressive hedging algorithm. Energy Systems. 7(4): 585–600.
Hsu, Y. et al. (2009) Profit refiner of futures trading using clustering algorithm. Expert Systems With
Applications. 36(3): 6192–6198.
Iba, H. and Aranha, C. C. (2012) Practical Applications of Evolutionary Computation to Financial
Engineering: Robust Techniques for Forecasting, Trading and Hedging (Adaptation, Learning,
and Optimization). Springer.
Kaufman, P. J. (2013) Trading Systems and Methods. Springer.
Leshik, E. and Cralle, J. (2011) An introduction to algorithms for stock trading on the NASDAQ
and New York Stock Exchange, Wiley-Blackwell.
Li, Z. et al. (2017) Research on Quantitative Trading Strategy Based on Neural Network Algorithm
and Fisher Linear Discriminant. International Journal of Economics and Finance. 9(2): 133.
Liu, X. et al. (2017) Quantified moving average strategy of crude oil futures market based on fuzzy
logic rules and genetic algorithms. Physica A: Statistical Mechanics and its Applications. 482:
444–457.
Murphy, J. J. (1999) Technical Analysis of the Financial Markets: A Comprehensive Guide to
Trading Methods and Applications. New York Institute of Finance.
Naranjo, R. et al. (2015) An Intelligent Trading System with Fuzzy Rules and Fuzzy Capital
Management. International Journal of Intelligent Systems. 30(8): 963–983.
Nelken, I. (1999) Pricing, Hedging, and Trading Exotic Options: Understand the Intricacies of
Exotic Options and How to Use Them to Maximum Advantage. McGraw-Hill.
Pauna, C. (2019) Data Mining Methods on Time Price Series for Algorithmic Trading Systems.
Informatica Economica. 23(1): 26–36.
Rhoads, R. (2011) Trading VIX Derivatives: Trading and Hedging Strategies Using VIX Futures,
Options, and Exchange-Traded Notes. Wiley.
Schmidt, G. et al. (2010) Experimental Analysis of an Online Trading Algorithm. Electronic Notes
in Discrete Mathematics. 36: 519–526.
158 6 Quantum Trading and Hedging Strategy
Shiau, J. (2009) Optimization of Reservoir Hedging Rules Using Multiobjective Genetic Algorithm.
Journal of Water Resources Planning and Management. 135(5): 355–363.
Tuchong (2019) Intelligent trading and market analysis. http://stock.tuchong.com/image?imageId=
533733773505462352. Accessed 21 Aug 2019.
Vella, V. and Ng, W. L. (2015) A Dynamic Fuzzy Money Management Approach for Control-
ling the Intraday Risk-Adjusted Performance of AI Trading Algorithms. Intelligent Systems in
Accounting, Finance and Management. 22(2): 153.
Yang, S. Y. et al. (2018) An investor sentiment reward-based trading system using Gaussian inverse
reinforcement learning algorithm. Expert Systems with Applications. 114: 388–401.
Zhang, J. and Maringer, D. (2016) Using a Genetic Algorithm to Improve Recurrent Reinforcement
Learning for Equity Trading. Computational Economics. 47(4): 551–567.
Chapter 7
AI Powerful Tools in Quantum Finance
What is intelligence?
What is artificial intelligence?
What are the core AI technologies?
How can we apply AI to quantum finance?
All who have heard about artificial intelligence (AI) must be familiar with Sir Alan
Turing—the father of AI with his famous Turing test. He was an English mathe-
matician, computer scientist, cryptanalyst, and theoretical biologist. He was highly
influential in the development of theoretical computer science, provided a formal-
ization on algorithm concepts and computation with his famous invention—Turing
machine was deemed as original computer prototype. His famous quotation brought
out the foundation concept and AI notion—machine or software to mimic and exem-
plification of human behaviors, which is also the core concept of Turing test.
In previous chapters, we have learnt the basic concepts of quantum finance.
More importantly, we have learnt how to make use of time series returns, together
with quantum anharmonic oscillator model of quantum finance Schrödinger equation
to evaluate quantum price levels (QPLs) on any financial market, which provide us
a new way and concrete solution to model financial markets.
We have also learnt how to apply QPLs, together with the seven major financial
trading (hedging) techniques to design and implement quantum trading and hedging
systems. The only component left behind is: how to make use of time series financial
information, together with QPLs to forecast financial markets using state-of-the-art
AI techniques?
© Portions of this chapter are reprinted from Lee (2006), with permission of Springer Nature.
judge is likely to pick out either subject, it showed that the computer has succeeded
in revealing to think with human intelligence.
Modern version of the Turing test has employed more than one human judge
to converse and interrogate with both subjects. The test is marked success if more
than 30% of the judges contemplated the computer program as human subsequent to
five minutes’ conversation. The Loebner Prize is an annual Turing test competition
that was started by American inventor and activist Dr. Hugh Loebner (1942–2016)
in 1991. He created additional rules to the original Turing test, calling for human
and computer program to have 25-min conversation with each of the four judges
presiding over the competition. The winner of the competition (not necessarily one
that passes the Turing test) is the one whose computer bot received the most votes
and highest ranking from the judges, regardless of whether there were 30% judges’
votes. Despite Sir Alan Turing predicted that by year 2000 machines would eventually
pass the Turing test, this did not occur until 2014. In 2014, Professor Kevin Warwick
organized a Turing test competition to mark the 60th anniversary of Sir Alan Turing’s
death. A computer chatbot called Eugene Goostman with the persona of a 13-year-
old boy had passed the Turing test in this competition. He secured 33% judges’ votes
who were convinced that he was human.
7.1.2 Definition of AI
Although there is no official definition of AI, one refers to definition of AI from Web-
ster’s Dictionary and the American Association for Artificial Intelligence (AAAI)
as
162 7 AI Powerful Tools in Quantum Finance
The capacity of computers or programs to operate in ways to mimic human thought processes,
such as reasoning and learning.
—Webster’s New College Dictionary
The scientific understanding of the mechanisms underlying thought and intelligent behavior
and their embodiment in machines.
—AAAI
Professors Stuart Russell and Peter Norvig in their remarkable book: Artificial
Intelligence—A Modern Approach (2015) provided a substantial survey on AI defi-
nition in four major categories:
• Systems that think like human;
• Systems that think rationally;
• Systems that act like human; and
• Systems that act rationally.
In author’s book—Fuzzy-Neuro Approach to Agent Applications published by
Springer in 2006 (Lee 2006) defined AI as (Fig. 7.2)
The exemplification of human intellectual thoughts, acts and behaviors for the design and
implementation of intelligent systems, software objects (agents) and robotic systems.
Since Dartmouth conference, many AI scientists at that time predicted that a machine
with human intelligent would exist in no more than a generation and they were given
7.1 An Overview of Artificial Intelligence 163
millions of dollars to make this vision come true. However, it became apparent that
the difficulties of constructing human-like robot were underestimated.
In 1973, in response to criticism of prolonged progress, shortages of practical and
promising AI applications, both U.S. and British Governments terminated funding
undirected research on artificial intelligence subsequent to winter of AI. Seven years
later, a visionary initiative by the Japanese Government inspired governments and
industry to provide billions of dollars on AI research, but by the late 80s investors
became disillusioned by insufficient computer capacity (hardware) and withdrew
funding again.
It was not until the first decades of twenty-first century, investment and interest in
AI revived, while machine learning was successfully applied to many problems in
academia and industry due to the presence of powerful computer hardware. It was
called the second golden age of AI.
One special feature of AI is the conformity with AI. There were debates after
Dartmouth conference even ongoing at present, on AI general definition and classi-
fication.
Professor Robert Wilensky (1951–2013), an influential AI scholar mentioned
in his work—Planning and Understanding: A Computational Approach to Human
Reasoning stated that:
Artificial Intelligence is a field renowned for its lack of consensus on fundamental issues.
One typical example was the argument between strong (hard) AI versus weak
(soft) AI. Some AI scientists believed that AI should focus on the design and sys-
tems/programs implementation that mimic and simulate how human think and act—
the so-called weak AI. Opponents believed that AI systems should not only think
and act like human, but rather should think and behave consciously like human—
so-called strong AI.
In fact, Turing test is an exemplification example of strong AI.
Strong AI refers to the study of machine intelligence that could successfully perform
any intellectual task as per human. It is also called artificial general intelligence
(AGI).
Key characteristics of strong AI include the ability to reason, solve puzzles, make
judgments, plan, learn, and communicate. It should have consciousness, objective
thoughts, and self-awareness.
Some AI scientists argue that a machine with strong AI should be able to go
through the same human development process, starting with a childlike mind through
learning in developing an adult mind. It should be able to interact with the world,
learn from it, acquire its own common sense, and language. Another argument is that
we will not know when we have developed strong AI (if it can indeed be developed)
because there is no consensus on what constitutes intelligence.
164 7 AI Powerful Tools in Quantum Finance
Artificial neural networks (ANNs) (or neural networks in short) is one of the major
components of microscopic AI, which focus on the study and modeling of intelligent
system to mimic one of the most important human organs—the brain.
The first scientist to work in the area of brain science was Italian physician Profes-
sor Camillo Golgi (1843–1926) who invented the stain method to investigate neural
activities inside the brain (Bentivoglio 2014). By using this method, he proposed
that the brain is made up of syncytium—a sponge-like tissue that is activated by the
staining operation. Based on his discovery, Spanish neuroanatomist Professor San-
tiago Ramón y Cajal (1852–1934) proposed an innovative idea that “these staining
tissues were not sponge-like elements, but rather the collections of the brain cells
called neurons”, which were interlinked together to form a complex group—neural
networks as shown in Fig. 7.5. Both esteemed medical professionals were awarded
the Nobel Prize for Physiology or Medicine in 1906.
Figure 7.5 shows each neural cell (neuron) consists of
• nucleus—central body of the neuron;
• axon—prolonged filament which connects to other neurons;
• dendrites—tree-like structures which branch from the neuron; and
• synapse—the axon tips (junctions) that make contact with other neurons by attach-
ing to the dendrites of these neighboring neurons.
7.2 Neural Networks—The Brain of AI 167
Latest neuroscience revealed that human brain consists of around 1011 neurons.
The enigma is: the volume of neurons in human brain is so massive that we can only
make use of less than 10% of neurons throughout our lives, which is rather against
the basic evolution theory.
In fact, how such biological neural network works was still a mystery at that time.
Prior 1943, almost all neuroscientists believed that the sole purpose of neurons was
to process energy. Yet the way they work such as how to process information and
store memory was unsolved.
In 1943, neurophysiologist Professor Warren McCulloch (1898–1969) and mathe-
matician Professor Walter Pitts (1923–1969) published an influential paper A logical
calculus of the ideas immanent in nervous activity (McCulloch and Pitts 1943) which
set off the birth of artificial neural networks, ANN in short (Abraham 2016).
In the paper, they proposed that the main function of neural activities was to
process information—not energy storage. They maintained that the functions of the
neurons were just like logical switches. Signal transmission from one neuron to
another at synapses is the result of a complex chemical process in which specific
transmitter substances are released from the sending points of the junctions. If the
potential reaches a certain threshold, a pulse will be generated down the axon, known
as firing, as shown in Fig. 7.6. More importantly, in the paper, they demonstrated
168 7 AI Powerful Tools in Quantum Finance
Fig. 7.6 3D illustration of integrate and fire in neural network (Tuchong 2019c)
how their proposed network (now called artificial neural network) could be used to
perform basic logical operations such as and, or, and not operations.
This breakthrough has not only merely solved the century mystery of how biologi-
cal neural network works, but also provided a solid foundation for digital computing
technology development.
Although we now understand that the neural activities in our brains are quite
different from logical switches such as transistors in digital computer, they behave
somewhat nonlinear (or even chaotic) integrate-and-fire operators for information
process and transmission. This discovery in 1943 coined the first golden age of
artificial neural networks.
As a direct analog of the biological neuron, the schematic diagram of neuron structure
can be interpreted as a computational model in which synapses are represented by
weights that modulate the effect of associated input signals, the formulation is given
by
n
y=f wi xi (7.1)
i=1
where x is the input signals, w’s are the weights, and y is the output.
7.2 Neural Networks—The Brain of AI 169
1
f (x) = (7.2)
1 + e−σ x
1 − e−σ x
f (x) = (7.3)
1 + e−σ x
in which σ is the steepness parameter to control the curvature of the transfer function.
The learning capability of an artificial neuron is achieved by adjusting the weights
in accordance with a predefined learning algorithm, usually in the form of
wj = ασ xj (7.4)
Artificial neural networks (ANNs, or neural network in short) are the pieces of a
computing system designed to simulate the way human brain analyzes and pro-
cesses information. They are the foundations of artificial intelligence (AI) and solve
170 7 AI Powerful Tools in Quantum Finance
Fig. 7.8 A typical single hidden layer artificial neural network model
7.2 Neural Networks—The Brain of AI 171
Following half a century of development, numerous neural networks have been pro-
posed with over 20 different types of commonly used ANNs.
Generally, ANNs are commonly classified by (1) machine learning techniques
(Fig. 7.9) and (2) areas of application (Fig. 7.10).
In terms of machine learning techniques, ANNs can be categorized into three
main types:
1. Supervised-learning (SL) neural networks—network learning (training) based on
input–output (target output) pairs. Typical examples include feedforward back-
propagation neural network (FFBPN), Hopfield network, support vector machine
(SVM), radial basis function (RBF) network, etc.
2. Unsupervised-learning (UL) neural networks—neural networks that do not
need any supervised learning and training strategies, include all kinds of self-
organizing, self-clustering, and learning networks such as SOM, ART (adaptive
resonant theory), etc.
3. Reinforcement-learning (RL) neural networks—different from supervised-
learning counterpart with well-defined input–output pairs, reinforcement learn-
ing trains the neural network to adopt with feedback signals, namely, reinforce-
ment signal (RS). For the right behavior, the network will respond with a posi-
tive RS to award the RL network, whereas the wrong behavior, the network will
respond with a negative RS to punish the RL network. This method is particu-
larity useful to tackle optimization problem without exact target solutions such
as trading strategy optimization. We will study the advanced topics in detail on
multiagent-based intelligent trading strategies in Chap. 13.
ANN
(By network learning classifica on)
ANN
(By Applica on Areas)
Pa ern Associa ve
Classifica on Predic on Op miza on
Recogni on Memory
Key:
AAM Auto-associaƟve Memory LTSM Net. Long Short -Memory Term Network
ART AdapƟve Resonant Theory RBFN Radial Basis FuncƟon Network
BAM BidirecƟonal AssociaƟve Memory SOM Self-Organizing Map
FFBPN Feedforward BackpropagaƟon Network SVM Support Vector Machine
HAM Hetero-associaƟve Memory
In terms of areas of application, ANNs can be categorized into five major types:
• classification,
• prediction,
• pattern recognition,
• associative memory, and
• optimization.
Figure 7.10 shows the classification of ANNs by areas of application. As shown
in Fig. 7.10, there are certain ANNs such as feedforward backpropagation network
(FFBPN) and radial basis function network (RBFN) that can be used on multiple area
applications such as classification, prediction, and pattern recognition, whereas other
ANNs such as bidirectional associative memory (BAM) and Boltzmann machine are
specialized to a particular application area.
In this chapter, we will study three basic and commonly used ANNs, they are as
follows:
• Associative network,
• Hopfield network, and
• Feedforward backpropagation network (FFBPN).
7.2 Neural Networks—The Brain of AI 173
x2 y2
xi yj
wnm
xn ym
174 7 AI Powerful Tools in Quantum Finance
The Hebb rule (Hebb 1949) is commonly used for network training. Figure 7.12
shows the network training algorithm of auto-associative network (Fausett 1994;
Patterson 1996).
Binary and bipolar vectors can be used in associative networks.
Both training
vectors will be a set of training input and target output pairs x , y .
Hebb rule is simple to exercise on weight adjustments, and other methods such
as the delta rule can also be adopted. In that case, the weight adjustment formula (in
Step 2.3) will be replaced by
wij (new) = wij (old ) + α yj − yj xi where i ∈ [1 . . . n], j ∈ [1 . . . m] (7.5)
Zk+1 Zk+2 Zl
Z1 Z2 Zk
w1l
w1N
Professor John Hopfield published his influential paper in 1984, Neurons with graded
response have collective computational properties like those of two-state neurons
(Hopfield 1984). In this paper, he described how a simple recurrent auto-associative
network can be used for content-addressable memory systems. Hopfield network also
provided a model for the understanding of human memory, which can also be used
in pattern recognition to tackle complex optimization problems such as the typical
traveling salesman problem (TSP).
The architecture of Hopfield network (Fig. 7.13) is similar to a classical auto-
associative network but with three basic differences:
1. Hopfield network is a recurrent network in the sense that output nodes in one
time step are fed as input in the next time step.
2. In classical associative network, all neurons update their activations simultane-
ously, whereas in Hopfield network, one neuron selects solely at a time to update
its activation and then broadcast its new state to other members of the network.
3. Each neuron keeps on receiving the stimulus from external signal during the
entire auto-association process.
Hopfield network’s key aspect is that it demonstrated how a powerful memory stor-
age and retrieval device can be composed of simple auto-associative network mod-
ification. Figure 7.14 shows the training algorithm of a classical discrete Hopfield
network.
176 7 AI Powerful Tools in Quantum Finance
Different from the previous two neural networks, feedforward backpropagation net-
works (FFBPNs) provide a multilayer network architecture (Lee 2006; Silva et al.
2017).
A typical FFBPN consists of an input layer, a hidden layer, and an output layer
as shown in Fig. 7.15. Although FFBPN can consist of several hidden layers, one or
maximum two hidden layers are usually sufficient in most of the cases.
The network training of FFBPNs consists of three main processes:
1. The feedforward process of network training;
2. The error evaluation process to calculate the errors between calculated output
values and target output values; and
3. The backpropagation process of the errors for weight adjustments.
Similar to most other networks, training terminates when errors are bound within
the tolerance level.
Note:
• In the network architecture, w’s denote network weights between the input and
hidden layers, and u’s denote network weights between the hidden and output
layers.
• The total numbers of neurons located in input (n), hidden (t), and output layers
(m), respectively.
• For activation functions, normally a sigmoid function is adopted.
Figure 7.18 shows the training algorithm of a typical FFBPN.
An FFBPN can model various kinds of problems such as weather prediction and
stock forecasting, pattern recognition such as character recognition, classification,
and even optimization. In quantum finance stock (or forex) prediction, after time
series financial data (e.g., Daily O, H, L, C, V) are normalized, they are used together
with QPLs as input signals for network training in order to calculate next day’s H/L
forecasts. Figure 7.16 shows the training algorithm of FFBPN.
However, FFBPN has certain intrinsic limitation such as trapping in local minima
along with difficulty in choosing optimal parameter settings (and input vectors).
Lengthy convergence rate is also another major concern. A possible solution is the
integration with chaotic neural oscillator technique will be studied in Chap. 9.
In this section, we have studied an overview of neural networks, their basic structure,
and mechanisms.
Current trends of neural networks research and development are focused on three
major areas:
1. The integration of other AI techniques to remedy certain classical neural net-
works intrinsic limitations includes fuzzy logic—fuzzy-neuro systems, genetic
algorithms (GAs) to overcome parameter selection problem and to fine-tune net-
works;
2. The investigation and study in neural dynamics, especially in neural oscillators,
neural oscillatory models; and
3. The investigation and study in chaotic neural dynamics of chaotic neural networks
to model complex AI problems (Figs. 7.17 and 7.18).
Is performance OK/
STOP
?
An evaluation function f (x) is applied to the population to compute the fitness value
of a chromosome.
This evaluation function varies among different problems.
7.3 Genetic Algorithms—The Optimization Engine 183
fi
pi = m (7.6)
j fj
Those chromosomes selected for the possibility of reproduction are directly pro-
portional to their fitness value, and they conform to the basic feature of natural
selection that: A fitter organism has a higher chance of survival, hence reproduction.
In GA, there are two main operators for reproduction, namely, crossover and muta-
tion.
184 7 AI Powerful Tools in Quantum Finance
1 0 1 1 0 0 0 1 1 0 1 1 1 0 1 0
0 0 1 1 1 0 1 0 0 0 1 1 0 0 0 1
1 1 1 0 1 1 0 0 0 1 0 1 0 1 0 0 1 0
1 0 1 1 1 0 1 1 0 1 1 1 1 1 1 1 0 0
For mutation operations, a single chromosome is selected from the population which
will be screened throughout the entire list.
Basically, there are five basic types of mutation (Fig. 7.22):
• Deletion,
• Duplication,
• Inversion,
• Insertion, and
• Translocation.
7.3 Genetic Algorithms—The Optimization Engine 185
7.3.8 GA—Implementation
In the elitism scheme, parents with the highest fitness value will be retained in
next generation in order to guarantee the performance of the population at a certain
standard.
For crossover operation, a two-point crossover in the other extreme to uniform
crossover can be applied for other GA schemes.
For setting GA parameters, besides using a fixed crossover and mutation rates
throughout the whole evolutionary process, a dynamic crossover and mutation rate
assignment scheme can also be used.
The ratio of mutation rate will normally be set to a higher value when the number
of generations increases to a higher level, such as 500 iterations.
The main reason for this is to induce a higher diversity of the chromosomes when
the entire population evolves to a more mature stage, whereas a higher mutation rate
can bring more “freshness” to the population.
7.3.9 GA—Applications
As one can see, genetic algorithm (GA) is based on the foundation of evolution theory
that focuses on target system improvement after generations of evolution.
Naturally speaking, GA is particularly useful to tackle two main categories of
problem:
• Optimization problem and
• Scheduling problem.
Besides, GAs have been widely used with neural networks in two specific areas:
• Topology optimization
• Genetic training algorithms
In topology optimization, GAs are used to select the optimal topology (or param-
eter setting) for neural network which in turn is trained using some fixed training
scheme such as FFBP training.
In genetic training algorithms, the learning of a neural network is formulated as
a weight optimization problem, usually using the inverse mean square error as the
fitness evaluation scheme.
In Part II of the book—applications of quantum finance, we will study how GA
can be used for the selection of top-10 fuzzy financial signals in a quantum finance
transient-fuzzy DNN (deep neural network) for financial prediction as in Fig. 7.23.
7.4 Fuzzy Logic—The Fuzzification Engine 187
In our daily lives, we have to handle numerous things all the time—solving problems,
asking and answering questions, etc.
At the end of the day, if we sit down and recall how many things were handled
that day, we will find that this number is surprisingly large.
188 7 AI Powerful Tools in Quantum Finance
If you take a closer look at all these things, we will find that most (or almost all)
of them have the following three basic properties:
• They are fuzzy and highly uncertain in nature.
• We need our knowledge and/or experience to handle them.
• The methods and/or solutions to handle them are usually highly dynamic (or
sometimes chaotic) in nature.
In fact, we might be aware that things that happen always seem to be highly
chaotic and unpredictable.
Does this mean that we cannot do anything to predict them, or cannot model all
these phenomena to be solved and handled automatically?
The notion of fuzzy is not a new idea. The first scientific and mathematical inter-
pretation for the phenomenon of fuzzy (or one can say the fuzzy property of matter)
attracted little attention from scientists until the feverish study of Heisenberg Uncer-
tainty Principle of matter in the late 1920s and 1930s.
In 1937, Professor Max Black (1909–1988) published his paper Vagueness: an
exercise in logical analysis in the distinguished journal Philosophy of Science pro-
posed to use continuous logic component-wise techniques in sets and lists of elements
(Black 1937).
However, instead of using the name fuzzy sets to describe these vague sets, he
referred to these structures as vagueness. Nevertheless, he was considered to be the
forerunner to propose and define the first fuzzy membership function.
The term fuzzy set was coined by Professor Lotfi A. Zadeh (1921–2017) in 1965 in
his influential paper fuzzy sets published in the journal Information & Control (Zadeh
1965). In this paper, he proposed a modified new kind of set theory (so-called fuzzy
set theory), which was used to describe the belonging degree of an individual member
that can exist as any real value between 0 and 1, instead of just either 0 or 1 (Lee
2006; Ross 2016). Later, in his distinguished 3-Part journal papers The Concept of
a Linguistic Variable and Its Application to Approximate Reasoning published by
Information Sciences in 1975, he established a concrete theoretical and mathematical
foundation on type-1 and type-n fuzzy logics which began the age of fuzzy logic in
the following half-century (Zadeh 1975a, b, c).
Moreover, he also demonstrated how these fuzzy sets could be operated, including
fuzzy set union and intersection, and also developed a consistent framework for
dealing with all of these structures and operations.
He believed that fuzzy sets, instead of crisp sets, should intuitively exist in our
world of experience (Zadeh and Aliev 2019).
More importantly, these kinds of existence were even more naturally accepted by
us and consistent with what we understood as our world of existence.
7.4 Fuzzy Logic—The Fuzzification Engine 189
Structurally speaking, fuzzy logic can be decomposed into four basic components—
the so-called ICMR structural framework of fuzzy logic as shown in Fig. 7.25.
Fuzzy Identification Module
This module focuses on determination and identification of fuzzy variable(s) (FV )
being used in the system.
It is the most important and foremost stage in the entire system design, because an
incorrect (or inappropriate) identification of the FV(s) will defeat the whole purpose
of system modeling.
One important fact is that the same quality (variable) can play totally different
roles in different scenarios for the design of fuzzy systems.
For example, if one wants to use fuzzy logic to represent the following statement:
John is tall—the fuzzy variable being used is the quality height. Although this quality
does not appear in the statement, conceptually speaking it is exactly what we mean
by common sense, or what we called priori knowledge.
However, consider another statement: Most of the students in the class are tall.
In this case, if we want to represent this statement using fuzzy logic, the FV being
used should not be the quality height, but rather it should be the quality most—it
depicts the quality of students’ proportion who are tall in this class! In other words,
we should be very careful in selecting the FV(s) being used in a fuzzy system.
Based on FV(s) being identified in the last module, this module focuses on how to
categorize the selected FV(s) into different fuzzy sets.
By using the example in previous case, for FV height, the possible fuzzy sets will
be short, average, and tall—in which each of them is a fuzzy set with a range of
values:
• short—for student height below 1.55 m.
• average—for student height between 1.5 and 1.65 m.
• tall—for student height over 1.6 m.
As shown in the above example, one major characteristic of fuzzy sets is that there
exists fuzziness in their boundaries.
In other words, there is not always a clear boundary between one fuzzy set and
another, which is totally unacceptable in a traditional crisp set.
Of course, the categorization of fuzzy sets is up to system designer in the sense
that there are no strict criteria for one to decide the number, the type, and nature of
fuzzy sets being used. But it should be logical and make sense.
For instance, instead of using three fuzzy sets, one can further categorize height
into five categories: very short, short, average, tall, and very tall (Fig. 7.26).
For each fuzzy set, the designer has to define its membership function (MF). The
membership function is one of the most important components in fuzzy logic. It
defines fuzzy mapping—the fuzzy belongings of each element within its fuzzy set.
From the mathematical point of view, let X be a collection of objects denoted by
{ x|x ∈ X } which is the so-called universe of discourse.
A fuzzy set A in this universe of discourse X is characterized by a membership
function P A(x) which takes values in the interval [0, 1].
For instance, if we define the fuzzy set A as
A= μA (x)/x (7.8)
X
(x)
1.0
0.63
Short Average Tall
0.23
Fig. 7.27 Fuzzy membership function. Note According to the above fuzzy membership functions.
If we say: the height of a student (Jack) is 1.63, the membership functions for fuzzy sets average and
tall will be 0.23 and 0.63, respectively. The implications for these fuzzy values are: Jack is tall,
but he is not among the tallest ones in the class. But overall speaking, he is taller than the average
students in the class
7.4 Fuzzy Logic—The Fuzzification Engine 193
The above example also demonstrates a very important concept in fuzzy logic—
the fuzzification versus defuzzification scheme. As said, the main concept of fuzzy
logic is to reflect the reality experience of our world (our perceived world), which is
uncertain and fuzzy.
In other words, the main job of fuzzy logic is to act as a bridge (or a crystal ball
as shown) for us to convert precise values (and measurements) from machine world
(the so-called digital world) to imprecise values in real world (the so-called perceived
world) which is full of fuzziness and uncertainty.
From the operational point of view, we denote the forward operation, which is
the conversion of digital measurements from machine world to fuzzy values in the
real world as the fuzzification scheme, while the reverse one is the defuzzification
scheme. From the mathematical point of view, fuzzification is the forward mapping of
membership function, whereas defuzzification is reverse mapping (inverse function)
of the membership function as shown in Fig. 7.28.
This module is the brain of the entire fuzzy system that aims to explore system’s
heuristics by applying the so-called fuzzy reasoning technique.
This module consists of three main processes:
• fuzzy rules construction process (FRCP),
• fuzzy knowledge-based construction process (FKCP), and
• fuzzy inference process (FIP).
Fuzzy Rules Construction Process—Fuzzy Relations (FRs)
During the construction process, it is essential to define a set of rules. Fuzzy rules
are basically set of fuzzy relations (FRs) that normally appear in the form of if-then
propositions. They are also called fuzzy implication functions (FIFs) (Fig. 7.29).
194 7 AI Powerful Tools in Quantum Finance
or written as
Rk = Ak → Bk , k ∈ [1 . . . N ] (7.12)
= 1 ∧ (1 − μA (x) + μB (y))/(x, y)
X ×Y
GMT —For any two fuzzy variables x and y, suppose we are given:
(a) Implication (the fuzzy rule): if x is A then y is B.
(b) Premise: y is B .
(c) Conclusion x is A .
which can be denoted by
This situation arises when there is a complex knowledge base containing a list of
fuzzy rules (Rk ) that correspond to the measured input signals A k for each fuzzy set
Ak .
That is,
x = (A1 , A2 , . . . Ak , . . . An ), y = Bj , j = [1 . . . n] (7.15)
Based on the GMP defined in (7.13), the fuzzy variable B can be inferred as the
composition operation between the fuzzy set Ak and the fuzzy relation R:
B = (A1 , A2 , . . . Ak , . . . An ) ◦ R (7.16)
From the implementation point of view, two composition schemes are commonly
adopted: (1) the sup-min operation and (2) the sup-product operation.
In the sup-min operation, the membership function value μB after the composition
operations, is given by
n
n
n
μB = suprx μAi μAki →μBk (7.17)
k=1 i=1 i=1
In this section, we will use a simple fuzzy air-conditioning control system (FACS)
to illustrate how fuzzy composite reasoning works.
First of all, suppose the FACS can vary its power control (Power) by two environ-
mental factors, namely, air temperature (Temp) and relative humidity (RH), which
are given by two sets of fuzzy variables:
Temp = {Very Cold, Cold, Cool, Mild, Warm, Hot, Very Hot}
RH = {Very Dry, Dry, Humid, Very Humid}
7.4 Fuzzy Logic—The Fuzzification Engine 197
and ranges of temperatures and relative humidity for each fuzzy variable are given
by Table 7.2. The membership function of Temp (x) and Relative Humidity (y) are
shown in Figs. 7.30 and 7.31.
Suppose that the power setting of FACS has three different fuzzy states, given by
Power = {Low, Medium, High}
with the membership function shown in Fig. 7.32.
Table 7.2 Ranges of temperatures and relative humidity for each fuzzy variable
Temperature Fuzzy temp range Relative humidity Fuzzy RH range (%)
description (Fuzzy (°C) (Fuzzy variable)
variables)
Mild 17–25 Dry ≤60
Warm 23–31 Moderate 55–85
Hot 25–33 Humid 65–95
Very hot ≥28 Very humid >75
Assume this power switch is controlled by the following three fuzzy rules:
Rule 1: If Temp is very hot and RH is very humid then switch to high.
Rule 2: If Temp is hot and RH is humid then switch to medium.
Rule 3: If Temp is warm or RH is moderate then switch to low.
Figure 7.33 illustrates a conceptual diagram of a fuzzy logic air-conditioning
system.
Now, given that the temperature is 30 °C and the relative humidity is 80%, the
defuzzification schemes of the power by using the sup-min method and sup-product
method are illustrated in Figs. 7.34 and 7.35.
Room
Temp, RH
Nowadays, fuzzy logic (FL) is widely adopted in many real-world applications rang-
ing from fuzzy electronic appliances such as rice cookers, air conditioners, and
washing machines as in Fig. 7.36 to sophisticated control systems such as robotics
and fuzzy-based ABS (automatic braking systems).
In reality, many Japanese car manufacturers incorporate fuzzy systems for antilock
braking, active suspension systems, automatic transmissions, and engine emission
controls into their automobiles.
Fuzzy systems are easy to set up, typically require less processing power than
alternative approaches and provide robust performance.
200 7 AI Powerful Tools in Quantum Finance
Fig. 7.36 Smart home with fuzzy logic electronic home appliances (Tuchong 2019f)
7.4 Fuzzy Logic—The Fuzzification Engine 201
From the implementation point of view, current fuzzy logic is mainly integrated
with other AI technologies in order to solve complex problems and produce more
sophisticated and comprehensive systems (Lee 2006; Siler and Buckley 2004). This
type of hybrid system integration technique is so-called “hybridization”.
Basically, there are two major kinds:
• Fuzzy expert systems (or fuzzy-ES for short) and
• Fuzzy-neuro systems.
Fuzzy Expert Systems on Financial Trading
Owing to the capability of fuzzy systems that can handle imprecise concepts and
values, fuzzy logic has been widely used in many practical commercial and industrial
applications. Fuzzy-ES focus on the integration of fuzzy with expert knowledge in
classical expert systems.
When fuzzy logic applies in financial trading, a typical schematic diagram of
a fuzzy expert system is required to incorporate a fuzzy knowledge base (KBS)
together with the fuzzification of technical indicators, in order to drive expert advice
and perform day trade.
Figure 7.37 illustrates the conceptual diagram of fuzzy expert systems on financial
trading.
The major shortcoming of the fuzzy system is the lack of learning capability.
The design of fuzzy sets and the assignment of all fuzzy relations are done by
system designers (or experts) without any way of acquiring membership functions
and inference rules automatically.
To solve this problem, hybridization with other AI models that provide automatic
machine learning such as neural networks—the so-called fuzzy-neuro systems were
developed.
Nowadays, fuzzy-neuro systems are widely adopted for solving complex prob-
lems such as stock prediction, severe weather forecasting (e.g., rainstorm prediction),
adaptive tracking systems (e.g., tropical cyclone (TC) tracking systems, missile track-
ing systems), robot vision, etc.
Figure 7.38 shows the integration of fuzzy logic with chaotic neural network
for stock prediction, and we will study quantum finance advance applications in
Chap. 12.
202 7 AI Powerful Tools in Quantum Finance
Input Layer
8-Bifurca on - Level Chao c Neuro- oscillatory Deep Learning Hidden Layers
TOP-10 FFS Vectors
CT2TFM
Output Layer
NEXT DAY Open, High, Low, Close
Forecast
Databank
FTS Vectors
FTSM
Fig. 7.38 System architecture of chaotic type-2 fuzzy deep neural network for financial prediction
(CT2TFDNN)
7.5 Conclusion 203
7.5 Conclusion
In this chapter, we have learnt the basic concept of artificial intelligence, what it is
and how it works.
We had also studied three major components of modern AI technology:
• Artificial neural networks,
• Genetic algorithms, and
• Fuzzy logic.
As mentioned, owing to the advancement of computer technology, the popularity
of Internet technology along with social medium and mobile computing, the needs
of AI and intelligent systems are more than anytime in this new era.
In fact, there are many new AI technologies, algorithms, techniques, and appli-
cations emerging on daily basis.
This chapter is only an introductory course for the path of AI.
The truth is: Different from other disciplines, AI is an integrated and cross-
discipline doctrine ranging from neuroscience and visual psychology to quantum
computing without any boundary. The only limitation is imagination and thoughts.
In next chapter, we will discuss two innovative AI technologies which are related
to financial engineering, and also important components of quantum finance—chaos
theory and fractals.
Problems
7.1 What is artificial intelligence (AI)? Give any three applications of AI in finance
industry and explain how they work.
7.2 What is Turing test? Discuss and explain how it works?
7.3 What discipline of AI does Turing test focus on? Why such test is believed
to be the best method to evaluate a machine (robot) is truly intelligence or
not? Give a live example in daily human interactions and communication to
support your explanation.
7.4 John Searle in 1980 proposed a thought experiment so-called “Chinese room
experiment” to challenge the validity of Turing test for the evaluation of
machine intelligence.
204 7 AI Powerful Tools in Quantum Finance
(i) What is the main argument of John Searle’s Chinese room experiment
to challenge the validity of Turing test for the evaluation of machine
intelligence in AI?
(ii) Does the argument and challenge by John Searle’s Chinese room exper-
iment against Turing test is valid or not? Why?
7.5 What is an intelligent agent in AI? State and explain the three main difference
between an intelligent agent versus traditional computer program (system)?
Give two examples of how intelligent agents can be applied to finance.
7.6 Discuss and explain the major differences between strong AI versus weak AI.
Give two examples of strong AI and weak AI applications and explain how
they work.
7.7 In 1997, IBM Deep Blue defeated world chess champion Mr. Garry Kasparov.
It is also the first time AI computer program defeat world chess champion.
(i) Why this is an important event and milestone in AI history? In other
words, why chess playing with chess master is an important challenge
in AI community?
(ii) In fact, IBM Deep Blue system at that time is a classical AI-based expert
system tailored for chess playing. Discuss and explain what is an expert
system. How it works?
(iii) However, after the world chess contest in 1997, Kasparov in the TV
interview complained that it was not a fair game and not really a kind
of human versus machine intelligence. What was his argument behind?
Do you agree? How this event influences the future development of AI?
7.8 Why was the past 20 years can be claimed as the second golden age of AI?
and what kind of AI is focused on—strong AI or weak AI? What are the logics
behind?
7.9 State and explain the three main disciplines of weak (soft) AI. For each disciple,
give one real-world application of soft AI and explain how it works.
7.5 Conclusion 205
7.10 What is soft AI? Discuss and explain why soft AI is also known as cognitive
approach (CA) AI technology. Name the major four soft AI technologies and
briefly explain how they work.
7.11 What is artificial neural network (ANN)? What is the main difference between
ANN and contemporary computer system in terms of (1) memory storage and
(2) machine learning and computational methods.
7.12 What are integrate-and-fire operations in biological neural networks? Why it
is important in machine learning? And how artificial neural networks model
these operations?
7.13 Describe and state the roles and importance of transfer function in typical
artificial neural networks (ANNs). How can we model transfer function in
traditional ANN?
7.14 Describe and explain the major pros versus cons of using sigmoid function as
transfer function in typical ANN. Give a real-time example in finance predic-
tion to support your explanation.
7.15 What is a multilayer feedforward backpropagation network (FFBPN)?
Describe and explain how it works? State and explain two examples for the
application of FFBPN in finance engineering.
7.16 In a typical multilayer FFBPN, how can we determine the: (1) number of input
and output nodes? (2) number of hidden layers and the number of neurons in
each hidden layer?
7.17 Describe and explain the three major categories of artificial neural networks
(ANNs) in terms of machine learning technique. For each category of ANN,
give one example of application in financial engineering and describe briefly
how it works.
7.18 In machine learning, pattern recognition and time series prediction are sides
of the same coin. Discuss and explain why. Give an example in finance engi-
neering to support your explanation.
7.19 Programming exercise I
(i) Write the flowchart and system training algorithm of feedforward back-
propagation network (FFBPN).
(ii) Write a MATLAB program to implement the FFBPN training algorithm
by using the time series of any financial product (e.g., DJI) exported from
MT4/R platform for short-term financial prediction.
(iii) First, using 5 days to predict next day open/high/low/close.
(iv) Second, using 10 days to predict next day open/high/low/close.
(v) Third, using 20 days to predict next day open/high/low/close.
(vi) Compare their performance in terms of (1) training performance and
(2) forecast performance.
(vii) Which one is better? Why?
7.20 Describe and explain what is genetic algorithm (GA)? What kind(s) of AI
applications and problems GA tackles with? Why? Draw the flowchart of GA
and explain how it works.
206 7 AI Powerful Tools in Quantum Finance
7.21 What is the core idea and innovation of genetic algorithms (GA) in machine
learning? Give two examples of how we can apply GA on finance engineering
and hence quantum finance.
7.22 Discuss and explain the roles and functions of crossover and mutations in GA.
As compared with crossover, explain why mutation must keep at a much lower
rate. What is the logic behind?
7.23 State and explain two typical applications for the integration of ANN with GA
in financial engineering.
7.24 Discuss and explain the relationship between fuzzy logic and uncertainty prin-
ciple in quantum theory. Use two financial markets as example to support your
explanation.
7.25 Discuss and explain how fuzzification process works in fuzzy logic? How can
we apply fuzzification in financial engineering? Give two examples to support
your explanation.
7.26 State and discuss two main types of fuzzy expert systems. For each type of
fuzzy expert system, give one potential application on (1) finance engineering
and (2) quantum finance and explain how they work.
7.27 Discuss and explain why the integration of fuzzy logic with artificial neural
networks (or recurrent neural networks) is commonly used in AI applica-
tions. Give two examples of how fuzzy-neuro systems can be used in quantum
finance.
7.28 Programming exercise II
(i) Repeat 7.19, but this time using MQL to implement the FFBPN in MT4
platform.
(ii) For the input nodes, in addition to the time series information, add
10 commonly used technical indicator as input nodes, which include
iAlligator (alligator oscillator), iMA (moving average), iBands
(Bollinger bands), iMomentum (momentum indicator), iMACD (MACD
oscillator), iRSI (RSI indicator), iRVI (RVI indicator), iStdDev (stan-
dard deviation indicator), iStochastic (stochastic oscillator), and iWPR
(Williams’ percent range indicator).
(iii) Apply fuzzy logic to fuzzification of these 10 technical indices, using
the fuzzification scheme for RSI discussed in this chapter as example.
(iv) Apply genetic algorithm (GA) to choose the TOP 5 technical indicators
for live application.
(v) Implement this GA-based fuzzy-neuro network and compare its perfor-
mance with the traditional FFBPN implemented in (i).
(Note: For detail training workshop on MQL, please visit QFFC.org official site.)
References 207
References
Abraham, T. Rebel (2016) Genius: Warren S. McCulloch’s Transdisciplinary Life in Science. MIT
Press, Cambridge.
Black, M. (1937) Vagueness: An Exercise in Logical Analysis. Philosophy of Science 4(4): 427–455.
Bentivoglio, M. (2014) “Golgi, Camillo”. In Daroff, Robert B.; Aminoff, Michael J. Encyclopedia
of the Neurological Sciences (Second edition. ed.). Burlington: Elsevier Science. 464–466.
Darwin, D. and Huxley, J. (2003) The Origin of Species: 150th Anniversary Edition. Signet; Reprint,
Anniversary edition.
Fausett, L. (1994) Fundamentals of Neural Networks Architectures Algorithms and Applications.
Prentice Hall.
Goldberg, D. E. (1989) Genetic Algorithms in Search, Optimization, and Machine Learning.
Addison-Wesley Professional.
Hansen, W. Classical Mythology: A Guide to the Mythical World of the Greeks and Romans. Oxford
University Press, 2005.
Hebb, D.O. (1949) The Organization of Behavior. New York: Wiley & Sons.
Holland, J. H. (1992) Adaptation in Natural and Artificial Systems: An Introductory Analysis with
Applications to Biology, Control, and Artificial Intelligence. A Bradford Book; Reprint edition.
Hopfield, J.J. (1984) Neurons with Graded Response Have Collective Computational Properties like
Those of Two-State Neurons. Proceedings of the National Academy of Sciences of the United
States of America. 81(10): 3088–3092.
Kramer, O. (2017) Genetic Algorithm Essentials (Studies in Computational Intelligence). Springer.
Lee, R. S. T. Fuzzy-Neuro Approach to Agent Applications (From the AI Perspective to Modern
Ontology). Springer-Verlag, Heidelberg Germany, 2006.
Lee, R. S. T. A Transient-chaotic Auto-associative Network (TCAN) based on LEE-oscillators.
IEEE Transactions on Neural Networks. 15(5): 1228–1243, 2004.
McCulloch, W. and Walter, P. (1943). A Logical Calculus of Ideas Immanent in Nervous Activity.
Bulletin of Mathematical Biophysics. 5 (4): 115–133, 1943.
Patterson, D. W. (1996) Artificial Neural Networks. Prentice Hall.
Ross, T. J. (2016) Fuzzy Logic with Engineering Applications. Wiley.
Russell, S. and Norvig, P. (2015) Artificial Intelligence: A Modern Approach, 3rd edition. Pearson
Education India.
Siler, W. and Buckley, J. J. (2004) Fuzzy Expert Systems and Fuzzy Reasoning. Wiley-Interscience.
Silva, et al. (2017) Artificial Neural Networks: A Practical Course. Springer.
Tuchong (2019a) Illustration of AI. http://stock.tuchong.com/image?imageId=
286594758192922638. Accessed 21 Aug 2019.
Tuchong (2019b) Weak AI. http://stock.tuchong.com/image?imageId=467459610627670027.
Accessed 21 Aug 2019.
Tuchong (2019c) 3D illustration of integrate-and-fire in neural network. http://stock.tuchong.com/
image?imageId=483388184041619483. Accessed 21 Aug 2019.
Tuchong (2019d) Neural network and AI. https://stock.tuchong.com/image?imageId=
490703320800559171. Accessed 21 Aug 2019.
Tuchong (2019e) Populations of chromosomes. http://stock.tuchong.com/image?imageId=
453246275369566360. Accessed 21 Aug 2019.
Tuchong (2019f) Smart Home with Fuzzy Logic Electronic Home Appliances. http://stock.tuchong.
com/image?imageId=267053275471413372. Accessed 21 Aug 2019.
Turing, A. (1950) Computing Machinery and Intelligence. Mind, LIX (236): 433–460.
Zadeh, L. A. and Aliev, R. A. (2019) Fuzzy Logic Theory and Applications: Part I and Part II.
World Scientific Publishing Company.
Zadeh, L. A. (1975a) The Concept of a Linguistic Variable and Its Application to Approximate
Reasoning-I. Information Sciences. 8(1): 199–249.
208 7 AI Powerful Tools in Quantum Finance
Zadeh, L. A. (1975b) The Concept of a Linguistic Variable and its Application to Approximate
Reasoning-II. Information Sciences. 8(4): 301–357.
Zadeh, L. A. (1975c) The Concept of a Linguistic Variable and its Application to Approximate
Reasoning-III. Information Sciences. 9(1): 43–80.
Zadeh, L. A. (1965) Fuzzy sets. Information and Control. 8 (3): 338–353.
Chapter 8
Chaos and Fractals in Quantum Finance
The theory of chaos and theory of fractals are separate but have
very strong intersections. That is one part of chaos theory is
geometrically expressed by fractal shapes.
Benoit Mandelbrot (1924–2010)
As everything that happens in the world is highly dynamical (or chaotic, as we said)
and uncertain, does this mean that chaos theory is a study of probability?
The answer is absolutely not.
The truth is: chaos theory has a basis that is entirely different from probability.
Although chaos theory is the study of the world of dynamics, it is not a world of
uncertainty or a matter of chance.
Strictly speaking, chaos theory deals with the world of determinism rather than
probabilism.
Chaos theory maintains that all the dynamics in the world, no matter the complex-
ities involved, can be (and must be) somehow modeled deterministically by certain
chaotic motions. But whether we can find these chaotic motions is another question.
In fact, the formal name for chaos is deterministic chaos in order to reflect this
characteristic (Schuste and Just 2005; Lee 2005).
From the mathematical point of view, no matter the complexity of a physical
phenomenon, the challenge of chaos theory is to model its dynamics by a set of
equations (of time) as follows:
In discrete format:
xt+1 = f xt (8.1)
212 8 Chaos and Fractals in Quantum Finance
Fig. 8.2 Lorenz attractor (upper right) and the butterfly flapping wings (lower left)
where xt is n-dim vectors (with n-variables) and f is its dynamics.
In continuous format:
˙
x = f (x, t) (8.2)
where x is n-dim vectors of variable x and f is its dynamics.
Figure 8.2 shows the Lorenz’s attractor and butterfly effect—the second imple-
mentation of chaos theory, in which the chaos dynamics of classical Lorenz’s attractor
resembles the flipping wings of a butterfly.
In chaos theory, the discrete chaotic motions are also called chaotic maps, and the
continuous motions are called chaotic flows.
8.1 Basic Concepts and Formulation on Chaos Theory 213
From the physical point of view, the discrete maps can be regarded as taking
snapshots (or cross sections) of the continuous flow on a regular (or timely) basis as
shown in Fig. 8.3.
What is the significance of the findings of maps and flows?
The answer is: It is extremely important!
For example, if the variables under consideration are weather elements such as
air temperature or rainfall, and the time step (say for a discrete map) is 5 days, then if
we can find such chaotic function(s), what we have really done is solving a weather
forecasting problem!
Imagine if functions are used to model the next-day stock market or the 15-day
financial pattern!
We can expect that what chaos theory is telling us is not something uncertain (or
chaotic), but rather how to identify the uncertain event in a chaotic way!
Chaotic phenomena—the first time they were noticed by scientists was in the late
nineteenth century by Professor Henri Poincaré (1854–1912) during his exploration
of planetary motions in 1886.
However, the major breakthrough in chaos theory was made by mathematician and
research meteorologist Professor Edward Lorenz (1917–2008) during his experiment
214 8 Chaos and Fractals in Quantum Finance
on a miniature weather modeling system (Lorenz 1963), using three simple differ-
ential equations (the so-called Lorenz equations) instead of using complex statistical
models which were commonly used by meteorologists at that time.
The Lorenz equations are
ẋ = −σ x + σ y (8.3a)
ẏ = −x z + r x − y (8.3b)
ż = x y − bz (8.3c)
will be changed entirely into what we called deterministic chaos; or chaos systems.
In that situation, merely a very minor change on initial condition of the system will
cause a huge difference of experimental results in future.
In summary, there are several features and characteristics that can be found in a
typical chaotic system.
They are
1. sensitivity to initial condition;
2. highly nonlinear but deterministic in nature;
216 8 Chaos and Fractals in Quantum Finance
It is one of the most remarkable features of chaotic system, but it alone does not
mean that a system is chaotic, but every chaotic system must possess this property.
Dependence of initial conditions means that for a very slight change in initial
conditions or measurements (observations) of a chaotic system, the result produced
differ tremendously after exhibiting for a period of time.
People like to quote butterfly effect to express such characteristics.
In layman’s term, it states that a butterfly wings’ flapping in Africa could result
in hurricane in Florida.
Figure 8.5 illustrates the sensitivity to initial condition of Lorenz’s equation of
two systems, one with x(0) = 1.00001 and the other with x(0) = 1.00000, given
σ = 10; r = 28; b = 8/3.
One should note that the sensitivity to initial conditions, although are very similar
to the concept of % errors of measurements in experimental physics, they are two
totally different concepts.
Even though a slightest difference in initial conditions can reach extremely different
results, all chaotic systems are deterministic in nature.
Deterministic means that equal causes having equal effects.
Or, from another viewpoint, equal effects have equal causes.
Equal causes having equal effects means predictability. That is, given e1 is the
effect of cause c1, if there is another cause c2 which is equal to c1, we can predict
that c2 will have an effect e2 equals to e1.
Equal effects have equal causes means reversibility. That is, given e2 and e1 are
two equal effects, if e1 is caused by c1, then we can say the cause c2 equals to c1 of
e2. Figure 8.6 illustrates two time series: one is deterministic chaos and the other is a
random walk. As shown, although they look alike, however, they are totally different
in terms of dynamics behavior.
Does it mean that only complex nonlinear equations such as the Lorenz equations
have chaotic effect?
The answer is no.
As mentioned, chaotic phenomena are so common and usual that even simple
nonlinear dynamics as in the logistic Eq. (8.4) can have this chaotic phenomenon.
xt+1 = r xt (1 − xt ) (8.4)
Figure 8.7 depicts a typical bifurcation diagram for the logistic equation with
control parameter r ranging from 0 to 4 (Kapitaniak 2000; Lee 2005).
Bifurcation is a common phenomenon found in chaotic systems which indicates
sudden, qualitative changes in the dynamics of the system under investigation either:
1. From one kind of periodic case (with limit cycle(s) and fixed point(s)) to another
kind of periodic situation, such as the change in bifurcation of the logistic map
from r = 3 (from one fixed point to two fixed points) or
2. From a periodic stage to a chaotic stage, such as dramatic changes in the dynamics
of the logistic map for r increasing from 3.5 to 4.
Although chaos theory is rather new and its technology yet emerging, there are
already numerous applications in various industries which adopted this innovative
technology.
8.2 Characteristics of Chaotic Systems 219
• consumer electronics,
• computer systems,
• health care,
• life sciences,
• engineering, and
• business and finance.
Table 8.1 summarizes the potential applications derived from this fascinating
technology.
Does this really mean that we can never predict our future accuracy?
The answer is yes and no.
Yes, in the sense that if Heisenberg’s uncertainty principle is really true, we should
have no way to “measure” the quantum variables for any chaotic system 100%
correctly that will lead to tremendous deviation according to first rule of chaotic
system.
No, in the sense that although we cannot be 100% sure about the initial condition,
we have one mathematical model that can help us to solve this forecast problem, one
model that can predict the future without knowing the exact initial condition, which
is
Neural network, time series neural network to be exact.
In the coming chapters on quantum finance application, we will study a special
kind of neural network, so-called chaotic neural oscillator, that can solve this problem
agreeably with the integration of chaos theory and neural network in quantum finance
prediction.
8.3 Fractals in Quantum Finance 221
The bifurcation diagram of logistic map learnt in last section also revealed other
interesting phenomena of a typical chaotic system—namely, the existence of self-
similarity in chaotic dynamics.
If we take a closer look at the bifurcation pattern in the first chaotic region (i.e.,
3.5 < r < 4), we will discover that similar bifurcation patterns can be found within
the original pattern, but in a smaller or scaled-down size. Figure 8.8 shows self-
similarity between bifurcation at µ1 , µ2 , and µ3 with same pattern but decrease in
scale to infinity.
More surprisingly, if we continue to zoom into these bifurcation patterns, we will
discover that they, in turn, contain even more scaled-down features with completely
same shapes and patterns—what we called the self-similarity nature of chaotic sys-
tems.
Based on these interesting findings, a group of scientists established a new doctrine
of applied mathematical geometry—fractal geometry (or simply fractals).
In fact, fractals are the graphical (visual) presentations of chaos while chaos is
the physical dynamics of fractals.
In this section, we will explore what fractals are, their formulations, and how they
can be applied to quantum finance.
The study of self-similarity in graphs and patterns is not a new thing. German
polymath and philosopher Gottfried Leibniz (1646–1716) studied recursive self-
similarity and used the term fractional exponent to describe such phenomena.
In 1872, German mathematician Professor Karl Weierstrass (1815–1897) pre-
sented the first definition of a function with a graph that would be considered as
fractal today.
In 1883, German mathematician Professor Georg Cantor (1845–1918) who
attended lectures by Weierstrass, published examples of subsets of the real line known
as Cantor sets—one of the fundamental fractals.
At the same period, German mathematician Professor Felix Klein (1849–1925)
and French mathematician Professor Henri Poincaré (1854–1912) introduced a cat-
egory of fractal that has come to be called self-inverse fractals.
In 1904, Swedish mathematician Professor Helge von Koch (1870–1924)
extended Poincaré’s ideas and gave a more geometric definition of fractal geometric
with famous fractal discovery known as the Koch snowflake.
By 1918, two French mathematicians, Professors Pierre Fatou (1878–1929) and
Gaston Julia (1893–1978) discovered fractal behavior associated with mapping com-
plex numbers and iterative functions leading to further ideas about attractors and
repellers.
In 1967, Professor Benoit Mandelbrot (1924–2010) published a paper about self-
similarity: How Long Is the Coast of Britain? (Mandelbrot 1967) aroused public
interests in fractal geometry in nature. Later in 1985, he published the remarkable
work in New Scientist: Fractals—Geometry Between Dimensions and coined the
term fractals and illustrated his mathematical definition with striking computer-
constructed visualizations—the Mandelbrot set (Mandelbrot 1982).
Figure 8.9a and b illustrates the Koch snowflake fractals and Julia set fractals,
respectively.
That is, a complex number c is part of the Mandelbrot set if and only if when
starting with z0 = 0, and applying the iteration repeatedly, the absolute value of zn
remains bounded by a number, say, 2.
If c = 1, it will give the sequence 0, 1, 2, 5, 26, …, which tends to infinity. As this
sequence is unbounded, 1 is not an element of the Mandelbrot set.
If c = −1 gives the sequence 0, −1, 0, −1, 0, …, which is bounded, and so −1
belongs to the Mandelbrot set.
By using this simple method, we can construct 2D Mandelbrot fractals by plot-
ting all possible c with x–y-axis as the real–imaginary components (1 belongs to
Mandelbrot, whereas 0 does not belong).
1
N= or D = − log(N )/log(ε) (8.7)
εD
As shown in Fig. 8.12, when
ε = 1/3, N = 27 => D = 3.
Using this method to calculate the fractal dimension of Koch fractal, we have
For i = 2:
Dkoch = −log(ε)
log(N )
= −log(4)
log( 13 )
= 1.261859507
−log(16)
Similarly, Dkoch = log 1 = 1.261859507
(9)
8.3 Fractals in Quantum Finance 225
Why?
The answer is obvious, if we are clever enough ….
Let’s come back to our old friend … quantum theory and subatomic world
Such one-to-many and many-to-one phenomena not only trigger modern graphics
and CGI such as the fantasy in sci-fi motion pictures, but also …
Worlds of simulation ….!
226 8 Chaos and Fractals in Quantum Finance
Fig. 8.13 System architecture of CDNOMS chaotic deep supervised-learning (CDSL) network for
time series financial prediction
Owing to the chaotic property of financial market, chaos theory becomes one of the
hottest topics in financial engineering, especially on financial prediction.
In the second part of this book, we will study quantum finance application on
worldwide financial prediction, explore how to integrate QPL; chaos theory, and
neural oscillators for real-time financial prediction.
Figure 8.13 shows a snapshot of the chaotic deep neural network for time series
financial prediction.
1. A bearish turning point occurs when there is a pattern with the highest high in
the middle and two lower highs on each side.
2. A bullish turning point occurs when there is a pattern with the lowest low in the
middle and two higher lows on each side.
Actually, in standard MT platform, MQL already provides such indicator iFractals
for real-time detection of bearish/bullish fractals.
Fractals are best used in conjunction with other indicators or forms of analysis
such as alligators or MAs.
Figure 8.15 shows a long-term uptrend with price staying predominantly above
the alligator’s teeth (middle moving average). Since the trend is up, bullish signals
can be used to generate buy signals.
In addition to identify buying and selling signals, can we use fractals to forecast
financial market, say, stock markets?
The answer is yes!
8.5 Conclusion
In this chapter, we have learnt chaos and fractals—the two contemporary mathemat-
ical models with vast application on nonlinear dynamics and financial engineering.
As mentioned, chaos and fractals are sides of the same coin. They show us two
ways of looking (modeling) the world’s dynamics and all physical phenomena.
Just like the particle–wave duality in quantum theory, we are talking about the
same scenario in different (mathematical) languages.
But if we look at them from different perspective, chaos and fractals, in fact,
can be considered as mathematical (and hence computational) way to describe the
particle–wave duality in terms of nonlinear equations, which is totally coherent with
our computational model of quantum finance and price level (QPL) evaluation to
form an important component of quantum finance.
In fact, the entire puzzle of quantum finance is almost complete, but with one
piece of component—how to integrate chaos theory into neural network for chaotic
modeling of financial time series?
In next chapter, we will study the last component of quantum finance—chaotic
neural oscillator.
Problems
8.1 Why scientists always say chaos and fractals are two sides of the same coin?
What is the logic behind it? Use two financial markets as examples to support
your explanation.
8.2 What is the meaning of deterministic chaos? Is it equivalent to random event?
Why or Why not?
8.3 What kind of systems or phenomena in nature are categories as chaotic sys-
tems? State five examples and explain why they are considered as chaotic
systems.
8.4 What is the relationship between chaotic flow versus chaotic map?
8.5 What is butterfly effect in chaos theory? Can we find any examples of such
phenomena in finance industry? Please give three typical examples of finance
and explain how they work.
8.6 Programing Exercise I—Lorenz attractor
230 8 Chaos and Fractals in Quantum Finance
8.7 State and explain the four major characteristics of chaotic systems. Use finan-
cial market such as forex market to explain these four characteristics in finan-
cial engineering.
8.8 Programming exercise II—sensitivity to initial conditions of Lorenz system
(i) First, implement the MATLAB system in 8.6.
(ii) Make a very minor change of initial condition x say (a minor difference
of 0.00001 of x), plot the result with the x-axis as time step and Y-axis
as future value. See what happen.
(iii) Change the initial conditions of y and z and check the results.
(iv) Any interesting findings and explain why.
8.9 What is bifurcation phenomenon in chaos theory? What is the importance of
bifurcation in a complex system?
8.10 Programming exercise III—logistic equation
8.5 Conclusion 231
(i) Write a MATLAB program to implement the logistic map using Eq. (8.4).
(ii) Plot the logistic map for x between 0 and 4.0, see whether you can obtain
the result below.
(v) State and design how can we integrate quantum finance with this fractal-
based trading program.
(vi) Implement this hybrid system and compare it with fractal-based trading
system.
References
Chau, K.T. & Wang, Z. (2011) Application of Chaotic Motion in Chaos in Electric Drive Systems.
Wiley, Singapore, 283–314.
Davis, P. (1990) Application of optical chaos to temporal pattern search in a nonlinear optical
resonator. Japanese Journal of Applied Physics. 29(7): 1228–1240.
Freeman, W. J. (2001) How brains make up their mind. Columbia University Press.
Heisenberg, W. (2007) Physics and Philosophy: The Revolution in Modern Science. Harper Peren-
nial Modern Classics.
Kapitaniak, T. (2000) Chaos for engineers: theory, applications, and control. Springer.
Katayama, R. (1993) Developing tools and methods for applications incorporating neuro, fuzzy and
chaos technology. Computers and Industrial Engineering. 24(4): 579–592.
Krishnamurthy, V. (2015) Edward Norton Lorenz: Discoverer of chaos. Resonance. 20(3): 191–197.
Kazem, A. et al. (2013) Support vector regression with chaos-based firefly algorithm for stock
market price forecasting. Applied Soft Computing Journal. 13(2): 947–958.
Lee, R. S. T. (2006) LEE-Associator – A Transient Chaotic Autoassociative Network for Progressive
Memory Recalling. Neural Networks. 19(5): 644–666.
Lee, R. S. T. (2005) Advanced Paradigms in Artificial Intelligence From Neural Oscillators, Chaos
Theory to Chaotic Neural Networks. Advanced Knowledge International, Australia.
Lorenz, E. (1995) The Essence of Chaos. University of Washington Press.
Lorenz, E. (1963) Deterministic nonperiodic flow. Journal of the Atmospheric Sciences. 20:
130–141.
Mandelbrot, B. (1997) Fractals and scaling in finance: discontinuity and concentration, Springer.
Mandelbrot, B. (1982) The fractal geometry of nature. Times Books.
Mandelbrot, B. (1967) How Long Is the Coast of Britain? Statistical Self-Similarity and Fractional
Dimension. Science, New Series. 156(3775): 636–638.
Munakata, T. (1998) Fundamentals of the new artificial intelligence: beyond traditional paradigm.
Springer.
Peters, E. E. (1994) Fractal market analysis: applying chaos theory to investment and economics.
Wiley.
Sambas, A. et al. (2016) A 3-D novel jerk chaotic system and its application in secure communication
system and mobile robot navigation. Studies in Computational Intelligence. 636: 283–310.
Soriano-Sanchez et al. (2018) Synchronization and FPGA realization of complex networks with
fractional–order Liu chaotic oscillators. Applied Mathematics and Computation. 332: 250–262.
Schuste, H. G. and Just, W. (2005) Deterministic Chaos: An Introduction. Wiley-VCH.
Tuchong (2019a) Fractals in Nature - Snowflakes. http://stock.tuchong.com/image?imageId=
79052163044817970. Accessed 21 Aug 2019.
Tuchong (2019b) Fractals in Nature - Blood vessels. http://stock.tuchong.com/image?imageId=
452726017391067492. Accessed 21 Aug 2019.
Tuchong (2019c) Fractals in Nature - Landscape. http://stock.tuchong.com/image?imageId=
479820371888701550. Accessed 21 Aug 2019.
Tuchong (2019d) Fractals in Nature - Saturn ring. http://stock.tuchong.com/image?imageId=
429030579742310411. Accessed 21 Aug 2019.
References 233
oscillators, and the author’s latest research on Lee-oscillators; its neural dynamics and
applications. After that, we will study quantum finance oscillators (QFO) using Lee-
oscillators and different application of QFO in quantum finance including quantum
financial prediction using chaotic neural networks, chaotic deep neural networks,
and chaotic intelligent multiagent-based trading systems.
Universe 6
Universe 5
Universe 4
Universe 3
Universe 2
Universe 1
Current neuroscience tells us that oscillations can not only be found in the physical
world but also can be found at the core of our body—our brain.
If one takes a closer look at neural dynamics in our brain—the original of neural
networks: What triggers the entire neural dynamics?
The stimulus, maybe, but how?
Current neurophysiology also tells us that all neurons in our brain exist in the state
of oscillations, chaotic oscillation to be exact.
It is that such oscillations trigger the entire thinking and learning processes.
The oscillations of these neurons within our brain are collectively called brain
waves in layman’s terms as shown in Fig. 9.3.
• Awake, conscious state—beta wave
• Insight and peak focus conscious state—gamma wave
• Relaxed, calm, lucid dream (but not thinking)—alpha wave
• REM dream state, deep relaxation and mediation—theta wave
• Deep, dreamless sleep—delta wave.
238 9 Chaotic Neural Networks in Quantum Finance
In fact, not only from our brain, chaotic oscillations can be easily found in the
human body including our five senses:
• eye (sight)—visual nerves;
• nose (smell)—olfactory nerves;
• ear (sound)—auditory nerves;
• tongue (taste)—gustatory nerves;
• skin (touch)—somatosensory nerves;
• our heartbeats and others.
9.2.1 An Introduction
We learnt from Chap. 7 that classical artificial neural networks, ANN in Fig. 9.4 are
composed of simple artificial neurons that emulate biological neural activities.
These kinds of neural models have been strongly criticized as being far simpler
than real neural models.
The latest studies in neuroscience and neurophysiology have examined such issues
as functional properties of the hippocampus, neural activities in pyloric CPG (central
pattern generator) of the lobster, and other human brain activities. For instance,
hippocampus—a major component of the brain as shown in Fig. 9.5, plays important
9.2 Chaotic Neural Oscillators 239
where SE and SI are input stimulus; ω are weights; ξE and ξI are threshold values;
the sigmoid function Sig() is given by
Sig(k) = 1 1 + e−k (9.4)
9.3 Lee-Oscillator
After over 5 years of research and testing, the author created an ideal chaotic neural
oscillator, now known as Lee-oscillator in 2004 and published in two major neural
network journals IEEE Transactions on Neural Networks (Lee 2004) for the intro-
duction of Lee-oscillator and its transient chaotic behavior; and Journal of Neural
Networks (Lee 2006) for the exploration of Lee-oscillator on progressive memory
recalling capability in visual psychology.
Different from Wang-oscillator, Lee-oscillator successfully emulates the transient
chaotic progressive growth in its neural dynamics, which helps to shed light on acting
as a perfect CTU to model complex and chaotic problems.
Figure 9.8 shows the neural structure of Lee-oscillator.
Basically, Lee-oscillator consists of 4 neural elements: E, I, , and L, which
corresponds to excitatory, inhibitory, input, and output neurons.
The neural dynamics are given by
where e1 , e2 , i1, and i2 are weights; ξE and ξI are threshold values and S(t) is an
external input stimulus.
The bifurcation diagram of Lee-oscillator is illustrated in Fig. 9.9.
244 9 Chaotic Neural Networks in Quantum Finance
• In fact, Lee-oscillators can be adopted and integrated with each other to form
a complex chaotic neural oscillatory model to tackle problems such as scene
analyses, robot vision, navigation, and of course, real-time financial prediction
in quantum finance.
• We will study this in detail in Part II of this book.
In Chap. 2, quantum field theory, we mentioned that the quantum world can be mod-
eled as quantum oscillators, influenced and oscillating like a ball over a trampoline
as shown in Fig. 9.10a.
So, in terms of quantum finance, it is natural to analog the dynamic of every
financial market as quantum oscillations of quantum financial particles influenced
by quantum energy (price) field as shown in Fig. 9.10b.
But instead of simple quantum harmonic oscillators, we are talking about quantum
anharmonic oscillator counterparts.
Such notion, in fact, is totally equivalent and coherent with our modeling of
quantum dynamics as quantum anharmonic oscillations studied in Chap. 4.
These quantum anharmonic oscillators are known as quantum finance oscillators
(OFO).
One of the most direct adoptions of the chaotic oscillator is the introduction of
quantum finance oscillator—QFO by the replacement of Lee-oscillator with financial
particle.
9.4 Quantum Finance Oscillators (QFO) 247
Figure 9.11 shows a typical USDX (USD Index) QFO model in the forex market.
The neural dynamics is given by
By using the same interpretation, practically speaking we can model any financial
market using QFOs and investigate the chaotic oscillation dynamics of these financial
markets.
More importantly, such modeling technique can be integrated with AI tools and
technologies mentioned in Chap. 7 to complex and highly chaotic phenomena, finan-
cial fluctuation in particular.
Fuzzy
Logics
Chao c Neural
Networks
QUANTUM
Chaos
PRICE Fractals
Theory FIELD
Neural
Oscillators
Gene c
Algorithms
As a direct adoption in artificial neural networks, QFO can be directly integrated with
classical neural networks such as feedforward backpropagation networks (FFBPN)
by replacing all simple neurons in input/hidden/output layers by Lee-oscillations.
By doing so, technically speaking, we convert a simple neural network system
into a multilayer chaotic neural network as shown in Fig. 9.13.
In the figure, two inputs types (time series input signals and technical index
signals) are replaced by Lee-oscillators.
From neural dynamics point of view, such changes bring (1) chaotic oscillation
dynamics during network training; (2) chaotic bifurcation transfer function (CBTF)
into forecast system to resolve the network training deadlock and trapped by local
minimum problems which usually occur during network training of highly complex
patterns (e.g., financial patterns) using classical FFPBN.
Detail implementation will be studied in Chap. 11.
Fig. 9.13 QFO for real-time financial prediction using chaotic neural networks
9.5 Applications of QFO in Quantum Finance 251
In Chap. 7, we have studied fuzzy logic (FL) and fuzzy logic system (FLS).
A simple fuzzy logic membership function (also known as type-1 fuzzy logic) of
financial technical signal (RSI) is shown in Fig. 9.14a.
Different from type-1 FL, a type-2 FL provides a higher degree of fuzziness by
the adoption of second-tier fuzziness in overlapping regions of the primary fuzzy
membership function.
Figure 9.14b shows a typical so-called interval type-2 MF f or RSI.
By QFO adoption, we technically can generate a chaotic overlapping region for
any technical financial signals—quantum finance signals (QFS).
Figure 9.14c shows a typical chaotic type-2 fuzzy logic MF (membership function)
for RSI QFO.
Detailed implementation will be studied in Chap. 12.
μ (x) μ (x)
0 x 100 0 x 100
Type-2 uncertainty regions
(a) Type-1 fuzzy logic MF on RSI (b) Interval type-2 fuzzy logic MF on RSI
Input Layer
8-Level Bifurca on Hidden Layers (BHL)
Latest neuroscience research discovered that neural dynamics for memory recall and
learning existed as the so-called retrograding signaling (RS), a kind of delayed and
feedback mechanisms of information processing.
Such an important finding leads to the latest development of LORS (LEE-
oscillators with Retrograde Signals).
Between 2012 and 2017, the author had categorized 8 major types of LORS
bifurcation signals (LORS#0-#7), which corresponded to 8 different kinds of chaotic
bifurcations and neural dynamics.
More importantly, such findings can be adopted to DNN (deep neural network)
technology for the conversion of single hidden layer FFBPN into CDNN (chaotic
deep neural networks) with 8-level bifurcation hidden layers (BHL).
Figure 9.15 shows the system architecture of CDNN on quantum finance. Detail
implementation will be studied in Chap. 12.
Neural networks can be used in supervised learning (SL) such as financial prediction,
it can also be used on unsupervised learning (UL) and reinforcement learning (RL)
as we learnt from Chap. 7.
9.5 Applications of QFO in Quantum Finance 253
9.6 Conclusion
In this chapter, we have learnt the basic theory of chaotic neural oscillators.
Also, we have learnt how to integrate chaotic neural oscillators (Lee-oscillator) to
effectively convert a typical neural network into chaotic neural networks to handle
highly complex and chaotic phenomena—quantum finance in particular.
As we can see, chaotic neural oscillators can be adopted into almost any AI tools
and technologies to improve efficiency and performance.
How can we do that?
As mentioned, all these various kinds of AI tools and technologies are just different
tools and methods to model and handle real-world problems, finance in our case,
which is highly complex and chaotic in nature.
More importantly, when we mentioned a (financial) market is highly chaotic or
fuzzy in nature, we are just seeing (modeling in technical perspective) the problem
with a particular perspective, the problem never changes itself.
Just like we are talking about the particle–wave duality property of financial
market in quantum finance.
The financial market always as it is, we are just using different angles and per-
spectives to observe and investigate it.
In Part II of this book, we will study four major applications of quantum finance
in financial prediction and intelligent trading systems.
Problems
9.1 Discuss and explain why Schrödinger in his 1952 lecture interpreted the quan-
tum events such as Schrödinger’s cat as different coexisting realities instead
of different alternative events, and what such notion is critical and related to
Heisenberg’s uncertainty principle.
9.2 Based on the brain waves shown in Fig. 9.3, please discuss and explain why our
perception of time is different in various brain wave states, and how it can be
related to the understanding of time in: (1) human perception; and (2) financial
markets.
9.3 If all human sensory schemes are products of sensory oscillators and their inter-
actions with neural networks in the brain, is it possible to have what we called
sensory interchange in theoretical perspective? And what is its implication?
9.4 What is the importance of converting a traditional artificial neural network
(ANN) into chaotic neural networks in terms of (1) network training; and (2)
network performance ?
9.6 Conclusion 255
9.5 What are the physical evidence and explanations for the existence of chaotic
neural dynamics in humans? And how such discoveries are vital to the future
development of AI and intelligent systems?
9.6 Based on Eqs. (9.1)–(9.4) and Eqs. (9.5)–(9.8), write two MATLAB programs to
plot the normalized bifurcation diagrams of Wang-oscillator and Lee-oscillator
(i.e., input and output in the range of [0 … 1]) and discuss how Lee-oscillator
can be used to convert ANY artificial neural networks (ANN) or recurrent neural
networks (RNN) into chaotic neural networks (CNN).
9.7 In both Wang-oscillator and Lee-oscillator, there are excitatory and inhibitory
neurons in their neural models. Discuss and explain the biological and math-
ematical meanings of these neurons in a typical chaotic neural network, as
compared with traditional ANN.
9.8 For the modeling of forex market (say AUDCAD) using quantum finance oscil-
lator (QFO):
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Wang-Oscillator
%
% Created By Dr. Raymond Lee on May 2019
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Define parameters
%
N = 600; % n = no. of time step default is 600
s = 5; % parameter for tanh function
a1 = 5; % default is 5
a2 = 5;
b1 = 1; % default is 5
b2 = 1;
eu = 0; % u threshold default is 0
ev = 0; % v threshold default is 0
e = 0.02;
%%%%%%%%%%
% Define and initialize u(t) and v(t)
%
u = zeros(1,N);
v = zeros(1,N);
z = zeros(1,N);
z(1) = 0.2; % IC of z set to 0.2
u(1) = 0.2;
hold on;
if (t > 500)
plot(i, z(t+1));
end
end
end
9.6 Conclusion 257
(i) Copy this program script into MATLAB and run the program, you should see
the bifurcation diagram as above.
(ii) As shown in the MATLAB code, we only plot the output z when t > 500. Why?
(iii) Modify this MATLAB to implement the Lee-oscillator using Eqs. (9.5)–(9.8).
You should obtain the below bifurcation diagram.
(iv) From the bifurcation diagram of Lee-oscillator, identify the sigmoid zone and
the bifurcation zone.
258 9 Chaotic Neural Networks in Quantum Finance
(v) As shown in the bifurcation diagram, the x-axis and y-axis are both between
[−1 … +1]. Modify the MATLAB program to convert the bifurcation diagram
of Lee-oscillator to Lee chaotic transfer function (LCTF) with normalized value
between [0 … 1], as shown in the below figure.
(vi) Modify the MATLAB program by creating a 2-D array Lee() which contains
the output values of Lee-oscillator for 1000 values of i between [1 … 1] and
100 time-step values of Lee-oscillator between 500–600. The definition of
Lee() array as shown below:
Lee = zeros(1001,100);
(vii) Store the LCTF-Lee() table array into a CSV data file for later use.
9.10 Programming exercise II
(i) Start with 7.28 with the implementation of MQL-based FFPBN for the
next-day forecast of at least 5 Forex products (e.g., AUDCAD, USD-
CAD, GBPUSD, USDJPY, EURUSD, etc.).
(ii) Implement the MATLAB program in 9.16 to obtain the CSV datafile of
LCTF (Lee chaotic transfer function).
(iii) Modify the MQL FFBPN program in (i) by: (1) Read the LCTF array in
the program initialization process; (2) Replace sigmoid function for the
FFPBN program with the LCTF function array.
(iv) Compare these two neural networks in terms of: (1) training perfor-
mance; and (2) forecast performance using five forex products mentioned
in (i) by plotting the following charts:
• Mean RMSE (root-mean-square error) in network training for 1000
iterations;
9.6 Conclusion 259
References
Chen, L. and Aihara, K. (1995) Chaotic stimulated annealing by a neural model with transient
chaos. Neural Networks. 8(6): 915–930.
Falcke, M. et al. (2000) Modeling observed chaotic oscillators in bursting neurons: The role of
calcium dynamics and IP3. Biol. Cybern. 82: 517–527.
Fernandes, T. and Malsburg, C. (2015) Self-organization of control circuits for invariant fiber
projections. Neural Computation. 27(5): 1005–1032.
Freeman, W. J. (2013) Imaging Brain Function With EEG: Advanced Temporal and Spatial Analysis
of Electroencephalographic Signals. Springer.
Freeman, W. J. (2008) A pseudo-equilibrium thermodynamic model of information processing in
nonlinear brain dynamics. Neural Network. 21(2–3): 257–265.
Freeman, W. J. (2000) Neurodynamics: An Exploration in Mesoscopic Brain Dynamics (Perspec-
tives in Neural Computing). Springer.
Hopfield, J. J. (1984) Neurons with Graded Response Have Collective Computational Properties
like Those of Two-State Neurons. Proceedings of the National Academy of Sciences of the United
States of America. 81(10): 3088–3092.
Hoshino, O. et al. (2003) Roles of dynamic linkage of stable attractors across cortical networks in
recalling long-term memory. Biol. Cybern., 88(3): 163–176.
Lee, R. S. T. (2006) LEE-Associator – A Transient Chaotic Autoassociative Network for Progressive
Memory Recalling. Neural Networks. 19(5): 644–666.
Lee, R. S. T. (2004) A Transient-chaotic Auto-associative Network (TCAN) based on LEE-
oscillators. IEEE Trans. Neural Networks. 15(5): 1228–1243.
Malsburg, C. (1995) Binding in models of perception and brain function. Current Opinion in
Neurobiology. 5(4): 520–526.
Tegmark, M. (2014) Our Mathematical Universe: My Quest for the Ultimate Nature of Reality.
Vintage.
Tuchong (2019a) What would happen if time stopped? http://stock.tuchong.com/image?imageId=
446677423538045208. Accessed 21 Aug 2019.
Tuchong (2019b) Artificial Neural Networks. http://stock.tuchong.com/image?imageId=
492056055110172742. Accessed 21 Aug 2019.
Wang, X. (1991) Period-doublings to chaos in a simple neural network: An analytic proof. Complex
Syst. 5: 425–441.
Zhou, C. and Chen, T. (2000) Chaotic neural networks and chaotic annealing. Neurocomputing.
30(1): 293–300.
Part II
Quantum Finance Applications
Chapter 10
Quantum Price Levels for Worldwide
Financial Products
Mr. Rick Santelli gave a vivid description of financial markets. As an old saying:
History repeats itself.
As mentioned in Chap. 1, humans are a species of habit. Under the same condi-
tions, we will always respond in the same ways, no matter the consequences are. If
we believe financial markets are the consequences of investors’ collective conscious
for market responses in every single moment. Patterns exist will be a natural cause.
If we believe every single phenomenon (including financial market) happened
among us no matter how chaotic or unpredictable at the very basic and microscopic
level, are all governed by quantum mechanics under the influence of quantum energy
levels generated by their own existence with neighboring quantum particles; thus, the
existence of financial energy levels; or what we called quantum price levels (QPL)
should be a natural cause too.
In Part I of this book, we have studied the basic concept and theory of quantum
finance with methods for the modeling and quantum price levels (QPL) evaluation.
In Part II, this chapter will begin on how to apply the theory and formulation of QPLs
evaluation on worldwide secondary financial markets which include: cryptocurrency,
forex, commodity, and worldwide financial indices.
First, we will introduce financial market types and their importance to the world-
wide economy.
Second, we will give a brief overview of traditional concepts and beliefs of quan-
tized market price levels—the support and resistance (S&R) levels, and how they are
related to our understanding of quantum price levels (QPLs) in quantum finance.
Third, we will introduce the MetaTrader (MT) system and MQL (MetaQuotes
Language)—the real-time worldwide financial program trading and system devel-
opment platform.
After that, we will study the system architecture of QPL evaluation system and
introduce two major MT4 platforms: Forex.com (one of the biggest worldwide forex
trading platforms) and AvaTrade.com (one of the major cryptocurrency trading plat-
forms).
For the system implementation section, we will study in detail the MT4 program on
automatic evaluation of worldwide 120+ financial products, based on the numerical
formulations revealed in Chap. 5.
In the last section, we will study QPL system implementation results; conclude its
related works including the design; implementation of real-time financial prediction,
and multi-agent-based trading system in Chaps. 11–13.
10.1.1 An Overview
It is important to understand the distinction between the primary market and the
secondary market. When a company issues stock or bonds for the first time and
sells those securities directly to investors, that transaction occurs on the primary
market. Some of the most common and well-publicized primary market transactions
are IPOs, or initial public offerings. During an IPO, a primary market transaction
occurs between the purchasing investor and the investment bank underwriting the
IPO. Any proceeds from the sale of shares of stock on the primary market go to the
company that issued the stock, after accounting for the bank’s administrative fees.
If these initial investors later decide to sell their stakes of the company, they can
do so on the secondary market. Any transactions on the secondary market occur
between investors, the proceeds of each sale go to the selling investor, not to the
company that issued the stock or to the underwriting bank. The secondary market
is where securities are traded after the company has sold its offering on the primary
market. It is also referred to as the stock market. The New York Stock Exchange
(NYSE), London Stock Exchange, and Nasdaq are secondary markets.
Small investors have a much better chance of trading securities on the secondary
market since they are excluded from IPOs. Anyone can purchase securities on the
secondary market as long as they are willing to pay the asking price per share.
A broker typically purchases the securities on behalf of an investor in the secondary
market. Unlike the primary market, where prices are set before an IPO takes place,
prices on the secondary market fluctuate with demand. Investors will also have to
pay a commission to the broker for carrying out the trade.
The volume of securities traded varies from day to day, as supply and demand for
the security fluctuates. This has a great effect on the security’s price.
When an initial offering is completed, the issuing company is no longer a party to
any sale between two investors, except in the case of a company stock buyback. For
example, after December 12, 1980, Apple’s IPO on the primary market, individual
investors were able to purchase Apple stock on the secondary market. Because Apple
is no longer involved in the issue of its stock, investors would, essentially, deal with
one another when they trade shares in the company.
The secondary market (Kuznetsov 2006; Drayer et al. 2008) has two different cat-
egories: the auction and the dealer markets. The auction market is home to the open
outcry system, where buyers and sellers congregate in one location and announce
the prices at which they are willing to buy and sell their securities. The NYSE is one
such example. In dealer markets, though, people trade through electronic networks.
Most small investors trade through dealer markets.
266 10 Quantum Price Levels for Worldwide Financial Products
Over-The-Counter Markets
The over-the-counter (OTC) market is an example of a secondary market. An OTC
market handles the exchanging of public stocks not listed on the Nasdaq, New York
Stock Exchange, or American Stock Exchange. Companies with stocks trading on
the OTC market are usually smaller organizations, as this financial market requires
less regulation and trading is less expensive.
Financial Markets for Bonds
A bond is a security in which an investor loans money for a defined period of time at
a preestablished rate of interest. Bonds are not only issued by corporations but may
also be issued by municipalities, states, and federal governments from around the
world. They are also referred to as debt, credit, or fixed-income market. For example,
the bond market sells securities such as notes and bills issued by the United States’
Treasury.
Money Markets
A money market is a portion of the financial market that trades highly liquid and
short-term maturities. The intention of the money market is for short-term borrowing
and lending of securities with maturity typically less than 1 year. This financial
market trades certificates of deposit, banker’s acceptances, certain bills, notes, and
commercial paper.
Derivatives Market
The derivatives market is a financial market that trades securities that derive its value
from its underlying asset. The value of a derivative contract is determined by the
market price of the underlying item. This financial market trades derivatives include
forward contracts, futures, options, swaps, and contracts-for-difference.
Forex Market
The forex market is a financial market, where currencies are traded. This financial
market is the most liquid market in the world, as cash is the most liquid assets. The
interbank market is the financial system that trades currency between banks.
In an OTC trade, the price is not necessarily published for the public.
OTC trading, like exchange trading, occurs with commodities, financial instru-
ments (including stocks), and derivatives of such products.
In 2008, approximately 16% of all U.S. stock trades were OTC trading, by April
2014 it has increased to about 40%.
A market maker or liquidity provider is a company or an individual that quotes
both a buy and a sell price in a financial instrument or commodity held in inventory,
hoping to make a profit on the bid-offer spread, or turn.
The U.S. Securities and Exchange Commission defines a market maker as a firm
that stands ready to buy and sell stock on a regular and continuous basis at a publicly
quoted price.
Most foreign exchange trading firms are market makers and so are many banks.
Market makers both sell to and also buy from its clients and is compensated by
means of price differentials for the services of providing liquidity, reducing transac-
tion costs and facilitating trade.
They make a profit by the difference between the price at which a market maker
is willing to buy a stock (the bid price) and the price that the firm is willing to sell it
(the ask price) is known as the market maker spread, or bid–ask spread.
Market makers also provide liquidity to their own firm’s clients for which they
earn a commission.
The foreign exchange market (forex, FX, or currency market) is a global decentralized
or OTC market for currencies trading.
This market determines the foreign exchange rates.
It includes all aspects of buying, selling, and exchanging currencies at current or
determined prices.
In terms of trading volume, it is by far the largest market in the world.
In retail forex trading, most foreign exchange trading centers/firms are market
makers and so are many banks.
Unlike a stock market, the foreign exchange market is divided into levels of access.
At the top is the interbank foreign exchange market, which is made up of the
largest commercial banks and securities dealers.
Key participants include the following:
• central banks,
• commercial banks,
• foreign exchange brokers,
• investment management firms,
• retail foreign exchange traders, and
• money transfer/remittance companies.
268 10 Quantum Price Levels for Worldwide Financial Products
The main participants in this market are the larger international banks.
Financial centers around the world function as anchors of trading between a wide
range of multiple types of buyers and sellers around the clock, with the exception of
weekends.
Currencies are traded against one another in pairs.
Each currency pair thus constitutes an individual trading product and is tradi-
tionally noted XXXYYY or XXX/YYY, where XXX and YYY are the ISO 4217
international three-letter code of the currencies involved.
For instance, the quotation EURUSD (EUR/USD) 1.5465 is the price of the Euro
expressed in US dollars, meaning 1 euro = 1.5465 US dollars.
Table 10.1 shows the list of the top 35 most traded currencies in 2016.
Forex trading is a huge trading volume, representing the largest asset class in the
world leading to high liquidity due to its geographical dispersion.
Its continuous operation is 24 h a day except weekends, i.e., trading from 22:00
GMT on Sunday (Sydney) until 22:00 GMT Friday (New York) as Asia trading
session ends, Europe session begins, followed by North America session and then
back to the Asia session.
There are a variety of factors that can affect exchange rates.
The margins of relative profit are moderate as compared with other markets of
fixed income.
There is no unified or centrally cleared market for the majority of trades, and there
is very little cross-border regulation.
The main trading centers are London, New York, Tokyo, Hong Kong, and other
prominent trading centers throughout the world.
The top 3 most heavily traded bilateral currency pairs were the following:
1. EURUSD: 23.0%;
2. USDJPY: 17.7%;
3. GBPUSD: 9.2%.
Different from stocks which are localized to the company’s financial situation,
fluctuations in exchange rates are usually caused by actual worldwide monetary flows
as well as by expectations of changes in monetary flows.
These are caused by changes in worldwide gross domestic product (GDP) growth,
inflation (purchasing power parity theory), interest rates, budget and trade deficits or
surpluses, large cross-border M&A deals, and other macroeconomic conditions.
Major financial reports, news, and indices from major financial/government insti-
tutions such as Federal Reserve Board (USA) and Organization of the Petroleum
Exporting Countries (OPEC) are important factors, which are released publicly, often
on scheduled dates.
Political conditions including internal, regional, and international political con-
ditions and events can have a profound effect on currency markets.
Supply and demand is also a major factor.
10.1 Financial Markets 269
(continued)
270 10 Quantum Price Levels for Worldwide Financial Products
Other 2.10
Total 200.00
Note
(1) Source Triennial Central Bank Survey Foreign exchange turnover in April 2016. Triennial
Central Bank Survey. Basel, Switzerland: Bank for International Settlements. 11 December 2016.
p. 7
(2) The total sum is 200% because each currency trade always involves a currency pair; one currency
is sold (e.g., US$) and another bought (e). Therefore, each trade is counted twice, once under the
sold currency (US$) and once under the bought currency (e). The percentages above are the percent
of trades involving that currency regardless of whether it is bought or sold, e.g., the U.S. Dollar is
bought or sold in 87% of all trades, whereas the Euro is 31.4%
10.1 Financial Markets 271
Retail foreign exchange trading is a small segment of the larger foreign exchange
market, where individuals speculate on the exchange rate between different curren-
cies.
This segment has developed with the advent of dedicated electronic trading plat-
forms and the internet, which allows individuals to access the global currency mar-
kets.
In 2016, it was reported that retail foreign exchange trading represented 5.5% of
the entire foreign exchange market ($282 billion in daily trading turnover).
Prior to the development of forex trading platforms in the late 90s, forex trading
was restricted to large financial institutions.
Nowadays, traders are able to trade spot currencies with market makers on margin.
This means they need to put down only a small percentage of the trade size and can
buy and sell currencies in seconds.
As both profit and loss will be amplified by margin trading, risk management such
as stop-loss strategy must execute in every trading transaction.
MetaTrader 4 (MT4) platform is the most popular retail forex trading platform.
By using MetaQuotes Language (MQL), a trader can develop one’s own trading
program for automatic program trading (Young 2015; Walker 2018).
Details of MT4 program trading will be studied in the next section.
Figure 10.1 shows a snapshot for forex trading over MT4 provided by Forex.com
(www.Forex.com), one of the largest forex trading platforms in the world.
Fig. 10.1 Snapshot for forex trading over MT4 platform provided by Forex.com
272 10 Quantum Price Levels for Worldwide Financial Products
10.2.1 Introduction
The concepts of support and resistance are undoubtedly two of the most highly
studied attributes of technical analysis. Part of analyzing chart patterns, these terms
are used by traders to refer price levels on charts that tend to act as barriers, preventing
the price of an asset from getting pushed in a certain direction (Bulkowski 2005;
Kirkpatrick and Dahlquist 2015; Murphy 1999; De Angelis and Peskir 2016; Gomes
and Waelbroeck 2010; Zapranis and Tsinaslanidis 2012).
In the Wall Street environment, the terms support and resistance are almost syn-
onymous with demand and supply respectively.
Support is a price level at which there is adequate demand for security to stop its
downward price movement and, normally, turn prices upward.
Typically, support occurs at reaction lows.
Resistance is a price level at which there is a significant supply of a stock causing
prices to halt an upward move and turn prices down.
Typically, resistance occurs at reaction highs.
Once an area or zone of support or resistance has been identified, it provides
valuable potential trade entry or exit points. This is because, as a price reaches a
point of support or resistance, it will do one of two things—bounce back away from
the support or resistance level or violate the price level and continue in its direction—
until it hits the next support or resistance level.
Most forms of trades are based on the belief that support and resistance zones
will not be broken. Whether price is halted by the support or resistance level, or it
breaks through, traders can bet on the direction and can quickly determine if they
are correct. If the price moves in the wrong direction, the position can be closed
at a small loss. If the price moves in the right direction, however, the loss may be
substantial. Figure 10.2 shows typical support and resistance lines.
In an uptrend, both support and resistance levels rise as illustrated in Fig. 10.3.
Typically, support levels hold while resistance offers temporary halts to upward
movements in prices. Resistance levels are repeatedly broken until the uptrend is
reversed. In a downtrend, both support and resistance levels move lower as illustrated
in the right figure. Typically, resistance levels hold while support levels temporarily
stop downward price movements. Support levels are repeatedly broken until the
downtrend is reversed.
In an uptrend, both support and resistance levels rise as illustrated in Fig. 10.4.
Typically, support levels hold while resistance offers temporary halts to upward
movements in prices.
Resistance levels are repeatedly broken until the uptrend is reversed.
Trend reversal at top: In an uptrend, a trend reversal occurs when prices are held at
a resistance level. A double top or some other reversal formation develops at that
point, and the trend changes direction.
Trend reversal at the bottom: A trend reversal occurs in a downtrend when prices
are unable to penetrate a support level. In this case, a bottom reversal pattern is
formed, and the trend changes direction to the upside.
Figure 10.5 shows typical trend reversal on support and resistance.
Keep in mind that a trend reversal is not signaled by the first failure to break
through a resistance level (in an uptrend) or a support level (in a downtrend). A
reversal pattern must fully develop before one gets the signal that the trend has
changed. In other words, a trader should not rush to sell all of one’s securities or sell
short just because prices have held at a resistance level.
In fact, the basis of technical analysis in the past 50 years is based on this funda-
mental concept.
The difference is that, with the exponential growth of program trading, espe-
cially HFPT (high-frequency-program-trading) (Durbin 2010). The financial markets
become so complex and chaotic that we don’t believe one can observe (or locate) all
these hidden-force-levels manually.
However, different from the traditional understanding of support and resistance
(S&R) levels, there is one major difference between them.
In traditional technical analysis, S&R levels are normally totally different price
levels as they play different roles in the supply and demand forces for market move-
ments. However, in quantum finance, quantum price levels (QPLs) are interpreted as
discrete energy levels for the movements of the financial particles from one energy
state to another, so basically there is no concepts either support or resistance, but just
energy states. In other words, one QPL can be acted as a support level for a moment
and then acted as resistance level at another moment.
The truth is, such interpretation becomes more realistic and practical in nowadays
financial markets, as we normally see a particular price level can be acted as both a
support and resistance levels all the times within a day or a period of time, especially
for highly fluctuated financial markets such as forex and cryptocurrency. The main
reason is maybe due to the popularity of program trading and especially HFPT
(Durbin 2010) in which trading programs normally define the same set of price
levels as the thresholds to trigger buying or selling signals, and seldom evaluate
them as two separated price levels for automatic program trading. That’s why the
frequent interchange of S&R roles is commonly found in nowadays financial markets
include stock, forex, and cryptocurrency markets (Fig. 10.6).
10.3.1 An Introduction
It allows not only to write a variety of expert systems, designed to operate in real
time, but also to create their own graphical tools to help users make trade decisions.
MQL4 is based on the concept of the popular programming language C++.
Like C++, MQL4 provides the OO-programming basics which include the fol-
lowing:
• Syntax,
• data types,
• operations and expressions,
• operators,
• functions,
• variables,
• preprocessor, and
• object-oriented programming.
(Details please refer to https://docs.mql4.com/basis)
In addition to all C++-style programming fundamental tools and functions, MQL4
provides predefined variables, classes, and functions tailored for program trading in
online financial markets which include the following:
• account information,
• checkup,
• market info,
• time series and indicators access
• chart operations,
• trade functions.
• trade signals,
• global variables of the terminal, and
• technical indicators.
These are functions for working with time series and indicators.
A time series differs from usual data array by its reverse ordering—elements of
time series are indexed from the end of an array to its start (from the most recent data
to the oldest ones).
To copy the time series values and indicator data, it is recommended to use
dynamic arrays only, because copying functions are designed to allocate the nec-
essary size of arrays that receive values.
Commonly used functions include the following:
• iOpen
• iHigh
• iLow
10.3 The MetaTrader (MT) Platform and MQL 279
Fig. 10.8 Syntax of iOpen() function and program example of using time series and indicators
access functions
• iClose
• iVolume
• iTime
Figure 10.8 shows the syntax and example of using time series and indicators
access functions.
most important and frequently used in program trading. Besides, MT4 also provides
six types of trading orders: Buy, Sell, Buy Limit, Sell Limit, Buy Stop, and Sell Stop
(Kaufman 2013).
iFractals Fractals
Figure 10.10 shows the syntax of two most commonly used technical indicators,
iMA (moving average), and iRSI (relative strength index). Appendix B shows the
list of 39 technical indicators functions implemented by MQL.
From the implementation perspective, 129 financial products from Forex.com (one of
the biggest forex MT platform providers) and AvaTrade.com (major cryptocurrency
MT platform providers) are used for QPLs evaluation.
They include the following:
• 9 Cryptocurrency,
• 84 Forex,
• 19 Financial Indices, and
• 17 Major Commodities.
10.4 System Implementation—QPL Evaluation for Worldwide Financial Products 283
Except cryptocurrency which has around 300–500 trading days information, all
other financial products contain 2048 time series trading day information for QPLs
evaluation.
Figure 10.12 shows a snapshot of the MT4 platform of cryptocurrency provided
by AvaTrade.com.
Appendix A shows the list of 129 financial products provided by Forex.com and
AvaTrade.com for their MT4 platforms.
The main program logic for the evaluation of the first 21 QPLs of all 120+ worldwide
financial product is shown in Fig. 10.13.
For each financial product, do the following:
• Read the daily time series and extract (Date, O, H, L, C, V)
• Calculate daily price return r(t)
• Calculate quantum price return wavefunction Q(r) (size 100)
• Evaluate λ value for the wavefunction Q(r) using F.D.M. and Eq. (5.21) & evaluate
other related parameters:
– sigma (std dev of Q)
– maxQPR (max quantum price return—for normalization).
284 10 Quantum Price Levels for Worldwide Financial Products
• Once λ is found, using QFSE (numerical solution) by solving the depressed cubic
equation using Cardano’s method Eq. (5.32a–c) to calculate first 21 quantum
finance energy level, QFEL(n), n = [1 … 20]
• Calculate quantum price return, QPR(n)
QFEL(n)
QPR(n) = (10.2)
QFEL(0)
where n = [1 … 20]
• Calculate normalized QPR(n)
where n = [1 … 20]
• Save two level of data files:
• For each financial product, save the QPL table contains QPE, QPR, NQPR for
the first 21 energy levels
• For all financial product, create a QPL summary table contains NQPR for all
FP, which will be used for financial prediction using recurrent neural networks.
Figure 10.14 shows the program header with program logic listed for the
QPL2019.mq4 program for QPLs evaluation of 120+ worldwide financial products.
where
10.5 MQL Program for QPLs Evaluation … 287
1/3
1.1924 + 33.2383n + 56.2169n2
K0 (n) = (10.5)
1 + 43.6196n
For each financial product (FP), this process uses MQL time series data functions
iOpen, iHigh, iLow, iClose to read the daily time series data and calculate the daily
return by
where DT_CL[d] and DT_CL[d+1] are the closing prices for d and d+1 day, respec-
tively. As mentioned, except cryptocurrencies which have 300–500 trading day
records, the other 120 financial products (forex, commodities and financial indices)
have 2048-trading day records, which are sufficient for the evaluation on distribu-
tion function (wavefunction) of the price returns (r). Program codes of process 2 are
shown in Fig. 10.18.
After the evaluation of daily returns DT_RT[d] of the financial time series, this
process evaluates the mean (mu, μ) and standard deviation (sigma, σ ) of the return
distribution function (ϕ).
10.5 MQL Program for QPLs Evaluation … 291
Fig. 10.19 Process 3 calculate mean (mu) and standard deviation (sigma) of return array
The purpose for mu evaluation is to locate the central point of the distribution
function, and sigma is used to calculate “dr” term—the width of each slice of returns
for the distribution function is an important factor to calculate Lambda using F.D.M.,
which is given by
sigma
dr = 3 ∗ ; (10.7)
50
For each QP distribution chart, 100 equal spacing slices with width dr are used for
to evaluate the distribution function values. Program codes of process 3 are shown
in Fig. 10.19.
Based on dr value calculated in process 3, this process calculates the price returns
wavefunction values Q[nQ], NQ[nQ] where nQ is the number of slice in distribution
function, Q[nQ] is the pdf (probability density function values) within the particular
slice nQ; and NQ[nQ] is the normalized pdf values of the returns wavefunction.
The NQ[nQ] is given by:
292 10 Quantum Price Levels for Worldwide Financial Products
0.045
0.04
0.035
0.03
Q(r)
0.025
0.02
0.015
0.01
0.005
0 1
0.97559986
0.97657587
0.97755187
0.97852788
0.97950388
0.98047989
0.9814559
0.9824319
0.98340791
0.98438391
0.98535992
0.98633592
0.98731193
0.98828793
0.98926394
0.99023994
0.99121595
0.99219196
0.99316796
0.99414397
0.99511997
0.99609598
0.99707198
0.99804799
0.99902399
1.00097601
1.00195201
1.00292802
1.00390402
1.00488003
1.00585603
1.00683204
1.00780804
1.00878405
1.00976006
1.01073606
1.01171207
1.01268807
1.01366408
1.01464008
1.01561609
1.01659209
1.0175681
1.0185441
1.01952011
1.02049612
1.02147212
1.02244813
1.02342413
Daily Return (r)
Fig. 10.20 Process 4 quantum price return wavefunction of Q(r) of gold (XAUUSD)
Figure 10.20 shows the return wavefunction for Gold (XAUUSD) in 2048 financial
time series. Program codes of process 4 are shown in Fig. 10.21.
Once all wavefunction values in each slice are evaluated, we make use of F.D.M.,
together with QFSE (Quantum Finance Schrödinger Equation) to evaluate the
Lambda value (λ), which is given by:
2
r−1 ϕr−1 − r+1
2
ϕr+1
λ= 4 (10.9)
r+1 ϕr+1 − r−1
4
ϕr−1
where ϕr−1 and ϕr+1 are wavefunction values (normalized) for the 1st left and right-
hand side slice from the slice with max wavefunction value, normally is the central
point with returns value = 1 as in Fig. 10.22.
Program codes of process 5 are shown in Fig. 10.23.
10.5 MQL Program for QPLs Evaluation … 293
//************************************************************************************************************
//
// 4. Generate the QP Wavefunction distribution
//
//************************************************************************************************************
auxR = 0;
// Loop over all r from r - 50*dr to r + 50*dr and get the distribution function
// Reset all the Q[] first
for (nQ=0;nQ<100;nQ++)
{
Q[nQ] = 0;
}
//********************************************************************************************
//
// 5. Evaluate Lambda L for the QP Wavefuntion
//
//********************************************************************************************
//
// Given:
// maxQno - i.e. ground state Q[0], r[0] = r[maxQno-dr]
// We have:
// Q[+1] = NQ[maxQno+1], r[+1] = r[maxQno]+(dr/2)
// Q[-1] = NQ[maxQno-1], r[-1] = r[maxQno]-(dr*1.5)
// Apply F.D.M. into Quantum Finance Schrodinger Equation
// L = abs((r[-1]^2*Q[-1]-(r[+1]^2*Q[+1]))/(r[-1]^4*Q[-1]-(r[+1]^4*Q[+1])))
r0 = r[maxQno] - (dr/2);
r1 = r0 + dr;
rn1 = r0 - dr;
Lup = (pow(rn1,2)*NQ[maxQno-1])-(pow(r1,2)*NQ[maxQno+1]);
Ldw = (pow(rn1,4)*NQ[maxQno-1])-(pow(r1,4)*NQ[maxQno+1]);
L = MathAbs(Lup/Ldw);
FileWrite(Lambda_FileHandle,TPSymbol,L);
Print(TPSymbol,L);
Fig. 10.23 Process 5 Evaluate lambda value for the returns wavefunction
10.5 MQL Program for QPLs Evaluation … 295
Once Lambda value is evaluated, we can apply the Cardano’s formula to solve the
quantum price return Schrödinger equation, with formulation given by:
3 q q2 p3 3 q q2 p3
E(n) = − + + + − − + (10.10)
2 4 27 2 4 27
where:
Please refer to Chap. 5 on detailed mathematical proof and derivations for the
numerical evaluation of quantum price level.
In this program, we calculate the first 21 quantum finance energy levels (QFEL)
of every financial product (ground state 0 and 20 Energy Levels), which is sufficient
for daily financial trading and analysis.
Figure 10.24 shows MQL codes for 21 energy levels evaluation.
This process closes all datafile handles, calculate total CPU time spent and report
the total time taken to calculate QPLs of all financial products.
As shown in Fig. 10.25, MQL also provides start() class for developers to imple-
ment real time trading/hedging programs.
In other words, one can make use of the MQL learnt in this chapter to evaluate the
QPLs for any financial product, and make use of it, say, as S&R lines to implement
real time trading and hedging programs learnt in Chap. 6.
Figure 10.26 shows a snapshot of implementation result of QPL evaluation pro-
gram on Forex.com MT4 platform for QPL evaluation of 120 financial products.
//*******************************************************************************************************************
// 6. Using QP Schrődinger Eqt to FIND first 21 Energy Levels
// By solving the Quartic Anharmonic Oscillator as cubic polynomial equation of the form
// a*x^3 + b*x^2 + c*x + d = 0
// Using (Dasqupta et. al. 2007) QAHO solving equation:
// (E(n)/(2n+1))^3 - (E(n)/(2n+1)) - K(n)^3*L = 0
// Solving the above Depressed Cubic Eqt using Cardano's Method
// Given t^3 + p*t + q = 0
// Let t=u+v
// Cardano's Method deduced that:
// u^3 = -q/2 + sqrt(q^2/4 + p^3/27)
// v^3 = -q/2 - sqrt(q^2/4 + p^3/27)
// The first cubic root (real root) will be:
// t=u+v
// So, combining Cardano's Method into our QF Sch Eqt.
// Substitue p = -(2n+1)^2; q = -L(2n+1)^3*(K(n)^3) into the above equations to get the real root
//
//*******************************************************************************************************************
for (eL=0;eL<21;eL++)
{
p = -1 * pow((2*eL+1),2);
q = -1 * L * pow((2*eL+1),3) * pow(K[eL],3);
// Apply Cardano's Method to find the real root of the depressed cubic equation
u = MathPow((-0.5*q + MathSqrt(((q*q/4.0) + (p*p*p/27.0)))),p3);
v = MathPow((-0.5*q - MathSqrt(((q*q/4.0) + (p*p*p/27.0)))),p3);
// Close Qfile
FileClose(Qf_FileHandle);
Fig. 10.24 Process 6 using QP Schrodinger equation to find the first 21 energy levels
10.5 MQL Program for QPLs Evaluation … 297
//*********************************************************************************************
//
// 7. Program Termination
//
//*********************************************************************************************
return(0);
}
int start()
{
return(0);
}
10.6 Conclusion
Based on quantum finance concepts and theories in Chaps. 1–4, and numerical QPL
(quantum price levels) evaluation learnt in Chap. 5, this chapter we studied how to
implement these methods and theories to evaluate QPLs of worldwide 120+ financial
products including: worldwide forex, major cryptocurrencies, international finance
indices and major commodities.
From the implementation perspective, we demonstrated how to use MQL
(MetaQuotes Language) on MT4 Platform—one of the world’s biggest online pro-
gram trading and development platform to develop real-time QPL evaluation system.
As mentioned in Chap. 6 about quantum trading and hedging strategy, besides
using QPL as S&R lines in program trading; QPL can also be incorporated with
chaotic neural networks (CNNs), deep neural oscillatory network (DNON) for real-
time financial predictions, which will be studied in Chaps. 11 and 12, respectively.
Problems
10.1 What is the financial market? Discuss and explain why financial market prices
may not indicate the true intrinsic value, say, a stock which leads to the
popularity of programming trading nowadays.
10.2 What is the major difference between primary versus secondary financial mar-
kets? And what is the importance of Secondary markets in modern finance?
10.3 What are the two different categories of secondary market? Give one example
for each category and discuss the major characteristics.
10.4 State and explain the five major types of financial markets. Give one example
for each type of financial market and explain how it works.
10.5 What are the two major roles and functions of market makers (MM) in a
financial market, such as forex market?
10.6 State and explain the five key participants in forex market, in the descending
order of their importance and market shares.
10.7 State and explain the five key forex trading characteristics.
10.8 What are the major factors to affect the prices in forex market?
10.9 What is retail forex trading platform? Give one example and discuss it is
different from traditional forex trading platform.
10.10 What are supports and resistance (S&R) analysis in technical analysis? Give
one example in each case and discuss how it works.
10.11 Discuss and explain how S&R analysis is related to supply and demand
analysis and theory in technical analysis. Give an example by using the daily
chart of DJI (Dow Jones Index) and explain how such theory works.
10.12 What is the major difference between role reversal vs. trend reversal on S&R
analysis by using simple charts to illustrate your explanation?
10.13 How S&R analysis is related and interpreted by QPL (quantum price level)
modeling in quantum finance?
10.6 Conclusion 299
10.14 Discuss and explain why QPL (quantum price level) in quantum finance are
critical for nowadays HFPT (High-Frequency-Program-Trading).
10.15 What are the major functions and characteristics of MetaTrader system as
compared with traditional financial trading platforms?
10.16 State and explain the five categories of programs/systems generated by MQL
of MT platform.
10.17 State and explain six major components in MQL as compared with traditional
programming languages which are critical for program trading in finance.
10.18 State six types of OrderSend() in MQL and explain how they work for the
design of trading and hedging systems.
10.19 Give five commonly used technical indicators in technical analysis and
explain how they works in MQL programming.
10.20 MQL programming task 10.1 Design and implement a real-time trading pro-
gram using MQL with the implementation of classical RSI (30-70) trading
algorithm. Financial products: Using at least five forex products for trading
(e.g., USDCAD, AUDJPY, etc.) Trading criteria: Using H1 as trading time-
frame, trigger a sell order when RSI value hit 70, trigger a buy order when it
hit 30.
Using (1) MQL built-in simulator; (2) Live test for at least 10 trading days
using demo account and compared their results.
10.21 MQL Programming Task 10.2
Similar to Task 10.1, but this time using two more technical indicators to
generate automatic trading rules. Commonly used technical indicators such
as: iBand (Bollinger Bands); iMomentum (Momentum); iMA (Moving Aver-
age); iMACD (MACD) and iStochastic (Stochastic Oscillator).
Compare the trading results with the one generated by Task 10.1.
10.22 MQL Programming Task 10.3
Based on Workshop #2 (QPL2019.mq4), design and implement a real-time
MQL trading program by combining QPLs (as S&R lines) and RSI trading
program implemented in Task 10.1 to implement a simple quantum finance
trading system.
Compare trading results with trading program implemented in Task 10.1.
References
De Angelis, T. and Peskir, G. (2016) Optimal prediction of resistance and support levels. Applied
Mathematical Finance 23(6): 465–483.
Drayer, J. et al. (2008) Tradition vs. Trend: A Case Study of Team Response to the Secondary Ticket
Market. Sport Marketing Quarterly 17(4): 235.
Durbin, M. (2010) All About High-Frequency Trading. McGraw-Hill Education.
Gomes, C. and Waelbroeck, H. (2010) An empirical study of liquidity dynamics and resistance and
support levels. Quantitative Finance 10(10): 1099–1107.
Guo, G. (2005) Finite Difference Methods for the BSDEs in Finance. International Journal of
Financial Studies 6(1): 26, 2018.
Huber, M. et al. (2012) Which factors drive product sales in OTC markets? International Journal
of Pharmaceutical and Healthcare Marketing 6(4): 291–309.
Kaufman, P. J. (2013) Trading Systems and Methods. Springer.
Kirkpatrick, C. D. and Dahlquist, J. R. (2015) Technical Analysis: The Complete Resource for
Financial Market Technicians. FT Press 3rd edition.
Kuznetsov, A. (2006) The Complete Guide to Capital Markets for Quantitative Professionals
(McGraw-Hill Library of Investment and Finance). McGraw-Hill Education 1st edition.
Murphy, J. J. (1999) Technical Analysis of the Financial Markets: A Comprehensive Guide to
Trading Methods and Applications. New York Institute of Finance.
Singh, R.M. et al. (2009) The solution of the Schrödinger equation for coupled quadratic and quartic
potentials in two dimensions. Pramana 72(4): 647–654.
Tichy, V. et al. (2012) Analytic energies and wave functions of the two-dimensional Schrödinger
equation: ground state of two-dimensional quartic potential and classification of solutions. Cana-
dian Journal of Physics 90(6): 503–513.
Walker, W. (2018) Expert Advisor Programming and Advanced Forex Strategies. Independently
published.
Young, A. R. (2015) Expert Advisor Programming for MetaTrader 4: Creating automated trading
systems in the MQL4 language. Edgehill Publishing.
Zapranis, A. and Tsinaslanidis, P.E. (2012) Identifying and evaluating horizontal support and resis-
tance levels: an empirical study on US stock markets. Applied Financial Economics 22(19):
1571–1585.
Chapter 11
Time Series Chaotic Neural Oscillatory
Networks for Financial Prediction
Financial prediction, ranging from stocks, commodities to forex forecast poses real
challenges to researchers and quantitative analysts (a.k.a. quants) due to its highly
chaotic and unpredictable nature. With the blooming of cryptocurrency trading which
provides 24 × 7 online currency trading, the financial markets, especially the world-
wide currency markets are more chaotic and fluctuating than before. An effective
and reliable financial prediction system is profoundly required.
With the integration of quantum price levels (QPL) evaluated by quantum finance
technology, a Time Series Chaotic Neural Oscillatory Network (TSCNON) for world-
wide financial market prediction is devised to effectively resolve the system over-
training and deadlock problems imposed by traditional recurrent neural networks
using classical sigmoid-based activation functions.
In terms of system implementation, TSCNON coalesces into 2048-trading day
time series financial data and 39 major financial signals as input signals for the real-
time prediction of 129 worldwide financial products which includes: 9 major cryp-
tocurrencies, 84 forex, 19 major commodities, and 17 worldwide financial indices.
In terms of system performance, past 500-trading day of average system perfor-
mance attained less than 1% forecast percentage errors.
11.1 Introduction
With the integration of quantum price levels (QPL) discussed in Chap. 10 and chaotic
neural networks learnt in Chap. 9, in this chapter, TSCNON (time series chaotic neu-
ral oscillatory networks) is devised to effectively resolve the system over-training
and deadlock problems imposed by traditional recurrent neural networks using
classical sigmoid-based activation functions (Lee 2004, 2006a; Li and Lee 2005;
Wong et al. 2008). TSCNON coalesces 2048-trading day time series financial data
with quantum finance signals (QFS) based on QPL derived in Chap. 10 into input sig-
nals for the real-time prediction of 129 worldwide financial products which includes:
9 major cryptocurrencies, 84 forex, 19 major commodities, and 17 worldwide finan-
cial indices.
The chapter is comprised of (1) TSCNON system architecture and its chaotic
neural network training algorithm in Sect. 11.2; (2) TSCNON system implementa-
tion framework for the real-time prediction of worldwide 129 financial products in
Sect. 11.3; (3) Workshop #2—quantum finance forecast system (TSCNON.mq4) will
be discussed in details in Sect. 11.4; (4) TSCNON system performance in Sect. 11.6;
(5) TSCNON—system implementation results in Sect. 11.6 and followed by (6)
conclusion in Sect. 11.7.
TSCNON (time series chaotic neural oscillatory networks) is the integration of mul-
tilayer feedforward backpropagation networks (FFBPNs) (Fausett 1994; Patterson
1996) with Lee-oscillators (Lee 2004, 2005, 2006a, b) by replacing all simple neu-
rons with chaotic neural oscillators. The network training algorithm of TSCNON
is shown in Fig. 11.1. Figure 11.2 shows the system architecture of TSCNON for
financial prediction.
Fig. 11.1 System architecture of TSCNON (Source Dr. Lee’s illustration, 2019)
11.2 TSCNON—System Architecture 303
Fig. 11.2 System training algorithm of TSCNON (Source Dr. Lee’s illustration, 2019)
304 11 Time Series Chaotic Neural Oscillatory Networks …
where e1 , e2 , i1, and i2 are the weights; ξE and ξI are the threshold values and S(t) is
the external input.
Detail system performance analysis will be studied in the next section.
Fig. 11.3 Quantum finance forecast center official site for TSCNON daily financial forecast on
May 3, 2019 (Source Dr. Lee’s illustration, 2019)
and weekly forecast services from January 1, 2018 for over 1000 worldwide traders
and individual investors for testing and evaluation. Figure 11.3 shows the official site
of Quantum Finance Forecast Center.
From the system implementation perspective, real-time and historical data of the
worldwide 129 financial products provided by Forex.com and AvaTrade.com are
adopted in TSCNON for chaotic neural network training and prediction.
They include the following:
– major cryptocurrencies (9);
– major worldwide forex (84);
– major commodities (19);
– major worldwide financial indices (17).
Appendix A depicts the list of 129 financial products under these four categories.
As shown in Appendix A, owing to the short trading history of cryptocurrencies
(300-trading day records are provided by AvaTrade.com), all other financial products
consist of 2048 past trading day records for each financial product (data provided
306 11 Time Series Chaotic Neural Oscillatory Networks …
by Forex.com), which provide sufficient training and test sets for TSCNON system
testing and evaluation.
To provide a fully coherent and automation of TSCNON with both Forex.com
and AvaTrade.com trading platforms for the automatic acquisition of real-time and
historical data, the whole TSCNON system is developed in MT platform (Walker
2018; Young 2015) using MetaQuotes Language (MQL) and Expert Advisor (EA)
system for daily financial forecast. Figure 11.4 shows the system framework of
TSCNON.
As shown in Fig. 11.4 each financial product has 2048-trading day data (except
cryptocurrency which only have 300-trading day data) are automatically generated
by the MT4 engines of Forex.com and AvaTrade.com on a daily basis. Through the
QPL (quantum price level) Generator revealed in Chap. 10, 21 closed QPL signals
are generated by TSCNON together with the previous 5-day time series patterns;
they are fed into TSCNON for chaotic neural network training and testing.
Time Series
Financial Data
(1..T Trading Days)
QPL Generator
(21 QPL Signals)
Time Series
Chaotic Neural Network TSCNON
(120 Financial Products,FP1..FP120)
Financial Forecast
Results T+1
(FFR1..FFR120)
Fig. 11.4 TSCNON System Framework (Source Dr. Lee’s illustration, 2019)
11.4 Workshop #2—Quantum Finance Forecast System (TSCNON.Mq4) 307
11.4.1 Introduction
In this section, we will explore the programming details of quantum finance forecast
system (TSCNON) using MQL for real-time implementation on any MT4 platforms.
For the time series chaotic neural oscillatory network (TSCNON), we are using the
QFFC SDK developed by QFFC.org.
This section will study the complete MQL programming details for the design
and development of quantum finance forecast system by using TSCNON technology
in this chapter. Users can base on the method and program learnt in this chapter to
design and implement their own quantum finance prediction systems.
Since the entire TSCNON.mq4 consists of over 1000 program lines of coding, this
section will focus on the main module implementation process. Complete program
coding can be found in QFFC.org Workshop #2.
Fig. 11.5 Main program logic of TSCNON.mq4 (Source Dr. Lee’s illustration, 2019)
308 11 Time Series Chaotic Neural Oscillatory Networks …
1. PROGRAM INITIALIZZATION
2. FORECAST DAY?
9. WITH RANGE?
END
11.4 Workshop #2—Quantum Finance Forecast System (TSCNON.Mq4) 309
Fig. 11.7 Declaration of data files and directories in TSCNON (Source Dr. Lee’s illustration, 2019)
archive and upload onto the QFFC.org official site. Figure 11.8 shows the daily
forecast table for the first 20 financial products on May 3, 2019. Figure 11.9
shows the daily forecast performance table for the top 20 financial products on
May 2, 2019 (sorted by the % errors).
2. 120FC_DT stores the normalized daily time series (DT) data (i.e., Open, High,
Low, and Close) of the past 500-trading days. Totally 120 data files with each con-
taining the time series of one trading product. For example, “1 XAGUSD_DT”
contains the (normalized) time series of Silver/USD, where “1” is the product
code number.
Figure 11.10 shows the (normalized) daily time series of XAGUSD.
Fig. 11.8 FC_DAILY—TSCNON daily forecast table of first 20 financial products on May 3, 2019
(Source Dr. Lee’s illustration, 2019)
11.4 Workshop #2—Quantum Finance Forecast System (TSCNON.Mq4) 311
Fig. 11.9 PF_DAILY—TSCNON daily forecast performance table of the top 20 financial products
on May 2, 2019 (Source Dr. Lee’s illustration, 2019)
Fig. 11.11 Normalized forecast H/L of XAGUSD (Source Dr. Lee’s illustration, 2019)
Fig. 11.12 Daily forecast performance table of XAGUSD (Source Dr. Lee’s illustration, 2019)
This section declares the key parameters for the TSCNON system, they include the
following:
• number of network layers;
• number of Lee-oscillators input, hidden and output layers;
• maximum training iterations (in case of deadlock);
11.4 Workshop #2—Quantum Finance Forecast System (TSCNON.Mq4) 313
Fig. 11.13 Declaration of system parameters (Source Dr. Lee’s illustration, 2019)
314 11 Time Series Chaotic Neural Oscillatory Networks …
This section declares the forecast elements and variables include: previous-day record
elements for Open, High, Low, and Close (OHLC); today forecast elements for OHLC
and QPL variables for the 8 closest QPLs as in Fig. 11.14.
Declaration of variables in init() include the creation of init() and the declaration of
all variables and arrays used in the program. As mentioned previously, init() instead
of start() class is used as the forecast system is a “one-off” real-time system being
Fig. 11.14 Declaration of forecast elements and variables (Source Dr. Lee’s illustration, 2019)
11.4 Workshop #2—Quantum Finance Forecast System (TSCNON.Mq4) 315
used only once every morning of trading day; instead of trading program, which will
be operated continuously throughout the entire trading day. Figure 11.15 shows the
variables and arrays declaration section of the init() class.
As daily forecast will only perform during trading days from Monday to Friday (even
though there are half-day trading in Saturday, but normally will not perform daily
forecast as the half-day time period is too short for actual prediction).
This process will check whether today is a weekday (i.e., Mon–Fri) or not. If it is a
weekday, b_Forecast will be set to TRUE and the system will read FX_NQPR.csv data
file. Actually, this file is the implementation results of the QPL evaluation program
(QPL2019.mq4) revealed in Chap. 10 for the QPLs evaluation of worldwide financial
products, and NQPR.csv contains 21 NQPRs of 120 financial products.
By multiplying the opening price for any trading day, users can calculate the 21
closest QPLs on both sides of the opening price for TSCNON network training and
the closest 8 QPLs evaluation for daily information update in the QFFC.org official
site.
In addition, this section also prepares the file header for daily forecast file
(FC_DAILY) and daily performance file (PF_DAILY), respectively. Figure 11.16
shows the program section of the checking for forecast day.
This section will start the looping of ALL trading product data acquisition and fore-
casting. For every financial market, two cases exist. Either today day bar exists or
not. If it does not exist, we set yesterday trading day closing as today opening to cal-
culate the 8 closest QPLs and forecast result adjustment. In either case, the system
will read and store the previous-day time series (i.e., O, H, L, C) for today forecast,
archive, and calculation of yesterday performance (Fig. 11.17).
This section will read three data source of previous time series, which are as follows:
• FC_DT—to read the previous 500-trading day normalized time series data,
together with the previous-day OHLC for today forecast;
316 11 Time Series Chaotic Neural Oscillatory Networks …
Fig. 11.15 Declaration of variables in the init() (Source Dr. Lee’s illustration, 2019)
11.4 Workshop #2—Quantum Finance Forecast System (TSCNON.Mq4) 317
Fig. 11.16 Process #2—Check for forecast day (Source Dr. Lee’s illustration, 2019)
318 11 Time Series Chaotic Neural Oscillatory Networks …
Fig. 11.17 Process #3—Loop over all trading products (Source Dr. Lee’s illustration, 2019)
11.4 Workshop #2—Quantum Finance Forecast System (TSCNON.Mq4) 319
• FC_HL—to read the previous 500-trading day forecast H/L data, together with
the previous-day actual H/L results to calculate yesterday forecast performance
and stored into FC_PF file. The system will also store today’s forecast results after
daily forecast;
• FC_PF—to open the previous 500-trading day daily performance data, and store
yesterday forecast performance results.
This process will check whether the first data record is the current D1 Bar. If yes,
there is no need to store it into the data array. In either case, the system reads all 500
previous-day time series into the DT data array for network training (Fig. 11.18).
This section checks whether b_PF is true or not. If it is true, record the previous-day
time series into the FC_DT data file. Figure 11.19 shows the program code of Process
#4.2.
This section will read FC_HL data file, which stores the daily forecast H/L of the
previous 500-trading day (Fig. 11.20).
This section will read the FC_PF data file. This data file contains the previous 500-
trading day daily forecast performance results (Fig. 11.21).
This section will check whether bWrite is TRUE. If it is true, calculate the yester-
day forecast H/L errors, overall % errors, and store them into the FC_PF data file
(Fig.11.22).
320 11 Time Series Chaotic Neural Oscillatory Networks …
Fig. 11.18 Process #4.1—read FC_DT file (Source Dr. Lee’s illustration, 2019)
11.4 Workshop #2—Quantum Finance Forecast System (TSCNON.Mq4) 321
Fig. 11.19 Process #4.2 write FC_DT data file if b_PF is TRUE (Source Dr. Lee’s illustration,
2019)
By using QFSDK, this process creates the TSCNON network and initial all the
Lee-oscillator in different network layers (Fig. 11.23).
This process calls prepareData() function to register the 500 time series input data
one-by-one. Also, it makes use of NQPR array to generate all 21 QPLs for network
inputs (Fig. 11.24).
This process performs network training with target RMSE defined in the declaration
section (Fig. 11.25).
322 11 Time Series Chaotic Neural Oscillatory Networks …
Fig. 11.20 Process #4.3 read FC_HL data file (Source Dr. Lee’s illustration, 2019)
This section registers the past 5-trading day time series and 21 QPLs to for next-day
forecast (Fig. 11.26).
11.4 Workshop #2—Quantum Finance Forecast System (TSCNON.Mq4) 323
Fig. 11.21 Process #4.4 read FC_PF data file (Source Dr. Lee’s illustration, 2019)
324 11 Time Series Chaotic Neural Oscillatory Networks …
Fig. 11.22 Process #4.5 write FC_PF data file if bWrite is TRUE (Source Dr. Lee’s illustration,
2019)
11.4 Workshop #2—Quantum Finance Forecast System (TSCNON.Mq4) 325
Fig. 11.23 Process #5 Create TSCNON and Initialize ALL LEE-oscillators (Source Dr. Lee’s
illustration, 2019)
After TSCNON daily forecast, this process evaluates the range between forecast
H and L can check whether it is within the acceptable range defined in the declaration
section. It is to check whether the forecast OHLC are in logical values to decide
whether it needs to forecast again (Fig. 11.27).
After the daily forecast is completed and within an acceptable range, this process
calculates the total time taken, calculates the closest 8 QPLs and records the forecast
results into FC_DAILY data file, for data archive and upload to QFFC.org official
site (Fig. 11.28).
This process writes the Forecast H/L into FC_HL data file and closes all data files
(Fig. 11.29).
326 11 Time Series Chaotic Neural Oscillatory Networks …
Fig. 11.24 Process #6 register time series data (Source Dr. Lee’s illustration, 2019) Note Training
data file “Data_4_mix.csv” contains 744 records and for each record includes 40 data, the first 36
data presenting 9-days of O, H, L, C, and the last 4 data presenting next day of O, H, L, C
Figure 11.30 shows a snapshot of TSCNON system training and forecast process of
120 financial products of Forex.com on May 6, 2019 in the server farm of quantum
finance forecast center using Intel i5 CPU 2.39 GHz 32 MB RAM Dell Server.
11.5 TSCNON—Implementation Results 327
Fig. 11.25 Process #7 TSCNON training (Source Dr. Lee’s illustration, 2019)
Fig. 11.26 Process #8 TSCNON forecast (Source Dr. Lee’s illustration, 2019)
328 11 Time Series Chaotic Neural Oscillatory Networks …
Fig. 11.27 Process #9—check forecast within range or NOT (Source Dr. Lee’s illustration, 2019)
Fig. 11.28 Process #10.1—forecast completed, store forecast results, and total time taken (Source
Dr. Lee’s illustration, 2019)
From the system performance and evaluation perspective, TSCNON system evalu-
ated the daily forecast performance of the 129 financial products in four timeframes:
daily, weekly average, monthly average, and past 500-day average. Figure 11.32
presents the past 500-day performance ranking list of the top 20 financial products.
As shown, the 500-day average forecast % error of the top 20 financial products
ranging from 0.011% to 0.227%, respectively, which is somewhat promising and sig-
nificant as reflected by over 1000+ members of QFFC which consist of professional
forex traders, quants, and investors.
330 11 Time Series Chaotic Neural Oscillatory Networks …
Fig. 11.29 Process #10.2—write FC_HL data file and close all files (Source Dr. Lee’s illustration,
2019)
Fig. 11.30 Snapshot of TSCNON (Forex.com) for system training and forecast of 120 financial
products for Forex.com MT4 platform on May 6, 2019 (Source Dr. Lee’s illustration, 2019)
11.7 Conclusion
TSCNON (time series chaotic neural oscillatory network) is for real-time financial
prediction incorporated into quantum finance forecast center—a nonprofit making
AI-fintech R&D and worldwide financial forecast center aims at R&D and provision
of a fair and open platform for worldwide traders and individual investors to acquire
free knowledge of worldwide 129 financial product forecasts based on state-of-the
-art AI, chaotic neural networks and quantum field theory technologies.
If TSCNON is so effective to forecast worldwide financial markets, is it the end
of story?
332 11 Time Series Chaotic Neural Oscillatory Networks …
Fig. 11.31 Snapshot of TSCNON (AvaTrade.com) for system training and forecast of 9 major
cryptocurrencies for AvaTrade.com MT4 platform on May 6, 2019 (Source Dr. Lee’s illustration,
2019)
The truth is: For a professional trader and investor, a reliable and effective financial
forecast system is only the beginning of the story. A good financial investment also
needs: (1) good, effective trading and hedging strategies; (2) stable, logical with
rational investment psychology, which are also the future R&D directions of quantum
finance forecast center.
Current research of QFFC include the following:
(1) Integration of TSCNON with fractal technology for market trends/patterns min-
ing and prediction;
(2) R&D on quantum entanglement of quantum finance system on severe financial
event modeling and prediction;
(3) Design and implementation of chaotic type-2 transient-fuzzy deep neural oscil-
latory network for real-time financial prediction;
(4) Design and develop intelligent agent-based hedging and trading systems as
discussed in Chap. 13 (Lee 2019).
11.7 Conclusion 333
Fig. 11.32 Past 500-day system performance ranking chart of top 20 financial products
(Source Dr. Lee’s illustration, 2019) Note 1. High (Error) = Abs(HighForecast − HighActual ) 2. Low
(Error) = Abs(LowForecast − LowActual ) 3. Average (Error) = Average(High(Error), Low(Error))
4. % Error = Average(Error)/CloseActual
Problems
11.1 What is a recurrent neural network (RNN)? How it is different from the
traditional neural network in terms of network architecture.
11.2 Explain how to integrate Lee-oscillator(s) into a recurrent neural network
(RNN) to convert RNN into chaotic RNN.
11.3 In TSCNON, we use the closest, say, 20 quantum price levels (QPLs) as
quantum finance signals (QFSs) for network training.
334 11 Time Series Chaotic Neural Oscillatory Networks …
using FFBPN and TSCNON system for each category of financial products
c “Average STT” denotes the average system training time for a single financial product of each
category
d “DL” denotes deadlock during system training
(i) Based on this bifurcation diagram and Eqs. (11.1)–(11.4), write a MAT-
LAB program to generate the TCAF (transient chaotic activation func-
tion) with external input stimulus S(t) and L(t) in the normalization
region [0, 1].
(ii) From the TCAF, identify the active bifurcation region.
(iii) During the normalization process of all input signals in the TSCNON,
what is the optimal normalization region? Why?
11.6 In TSCNON discussed in this Sect. 11.2, 5-day timeseries are used as input
signal vectors with QPLs to forecast next-day high/low Prices. Why? Try to
use more trading days, says 21 days to do next-day forecast and check the
difference.
11.7 In this chapter, we used TSCNON for daily financial prediction. Discuss and
explain how we can use TSCNON for weekly and monthly prediction in
terms of (1) time series input vectors; (2) time horizon for network training;
and (3) QPLs being used. Do we need to recalculate all the QPLs? Why?
11.8 In Chap. 8, we learnt how initial conditions are critical for the prediction
of complex and highly chaotic systems like weather and financial markets.
Discuss why we can still use chaotic neural networks to perform financial
prediction? What is the basic concept and logic behind?
11.9 In QFFC.org, four timeframes of daily system performance analysis are gen-
erated: daily, weekly, monthly, and 500-Day average daily performance. Dis-
cuss and explain physical meaning and importance of each type of perfor-
mance results in terms of (1) system stability and (2) significance on different
timeframes of trading. Which financial products are the best in terms of fore-
cast performance? Why?
336 11 Time Series Chaotic Neural Oscillatory Networks …
Acknowledgements The author wishes to thank Forex.com and AvaTrade.com for the provision
of historical and real-time financial data. The author also wishes to thank Quantum Finance Forecast
Center of UIC for the R&D supports and the provision of the channel and platform QFFC.org for
worldwide system testing and evaluation.
References
Vigna, P. and Casey, M. J. The Age of Cryptocurrency: How Bitcoin and the Blockchain Are Chal-
lenging the Global Economic Order. Picador, 2016.
Walker, W. Expert Advisor Programming and Advanced Forex Strategies. Independently published,
2018.
Wong et al. Wind Shear Forecasting by Chaotic Oscillatory-based Neural Networks (CONN) with
Lee-oscillator (Retrograde Signaling) Model. International Joint Conference on Neural Networks
(IJCNN), 2040–2047, 2008.
Young, A. R. Expert Advisor Programming for MetaTrader 4: Creating automated trading systems
in the MQL4 language. Edgehill Publishing, 2015.
Chapter 12
Chaotic Type-2 Transient-Fuzzy Deep
Neuro-Oscillatory Network
(CT2TFDNN) for Worldwide Financial
Prediction
In this chapter, the author proposed a chaotic type-2 transient-fuzzy deep neuro-
oscillatory network with retrograde signaling (aka CT2TFDNN) for worldwide finan-
cial prediction. With the extension of the author’s original work on Lee-oscillator—
a chaotic discrete-time neural oscillator with profound transient-chaotic property,
CT2TFDNN provides: (1) effective modeling of Interval type-2 fuzzy logic with
chaotic type-2 transient-fuzzy membership function (CT2TFMF); (2) effective time
series network training and prediction using chaotic deep neuro-oscillatory network
with retrograde signaling (CDNONRS). CT2TFDNN not only provides a fast chaotic
fuzzy-neuro deep learning and forecast solution, but also it successfully resolves the
massive data over-training and deadlock problems, which are usually imposed by tra-
ditional recurrent neural networks using classical sigmoid-based activation functions.
From the implementation perspective, CT2TFDNN is integrated with 2048-trading
day time series financial data and top-10 major financial signals as fuzzy financial
signals (FFS) for the real-time prediction of 129 worldwide financial products which
consists of: 9 major cryptocurrencies, 84 worldwide forex, 19 major commodities,
and 17 worldwide financial indices.
Over the years, financial engineering ranging from the study of financial signals
to the modeling of financial prediction is one of the most exciting topics for both
academia and financial community. With the flourishing of AI technology in the past
20 years, various hybrid intelligent financial prediction systems with the integration
of neural networks, chaos theory, fuzzy logic, and genetic algorithms were proposed.
Interval type-2 fuzzy logic system (IT2FLS) with its remarkable capability for the
modeling of highly uncertain events and attributes, provides a perfect tool to interpret
various financial phenomena and patterns.
In this chapter, the author proposed a chaotic type-2 transient-fuzzy deep neuro-
oscillatory network with retrograde signaling (aka CT2TFDNN) for worldwide finan-
cial prediction (Lee 2019a, b). With the extension of author’s original work on Lee-
oscillator—a chaotic discrete-time neural oscillator with profound transient-chaotic
© Portions of this chapter are reprinted from Lee (2019a), with permission of IEEE.
property, CT2TFDNN provides: (1) effective modeling of Interval type-2 fuzzy logic
with chaotic type-2 transient-fuzzy membership function (CT2TFMF); (2) effective
time series network training and prediction using chaotic deep neuro-oscillatory net-
work with retrograde signaling (CDNONRS). CT2TFDNN not only provides a fast
chaotic fuzzy-neuro deep learning and forecast solution but also more prominently
successfully resolves the massive data over-training and deadlock problems, which
are usually imposed by traditional recurrent neural networks using classical sigmoid-
based activation functions. From the implementation perspective, CT2TFDNN is
integrated with 2048-trading day time series financial data and top-10 major financial
signals as fuzzy financial signals (FFS) for the real-time prediction of 129 worldwide
financial products which consists of: 9 major cryptocurrencies, 84 worldwide forex,
19 major commodities, and 17 worldwide financial indices.
12.1 Introduction
In a typical financial prediction problem, there are two basic problems we must tackle
with: (1) massive and highly uncertain financial patterns and signals; (2) massive time
series data and information for system training and machine learning. fuzzy logic
system (FLS) (Zadeh 1975; Ross 2016; Siler and Buckley 2004; Zadeh and Aliev
2019) with its intrinsic property of handling attributes of uncertainty, provides a
viable solution for system modeling and data representations.
This section gives a general overview of type-1 and type-2 FLSs, their systems’
characteristics and limitations, and the current research of FLS in financial predic-
tions. To tackle with highly chaotic and massive time series data such as severe
weather information and financial data, data scientists, and AI researchers are now
exploring the possibility of adopting chaotic neural oscillators into traditional recur-
rent neural networks—chaotic neuro-oscillatory networks (CNON, or chaotic neural
networks, CNN in short) for chaotic time series modeling and forecast. This section
gives a general overview of chaotic neural oscillator and the author’s original work
on Lee-oscillator, its neural architecture, and the latest works on Lee-oscillator with
retrograde signaling (LORS).
Like many real-world phenomena, the linguistic variables used to describe financial
markets (or market patterns), ranging from worldwide financial indices and stocks,
to highly volatile markets such as worldwide forex and cryptocurrencies are typical
fuzzy logic systems (FLS) with high degree of uncertainty and fuzziness (Ross 2016;
Siler 2004; Zadeh 1975; Zadeh and Aliev 2019).
For example, to describe a typical stock market (e.g., Nasdaq Index), financial
professionals are usually using fuzzy linguistic variables such as: bearish, bullish,
over-buy, or over-sell. More importantly, these fuzzy linguistic variables are usually
coexisting and overlapping in nature. For instance, when a stock market (e.g., Dow
Jones Index) appeared to be bearish (means short-sell), it is also having a certain
degree of over-sell (means rebound—with just the opposite trading signal) simul-
taneously. The same case occurs in a bullish market. Besides, all these linguistic
variables are fuzzy in the sense that the meaning of bearish or bullish are highly
subjective and different for different people, even for the same person the meanings
of these linguistic variables are usually different at different times and scenarios.
In order to model these highly uncertain and fuzzy linguistic variables into a
computer system (such as neural networks) for system modeling, FLS is one of the
most viable solutions. A typical FLS consists of three main modules:
12.2 Literature Review 343
For example, in a typical type-2 FLS, the membership function of each attribute
of the system itself is also a fuzzy set with a fuzzy range over the interval [0, 1]. In
other words, a higher order (n > 1) type-n FLS will increase the degree of uncertainty
of each fuzzy variable substantially.
But it has an intrinsic problem of computational complexity. For a simple situation
of a T2-FLS with k fuzzy variables, each fuzzy variable has m membership functions,
and each membership function is quantized into N different states. The total number
of possible fuzzy rules/states will be (N m )k , which will be an astronomical number
when such method is applied to real-world financial time series prediction problems
which usually have over 50 fuzzy attribute signals (from different financial indicators
and oscillators) to consider and each attribute has 4 membership functions, each can
span up to 100 different states, which means (1004 )50 possible states/fuzzy rules!
In order to solve this computational problem, interval type-2 fuzzy logic sys-
tem (IT2FLS) is introduced. In a typical IT2FLS, only certain interval(s) of the T2
membership function (usually the intervals of the state-transition-region, STR) are
fuzzified to a second-order FMF. Figure 12.2 shows a typical interval type-2 fuzzy
membership function (IT2-FMF) of relative strength index (RSI) for financial engi-
neering.
μ (x)
0 x 100
Fig. 12.1 Type-1 fuzzy membership function of relative strength index (RSI)
344 12 Chaotic Type-2 Transient-Fuzzy Deep …
μ (x)
0 x 100
Type-2 uncertainty regions
where μ̄à (x) and μà (x) denote the upper and lower membership functions for the
IT2-FS (Ã).
As shown in Fig. 12.2, the IT2-FMF is characterized by the second-order FMF
(the grey areas) in the fuzzy membership function, which are also known as FOU
(footprints of uncertainty). Owing to this high uncertainty modeling capability of
IT2FLS as compared with its T1-FLS counterpart, extensive researches have been
done in the past 20 years, especially in the fields of fuzzy financial modeling and
time series prediction.
Latest works of type-2 FLS in financial time series modeling and prediction
include: Castillo et al. have done extensive research of IT2FLS and fuzzy-neuro
systems on time series financial predictions including Mexican Stock Exchange
and Taiwan Stock Exchange (Castillo et al. 2014; Melin et al. 2012; Gaxiola et al.
2017; Ontiveros et al. 2018; Pulido et al. 2018); Bhattacharya et al. (Bhattacharya
et al. 2016; Konar and Bhattacharya 2017; Bhattacharya and Konar 2018) using
self-adaptive IT2FLS for stock prediction; IT2FLS for chaotic time series predic-
tion proposed by Lee et al. (2014); Multi-order fuzzy time series forecasting model
proposed by Ye et al. (2016) and Yolcu et al. (2016); Compact Evolutionary Interval-
Valued Fuzzy Rule-based system for real-time financial prediction proposed by Sanz
et al. (2015); Interval Type-2 Mutual Subsethood Fuzzy Neural Inference System
proposed by Sumati and Patvardhan (2018) for time series prediction and function
approximation; Fuzzy time series forecast of Taiwan stock market based on two-
factor second-order fuzzy-trend logical relationship groups (TSFTLRGs) with par-
ticle swarm optimization technique proposed by Chen and Jian (2017); IT2FLS for
stock index forecast based on fuzzy logical relationship map proposed by Jiang et al.
12.2 Literature Review 345
(2018); and type-2 neuro-fuzzy for stock price prediction based on self-constructing
clustering method of fuzzy rules and particle swarm optimization technique by Liu
et al. (2012).
Although IT2FLS provides a viable and computational feasible solution to model
highly uncertain phenomena, the determination and formulation of FOU is still an
area of interest in which the de facto usage of triangular-shape formulation as FOU
is also queried to be a bit artificial in nature, which motivates the author to search
for an integrated mathematical framework to model both interval type-2 fuzzy and
type-1 fuzzy regions in IT2-FMF as a single continuous transient-fuzzy membership
function.
By the extension of the author’s original work on Lee-oscillators (Lee 2004a), this
chapter proposed an innovative solution for the modeling of chaotic type-2 transient-
fuzzy logic (CT2TFL) by using multiple composite Lee-oscillators.
The motivation for introducing CT2TFL is in three aspects, which are as follows:
1. Typical financial signals and indicators such as RSI and MACD coexist with
multiple linguistic variables (over-sell, bearish, bullish, and over-buy), FLS is a
viable solution for technical signal modeling;
2. These linguistic variables themselves exist with different degrees of uncertainty
and fuzziness in nature, T2FLS is the best tool for handling such high-order
degree of fuzziness;
3. If we can construct a chaotic neural oscillator model in which its transient-chaotic
bifurcation diagram itself can directly model (simulate) a typical T2FLS with a
transient-fuzzy property only appears in FOU, the computational complexity
problem of T2FLS will be effectively resolved. More importantly, if such com-
posite chaotic neural oscillators themselves are exactly input neurons of a deep
neural network (DNN), the type-2 fuzzification process will become the intrin-
sic property of the DNN itself; instead of external fuzzification process in many
contemporary fuzzy-neuro systems.
In the next section, we will study an overview of discrete-time neural oscillators
and chaotic neural networks; and how it can be used to implement a type-2 chaotic
fuzzy neural network for time series prediction. After that, we will explore how
composite Lee-oscillators can be used to model T2FMF for financial time series
financial prediction.
where E, I, , and LORS denote excitatory, inhibitory, input, and output neurons
of LORS; ai and bi are the weights for excitatory and inhibitory neurons; ξE and ξI
are the threshold values and S(t) is the external input stimulus.
After extensive experiments and research (2008–2018) on the bifurcation behav-
iors of LORS with different parameter settings and conditions in Table 12.1, we cate-
gorize LORS into 8 major categories (LORS#0–LORS#7), with LORS#0 corresponds
to the original Lee-oscillator without retrograde signals and LORS#1–LORS#7 corre-
spond to different degrees of bifurcations, from single to multiple bifurcation regions.
Figure 12.4 illustrates the bifurcation diagrams for the 8 major categories of LORS.
Chao c
Financial GA
Type-2 Chao c T2 Forecast
Signal TOP10 FS
Transient- Transient- DataBank
Generator Selec on
Fuzzifica on Fuzzy Deep
Financial Module Module
Module Neural
Time FSGM GAT10FSSM
CT2TFM Network
Series
Module CT2TFDNN
CIT2TFDNNM DataBank
CT2TFMF is the modeling of interval type-2 fuzzy logic by using the author’s devised
time-discrete chaotic neural oscillator—LORS. The formulation of CT2TFMF (nor-
malized) is given by
LORS(2x, t), x ≤ 0.5
CT 2TFMF(x, t) = (12.6)
LORS(2 − 2x, t), x > 0.5 ≥ 1
where x is the fuzzy variable value (e.g., RSI value) which corresponds to the input
stimulus S(t) in the LORS formulations Eqs. (12.2)—(12.5); t is the type-2 fuzzy logic
12.3 CT2TFDNN—The System 351
index; LORS(x, t) is the normalized LORS function given by Eq. (14). Figure 12.6
shows the CT2TFMF by using LORS#0 with MATLAB simulation result of 1000
× 200 time-steps.
As shown, the CT2TFMF generated by LORS has certain special features:
(i) The membership function generated is a typical type-2 fuzzy membership func-
tion with remarkable transient-fuzzy FOU, which corresponds to the bifurcation
regions of the chaotic oscillators.
(ii) The whole type-2 fuzzy membership function can be modeled and generated
by a simple time-discrete chaotic neural oscillator, which can be easily imple-
mented to model various Interval type-2 fuzzy logic systems (IT2FLS).
(iii) As the neural dynamics of FOUs generated by CT2TFMF is inherited from
the Lee-oscillators, so it naturally converges to the two stable states at both
ends, while exhibits progressive and controlled fuzziness (bifurcation in chaos
theory).
(iv) By regulating various parameters (e.g., weights of inhibitory and excitatory
neurons, threshold values ξ E and ξ I , decay constant k) in the Lee-oscillator, the
FOUs of CT2TFMF can be adjusted and transformed to other chaotic patterns
to tackle with different complex IT2FLS problems.
For the ease of modeling type-2 fuzzy logic for the 39 financial signals, chaotic type-2
composite transient-fuzzy membership function (aka CT2CTFMF) is constructed to
model the following four type-2 fuzzy financial linguistic variables: over-sell (OSell),
bearish (Bear), bullish (Bull), and over-buy (OBuy).
Figure 12.7 shows the MATLAB simulation of normalized CT2CTFMF for finan-
352 12 Chaotic Type-2 Transient-Fuzzy Deep …
cial signal RSI (relative strength index) using 4 composite Lee-oscillators (LORS#0)
with MATLAB simulation results of 1000 × 200 time-steps.
The CT2CTFMF of these four linguistic variables are the following:
CT 2TFMF(2x + 0.5, t), x ≤ 0.25
CT 2CTFMFOsell (x, t) = (12.7)
0, x > 0.25 ≥ 1
CT 2TFMF(1.6x, t), x ≤ 0.625
CT 2CTFMFBear (x, t) = (12.8)
0, x > 0.625 ≥ 1
0, x ≤ 0.375
CT 2CTFMFBull (x, t) = (12.9)
CT 2TFMF(1.6x − 0.6, t), x > 0.375 ≥ 1
0, x ≤ 0.75
CT 2CTFMFOBuy (x, t) = (12.10)
CT 2TFMF(2x − 1.5, t), x > 0.75 ≥ 1
From the fuzzy-neuro perspective, Fig. 12.7 is the bifurcation diagram of the
composite Lee-oscillators with the superposition of four LORS#0 Lee-oscillators
which model the membership function CT2CTFMF of the four type-2 fuzzy vari-
ables: over-sell, bearish, bullish, and over-buy with their neural dynamics governed
by (12.7)–(12.10), respectively.
As shown in the above equations, the formulations of all type-2 fuzzy linguistic
variables are continuous state functions with transient-chaotic (named as transient-
fuzzy in Type-n FLS) properties within the state-transition regions, which correspond
to FOUs in the type-2 FLS. Besides, since CT2CTFMF is generated by Lee-oscillator
which is a discrete-time chaotic oscillator, all type-2 fuzzy states can be easily modi-
fied, implemented, and evaluated by adjusting the total number of first-order (x) and
second-order (t) CTFMV (composite transient-fuzzy membership values) to fit for
different requirements of granularity for any IT2FLS problems.
From the theoretical perspective, the chaotic bifurcation diagram of the compos-
ite Lee-oscillators is the transient-chaotic output states of these chaotic oscillators
subjected to the input stimulus. In terms of type-2 fuzzy logic, the transient-fuzzy
bifurcation at type-2 transient-fuzzy regions shown in Fig. 12.7 are theoretically ana-
log to the interval type-2 concept in fuzzy logic. The difference is that this chaotic
transient-fuzzy membership function is not an additional or external fuzzification
engine that usually is applied by typical IT2 FLS, but rather it is an intrinsic property
of the fuzzy-neuro network itself. In other words, the type-2 fuzzification process
proposed in this system is just part of the neural dynamics of the input neurons by sim-
ply replaced each of the input neuron (financial signal) by 4 LORS#0 Lee-oscillators
and automatically inherited the transient-fuzzy capability during the system training
and forecast process.
(3) Chaotic T2 Transient-Fuzzification Module (CT2TFM)
In this module, all 39 normalized trading signals (oscillators) will undergo the
chaotic interval type-2 fuzzification process by applying the CT2CTFMF described
in (12.7)–(12.10). The resulted 39 (each fuzzy financial signal has 4 second-order
type-2 TFMV) fuzzified financial signals will enter to the GA selection module for
top-10 financial fuzzy signals selection.
financial signal vectors with 4 dimensions correspond to the four type-2 fuzzy
variables.
In the initialization stage, a random number generator is used to generate all the
weights for these 1000 FFSVs. Note that these weights are also used as the initial
weights used for the CT2TFDNN for fitness evaluation. In fact, the objective of
this GA-based signal selection scheme is to evaluate the best (fitness) FFSV and
retrieve the top-10 FFS with highest weights for system training and prediction
in CT2TFDNN.
(2) Fuzzy Financial Signals Crossover Module (FFSCM)
The whole FFSCM consists of the following steps:
12.3 CT2TFDNN—The System 355
As shown in Fig. 12.9, the input vectors of CT2TFDNN include the following:
(1) Top-10 T2 fuzzy financial signals (FFS), each consists of 4 fuzzy attributes
indicate the T2 FMV of: over-sell (OS), bearish (BR), bullish (BU), and over-
buy (OB);
(2) Time series financial data, each set consists of the open (O), high (H), low (L),
close (C), and volume (V) of 10-trading days normalized time series data, each
is multiplied by time-step decay (forgetting) function fg() given by
where D is the time-horizon for time series and k = 0.5 is the decay factor.
Figure 12.11 shows the decay chart for financial time series data (Lee 2004b).
As shown in Fig. 12.11 the decay function almost converges to 0 when time
horizon (TH) close to day-10. So, we set the time horizon for time series financial
data to 10. As reflected from previous works (Lee 2004b), the introduction of decay
(forgetting) factor is vital not only because it simulates time series relationships of
the historical data, but also it can avoid over-training by effectively control the data
size of time series input vectors and speedup the whole training process. Also, by
replacing all neurons of CT2TFDNN with Lee-oscillators, the traditional FFPBN
effectively transforms into a multilayer neuro-oscillatory network with inherited
transient-chaotic neuron activation properties from Lee-oscillators, which not only
significantly speedup the whole network training process, but more importantly it
Fig. 12.11 Decay (forgetting) factor for the financial timeseries data
12.3 CT2TFDNN—The System 359
resolves the over-training and deadlock problems which commonly occurs in most
recurrent neural networks with massive financial time series data. Detailed system
performance analysis will be studied in Sect. 12.5.
With the successful cooperation with AvaTrade.com (major cryptocurrency MT4 ser-
vice provider) and Forex.com (major forex MT4 service provider), QFFC launched
the 129 financial products free daily and weekly forecast services from January, 2018
for worldwide traders and individual investors. They include the following:
(1) 9 major cryptocurrencies;
(2) 84 worldwide forex;
(3) 19 major commodities;
(4) 17 worldwide financial indices.
Appendix A shows the list of 129 financial products under these four categories.
As shown in Appendix A, owing to the short trading history of cryptocurrency,
300-trading day of historical time series are provided by AvaTrade.com, while all
other financial products consist of a 2048-trading day of historical time series for
each financial product provided by Forex.com which provide sufficient training and
test sets for system implementation and performance analysis. Also, each time series
record consists of daily information: open (O), high (H), low (L), close (C), and
volume (V).
Table 12.3 shows parameter settings of CT2TFDNN for network training and fore-
cast. As shown, 10 trading day time series are input into CT2TFDNN for network
training, so totally we have 50 input nodes (LORS#0) for time series inputs and 100
fuzzy financial signals (FFS) inputs with totally 400 FFS input nodes (LORS#0).
For each hidden layer, 400 LORS (LORS#0–LORS#7) hidden nodes are used for
network training. For financial products with 2048-trading day time series data, 1228
(60%) time series dataset is used for training, 401 (20%) time series dataset is used
for network testing and validation. For cryptocurrency with only 300 trading day time
series data, same proportion of datasets are employed for the next training, testing,
and validation.
From the implementation perspective, the whole CT2TFDNN system are imple-
mented over MT4 (MetaTrader4) platform (Walker 2018; Young 2015)—the world’s
biggest online financial program trading and development platform with over hun-
dreds of participating financial institutions for the provision of online program trading
and development services of all common worldwide financial products.
Since January 1, 2018, QFFC released daily financial forecast using CT1FNON
(type-1 fuzzy chaotic neuro-oscillatory networks) as pilot run and open testing for
worldwide traders and investors.
From October 1, 2018, after completing the system implementation of
CT2TFDNN, QFFC daily worldwide financial predictions are conducted by
CT2TFDNN system.
12.5.1 Introduction
From the system performance perspective, three types of system performance anal-
ysis were conducted. They were the following:
1. System training performance analysis;
2. System forecast simulation performance analysis;
3. Actual daily forecast performance analysis.
In all these performance analyses, the system performance of CT2TFDNN was
compared with five forecast models:
1. Traditional time series feedforward backpropagation network (FFBPN);
2. Support vector machine (SVM) forecasting tool provided by R Project—one of
the most popular financial forecasting tools used in the finance industry;
3. Deep neural network (DNN) with PCA (principal component analysis) model
(Singh and Srivastava 2017);
4. Classical interval type-2 fuzzy-neuro network (IT2FNN);
5. Chaotic type-1 fuzzy-neuro-oscillatory network (CT1FNON).
362 12 Chaotic Type-2 Transient-Fuzzy Deep …
In CT2TFDNN training performance analysis, 60% of time series data of 129 finan-
cial products are employed for system training in two aspects. Figure 12.13 shows
system performances of the six forecast models over 500 epochs of network training
Fig. 12.13 System training performance (over 500 epochs) of six financial forecast models for 129
financial products. (TOP) Mean of RMSE. (BOTTOM) Standard deviation of RMSE
12.5 CT2TFDNN—Performance Analysis 363
of the 129 financial products in terms of mean and standard deviations of RMSE
(root-mean-square errors).
As shown in Fig. 12.13, two observations can be found: (1) CT2FDNN outper-
formed the other five models in terms of both mean and standard deviation of RMSE;
(2) CT2FDNN attained the promisingly low RMSE in 70 epochs while the RMSE
of other networks especially FFBPN, SVM, and IT2FNN were still half-way of their
lowest RMSE levels.
Note
1. Results are generated by 500 simulations of each neural network system (in msec)
2. “Total STT” denotes the total average system training time for 500 simulations
3. “Av. STT” denotes the average system training time for a single financial product
4. “DL” denotes deadlock during system training
12.5 CT2TFDNN—Performance Analysis
365
366 12 Chaotic Type-2 Transient-Fuzzy Deep …
(4) In terms of the system performance across different financial products, the
simulation results clearly reflected that both cryptocurrency and forex were
more chaotic and difficult for network training than other financial products as
expected, which will be one of the future R&D directions of quantum finance
forecast center.
Average(DFErr(H ), DFErr(L))
DFPE = × 100% (12.12)
DClose
where DFErr(H ), DFErr(L) are the daily errors of daily forecast high (low) with
the daily actual high (low), respectively, and DClose is the daily closing price.
As shown in Fig. 12.14, the 120-trading day actual forecast performance of six
forecast models were rather consistent with their system training results shown in
previous tests, in which FFPBN performed the worst and CT2TFDNN performed
the best.
But one interesting difference is that although the ranking of their performances
were the same between system training performance against actual forecast perfor-
mance, the overall forecast performance gaps between these six forecast systems
were more distinct in which CT2FDNN outperformed the other five forecast models
significantly and it took less than 20-trading days to attain its stable forecast per-
formance state while other forecast systems took 40–60 trading days to attain their
stable forecast performance states.
Figure 12.15 shows the daily forecast performance of CT2TFDNN across the four
different categories of financial products. As shown, owing to difference levels of
chaotic behavior and disturbance between different categories of financial products,
there were two interesting findings: (1) the forecast performance of cryptocurrency
was significantly poorer than all other categories even though their differences in
training performance were not so significant. This might due to the highly chaotic
property of cryptocurrency and insufficient time series history data; (2) the forecast
performance of forex was better than its performance in system training, which
was rather consistent with the observations from the professional traders using the
12.5 CT2TFDNN—Performance Analysis 367
Fig. 12.14 Actual daily forecast performance of six financial forecast models for 129 financial
products between 10/1/2018 and 03/15/2019. (TOP) Mean of forecast % error. (BOTTOM) Standard
deviation of forecast % error
368 12 Chaotic Type-2 Transient-Fuzzy Deep …
Fig. 12.15 Actual daily forecast performance of CT2TFDNN of four different categories of finan-
cial products between 10/1/2018 and 3/15/2019. (TOP) Mean of RMSE. (BOTTOM) Standard
deviation of RMSE
12.5 CT2TFDNN—Performance Analysis 369
CT2TFDNN forecast service during this period of time also concluded that although
forex products overall were highly chaotic in nature, CT2TFDNN provided a reliable
daily forecast with rather a stable degree of accuracy.
12.6 Conclusion
The dawn of big data epoch has driven us to face new challenges from over-flooding
data and information. This chapter devised an innovative chaotic type-2 transient-
fuzzy deep neuro-oscillatory network (CT2TFDNN) to address the over-training
and deadlock problems, which are commonly occurred during network training of
massive data such as financial, weather, and biomedical big data.
For the system architecture perspective, CT2TFDNN provided integration of four
different innovative AI technologies:
(1) chaotic neural oscillator for the modeling of neural dynamics;
(2) type-2 transient-fuzzy logic for the modeling of fuzzy financial signals;
(3) genetic algorithm for the selection of the best fuzzy financial signals;
(4) deep chaotic neural network for network training and prediction.
From the implementation perspective, CT2TFDNN has been adopted for the real-
time prediction of 129 worldwide financial products. In comparison with five fore-
cast systems ranging from traditional FFBPN, SVM, DNN with PCA, IT2FNN to
CT1FNON, CT2TFDNN produced promising results in terms of system training
performance and actual daily forecast performance.
The future and related works include the following:
1. Further research and study of CT2TFLS for the modeling, analysis, and data
mining of other big data problems such as weather, biometric and biomedical
engineering.
2. Further study of CT2TFDNN for the categorization of various CT2TFMF using
neural retrograde signaling techniques.
3. R&D of intelligent agent-based hedging and trading systems based on CT2TFLS.
4. Integration of CT2TFDNN with quantum price level (QPL) study using quantum
anharmonic oscillatory model (QAOM) for financial trend prediction and long-
term investment.
Problems
12.1 What is fuzzy logic? Discuss and explain the difference between type-1 vs.
type-2 fuzzy logic. Give two examples and explain how type-2 fuzzy logic
can be applied in finance engineering and quantum finance.
12.2 What are the major advantages and shortcomings of type-1 fuzzy logic? Use
two applications of type-1 fuzzy logic on technical indicators in the financial
market for illustration.
370 12 Chaotic Type-2 Transient-Fuzzy Deep …
12.3 What is interval type-2 fuzzy logic (IT2FL)? State and explain the major
difference between type-2 fuzzy logic and IT2FL. Use two examples in real-
world situation for illustration.
12.4 The following figure shows the type-1 fuzzy membership function of RSI
(i) Use the same methodology, draw the type-1 fuzzy membership function
to describe the fuzzy variable of temperature.
(ii) Compare these two fuzzy membership functions, discuss and explain
why the fuzzy membership of RSI for the description of financial market
is more meaningful and critical for fuzzification than traditional fuzzy
variable such as temperature and humidity for the description of weather
situation.
(iii) Based on the given type-1 membership function of RSI:
• Draw the corresponding type-2 membership function and write the
corresponding membership function formulation;
• Draw the corresponding internal type-2 membership function and
write the corresponding membership function formulation;
• Contract their difference (i.e., pros and cons) and describe how they
work;
• Why they are more meaningful and useful than type-1 fuzzy mem-
bership?
12.5 State and describe the formulation and logic behind the type-n fuzzy logic.
Use two real-time examples (weather and finance) to illustrate your explana-
tion.
12.6 What are the major advantages and shortcomings of type-n fuzzy logic?
Justify your explanation by using real-world example in finance engineering.
12.7 What is retrograde signaling in biological neuroscience? State and discuss
the latest research and findings on symptoms and illness in human memory
related to this effect.
12.8 What is Lee-oscillators with retrograde signaling? What is the mathematical
formulation? How can it relate to biological neuroscience?
12.9 State and explain the formulation of Lee-oscillator with retrograde signaling.
Discuss how it works in real-world application on weather prediction and
financial engineering.
12.6 Conclusion 371
12.10 Discuss and explain the major differences between Lee-oscillator and Lee-
oscillator with retrograde signaling in terms of (1) physical meaning in biolog-
ical neuroscience; (2) mathematical formulation; physical meaning in chaotic
neural network modeling.
12.11 Fig. 12.4 shows the bifurcation diagrams of 8 major Lee-oscillators with
retrograde signaling. Discuss and explain their major characteristic in terms
of (1) bifurcation; (2) chaotic transfer function capability.
12.12 Below figure shows the system framework of CT2TFDNN (chaotic type-2
transient-fuzzy deep neural network)
(i) Discuss and explain the major roles and functions of each functional
modules of CT2TFDNN.
(ii) What is deep neural network (DNN)? What is different between DNN
and ANN?
(iii) What are the major shortcomings of DNN for modeling a complex
system such as real-time financial prediction systems?
(iv) What are the major advantages and characteristics of CT2TFDNN ver-
sus traditional DNN (deep neural networks)?
12.13 Below figure shows the chaotic type-2 composite transient-fuzzy membership
functions (CT2CTFMF) of RSI.
12.14 Discuss and explain why GA-based top-10 financial signals section module
is critical in the CT2TFDNN system.
12.15 Programming exercise I
(i) Draw the system flowchart for the implementation of CT2TFDNN
system for real-time financial prediction.
(ii) Write the system training algorithms of CT2TFDNN.
(iii) Based on the MQL program skill learnt in QFFC.org, implement
CT2TFDNN for at least five forex products using MQL on MT4 plat-
form.
(iv) Compare their system training performance in terms of (1) RMSE
(root-mean-square error) and (2) standard deviations in 1000 iterations
using error rate 1 × 10−6 .
(v) Compare their next-day forecast performance results in terms of (1) %
Error and (2) Standard deviation of % error for at least 20 trading days
(or 3 months MT4 simulation results).
(vi) Implement and perform the same performance test for three other cate-
gories of financial products: (1) financial indices; (2) major commodity
and (3) cryptocurrency.
(vii) Compare their results in terms of different categories of financial prod-
ucts. Discuss and explain the experimental results.
12.16 Figure 12.15 shows the actual daily forecast performance of CT2FDNN for
four different categories of financial products: cryptocurrency, forex, financial
indices, and major commodity.
(i) Discuss and explain why cryptocurrency is always the worst in terms
of forecast performance. How can we improve it?
(ii) As compared with system training performance shown in Fig. 12.4,
the forecast performance of forex products is significantly improved.
Why?
(iii) What is a suggestion and conclusion in terms of a financial investment
perspective?
Acknowledgements The author wishes to thank Forex.com and AvaTrade.com for the provision
of historical and real-time financial data. The author also wishes to thank Quantum Finance Forecast
Center of UIC for the R&D supports and the provision of the channel and platform qffc.org for
worldwide system testing and evaluation.
References 373
References
Bhattacharya et al. (2016) Secondary Factor Induced Stock Index Timeseries Prediction using
Self-Adaptive Interval Type-2 Fuzzy Sets. Neurocomputing 171:551–568.
Bhattacharya, D. and Konar, A. (2018) Self-adaptive type-1/type-2 hybrid fuzzy reasoning tech-
niques for two-factored stock index timeseries prediction. Soft Computing 22(18): 6229–6246.
Castillo et al. (2014) Application of Interval Type-2 Fuzzy Neural Networks in Non-Linear Identi-
fication and Timeseries Prediction. Soft Computing 18(6): 1213–1224.
Chen, S. M. and Jian, W. S. (2017) Fuzzy Forecasting Based on Two-Factors Second-Order Fuzzy-
Trend Logical Relationship Groups, Similarity Measures and PSO Techniques. Information Sci-
ences 391–392: 65–79.
Faghihi, F. and Moustafa, A. A. (2017) Sparse and burst spiking in artificial neural networks inspired
by synaptic retrograde signaling. Journal of Information Science 421: 40–42.
Gaxiola et al. (2017) Comparison of T-Norms and S-Norms for interval type-2 fuzzy numbers in
weight adjustment for neural networks. Information 8(3): 114.
Jiang et al. (2018) An Interval Type-2 Fuzzy Logic System for Stock Index Forecasting Based on
Fuzzy Timeseries and a Fuzzy Logical Relationship Map. IEEE Access 6: 69107–69119.
Konar, A. and Bhattacharya, D. (2017) Handling main and secondary factors in the antecedent for
type-2 fuzzy stock prediction. Intelligent Systems Reference Library 127: 105–132.
Korkut et al. (2013) Regulation of Postsynaptic Retrograde Signaling by Presynaptic Exosome
Release. Neuron 77: 1039–1046.
Lee, R. S. T. (2019a) Chaotic Type-2 Transient-Fuzzy Deep Neuro-Oscillatory Network
(CT2TFDNN) for Worldwide Financial Prediction. IEEE Transactions on Fuzzy System. https://
doi.org/10.1109/tfuzz.2019.2914642.
Lee, R. S. T. (2019b) Chaotic Interval Type-2 Fuzzy Neuro-oscillatory Network (CIT2-FNON) for
Financial Prediction. International Journal of Fuzzy Systems. https://doi.org/10.1007/s40815-
019-00688-w
Lee, R. S. T. (2006a) LEE-Associator – A Transient Chaotic Autoassociative Network for Progres-
sive Memory Recalling. Neural Networks 19(5): 644–666.
Lee, R. S. T. (2006b) Fuzzy-Neuro Approach to Agent Applications (From the AI Perspective to
Modern Ontology). Springer-Verlag, Germany.
Lee, R. S. T. (2005) Advanced Paradigms in Artificial Intelligence From Neural Oscillators, Chaos
Theory to Chaotic Neural Networks. Advanced Knowledge International, Australia.
Lee, R. S. T. A (2004a.) Transient-chaotic Auto-associative Network (TCAN) based on Lee-
oscillators. IEEE Trans. Neural Networks 15(5): 1228–1243,
Lee, R. S. T. (2004b) iJADE Stock Advisor: An Intelligent Agent based Stock Prediction System
using Hybrid RBF Recurrent Networks. IEEE Trans. on SMC A 34(3): 421–428.
Lee et al. (2014) An Efficient Interval Type-2 Fuzzy CMAC for Chaos Timeseries Prediction and
Synchronization. IEEE Transactions on Cybernetics 44(3) 29–341.
Liu et al. (2012) Application of Type-2 Neuro-Fuzzy Modeling in Stock Price Prediction. Applied
Soft Computing Journal 12(4): 1348–1358.
Melin et. al. (2012) A new approach for timeseries prediction using ensembles of ANFIS models.
Expert Systems with Applications 39(3): 3494–3506.
Murphy, J. J. (1999) Technical Analysis of the Financial Markets: A Comprehensive Guide to
Trading Methods and Application. New York Institute of Finance, New York.
Naeem et al. (2015) On the Role of Astroglial Syncytia in Self-Repairing Spiking Neural Networks.
IEEE Trans. On Neural Networks and Learning Systems 26(10): 2370–2380.
Ontiveros et al. (2018) High order α-planes integration: A new approach to computational cost
reduction of General Type-2 Fuzzy Systems. Engineering Applications of Artificial Intelligence
74: 186–197.
Pulido, M. and Melin, P. (2018) Optimization of Ensemble Neural Networks with Type-1 and Type-
2 Fuzzy Integration for Prediction of the Taiwan Stock Exchange. Studies in Fuzziness and Soft
Computing 361:151–164.
374 12 Chaotic Type-2 Transient-Fuzzy Deep …
Over the years, financial engineering ranging from the study of financial signals to
the modeling of financial prediction is one of the most stimulating topics for both
academia and financial community. Not only because of its importance in terms of
financial and commercial values, but also it vitally poses a real challenge to world-
wide researchers and quants owing to its highly chaotic and almost unpredictable
nature. This chapter devises an innovative multiagent-based quantum financial fore-
cast and trading system (a.k.a. quantum trader) for worldwide financial prediction
and intelligent trading. With the adoption of author’s theoretical works on Lee-
oscillator with profound transient-chaotic property, quantum trader effectively inte-
grates quantum field signals (QFS) and quantum field oscillators (OFS) studied in
Part I for neural network training and prediction into: (1) quantum forecaster—
chaotic FFBP-based time series supervised-learning agent for worldwide financial
forecast and; (2) quantum trader—chaotic RBF-based actor-critic reinforcement-
learning agents for the optimization of trading strategies. Quantum trader not only
provides a fast reinforcement-learning and forecast solution, more prominently it
successfully resolves the massive data over-training and deadlock problems which
is usually imposed by traditional recurrent neural networks and RBF networks using
classical sigmoid or Gaussian-based activation functions.
From the implementation perspective, the quantum trader is integrated with 2048-
trading day time series financial data and 39 major financial signals as input signals
for the real-time prediction and intelligent agent trading of 129 worldwide financial
products which consists of: 9 major cryptocurrencies, 84 forex, 19 major commodi-
ties, and 17 worldwide financial indices. In terms of system performance, past 500-
day average daily forecast performance of quantum trader attained less 1% forecast
percentage errors and with promising results of 8–13% monthly average returns.
© Portions of this chapter are reprinted from Lee (2019), with permission of KeAi Publishing
Communications Ltd.
13.1 Introduction
Conventional technical analysis and chart analysis methods probe various trading
signals (e.g., K-lines, MAs, Bollinger-band index, KDJ and RSI indices) and chart
patterns (e.g., major reversal and trend patterns, golden-ratio patterns, Fibonacci
patterns, Elliot-wave patterns) that believe to affect the market price trends, trad-
ing patterns and individual reasonings to determine the best time to trigger buy or
sell decisions (Borden 2018; Brown 2012; Bulkowski 2005; Murphy 1999). How-
ever, these numerous trading signals and chart-patterns are usually self-contradictory
between different timeframes, let’s alone with the fact that they are highly subjective
to the traders’ own judgment and psychological condition.
With the advancement of computational capacity in past decades, the modeling of
complex financial prediction systems ranging from artificial neural networks (ANNs)
(Chang et al. 2012; Dai et al. 2012) to fractal-based financial forecast systems (Ling
2013) using ordinary desktop personal computers and workstations is no more a
reverie.
Current research on financial prediction include: stock prediction using deep neu-
ral network (DNN) with principal component analysis (PCA) by Singh and Srivas-
tava (2017); fuzzy models by Hwang and Oh (2010); Postfix-GP (Genetic Program-
ming) models by Dabhi and Chaudhary (2016); SVM (Support Vector Machine) and
hybrid SVR (Support Vector Regression) models by Henrique et al. (2018), Nahil
and Lyhyaoui (2018) and Ouahilal et al. (2017).
Moreover, the popularity of free and open quantitative financial system develop-
ment platforms such as MetaTrader (MT) platform provides an ideal environment
for worldwide researchers and quants to test their trading algorithms, strategies and
financial signals with real-time financial data streams which prosper the popular-
ity of program trading, especially the high-frequency algorithmic program trading
(HFAPT) in the past 10 years (Durbin 2010; Walker 2018; Young 2015).
From the financial market perspective, the blooming of cryptocurrency origi-
nated from bitcoin in 2009 had increased to more than 4000 cryptocurrencies in
the worldwide financial market (Narayanan 2016; Vigna and Casey 2016). More
importantly, major international fund houses and forex trading platforms integrate
24 × 7 electronic trading of cryptocurrency into their forex trading platforms since
2013. Together with the flourishment of HFAPT in the past 10 years, the world-
wide financial markets; especially the international currency market becomes more
volatile and unpredictable. An effective, open, and reliable worldwide financial pre-
diction, trading and advisory system is profoundly required for worldwide traders
and investors, especially independent investors than ever before.
This chapter devises an innovative multiagent-based quantum financial forecast
and trading system (a.k.a. Quantum Trader) for worldwide financial prediction and
intelligent trading. With the adoption of author’s theoretical works on Lee-oscillator
with profound transient-chaotic property (Lee 2004), quantum trader effectively inte-
grates quantum field signals (QFS) and quantum field oscillators (OFS) studied in
Part I for neural network training and prediction into: (1) quantum finance forecaster
13.1 Introduction 377
Time series prediction, ranging from weather forecast to stock prediction has been
studied for over 50 years. With the improvement of computational speed, nonlinear
models such as artificial neural networks (ANN) have proven success to tackle these
problems. Traditional ANN such as feedforward backpropagation neural network
(FFBPN) is a typical kind of supervised-learning (SL) neural network to tackle these
problems with certain success.
However, when it comes to massive input data such as financial prediction with
over thousands time series financial data and signals as input vectors, these conven-
tional ANNs using classical sigmoid-based activation function are usually “trapped”
in local minima during neural network training; which not only affects the efficiency
(time cost), but also the accuracy of the forecast results (Lee 2006).
Fig. 13.1 System architecture of quantum finance CSL network for time series financial prediction
network will respond with a negative RS to punish the RL network. As we can see,
RL networks don’t need well-defined input/target-output pairs, all they need to do is
to search for a set of optimal weights to minimize the negative reinforcement signals.
Classical RL model such as Markov decision process (MDP) using
stochastic-based reinforcement-learning algorithms such as Q-Learning, dynamic-
programming (DP) and TD-learning (TDL) with certain success (Kaelbling et al.
1996). However, when it comes with time series financial optimization problems
with over thousands of input signals and possible trading strategies, these classical
stochastic RL methods are either too computationally intensive or difficult to adopt
for actual implementation.
With the flourishing of recurrent neural networks in the past decades, researchers
began to explore how recurrent neural networks can be applied for RL on vari-
ous optimization problems (Li et al. 2009; Liu et al. 2005); financial engineering
include Deng et al. (2017) using deep direct reinforcement-learning network for
financial signal representation and trading; Pendharkar and Cusatis (2018) applied
reinforcement-learning agents for trading financial indices; Tan et al. (2011) used
reinforcement-learning system for stocking trading with cycles; Chang et al. (2017)
used asymmetric reinforcement-learning and conditioned responses technique to
analyze global financial crisis; Carapuco et al. (2018) using reinforcement-learning
system for short-term speculation in the foreign exchange market and Jeong and Kim
(2019) using deep Q-Learning to improve financial trading decisions.
= {a t , t = 1 . . . T } (13.10)
T
V = r t (s t , a t ) (13.11)
t=1
13.3 Quantum Trader—Chaotic RBF-Based Actor-Critic Reinforcement … 381
Critic
Actor Agent Action Space (A)
Agent
(Actor)
(Critic)
V∗ = max V (13.12)
As shown in the above formulation: S and A denote the state space and action
space, s and a denote the state and action vectors; r denotes the reward vector;
denotes the action policy from time t = 1 to t = T (dimension of policy space); V
denotes the value function which represents the total returns for a particular policy .
For DRL with maxI iterations, there will be totally maxI policies being generated,
and V* is the optimal returns obtained by the calculation of all possible return values
V k (where k = 1… maxI) from these policies. So, the whole optimization problem
is to find the best policy * via DRL in order to attain the optimal returns V* . Next
section we will explore how to adopt CRBFN (chaotic radial basis function neural
network) for DRL.
Like FFBPN, a typical multilayer radial basis function neural network (RBFN) also
consists of input, hidden, and output layers. Although network architectures between
FFBPN and RBFN are highly similar, the network activations in RBF networks
are localized RBF functions such as Gaussian functions, resulting in a much faster
training rate (Markopoulos et al. 2016).
Unlike FFBPN, input vectors in RBFN distribute values to the hidden layer neu-
rons uniformly, without multiplying them with weights. The neurons in the hidden
layer are presented by RBF neurons using radial basis function such as Gaussian
function as activation function, which is given by
382 13 Quantum Trader—A Multiagent-Based Quantum Financial Forecast …
r
G(r) = ex p − 2 (13.13)
2σ
Different from FFBPN which is only tailored for supervised learning, experimen-
tal results revealed that RBFNs can basically approximate any functions. As a result,
they are usually known as “universal-approximators”. In other words, RBFN can be
used for both SL and RL by using RBFN to approximate the V-value function.
However, like FFBPNs, when it comes with handling massive input data and/or
highly chaotic nature such as time series financial forecast using over thousands of
input values and financial signals as network input vectors, RBFNs also encounter
“over-training” and “deadlock” problems, which hinder further improvement of net-
work accuracy and resulted in an expensive time costs from the computational per-
spective.
of all time series input signals together with the corresponding quantum price levels
(QPLs) as quantum field signal (QFS) for reinforcement training. Reward signal
vector r contains four reinforcement feedback signals which are generated by the
critic agent in the previous time-step. These four reward signals rT,B , rT,S , rP,B , rP,S
correspond to four actions aT,B , aT,S , aP,B , and aP,S which emulate de facto short-term
trading strategies:
(1) Time-driven-buy strategy—trigger buy action aT,B when current price reaches
forecast low, day-end harvest;
(2) Time-driven-sell strategy—trigger sell action aT,S when current price reaches
forecast high, day-end harvest;
(3) Price-driven-buy strategy—trigger buy action aP,B when current price reaches
forecast low, closing when reaching target price/stop-loss price;
(4) Price-driven-sell strategy—trigger sell action aP,S when current price reaches
forecast high, closing when reaching target price/stop-loss price.
The hidden layer of quantum finance CRL network consists of H LRbf nodes,
which facilitate transient-chaotic RRB-based RL.
The output layer consists of four possible actions: aT,B , aT,S , aP,B , and aP,S as
described above. Their scalar values are normalized values between 0 and 1 which
represent the size (lot) of investment (“0” means not invest; “1” means to invest one
complete lot).
From the implementation perspective, quantum finance system model adopts a 5-tier
system implementation architecture, namely, TEQNA as shown in Fig. 13.7.
Quantum finance TEQNA system architecture consists of the following:
1. Technology layer—supports MT4/MT5 platforms and related programming
technologies such as expert advisors (EAs), quantum trader agent protocol
(CAP).
2. Encryption layer—supports critical cryptographical technologies include both
encryption and blockchain technologies.
386 13 Quantum Trader—A Multiagent-Based Quantum Financial Forecast …
Quantum Finance
5-Tier Model ARCHITECTURE
AGENTS LAYER
Quantum Finance CULN Quantum Finance CSLN Quantum Finance CRLN
Chao c UnsupervIsed-Learning Networks Chao c Supervised-Learning Networks Chao c Reinforcement-Learning Networks
ENCRYPTION LAYER
MT4 MT5 CAP
(MetaTrader4 Pla orm) (MetaTrader5 Pla orm) (Chao c Agent Protocol)
TECHNOLOGY LAYER
From the application perspective, real-time and historical data of worldwide 129
financial products provided by Forex.com (major online Forex trading platform) and
AvaTrade.com (the biggest cryptocurrency trading platform) are adopted for quantum
trader system implementation. They include: major cryptocurrencies (9), worldwide
13.4 System Implementation 387
forex (84), major commodities (19), worldwide financial indices (17). Appendix A
shows the list of financial products under these four categories.
For the ease of fully integration and automation of quantum trader system with both
real-time and historical financial data provided by Forex.com and AvaTrade.com, the
whole intelligent agent-based system fully integrated with MT platforms. Figure 13.8
shows the system implementation framework of quantum trader.
The whole quantum trader system consists of two main modules: (1) quantum
forecaster using quantum finance CSL network for time series worldwide financial
prediction; and (2) quantum trader and critic agents using quantum finance CRL
network for the optimization of trading strategy.
The agent activities of these quantum finance agents are described as follows:
Quantum Forecaster Agent
Quantum forecaster is a server-side forecast agent located at the server farm of
quantum finance forecast center (QFFC) using Intel i5 CPU 2.39 GHz 32 MB ram
Dell servers.
For each financial product, 2048-trading day data (except cryptocurrency which
only have 300-trading day data) include: open (O), high (H), low (L), close (C), and
volume (V) are automatically generated by MT4 engines of Forex.com and AvaTrade.
com. Through the trading signal generator, 39 most common trading signals are
generated, together with the 2048-trading day data, they are fed into the forecast
system for training and forecast of next-day open (O), high (H), low (L), and close
(C). The predicted forecasts of these 129 financial products are stored at the quantum
forecast database for the quantum trader trading agents to access. Appendix B shows
the 39 trading signals generated by trading signal generator.
Besides input time series data and trading signals, one of the major characteristics
of a quantum forecaster is to incorporate with quantum field signals (QFS) generated
by quantum field signal generator (QFSG) as shown in Fig. 13.8 that was studied in
Part I. These QFS are stored in QFS databank which will also be used by quantum
traders and critic agents for reinforcement learning.
Quantum Trader Agents
The quantum trader receives inputs from four sources: (1) input signals from markets
(stored at the input signal databanks of the quantum finance server farm) of current
and past records; (2) quantum field signals (QFS) from QFS databank; (3) current
forecasts stored at quantum forecast database of the quantum finance server farm;
and (4) reward signals from previous time-step generated by quantum finance critic
agent. By using the quantum finance CRL algorithm, it evaluates four possible actions
a. Updates its trading policy and keeps track of the market movements in order to
trigger the trading actions.
388 13 Quantum Trader—A Multiagent-Based Quantum Financial Forecast …
Figure 13.9 shows a snapshot of quantum finance forecaster (or quantum forecaster
in short) for the training and forecast of 120 financial products of Forex.com on
November 09, 2018. As shown, in a typical daily forecast, the quantum forecaster
only took 62,341 ms (62.341 s) to finish the training forecast of 120 financial products.
On average, it took 0.519 s (less than 1 s) to finish the network training and forecast
process of a single financial product.
Figure 13.10 shows the snapshot of quantum forecaster for the system training
and forecast of 9 major cryptocurrencies over AvaTrade.com MT platform on the
same trading day.
As shown, quantum forecaster took 44,976 ms (44.976 s) to finish the training
and forecast of 9 cryptocurrencies. On average, it took 4.99 s to train and forecast a
single cryptocurrency.
Fig. 13.9 Snapshot of quantum forecaster for the training and forecast of 120 financial products
for Forex.com MT4 platform on November 09, 2018
390 13 Quantum Trader—A Multiagent-Based Quantum Financial Forecast …
Fig. 13.10 Snapshot of quantum forecaster for training and forecast of 9 major cryptocurrencies
for AvaTrade.com MT4 platform on November 09, 2018
Started from January 1, 2018, 342 members of QFFC which consists of professional
traders and quants from major fund houses are invited to join the quantum trader
system evaluation focus group for a 1-year worldwide evaluation program of quantum
trader trading system as compared with their own trading strategies.
They were all provided with free quantum finance daily forecasts for the 129
financial products and the two de facto agent trading programs (i.e., the time-driven
and price-driven trading agents). Based on quantum finance daily forecasts, they are
free to use either the de facto trading agents or their own trading strategies to do
trading.
13.4 System Implementation 395
13.5 Conclusion
Problems
13.1 What is an intelligent agent? What are the major differences between tradi-
tional computer programs and intelligent agents? Give two real-world exam-
ples on how to apply intelligent agent technology in finance engineering.
13.2 Discuss and explain the major advantages of using intelligent agent technology
for the implementation of intelligent trading systems.
13.3 Discuss and explain why program trading become so popular in nowadays
financial community. What are the major differences between traditional finan-
cial trading versus program trading? Give two examples of program trading
and describe how they work.
13.4 Describe and explain what is high-frequency algorithmic program trading
(HFAPT). Give two examples of HFAPT in forex markets and describe how
they work.
13.5 Discuss and explain why nowadays AI become so popular in building program
trading systems. Give two examples of financial product trading for illustration.
13.6 Financial prediction nowadays becomes one of the hottest topics in financial
engineering. Why now as AI prediction already exists for over half a century?
13.7 State and discuss three contemporary AI-based financial prediction technolo-
gies and briefly explain how they work.
13.8 As mentioned in Chap. 8, chaos theory told us that the forecast of complex
systems such as weather and financial markets are bounded by the initial
condition. How can AI such as artificial neural networks or recurrent neural
networks get around with this intrinsic problem? Use forex prediction system
as an example for explanation.
Acknowledgements The author wishes to thank Forex.com and AvaTrade.com for the provision
of historical and real-time financial data. The author also wishes to thank Quantum Finance Forecast
Center of UIC for the R&D supports and the provision of the channel and platform Qffc.org for
worldwide system testing and evaluation.
References
Borden, C. (2018) Fibonacci Trading: How to Master the Time and Price Advantage. McGraw-Hill
Education, UK.
Brown, C. (2012) Elliot Wave Principle: Elementary Concepts, Wave Patterns, and Practice Exer-
cises. Bloomberg Press, New York.
Bulkowski, T. N. (2005) Encyclopedia of Chart Patterns. Wiley, UK.
Carapuço, J. et al. (2018) “Reinforcement learning applied to Forex trading,” Applied Soft Computing
Journal 73: 783–794.
References 397
Chang, P. C. et al. (2012) A novel model by evolving partially connected neural network for stock
price trend forecasting. Expert Systems with Applications 39(1): 611–620.
Chang, C. et al. (2017) Asymmetric Reinforcement Learning and Conditioned Responses During
the 2007–2009 Global Financial Crisis: Evidence from Taiwan. Review of Pacific Basin Financial
Markets and Policies 20(2): 1750010.
Dabhi, V. K. and Chaudhary, S. (2016) Financial time series modeling and prediction using postfix-
GP. Computational Economics 47(2): 219–253.
Dai, W. et al. (2012) Combining nonlinear independent component analysis and neural network for
the prediction of Asian stock market indexes. Expert Systems with Applications 39(4): 4444–4452.
Deng Y. et al. (2017) Deep Direct Reinforcement Learning for Financial Signal Representation and
Trading. IEEE Transactions on Neural Networks and Learning Systems 28(3): 653–664.
Durbin, M. (2010) All About High-Frequency Trading. McGraw-Hill Education.
Henrique, B. M. et al. (2018) Stock price prediction using support vector regression on daily and
up to the minute prices. The Journal of Finance and Data Science 4(3): 183–201.
Hwang, H. and Oh, J. (2010) Fuzzy models for predicting time series stock price index. International
Journal of Control, Automation, and Systems 8(3): 702–706.
Jeong G. and Kim, H. Y. (2019) Improving financial trading decisions using deep Q-learning:
Predicting the number of shares, action strategies, and transfer learning. Expert Systems with
Applications 117: 125–138.
Kaelbling, L. P. et al. (1996) Reinforcement Learning: A Survey. Journal of Artificial Intelligence
Research 4: 237–285.
Lee, R. S. T. (2004) A Transient-chaotic Auto-associative Network (TCAN) based on LEE-
oscillators. IEEE Trans. Neural Networks 15(5): 1228–1243.
Lee, R. S. T. (2006) Fuzzy-Neuro Approach to Agent Applications (From the AI Perspective to
Modern Ontology). Springer-Verlag, Germany.
Lee, R. S. T. (2019) COSMOS Trader – Chaotic Neuro-oscillatory Multiagent Financial Prediction
and Trading System,” The Journal of Finance and Data Science 5: 61–82.
Li, C. G. et al. (2009) An Actor-Critic reinforcement learning algorithm based on adaptive RBF
network. 2009 IEEE International Conference on Machine Learning and Cybernetics 984–988.
Ling, P. W. (2013) The stock price forecasting comparative research of the use of fractal theory
at Taiwan traditional industry and technology industry. Applied Mechanics and Materials 274:
53–56.
Liu, F. et al. (2005) Neural network model for time series prediction by reinforcement learning.
2005 IEEE International Joint Conference on Neural Networks 2: 809–814.
Markopoulos, A. P. et al. (2016) On the use of back propagation and radial basis function neural
networks in surface roughness prediction. Journal of Industrial Engineering International 12(3):
389–400.
Murphy, J. J. (1999) Technical Analysis of the Financial Markets: A Comprehensive Guide to
Trading Methods and Application. New York Institute of Finance, New York.
Nahil, A. and Lyhyaoui, A. (2018) Short-term stock price forecasting using kernel principal com-
ponent analysis and support vector machines: the case of Casablanca stock exchange. Procedia
Computer Science 127: 161–169.
Narayanan A. et al. (2016) Bitcoin and Cryptocurrency Technologies: A Comprehensive Introduc-
tion. Princeton University Press.
Ouahilal, M. et al. (2017) A novel hybrid model based on Hodrick–Prescott filter and support vector
regression algorithm for optimizing stock market price prediction. Journal of Big Data 4(1): 1–22.
Pendharkar P. C. and Cusatis, P. (2018) Trading financial indices with reinforcement learning agents.
Expert Systems with Applications 103: 1–13.
Singh, R., & Srivastava, S. (2017) Stock prediction using deep learning. Multimedia Tools and
Applications 76(18): 18569–18584.
Tan, Z. et al. (2011) Stock trading with cycles: A financial application of ANFIS and reinforcement
learning. Expert Systems with Applications 38(5): 4741–4755.
398 13 Quantum Trader—A Multiagent-Based Quantum Financial Forecast …
Vigna, P. and Casey, M. J. (2016.) The Age of Cryptocurrency: How Bitcoin and the Blockchain
Are Challenging the Global Economic Order. Picador,
Walker, W. (2018) Expert Advisor Programming and Advanced Forex Strategies. Independently
published.
Young, A. R. (2015) Expert Advisor Programming for MetaTrader 4: Creating automated trading
systems in the MQL4 language. Edgehill Publishing.
Chapter 14
Future Trends in Quantum Finance
Professor David Deutsch in his famous quotation pointed out an important role and
function of a quantum computer—the simulation of quantum systems and related
applications, which cannot be efficiently simulated by classical computers.
Is it really true?
The answer is yes and no. “Yes” in the sense that the major objective of the quantum
computer is to model quantum dynamics and simulate quantum applications with
quantum computing technology—so-called hard quantum computing. “No” in the
sense that without the usage of quantum computers, technically we can still model
quantum dynamics and quantum applications such as quantum finance model we
have studied in this book—so-called soft quantum computing.
In this final chapter, we will explore the future of quantum finance and the new era
of quantum computing. Similar to the history of artificial intelligence (AI) that has
both hard AI and soft AI. Each of them focuses on different aspects and applications,
but after over half a century; the boundary between them becomes obscure. In this
chapter, we will study two disciplines of quantum computing and how they interact
to shape the new age of intelligent computing.
As mentioned in previous chapters, quantum finance is a cross-discipline subject to
challenge the utmost question of finance engineering—the exploration of the nature
and dynamics of financial market activities in the quantum realm.
Quantum finance is one of the major research areas of quantum finance forecast
center (QFFC.org). In this chapter, we will explore and introduce other aspects and
active research of QFFC in terms of (1) AI-fintech—the integration of AI technology
with state-of-the-art finance technology such as blockchains and digital ledgers;
(2) quantum computing—the R&D of potential applications of quantum computing
technology in various areas such as quantum entanglements in quantum finance,
quantum cryptography, quantum holographic systems, etc.
Since the birth of AI and computing technology from over half a century ago, we are
now coming to the historical moment of a new era on computing technology—quan-
tum computing. With the official launch of IBM’s System Q—the first commercially
available quantum computer at CES 2019 Las Vegas USA in January 2019 signify
the dawn of quantum computing technology (Moran 2019; Silva 2018).
Different from traditional computers which use bits of 0s and 1s as the fun-
damental binary representation in data storage and program calculation, quantum
computers use qubits (stands for quantum bits)—quantum superpositions of the two
states which allow for far greater flexibility than the traditional binary system in data
representation and programming (Hirvensalo 2010; Scherer 2019; Zygelman 2018).
In general, a quantum computer technically would be able to perform calculations
on a far greater order of magnitude than traditional computers. As mentioned by
Professor David Deutsch in his famous quotation stated at the beginning of this
chapter, quantum computing is the best solution tailored for the modeling of quantum
systems with related highly complex and sophisticate quantum phenomena such as
quantum cryptography and quantum finance in our case (Assche 2006; Bernhardt
2019; Jaeger 2018).
The origin of quantum computing can be traced back to 1959 a speech by Professor
Richard Feynman in which he spoke about the effects of miniaturization, including
the idea of exploiting quantum effects to create more powerful computers. However,
before the quantum effects of computing could be realized, quantum computing is still
a concept and idea in the scientific community. It was not until 1985, Professor David
Deutsch proposed a new idea of quantum logic gates in his paper Quantum theory
as a universal physical theory as a means of harnessing the quantum realm inside a
computer. In fact, his paper on the subject showed that any physical process could
be modeled by a physical quantum computer—so-called hard quantum computing
(Deutsch 1985; Steane 1998).
The road of hard quantum computing was not an easy path. Owing to technical
complexity and difficulty, after almost decades, Professor Peter Shor devised an algo-
rithm in 1994 that could use only 6 qubits to perform basic factorization operations.
Since then, a handful of quantum computers were built. The first, a 2-qubit quantum
computer in 1998, could perform trivial calculations before losing decoherence after
a few nanoseconds. In 2000, quantum computing teams including IBM and AT&T
successfully built both a 4-qubit and a 7-qubit quantum computers.
IBM has showcased its IBM Q System One at CES 2019, which was claimed as
the world’s first integrated quantum computing system designed for scientific and
14.2 Two Sides of the Same Coin … 401
commercial use. The 20-qubit system by IBM, which was seen as one of the leaders
in the field of quantum computing (Silva 2018; Moran 2019).
Just like hard AI versus soft AI in artificial intelligence (AI) realm, soft quantum
computing refers to the modeling of quantum theory and its mathematical models by
means of computing systems and programs, similar to the analog of soft AI with the
focus of building computer models using artificial neural networks (ANN) to model
human intelligence and learning process.
In other words, all quantum theory concepts and models we have studied in this
book, ranging from Feynman’s path integral for the modeling of forward interest
rate to quantum anharmonic oscillator model for the modeling of quantum price
levels; along with quantum financial signals are components and frameworks of soft
quantum computing.
If we can model quantum theory and related phenomena by means of traditional
computers, why do we need to build quantum computers?
The answer is simple. If we can model quantum theory effectively using tra-
ditional computers with binary formulation and representations, integrating these
quantum models with quantum computers will become more direct and effective
while the fundamental construction of quantum computer itself totally conforms to
quantum model and architecture. In other words, by implementing a quantum model,
say quantum finance model into a traditional computer; technically speaking, we are
converting a traditional financial computation system into a quantum financial com-
putation machine!
As mentioned earlier in this chapter, quantum finance is one of the major R&D
projects of quantum finance forecast center (QFFC.org)—a worldwide financial pre-
diction and R&D center for the design and implementation of next generation of
AI-fintech standards, toolkits and applications (Nicoletti 2017).
Figure 14.1 depicts the AI-fintech 5-layer architecture of QFFC.
(1) AI-applications Layer
• This layer focuses on AI-fintech-related systems and applications in four
major areas: forecasts such as quantum finance forecast, deep learn-
ing/reinforcement learning such as multiagent-based trading agents; data
mining and NLP (natural language processing) such as robo-advisor (Lim
et al. 2011; Sironi 2016).
(2) Business Layer
• This layer focuses on the business applications and fintech systems includ-
ing cryptocurrency, blockchain systems on financial trading, payment, clear-
ing and hedging transactions (Antonopoulos 2017; Gaur 2018; Sironi 2016;
Nielsen 2011, Swan 2015).
402 14 Future Trends in Quantum Finance
AI
Forecasting
Deep Learning
Data Mining
Natural Language Processing
Business
Cryptocurrency &
Blockchain System on Trading,
Payment, Clearing, Hedging
Security
Blockchain 1.0/2.0/3.0 Technology
Quantum Cryptography
Technology
Cloud, Bit Torrent, Intelligent Agents, Neural
Networks, Deep Learning, Biometrics, Data Mining
Internet
Besides the provision of various AI-fintech forecasts and applications, QFFC also
actively developing a next-generation AI-fintech development kit—quantum finance
development kit (QFDK), an easy to use C/C++ library with the implementation of
all state-of-the-art AI-fintech functions and libraries; so that AI-fintech developers
14.4 Quantum Finance System Development Platform 403
and data scientists can base on these functional libraries to design and develop their
own quantum finance and AI-fintech systems and applications.
Figure 14.2 depicts the QFSDK 5-layers model of version 1.0, which will be
launched officially in late 2019 at QFFC.org official site.
14.5 Conclusion
In this final chapter, we studied the future trend in quantum finance—a cross-
discipline subject that comprises quantum theory as a theoretical foundation;
numerical computational theory as computer model; artificial intelligence as machine
404 14 Future Trends in Quantum Finance
learning; prediction and trading optimization models; and finally quantum comput-
ing as the ultimate intelligence machine. In other words, the future R&D and growth
of quantum finance technology not only depends on the development of quantum
finance theory itself but also depends on future development and growth of related
technologies such as AI and quantum computing technologies.
As mentioned in the introductory chapter, since Professor Heisenberg introduced
the ground-breaking quantum mechanics’ idea to nowadays, we have concrete mathe-
matical and computational models to model quantum dynamics and QPL of financial
markets, along with the interpretation of path integrals of the forward interest rate.
It is both a challenging and exciting path. The contribution is not only the credit of
an individual but also is the collective contribution of intelligence, innovation, and
R&D from many centuries.
In view of the advancements of technology and AI in the past decades, quantum
finance, together with AI and quantum computing technology should work together to
provide more scientific and intelligent applications, systems and services for world-
wide investors and financial professionals.
Problems
14.1 What is a quantum computer? State and explain the major difference between
a quantum computer and the traditional computer systems.
14.2 State and explain the major challenges in quantum computing. Give two exam-
ples of illustrations.
14.3 State and contrasts the major differences between hard quantum computing
and soft quantum computing. Give two examples in each case for illustration.
14.4 Discuss whether quantum computer in the future will or will not replace tra-
ditional computers. Why?
14.5 What is finance technology (fintech)? State three typical fintech-related tech-
nologies and briefly explain how they work.
14.6 What is a robo-advisor in fintech? State and explain the basic underlying
technology. Give two examples of robo-advisor in fintech and explain briefly
how they work.
14.7 What is blockchain technology? State and explain the difference between
Blockchain 1.0, 2.0, and 3.0 technologies. Give one example in each case
for illustration.
14.8 What is quantum cryptography? State and explain the major difference
between traditional cryptosystem and quantum cryptosystem. What are the
major challenges in quantum cryptography?
References 405
References
(continued)
Code Product description Code Product description
SUGAR Sugar XAUJPY Gold versus Japanese Yen
UK_OIL Brent Crude Oil XAUUSD Gold versus US Dollar
US_NATG US Natural Gas
Forex (Data provided by Forex.com)
AUDCAD Australian Dollar versus GBPDKK British Pound versus Danish
Canadian Dollar Krone
AUDCHF Australian Dollar versus Swiss GBPHKD British Pound versus Hong
Franc Kong Dollar
AUDCNH Australian Dollar versus GBPJPY British Pound versus Japanese
Chinese Yuan Yen
AUDJPY Australian Dollar versus GBPMXN British Pound versus Mexican
Japanese Yen Peso
AUDNOK Australian Dollar versus GBPNOK British Pound versus
Norwegian Krone Norwegian Krone
AUDNZD Australian versus New Zealand GBPNZD British Pound versus New
Dollar Zealand Dollar
AUDPLN Australian Dollar versus Polish GBPPLN British Pound versus Polish
Zloty Zloty
AUDSGD Australian Dollar versus GBPSEK British Pound versus Swedish
Singapore Dollar Krona
AUDUSD Australian Dollar versus US GBPSGD British Pound versus Singapore
Dollar Dollar
CADCHF Canadian Dollar versus Swiss GBPUSD British Pound versus US Dollar
Franc
CADJPY Canadian Dollar versus GBPZAR British Pound versus South
Japanese Yen African Rand
CADNOK Canadian Dollar versus HKDJPY Hong Kong Dollar versus
Norwegian Krone Japanese Yen
CADPLN Canadian Dollar versus Polish NOKDKK Norwegian Krone versus
Zloty Danish Krone
CHFHUF Swiss Franc versus Hungarian NOKJPY Norwegian Krone versus
Forint Japanese Yen
CHFJPY Swiss Franc versus Japanese NOKSEK Norwegian Krone versus
Yen Swedish Krona
CHFNOK Swiss Franc versus Norwegian NZDCAD New Zealand versus Canadian
Krone Dollar
CHFPLN Swiss Franc versus Polish Zloty NZDCHF New Zealand Dollar versus
Swiss Franc
CNHJPY Chinese Yuan versus Japanese NZDJPY New Zealand Dollar versus
Yen Japanese Yen
EURAUD Euro versus Australian Dollar NZDUSD New Zealand Dollar versus US
Dollar
(continued)
Appendix A: List of 139 Financial Products 409
(continued)
Code Product description Code Product description
EURCAD Euro versus Canadian Dollar SGDHKD Singapore versus Hong Kong
Dollar
EURCHF Euro versus Swiss Franc SGDJPY Singapore Dollar versus
Japanese Yen
EURCNH Euro versus Chinese Yuan TRYJPY Turkish Lira versus Japanese
Yen
EURCZK Euro versus Czech Koruna USDCAD US Dollar versus Canadian
Dollar
EURDKK Euro versus Danish Krone USDCHF US Dollar versus Swiss Franc
EURGBP Euro versus British Pound USDCNH US Dollar versus Chinese Yuan
EURHKD Euro versus Hong Kong Dollar USDCZK US Dollar versus Czech Koruna
EURHUF Euro versus Hungarian Forint USDDKK US Dollar versus Danish Krone
EURJPY Euro versus Japanese Yen USDHKD US Dollar versus Hong Kong
Dollar
EURMXN Euro versus Mexican Peso USDHUF US Dollar versus Hungarian
Forint
EURNOK Euro versus Norwegian Krone USDILS US Dollar versus Israeli Shekel
EURNZD Euro versus New Zealand USDJPY US Dollar versus Japanese Yen
Dollar
EURPLN Euro versus Polish Zloty USDMXN US Dollar versus Mexican Peso
EURRON Euro versus Romanian Leu USDNOK US Dollar versus Norwegian
Krone
EURRUB Euro versus Russian Ruble USDPLN US Dollar versus Polish Zloty
EURSEK Euro versus Swedish Krona USDRON US Dollar versus Romanian
Leu
EURSGD Euro versus Singapore Dollar USDRUB US Dollar versus Russian
Ruble
EURTRY Euro versus Turkish Lira USDSEK US Dollar versus Swedish
Krona
EURUSD Euro versus US Dollar USDSGD US Dollar versus Singapore
Dollar
EURZAR Euro versus South African USDTHB US Dollar versus Thai Baht
Rand
GBPAUD British Pound versus Australian USDTRY US Dollar versus Turkish Lira
Dollar
GBPCAD British Pound versus Canadian USDZAR US Dollar versus South African
Dollar Rand
GBPCHF British Pound versus Swiss ZARJPY South African Rand versus Jap
Franc Yen
Appendix B
List of 39 Financial Indicators
(continued)
No Function name Signal name
25 iMomentumOnArray Calculation of Momentum, stored in array
26 iMFI Money Flow Index
27 iMA Moving Average
28 iMAOnArray Calculation of Moving Average indicator on data
29 iOsMA Moving Average of Oscillator
30 iMACD MACD indicator
31 iOBV On Balance Volume
32 iSAR Parabolic Stop And Reverse System
33 iRSI Relative Strength Index
34 iRSIOnArray Calculation of Momentum, stored in array
35 iRVI Relative Vigor Index
36 iStdDev Standard Deviation
37 iStdDevOnArray Standard Deviation indicator, stored in array
38 iStochastic Stochastic Oscillator
39 iWPR Williams’ Percent Range