Let's talk about Autonomous Traders
There are many initiatative that try to create software able
to buy and sell financial assets (stock, foreign exchanges, etc) in an
autonomous way. There are some digital platforms that allow
thedevelopment, test and
deployment of trading agents
(or robots)in simulated or real markets.
In fact, autonomous trading robots have been
studied in artificial
intelligence area for some
time. Some of these work
focus on very short
horizons of investment (often called high
frequency trading), while
others deal with longer periods.
These autonomous strategies may be
created with some simple idea (moving averages, for instance), or more
complex approaches including the use of complex Artificial Intelligence
algorithms. The spectrum of
used AI techniques in
finance field is wide and it includes
more recent approaches like convolutional neuralnetworks and deep
reinforcement learning.
There are many cases, where the
developers are successful in
creating robots with
great performance when
executing with historical price
series (so called backtesting).
Furthermore, some electronic platforms
make available thousands of
robots that [allegedly] are
able to be profitable in real
markets.
Nevertheless, when these robots are
used in real markets
(or data not used
intheir training or evaluation)
frequently they present very
poor performance and high
variance of returns.
Building Reliable Autonomous Traders is a VERY complex task that
require dealing with several challenging, as we will see...
Algortitms that can invest [
better than people] ??
“Few people
have what it takes to be great investors. Some can be taught, but not
everyone . . . and those who can be taught can’t be taught
everything.
Valid approaches work
some of the time but not all. And investing can’t be
reduced to an algorithm and turned over to a computer. Even the best investors
don’t get it right every time.
The reasons are simple.
No rule always works. The environment isn’t controllable, and
circumstances rarely repeat exactly.
Psychology plays a major
role in markets, and because it’s highly variable, cause-
and- effect relationships aren’t reliable. An investment
approach may work for a while but eventually the actions it calls for
will change the environment, meaning a new approach is needed. And if
others emulate an approach, that will blunt its effectiveness.”
The most important thing: uncommon sense for the thoughtful investor.
Howard Marks. Columbia Press. 2011 -
“This is that rarity, a useful book."--Warren Buffett
What happens if Algo Traders
become ubiquitous?
- Would everybody become rich or at least present
very high average returns on their investments?
- The short answer is no.
- We believe the scenario described by Eugene Fama
[6] in his Efficient Market Hypothesis (EMH) would take place.
- The EMH states that financial markets are
efficient in pricing assets. Asset prices would reflect all information
publicly available and the collective beliefs of all investors over the
foreseeable future.
- Thus, it would not be possible to overcome the
performance of the market, using information that is known by the
market, except for simple chance
How
hard is Autonomous trading?
- The environment faced by the
autonomous investment analysts could be classified in a classic way as:
- partially observable,
- sequential,
- stochastic,
- dynamic,
- continuous
- and multiagent,
- Which is the most complex environment
class
- However, it does not really
represents the whole complexity of the problem.
- More than stochastic, such
environment is also a non-stationary process (Probability distributions
do change along the time) and it is also strategic in the sense that
two traders compete for a more accurate valuation of assets and their
actions may change other agents’ behavior.
Many exciting Opportunities and
Technologies..
- Deep Learning
- Convolutional neural networks tem
apresentado execelentes resultados no processamento de imagens, mas
também em análises de séries temporais
(preço, volume,etc.) e podem ser muito úteis na
construção de novos algoritmos
- The deep network approach has been
tested in different tecnhiques with promising results...
- Deep Reinforcemente Learning
- Deep Bayesian Networks
- Agent based Simulations
- Cognitive Computing
- Specially Natural language
processing, Sentiment analysis and human-computer interaction
- A Small Market (like Brazil) may take
more time to adjust to new information, it gives opportunities to Algo
trading to explore it
Framework
mt5bse
The framework mt5se provides access to the Stock
Exchange markets to python programs through Metatrader and
some Brazilian brokers (XP, Clear corretora, and others...)
It allows access to price data (open, close, high, low) and book data
(bid, ask) and it also allows order placement.
mt5se provides an API and facilitates the creation of
autonomous traders based on traditional algorithms or AI techniques
Primary information source:
https://github.com/paulo-al-castro/mt5se/
Notebooks, examples and tutorials
Metatrader 5
MetaTrader 5 is a multi-asset platform offering trading
possibilities and technical analysis tools, as well as enabling the use
of automated trading systems (trading robots). MT5 is a product of
MetaQuotes Software Corp.
MT5 uses a proprietary language called MQL5, which is similar to C++.
It is not an open source software, but it is free to use by retail
investors and traders
URL: https://www.metatrader5.com/
- Data Collector: According to
theStrategy, there are setof data points
that needs to be
collected and properly stored
in theMarket informationin a
continuous way. That is the role of the Data collector
component.
- Trading Strategy: it
is the implementation of
the function that decides the Robot’s
actions according to current portfolio and Market situation. It can
arbirtraly complex and it needs to deal with market prediction and risk
management.
- Order Processor:
Once the Strategy decides which orders to submit
according to the observed Market information and current portfolio.
These orders are dispatched to
some Market (real orsimulated) by the
Order processor component to be completely or partially executed or
even not executed according to the market conditions. The order
processor also updates the portfolio
information according to the
result of the submitted orders
For an Introduction to Building Autonomous Traders with mt5se. Click here