Artificial Intelligence Trading Systems
“By far, the greatest danger of Artificial Intelligence is that people conclude too early that they understand it.”
A few days ago I was talking with a good friend about artificial intelligence (AI). He told me “I think the AI is overvalued and quite inflated, really AI has not had big changes since I left the university (30 years ago!).
I was surprised by that statement because this friend is a cultured person with a good university education. So I thought that artificial intelligence is still a great unknown even in our trading world.
This post is the first of a series on AI fundamentals. After reading it you will be able to better understand the naming and structure of AI and its application to financial markets.
Continue reading to have a clear vision of the AI.
Let’s get acquainted a little with the necessary terminology.
The names or terms comprising AI is very extensive. Perhaps the better compilation is that of Wikipedia:
This glossary is very broad and will increase since the field is very active. The good news is that you do not have to learn it all, only what you have to work with.
Reading what follows below will give you a good starting point.
Since the first imagining of so-called “thinking machines” or “artificial intelligence” (AI), there has been a rich debate as to whether machines would, could, or should supplant humans or only enhance humans. In theory, AI could be designed to do either task .
The Artificial Intelligence Waves
DARPA’s John Launchbury first coined the notion of the “three waves of AI”, and Six Kin Development’s Scott Jones recently expounded upon that to add timelines, examples, and a fourth wave to account for AI, we have adapted it to trading systems as illustrated in the chart below.
The First Wave: PURELY REACTIVE
DARPA defines the first wave of AI as enabling “reasoning over narrowly defined problems,” but with a poor level of certainty.
This is the most basic form of AI. It doesn’t store memories or past experiences and It acts directly for what it sees. Overall, It doesn’t have a
To date, AI has developed many tools and techniques to perform very specific functions. Basically in the form of programs. However, programs and expert systems can be very fragile and must follow specific rules. Human designers write logic line by line.
This is the so-called “1st wave AI”. Even a simple standard computer can be considered to fall into this category, as they are designed and coded to fulfill a specific purpose. For example, a Python program that makes a simple trend following strategy based on exponential averages. It is a rudimentary form of AI because it replaces what the human brain would do with a computer algorithm: a first step to emulate human cognition.
Examples: Trading system program coded with strategies like reveled in the book:
“151 Trading Strategies” of Kakushadze and Serur (2018).
And you want something of software, here there is an example of an open source trading platform writing in python with trading strategies of the first wave:
This last software is excellent and you can use it to implement more modern systems as those related to the below “Second Wave”.
Nowadays, implementing strategies of the First Wave type is almost always an absolute waste of time.
The Second Wave: LIMITED MEMORY
“Econometrics might be good enough to succeed in financial academia (for now), but succeeding in practice requires ML.”
Marcos López de Prado (2018)
The second wave enables creating statistical models and training them on big data, albeit with minimal reasoning.
The second wave of AI is currently in full swing. It consists of statistical systems that use new and powerful techniques and computer resources to perform the statistical recognition of objects and search for patterns in large batches of data.
Neural network algorithms were developed for the first time in the 1950s . These systems tried to reflect the organization of the human brain by mimicking the connectivity of neurons and synapses at a very simplistic level.
Artificial neural networks (ANN) is also called connectionist models. “Neurons” within ANN have a simple input / output structure and perform a processing layer between each subsequent “synaptic” connection layer.
However, the analogy with human brain systems is so weak that most system practitioners now talk more about nodes and layers rather than neurons and synapses.
With the development of the latest deep neural network (DNN) algorithms and the increase of computing power, these systems have become powerful enough to recognize categorical objects and faces.
While it is extremely powerful, there are several drawbacks in these statistical systems.
- There is the requirement of tens of thousands of examples for the system to learn. And Only historical data are available in financial markets.
- The limited capacity of the system once trained to perform only specific tasks. For example, a system trained to trade a trending market can do quite well in recognizing trends and trade it, but it will fail completely if it is suddenly asked to trade a sideways market.
- These systems do not have general or real-time interactive learning capacity, cannot work with dynamic objectives and contexts, or deal with abstract reasoning or the understanding of language.
- These systems develop a black box solution for your specific problem, which makes it extremely difficult to understand and debug errors.
An alternative approach lies in the so-called 3rd wave of AI, which is designed to supplant the problem and develop cognitive reasoning systems based on machines more analogous to human reasoning and capabilities.
Example: Trading system program coded with strategies like reve
“Advances in Financial Machine Learning” 
Marcos López de Prado (2018)
Here you are some excellent Github examples implemented in python:
The Third Wave: THEORY OF MIND
The third wave which enables machines to adapt to changing situations.
For instance, adaptive reasoning will enable computer algorithms to discern the difference between the use of ‘principal’ and ‘principle’ based on the analysis of surrounding words to help determine context.
The third wave of artificial intelligence designs systems that adapt to the context.
Systems that can reason, learn and adapt to their environments. The Third Wave AI is based on the paradigm of cognitive systems  that moves away from the current statistical AI and seeks to understand the fundamental processes.
An architecture can be thought of as a fixed set of structures and mechanisms or processes. Cognitive behaviors have certain aspects: they are objective-oriented, reflect a rich and complex environment, require a large amount of knowledge, require the use of symbols and abstractions, are flexible and require experience and learning .
These cognitive architectures form the template for the development of intelligent software agents to solve problems of the highest level as financial market problems.
Laird et al.  have recently published a Standard Model of the Mind that seeks to formally unify the components and processing design of all human-type cognitive functions. This model includes systems based on AI, neuroscience or robotics.
In the figure below I have created a trading system architecture based on the standard model of mind.
This standard model integrates memory, perception and action components with learning, communication and representation processes. The basic fundamentals of the standard models are:
Structure and Processing
- Processing produces bounded rationality, not optimality.
- There is significant parallel processing (within and across the modules).
- Complex behavior arises from a sequence of independent cognitive cycles that operate in its local context.
- A cognitive cycle drives behavior via sequential action selection.
Memory and Content
- Declarative and procedural long-term memories (LTMs) contain symbol structures and associated quantitative metadata.
- Short-term working memory (WM) provides global communication:
- Composed of rule-like conditions and actions
- Exerts control by altering contents of WM
- Procedural LTM provides global control.
- Declarative LTM provides factual knowledge.
- The content of LTM is learnable.
- Learning occurs online and incrementally, as a side effect of performance and is often based on an inversion of the flow of information from performance
- Procedural learning involves, at least, reinforced learning and procedural composition:
- Reinforcement learning yields weights over action selection.
- Procedural composition yields behavioral automation.
- Declarative learning involves the acquisition of facts and tunning of metadata.
- More complex forms of learning involve combinations of the fixed set of simpler forms of learning.
Perception (Input data) and Action (Motor)
- Perception (input data) produces symbol structures with associated metadata in specific WM buffers.
- There can be many different perception modules with different input modalities and its own buffer.
- Perceptual learning acquires new patterns and
tunesof existing ones.
- The bottleneck of attention limits the information available in the WM.
- Top-down information from WM can influence the perception (input).
- Action control converts symbol structures in its buffers into external actions
- There can be multiple action modules.
- Action learning acquires new patterns and tunes of existing ones.
Standard model reflects a real initial consensus about how could work AI:
- Serial and parallel processing
- Symbolic and representations
- Procedural and declarative memories
- Pervasive learning
But still remain incomplete.
In next pots we will continue deepening in this system model.
Example: C-3P0 and R2D2 from Star Wars
The Fourth Wave: SELF- AWARE
The fourth wave accounts for what many believe will be the ultimate phase of AI: human-level intelligence and Super-intelligence.
Talking about this wave is highly speculative, so I won’t. But here you have some indications if you want to:
Superintelligence: Paths, Dangers, Strategies
You may be wondering at this point…Where are we at this moment?
Obviously, In the second wave!
So let’s look at it more closely.
I have elaborated a machine learning taxonomy picture in order to clarify it. This taxonomy is based on multiples sources from academic and web sites.
One of the classes in taxonomy is Reinforcement Learning which is a very active researching field, so I have adopted a graph from the page  which is quite complete. In this site, you can start programming your Reinforcement Learning trading systems. You have an excellent idea of this kind of system looking at the .github repository of Andrew Kismuz 
1) Grigsby S.S. (2018) Artificial Intelligence for Advanced Human-Machine Symbiosis. In: Schmorrow D., Fidopiastis C. (eds) Augmented Cognition: Intelligent Technologies. AC 2018. Lecture Notes in Computer Science, vol 10915. Springer, Cham
2) Launchbury, J.: A DARPA Perspective on Artificial Intelligence (2017).
4)Z. Kakushadze and J.A. Serur. 151 Trading Strategies. Cham, Switzerland:
Palgrave Macmillan, an imprint of Springer Nature, 1st Edition (2018), XX,
480 pp; ISBN 978-3-030-02791-9. Full version:
5) Kleene, S.C.: Representation of events in nerve nets and finite automata. Ann. Math. Stud. 34, 3–41 (1956)
6) ”Advances in Financial Machine Learning” Marcos López de Prado (2018)
7) Langley, P.: The cognitive systems paradigm. Adv. Cogn. Syst. 1, 3–13 (2012)
8) Laird, J.E.: The Soar Cognitive Architecture. MIT Press, Cambridge (2012)
9) Profanter, S.: Cognitive
10) Laird, J.E., Lebiere, C., Rosenbloom, P.S.: A standard model of the mind: toward a common