0% found this document useful (0 votes)
11 views80 pages

Algo Fundamentals With Python Hayden Van Der Post Instant Download

The document discusses 'Algo Fundamentals with Python' by Hayden Van Der Post, which serves as a comprehensive guide to algorithmic trading, covering its definition, benefits, and the fundamental principles of algorithm design. It emphasizes the use of Python for financial applications, including data handling, quantitative analysis, and modeling, while also addressing regulatory and ethical considerations. The text aims to equip readers with the knowledge to develop, test, and optimize trading algorithms effectively.

Uploaded by

aslamyboafor
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views80 pages

Algo Fundamentals With Python Hayden Van Der Post Instant Download

The document discusses 'Algo Fundamentals with Python' by Hayden Van Der Post, which serves as a comprehensive guide to algorithmic trading, covering its definition, benefits, and the fundamental principles of algorithm design. It emphasizes the use of Python for financial applications, including data handling, quantitative analysis, and modeling, while also addressing regulatory and ethical considerations. The text aims to equip readers with the knowledge to develop, test, and optimize trading algorithms effectively.

Uploaded by

aslamyboafor
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 80

Algo Fundamentals With Python Hayden Van Der

Post download

https://ebookbell.com/product/algo-fundamentals-with-python-
hayden-van-der-post-56824030

Explore and download more ebooks at ebookbell.com


Here are some recommended products that we believe you will be
interested in. You can click the link to download.

Fundamentals Of Renewable Energy Processes Second Edition 2nd Edition


Aldo V Da Rosa

https://ebookbell.com/product/fundamentals-of-renewable-energy-
processes-second-edition-2nd-edition-aldo-v-da-rosa-2201358

Fundamentals Of Renewable Energy Processes 4th Edition Aldo Vieira Da


Rosa

https://ebookbell.com/product/fundamentals-of-renewable-energy-
processes-4th-edition-aldo-vieira-da-rosa-26749584

Fundamentals Of Renewable Energy Processes Aldo Vieira Da Rosa

https://ebookbell.com/product/fundamentals-of-renewable-energy-
processes-aldo-vieira-da-rosa-4409752

Bioactive Glasses Fundamentals Technology And Applications Gld Aldo R


Boccaccini

https://ebookbell.com/product/bioactive-glasses-fundamentals-
technology-and-applications-gld-aldo-r-boccaccini-5699608
Fundamentals Of Renewable Energy Processes 1st Edition Aldo V Da Rosa

https://ebookbell.com/product/fundamentals-of-renewable-energy-
processes-1st-edition-aldo-v-da-rosa-1369882

Calculus And Linear Algebra Fundamentals And Applications 1st Edition


Aldo G S Ventre

https://ebookbell.com/product/calculus-and-linear-algebra-
fundamentals-and-applications-1st-edition-aldo-g-s-ventre-47779422

Cooling Of Rotating Electrical Machines Fundamentals Modelling Testing


And Design David Staton

https://ebookbell.com/product/cooling-of-rotating-electrical-machines-
fundamentals-modelling-testing-and-design-david-staton-46083346

Algo Bots And The Law Technology Automation And The Regulation Of
Futures And Other Derivatives Gregory Scopino

https://ebookbell.com/product/algo-bots-and-the-law-technology-
automation-and-the-regulation-of-futures-and-other-derivatives-
gregory-scopino-48035876

The Algo Rythm Learn To Trade The Rythm Of The Options Market With
Python Bisette

https://ebookbell.com/product/the-algo-rythm-learn-to-trade-the-rythm-
of-the-options-market-with-python-bisette-61183618
ALGO
F U N D A M E N TA L S
with Python

Hayden Van Der Post

Reactive Publishing
Copyright © 2024 Reactive Publishing

All rights reserved

The characters and events portrayed in this book are fictitious. Any similarity to
real persons, living or dead, is coincidental and not intended by the author.

No part of this book may be reproduced, or stored in a retrieval system, or


transmitted in any form or by any means, electronic, mechanical, photocopying,
recording, or otherwise, without express written permission of the publisher.

ISBN-13: 9781234567890
ISBN-10: 1477123456

Cover design by: Art Painter


Library of Congress Control Number: 2018675309
Printed in the United States of America
To my daughter, may she know anything is possible
CONTENTS

Title Page
Copyright
Dedication
Chapter 1: Introduction to Algorithmic Trading
1.1 Definition of Algorithmic Trading
1.2 Key Benefits of Algorithmic Trading
1.3 Fundamentals of Algorithm Design
1.4 Regulatory and Ethical Considerations
Chapter 2: Understanding Financial Markets
2.1 Market Structure and Microstructure
2.2 Asset Classes and Instruments
2.3 Fundamental and Technical Analysis
2.4 Trading Economics
Chapter 3: Python for Finance
3.1 Basics of Python Programming
3.2 Data Handling and Manipulation
3.3 API Integration for Market Data
3.4 Performance and Scalability
Chapter 4: Quantitative Analysis and Modeling
4.1 Statistical Foundations
4.2 Portfolio Theory
4.3 Value at Risk (VaR)
4.4 Algorithm Evaluation Metrics
Epilogue
CHAPTER 1:
INTRODUCTION TO
ALGORITHMIC TRADING

A
lgorithmic trading has emerged as a transformative
force, meticulously choreographed by the most astute
practitioners of quantitative finance. This opening act
of our narrative embarks upon a meticulous dissection of
algorithmic trading, laying the groundwork for the
sophisticated strategies that will be unveiled in subsequent
sections.

Algorithmic trading, commonly referred to as algo-trading,


implements complex mathematical models and
sophisticated computer technologies to automate trading
strategies, executing orders at a velocity and precision
beyond human capability. This method of trading harnesses
algorithms—step-by-step procedural instructions to carry
out tasks—to identify opportunities, execute trades, and
manage risk with machine-like efficiency.

The genesis of algorithmic trading can be traced to the


convergence of three pivotal trends: the advancement of
computing power, the deregulation of financial markets, and
the relentless pursuit of competitive advantage. From its
embryonic stages in the proprietary dens of hedge funds
and investment banks, it has burgeoned into a dominant
force, accessible to a broader swath of market participants.

As we delve deeper into this subject, let us first disentangle


the core components of an algorithmic trade. An algorithmic
trade involves several crucial stages: signal generation, risk
assessment, order placement, and trade execution. The
signal generation is the algorithm's decision-making
nucleus, leveraging market data to pinpoint buy or sell
opportunities. This process depends heavily on pre-defined
strategies, which could be as simple as a moving average
crossover or as intricate as a multi-layered neural network.

Concurrently, risk assessment evaluates the potential


trade's adherence to the pre-established risk parameters. It
ensures that the trade size is proportional to the portfolio's
risk profile, and it diversifies exposure to shield from market
volatility. This facet is where the algorithm ensures that
even in the quest for profit, the principle of preservation of
capital is not relegated to the wings.

Once a trade passes through the risk assessment's filter, the


algorithm proceeds to order placement. This process
transpires in milliseconds, with the algorithm selecting the
most optimal venue from a web of exchanges and dark
pools to minimize market impact and slippage—the
difference between the expected price of a trade and the
price executed.

Finally, trade execution is the climactic point where the


order interacts with the market, transformed from a
theoretical construct into a palpable force that shapes the
market mosaic. The execution algorithm's task is to
intelligently navigate the market, seeking the best possible
price while evading the predatory gaze of other market
participants who might discern the strategy behind the
orders.

As we journey through this book, armed with Python as our


tool of choice, we'll intricately stitch these stages into
cohesive strategies. We shall draw upon examples that not
only demonstrate the raw power of these algorithms but
also expose their potential pitfalls. The market is an
ecosystem of human psychology and technological prowess,
where victory favours the vigilant and the versatile.

In the passages that follow, we will explore the various


realms of algorithmic trading, from basic concepts to the
enveloping complexity of advanced strategies. With
Python's versatility, we will breathe life into theoretical
constructs, translating abstract ideas into tangible code that
dances to the rhythm of the markets.

Let us embark on this intellectual odyssey, not as mere


spectators but as active participants, seeking to master the
art of algorithmic trade, to wield its power judiciously, and
to navigate the financial markets with a discerning eye and
an unwavering resolve. For in the intricate interplay of
numbers and narratives lies the promise of financial acumen
that stands the test of time and tide.
1.1 DEFINITION OF
ALGORITHMIC TRADING
Algorithmic trading, a term that has become a cornerstone
in the lexicon of modern finance, refers to the systematic
execution of trading orders via pre-programmed
instructions. These instructions are predicated on a variety
of factors, including time, price, volume, and a myriad of
other mathematical models and market indicators.

At its core, algorithmic trading operates on the principle of


breaking down a larger trade into smaller orders, using
complex algorithms to leverage market conditions and
optimize trade execution. This approach contrasts sharply
with traditional trading, where decisions are often driven by
intuition and executed manually.

To properly grasp the intricacies of algorithmic trading, one


must understand the algorithms themselves. These are
detailed sets of rules written in programming languages like
Python, which instruct a computer on when and how to
execute trades. The algorithms are designed to interpret,
predict, and respond to market events in real-time, often
capitalizing on small price discrepancies that may only exist
for fractions of a second.

The algorithms behind these trading strategies vary in


complexity from simple automated systems that execute
trades based on static input parameters, to sophisticated
dynamic models that can adapt to changing market
conditions. The more advanced algorithms incorporate
elements of artificial intelligence and machine learning,
allowing them to learn from market patterns and improve
their decision-making processes over time.

Furthermore, algorithmic trading spans various strategy


types, including:

1. Statistical Arbitrage: Exploiting price discrepancies


between correlated securities.
2. Market Making: Providing liquidity by simultaneously
bidding and offering with the aim of profiting from the bid-
ask spread.
3. Trend Following: Utilizing technical indicators to identify
and capitalize on market momentum.
4. High-Frequency Trading (HFT): Implementing strategies
that execute orders in milliseconds or microseconds to gain
an edge over slower market participants.

One of the quintessential benefits of algorithmic trading is


the ability to execute orders with unparalleled speed and
accuracy. Algorithms can process vast amounts of data,
examine market conditions, and execute trades at volumes
and speeds beyond human capabilities.

Moreover, algorithmic trading reduces human error and


eliminates emotional decision-making, leading to more
disciplined and consistent trading. It also enhances liquidity
and tightens spreads, which in turn reduces costs for market
participants.

However, the rise of algorithmic trading has not been


without controversy. Issues such as market fairness, the
ethical use of information, and the potential for flash
crashes due to algorithmic interactions are subjects of
ongoing debate in the financial community.

In the subsequent content of this book, we will dissect these


strategies, scrutinize the algorithms' underlying
mathematical models, and explore how they can be
meticulously constructed, backtested, and optimized using
Python. The pursuit is not only to comprehend algorithmic
trading but to master it, to wield the computational power at
our disposal with precision, insight, and ethical
consideration.

As we progress, we'll also navigate the regulatory waters


that shape the practice of algorithmic trading. From the
Markets in Financial Instruments Directive (MiFID II) in
Europe to the Dodd-Frank Act in the United States,
compliance with legal standards is paramount. The
algorithms must not only be proficient but also operate
within the complex mosaic of global regulations.

Algorithmic trading is the embodiment of the intersection


between finance and technology, a symbiosis of
quantitative analysis and computer science. It is a domain
where the astute use of data and algorithms can lead to
significant competitive advantages, but it is also a field that
demands constant vigilance, adaptability, and a rigorous
understanding of both the opportunities and the perils
inherent in its practice.

History and Evolution of Algorithmic Trading


Tracing the roots of algorithmic trading leads us back to the
late 20th century when the financial markets began a
transformation that would fundamentally alter their
operation. This evolution was catalyzed by the convergence
of two pivotal developments: the rise of computer
technology and the deregulation of financial markets.

The 1970s marked the advent of early electronic trading


platforms, with NASDAQ being a notable pioneer in this
field. Initially, these platforms simply provided a digital
alternative to the outcry auction system, but their potential
for rapid information processing laid the groundwork for the
algorithmic revolution that was to follow.

The 1980s witnessed the introduction of computer-driven


trading programs that could execute straightforward
strategies, such as index arbitrage. These systems were
rudimentary by today's standards, often based on fixed sets
of rules and lacking the capacity to adapt to changing
market dynamics. Nevertheless, they represented a
significant stride towards the automation of trade execution.

The watershed moment for algorithmic trading, however,


came on October 19, 1987 – a day infamously known as
Black Monday when stock markets around the world
crashed. Computer-based portfolio insurance strategies,
which sought to limit losses through automated hedging,
were widely implicated in exacerbating the crash due to
their simultaneous execution across the market. This event
underscored the profound impact that automated trading
systems could have, albeit negatively in this case, and
foreshadowed their potential influence on global finance.

The 1990s and early 2000s saw a rapid acceleration in the


development of algorithmic trading as increasing
computational power and the advent of the internet made
real-time data processing and electronic execution not only
feasible but also efficient. Proprietary trading firms and
hedge funds began to explore and exploit quantitative
strategies, leading to an arms race of sorts in the
development of sophisticated algorithms.

During this period, electronic communication networks


(ECNs) and alternative trading systems (ATS) emerged,
further democratizing market access and reducing the
reliance on traditional exchanges. The fragmentation of
markets, while creating complexity, also presented
opportunities for arbitrage and algorithmic strategies that
could capitalize on price discrepancies across different
venues.

The introduction of high-frequency trading (HFT) took


algorithmic trading to new heights. Leveraging ultra-fast
communication networks and sophisticated algorithms that
could make decisions in microseconds, HFT firms gained a
significant advantage by being first to market.

Yet, this era also highlighted the need for stringent oversight
as the "Flash Crash" of May 2010 exposed vulnerabilities in
the financial system, where a single algorithmic trader's
actions triggered a rapid and deep market sell-off. This
event led to increased scrutiny and regulation of algorithmic
trading practices.

Today, algorithmic trading continues to advance with the


integration of machine learning and artificial intelligence,
expanding not only in sophistication but also in accessibility.
Retail traders and small firms now have at their disposal
tools that were once the exclusive domain of large
institutions. Open-source programming languages,
particularly Python, have played a pivotal role in this
democratization, enabling traders to develop, test, and
deploy complex trading strategies within robust,
community-supported ecosystems.

The historical journey of algorithmic trading is a testament


to the relentless pursuit of efficiency and edge in financial
markets. From its nascent beginnings to its status as an
integral part of modern finance, algorithmic trading has not
only adapted to each evolutionary phase of the markets but
also often served as the catalyst for change. As we examine
the fabric of this evolution, we uncover a narrative of
innovation, adaptation, and occasional upheaval—a
narrative that continues to unfold as the markets and
technologies that underpin algorithmic trading advance into
new territories.

Role in Modern Finance

The role of algorithmic trading in modern finance is


multifaceted and profound, reshaping the landscape in ways
that extend far beyond mere trade execution. In this era of
digital transformation, algorithmic trading has emerged as a
cornerstone of modern financial practices, driving efficiency,
liquidity, and innovation while also presenting new
challenges and complexities.

Liquidity Provision

One of the primary functions of algorithmic trading in


modern financial markets is the provision of liquidity.
Algorithms are programmed to continuously place buy and
sell orders in the market, thus facilitating the ease with
which assets can be bought or sold. This constant
availability of market participants has significantly narrowed
bid-ask spreads, reducing trading costs for all market
players and contributing to more efficient price discovery.

Market Efficiency

Algorithmic trading contributes to market efficiency by


ensuring that price discrepancies are swiftly corrected.
When an algorithm identifies an asset that is under or
overvalued across different markets or exchanges, it can
execute trades that capitalize on the discrepancy, thereby
bringing the prices back into alignment. This arbitrage
activity ensures that prices across markets are coherent and
fair, benefiting all participants by maintaining orderly
markets.

Strategic Trading

Institutions utilize algorithms to execute large orders


strategically, minimizing market impact and potential price
slippage. Through techniques such as Volume-Weighted
Average Price (VWAP) and Time-Weighted Average Price
(TWAP), algorithms split large orders into smaller, less
conspicuous transactions, spreading them out over time or
across multiple venues, thus preserving trade confidentiality
and price integrity.

Risk Management

Algorithmic trading also plays an essential role in risk


management. Traders and portfolio managers use
algorithms to implement complex hedging strategies,
dynamically adjusting to market movements to protect
against adverse price changes. This automated risk
management allows for real-time protection that would be
impossible to achieve manually.

Innovation and Strategy Development

Algorithmic trading has become a sandbox for financial


innovation. The use of machine learning and artificial
intelligence in trading algorithms has opened new frontiers
for strategy development. These advanced models can
identify non-linear patterns and relationships in market data
that are imperceptible to human traders, leading to the
generation of predictive insights and novel trading
strategies.

Personalization and Retail Trading

With the advent of online brokerage platforms that offer API


access, retail traders now can engage in algorithmic trading.
This has led to a more personalized trading experience
where individuals can develop and deploy strategies that
align with their risk tolerance, trading goals, and insights. As
a result, the democratization of finance through technology
is one of the most significant shifts enabled by algorithmic
trading.

Challenges and Concerns

Despite its many benefits, algorithmic trading also presents


challenges that are integral to modern finance. The
potential for flash crashes, systemic risk, and market
manipulation are concerns that regulators and market
participants constantly grapple with. The complexity of
algorithms and their interactions in a high-speed trading
environment require ongoing oversight and the
development of sophisticated monitoring tools to ensure
market stability and integrity.

Regulatory Response

The role of regulation has expanded in response to the


growth of algorithmic trading, with measures such as the
Markets in Financial Instruments Directive (MiFID II) in
Europe and the Dodd-Frank Act in the United States aimed
at increasing transparency and accountability. Regulators
continue to evolve their oversight frameworks to keep pace
with the rapid advancements in trading technology.

In conclusion, the role of algorithmic trading in modern


finance is integral and dynamic. It has revolutionized market
practices, lowered costs for participants, and introduced a
level of sophistication in trading strategies that was
previously unattainable. As the financial markets continue to
evolve, the influence and importance of algorithmic trading
are set to increase, shaping the future of finance in ways
that are both exciting and unpredictable. This evolution
demands that market practitioners and regulators remain
vigilant, adaptive, and forward-thinking to harness the
benefits of algorithmic trading while mitigating its risks.

Comparison with Traditional Trading

In the financial mosaic, the advent of algorithmic trading


represents a significant paradigm shift from the era of
traditional trading practices. This evolution reflects the
quantum leap from human-driven decision-making to
machine-driven precision. The contrast between traditional
and algorithmic trading is stark, not only in the execution of
trades but also in the underlying philosophies,
methodologies, and outcomes that define success in the
markets.

Human Versus Algorithmic Precision

Traditional trading is characterized by human traders


making decisions based on a combination of research,
experience, and intuition. The limitations of human
cognition and emotional bias are inherent in this approach,
often leading to inconsistencies in decision-making and
execution. In contrast, algorithmic trading relies on
predefined mathematical models and algorithms that
execute trades based on quantitative data, stripped of
emotional influence, ensuring a level of precision and
consistency unattainable by human traders.

Speed of Execution

The velocity at which trading decisions are executed in an


algorithmic setup is unparalleled. Traditional trading
methods are constrained by the physical speed at which
orders can be placed and filled, often leading to missed
opportunities or entry at less than optimal prices.
Algorithmic trading systems, however, operate at near-
instantaneous speeds, executing complex strategies within
microseconds, far beyond the capabilities of even the most
skilled human traders.

Strategic Diversity and Complexity

Algorithmic trading introduces a level of strategic diversity


and complexity that traditional trading methods cannot
match. Traditional strategies often rely on simpler tactics
like buy-and-hold or basic technical analysis indicators.
Algo-trading, on the other hand, can incorporate a myriad of
factors into its decision process, from deep statistical
analysis and predictive modeling to high-frequency trading
tactics and multi-asset diversification.

Capacity and Scalability

The scale of trading operations between the two methods


also differs significantly. Traditional traders are limited by
the volume of information they can process and the number
of trades they can manage simultaneously. Algorithmic
traders can monitor and trade across multiple markets and
instruments, handling vast datasets and executing
numerous strategies concurrently without the risk of
cognitive overload.

Cost Effectiveness

Cost effectiveness is another area where algorithmic trading


stands apart. Traditional trading incurs higher costs due to
broker fees, wider bid-ask spreads, and potential slippage.
Algorithmic trading minimizes these costs through direct
market access and the ability to execute trades at optimal
price points, thus improving the potential profitability of
trading strategies.

Backtesting and Predictive Analytics

A key advantage of algorithmic trading is the ability to


backtest strategies using historical data to predict future
performance. While traditional traders may rely on past
performance as a rough guide, algorithmic trading allows for
rigorous simulations of how a strategy would have behaved
under various market conditions, providing more confidence
and risk assessment before strategy deployment.
Regulatory and Compliance Challenges

With the rise of algorithmic trading, regulatory challenges


have also become more complex. Traditional trading
compliance focuses on straightforward disclosures and trade
reporting. However, compliance in algorithmic trading must
contend with the intricacies of ensuring fair algorithms,
preventing market abuse, and maintaining adequate control
systems to monitor automated trading activities.

Impact on Market Behavior

Finally, the impact on market behavior and dynamics is


significantly different. Traditional trading influences market
movements more gradually, with trends developing over
longer periods. Algorithmic trading can cause rapid shifts in
market sentiment and price levels, sometimes resulting in
phenomena like flash crashes or amplified volatility. The
need to understand and adapt to these rapid market
dynamics is crucial for contemporary traders.

The comparison between traditional and algorithmic trading


is a study in the contrast between human and machine
capabilities. While traditional trading will always have its
place, particularly in the realm of qualitative analysis and
relationship-driven markets, the efficiency, speed, and
precision of algorithmic trading are indispensable in today's
digital and data-driven financial environment. As algorithms
continue to evolve and become more sophisticated, their
impact on market dynamics, risk management, and trading
success will only grow, further distinguishing them from the
traditional methodologies of the past.
1.2 KEY BENEFITS OF
ALGORITHMIC TRADING
The infiltration of algorithmic strategies into the trading
sphere has not been without its critics, yet the benefits it
affords are undeniable and multifaceted. In this section, we
explore the key advantages algorithmic trading has
conferred upon the financial markets, dissecting the
theoretical underpinnings that make these benefits possible.

Enhanced Market Efficiency

Algorithmic trading has been a catalyst for market


efficiency, bridging the gap between theoretical market
models and the practical realities of trading. By leveraging
algorithms capable of parsing vast swathes of data and
executing trades with precision, markets have become more
reflective of underlying economic indicators and valuations.
This concordance with the Efficient Market Hypothesis
propels markets closer to informational efficiency, where
prices reflect all available information.

Mitigated Emotional Trading

One of the most salient benefits of algorithmic trading lies in


its emotionless nature. Traditional trading is often
susceptible to emotional biases—fear and greed being
principal actors—leading to suboptimal decisions.
Algorithmic trading, however, operates within the
parameters of cold logic and statistical probability,
extricated from the whims of human emotion. This
detachment results in a disciplined adherence to trading
plans, which is crucial for long-term profitability.

Quantitative Rigor and Systematic Strategy

Algorithmic trading harnesses the power of quantitative


analysis to develop systematic strategies that are both
robust and scalable. It is the embodiment of a scientific
approach to the markets, applying rigorous backtesting and
validation techniques to ensure that strategies are both
sound and have a statistical edge over random chance. This
quantitative rigor allows for the identification of subtle
patterns and inefficiencies in the markets that might elude
the human eye.

Diversification and Risk Management

The computational prowess of algorithmic trading allows for


sophisticated portfolio diversification and risk management
strategies, far surpassing traditional methods. Algorithms
can monitor correlations in real-time, adjusting exposures to
minimize systemic risk and optimize returns. Moreover,
through techniques like volatility targeting and dynamic
hedging, algorithmic trading provides a granular control
over risk management that traditional approaches cannot
hope to match.

High-Frequency Trading and Liquidity

Algorithmic trading has given rise to high-frequency trading


(HFT), which contributes significantly to market liquidity. By
constantly posting buy and sell orders, HFT algorithms
reduce spread costs and improve market depth, benefiting
all market participants. This liquidity generation also
facilitates price discovery, ensuring that the markets remain
liquid and tradeable even during turbulent periods.

Cost Reduction

A pivotal advantage of algorithmic trading is the reduction


of transaction costs. Algorithms are designed to seek the
optimal execution strategy, considering factors such as
market impact and timing risk. Through techniques like
order slicing (VWAP/TWAP strategies) and dark pool
utilization, algorithmic trading can execute significant orders
without causing adverse price movements, thereby reducing
the costs associated with slippage.

Innovative Trading Models

Algorithmic trading has been at the forefront of utilizing


innovative trading models, including machine learning and
artificial intelligence. These models adapt and improve over
time, carving out new strategies that were once the realm of
speculative fiction. From reinforcement learning models that
adapt to new market conditions to neural networks that can
predict price movements, the innovative potential of
algorithmic trading continues to expand the horizons of
what is possible in financial markets.

Global Trading and Time Management

The global nature of financial markets requires a trading


presence that transcends time zones. Algorithmic trading
operates around the clock, exploiting opportunities in
different markets without the need for human intervention.
This 24/7 trading capability not only maximizes
opportunities but also provides a better work-life balance for
traders who are no longer tethered to their screens day and
night.

Compliance and Auditability

With the regulatory landscape of financial markets


becoming increasingly complex, the importance of
compliance cannot be overstated. Algorithmic trading offers
superior auditability compared to traditional trading
methods. Every decision made by an algorithm can be
logged and traced, providing a transparent record that
simplifies compliance reporting and facilitates audits.

The key benefits of algorithmic trading—from market


efficiency and quantitative rigor to cost reduction and
compliance—demonstrate its significant impact on the
financial markets. As we continue to explore the practical
applications of these benefits in subsequent sections, it
becomes clear that algorithmic trading is not just a
technological advancement but a fundamental shift in the
philosophy and execution of trading strategies.

Speed and Efficiency

Speed and efficiency are not mere advantages—they are


imperatives. Algorithmic trading, through its fusion of
advanced computational techniques and financial acumen,
has elevated these imperatives to new heights, creating an
ecosystem where milliseconds can delineate the boundary
between profit and loss.

At the heart of algorithmic trading lies the capacity for


expedited decision making. Traditional analysis, with its
reliance on human cognition, is inherently sluggish against
the backdrop of a fast-paced market. Algorithms, however,
process and analyze data at an almost instantaneous rate,
executing decisions with a swiftness unattainable by human
traders. This speed opens the door to exploiting fleeting
opportunities and arbitrage that would otherwise evaporate
in the blink of an eye.

Efficiency in algorithmic trading transcends the mere speed


of transactions—it encompasses the orchestration of
multiple components working in harmony. The strategic
placement of orders, the optimal allocation of resources
across various instruments, and the minimization of market
impact are all facets of the efficiency algorithms embody.
This orchestration ensures that every trade is not simply
quick but also calibrated for optimal market conditions.

Behind the scenes of algorithmic trading lies a technological


infrastructure purpose-built for speed. High-frequency
trading firms invest heavily in state-of-the-art hardware and
software to maintain a competitive edge. Co-location
services place algorithmic servers in close physical
proximity to exchange servers, reducing the travel time of
data and effectively slashing milliseconds off order
execution times. It is in this high-stakes arena that the
technological prowess of a firm is directly correlated with its
capacity to capitalize on market movements.

The efficiency of algorithmic trading is further magnified by


optimization algorithms, which are designed to find the best
possible solution within the constraints of a problem.
Whether it's minimizing the cost function in an execution
algorithm or optimizing the parameters of a trading model,
these algorithms are relentless in their pursuit of efficiency.
By continuously fine-tuning themselves, they ensure that
the trading process remains as lean and effective as
possible.

In the battle for speed, latency is the adversary. Algorithmic


trading combats latency through meticulously crafted
reduction strategies. Every layer of the trading stack is
scrutinized for delays—from the hardware layer to the
application layer—and each bottleneck is methodically
removed. Innovative networking protocols, ultra-low latency
switches, and direct fiber-optic connections are just a few
weapons in the arsenal against latency.

Beyond speed, algorithms act as efficiency experts in trade


execution. They dissect the markets, determining the most
propitious time to trade to minimize price impact and
maximize execution quality. Smart order routing algorithms
navigate through a maze of different exchanges and dark
pools, finding the best possible price with remarkable
efficiency. These algorithms are not just trading—they are
negotiating the intricacies of the market on behalf of their
operators.

Algorithms also introduce the concept of time-slicing in


trade execution. By breaking down a large order into
smaller, less market-impacting parcels and executing them
over a defined time horizon, they avoid tipping the market's
hand. The algorithm's ability to respond dynamically to real-
time market conditions ensures that it remains stealthy,
minimizing the ripples its trades cause in the market pond.

As we look to the horizon, the trajectory of speed and


efficiency in algorithmic trading seems boundless. Quantum
computing looms as a potential game-changer, offering
processing speeds that dwarf current capabilities. Yet, even
in this accelerating landscape, algorithmic trading maintains
a focus on efficiency—not just for the sake of being fast but
to navigate the markets with precision and acuity.

Speed and efficiency are quintessential components of


algorithmic trading's DNA. They propel a trading strategy
from the realm of the theoretical into the high-octane reality
of market implementation. As we advance through this
book, the reader will be introduced to Python code examples
that embody these concepts, transforming the abstract
beauty of algorithmic velocity and efficiency into tangible,
executable trading strategies.

Elimination of Human Emotions

The psychological interplay of fear and greed is as old as


the markets themselves. Human emotions, while central to
the richness of human experience, often cloud judgment
and lead to decisions that are irrational from an investment
standpoint. Algorithmic trading, with its systematic
approach, eliminates the susceptibility of trading to these
emotional biases, fostering an environment where logic and
probability reign.

Algorithms are immune to the emotional rollercoaster that


can plague even the most seasoned traders. They are
programmed to follow a set of predefined rules, regardless
of the mayhem that may be unfolding in the markets. They
do not experience panic in the face of a market crash, nor
do they exude overconfidence during a bull run. By adhering
strictly to their coded strategies, they offer a bulwark
against the whims of human emotion that so often result in
suboptimal trades.
Quantitative models stand at the vanguard of rational
decision-making in algorithmic trading. These models, built
on historical data and statistical methods, predict market
movements based on empirical evidence rather than
intuition or feeling. They provide a structured approach to
trading that is repeatable and scalable, qualities that are
antithetical to the inconsistent nature of emotional
reactions.

Backtesting is the rigorous process by which an algorithm's


strategy is vetted against historical data before it is
unleashed in the live market. This methodical validation
serves as an antidote to the overfitting of emotions to
market conditions. It ensures that the strategies encoded
within an algorithm have withstood the test of time and are
not merely a reflection of transient market sentiments.
Stress testing goes a step further, simulating extreme
market scenarios to gauge an algorithm's resilience. It is
akin to preparing for the psychological warfare of trading,
but instead of fortifying the human psyche, it fortifies the
algorithmic logic. By probing the algorithm's reactions to
stark market shocks, traders can be confident that their
automated systems will not capitulate when faced with real-
world pressures.

Systematic trading is disciplined trading. Algorithms execute


trades with a frequency and precision that are simply
unattainable by humans, governed by the cool calculus of
risk and reward. They do not chase losses or rest on laurels;
they operate within the parameters of a well-tested system,
devoid of the euphoria and despair that can lead humans
astray.

Despite the elimination of human emotions from the


decision-making process, the human element remains
critical in the form of oversight and adaptation. Algorithms
are tools created by humans and, as such, require regular
evaluation and adjustment to ensure they continue to
perform as intended. The strategic intervention by a human
to update an algorithm in response to shifting market
regimes is an act of governance, not emotion, and is
essential to the sustainable success of algorithmic trading.

The immutable machine that is a Python algorithm serves


as an embodiment of objectivity in the pursuit of trading
excellence. Python code is unerring and precise, executing
trades based on statistical signals rather than gut reactions.
In the following sections of this book, we will dissect Python
code snippets that exemplify this detachment from emotion,
illustrating the implementation of emotionless trading
strategies that rely solely on data-driven insights.

The elimination of human emotions from trading is one of


the most salient features of algorithmic trading. It
represents the tranquil rationality of a system that operates
on the principles of statistical evidence and mathematical
probability. It is this quality that we will explore and exploit
in our journey through the intricate world of algorithmic
trading with Python—a journey devoid of emotional
turbulence, guided instead by the steadfastness of code and
the clarity of data.

Backtesting and Optimization

Backtesting stands as a rigorous method for evaluating the


efficacy of trading strategies against historical data. This
empirical approach is essential for verifying that a proposed
strategy would have been profitable in the past, which,
while not a guarantee of future success, is a significant
indicator of its robustness.

The process of backtesting involves recreating trades that


would have occurred in the past using the rules defined by
the algorithm. This historical simulation allows traders to
assess how a strategy would have performed under various
market conditions. It's a meticulous task that demands high-
quality data and comprehensive understanding of the
potential biases that can skew results.

The availability and granularity of historical data are critical


in backtesting. For a strategy to be thoroughly tested, the
data must span different market cycles and conditions. This
includes bull and bear markets, periods of high volatility,
and black swan events. The data must also be adjusted for
corporate actions such as dividends and stock splits to
ensure accuracy.

A paramount challenge in backtesting is the mitigation of


biases that can lead to overestimating a strategy's
performance. Look-ahead bias, survivorship bias, and
overfitting are among the subtle pitfalls that the trader must
navigate. For instance, ensuring that the strategy only
utilizes information that would have been available at the
time of trading is essential to avoid look-ahead bias.

Optimization is the process of fine-tuning a strategy's


parameters to maximize performance. While it is a powerful
tool that can enhance a strategy's profitability, it is also a
double-edged sword. Over-optimization, or curve-fitting,
occurs when a strategy is excessively tailored to the
historical data, making it less adaptable to future market
conditions.
The key to successful optimization is finding the balance
between fit and adaptability. This involves selecting a range
of parameters broad enough to capture different market
behaviors without becoming overly specific. Techniques
such as cross-validation and out-of-sample testing are
employed to gauge the strategy's adaptability and to
prevent overfitting.

Python, with its rich ecosystem of libraries such as pandas,


NumPy, and backtrader, is a formidable tool for conducting
backtesting and optimization. It affords traders the ability to
process large datasets efficiently and to iterate over
different strategies and parameters rapidly. Python's
capability for data manipulation and its robust statistical
packages enable traders to develop, test, and optimize
strategies with a level of precision and speed that is
indispensable in modern algorithmic trading.

Consider a simple moving average crossover strategy,


where the objective is to determine the optimal lengths of
the short and long moving averages. A Python script can be
constructed to iterate over a range of values for these
parameters. The script can then perform backtesting for
each pair of values, calculating key performance metrics like
the Sharpe ratio, maximum drawdown, and cumulative
returns.

Backtesting and optimization serve as the dual lenses


through which the viability of an algorithmic strategy is
refined. They are foundational processes in the crafting of
any automated trading system, pivotal in transitioning from
theoretical models to practical, deployable strategies. As we
delve deeper into these processes, we will uncover Python's
pivotal role in enabling traders to backtest and optimize
with unparalleled precision, paving the way for data-driven,
emotion-free trading decisions.

Diversification and Risk Management

In the theatre of financial markets, diversification is the


strategy that shapes the risk-reward profile of an
investment portfolio. It is the quintessential defense against
the idiosyncratic risks that can lay siege to concentrated
positions. Risk management, on the other hand, is the
overarching discipline that encompasses diversification
among its arsenal of tools designed to mitigate losses and
preserve capital.

Diversification stems from the fundamental precept that not


all assets move in tandem. By spreading investments across
various asset classes, sectors, and geographical regions, a
portfolio can reduce its susceptibility to the adverse
performance of a single asset or sector. It is the
embodiment of the adage "do not put all your eggs in one
basket," a principle particularly salient in the context of
algorithmic trading where strategies can be deployed across
a broad spectrum of instruments.

The effect of diversification can be quantified using


statistical measures such as correlation coefficients to
determine the relationship between asset returns. In an
optimally diversified portfolio, these correlations are low, or
even negative, suggesting that assets do not move in
lockstep and can therefore provide a smoothing effect on
the portfolio's overall volatility.
Risk management transcends diversification. It is a holistic
approach that involves identifying, assessing, and
responding to all forms of risk that could impede the
portfolio's objectives. This includes setting position sizes,
employing stop-loss orders, and utilizing derivative
instruments for hedging purposes.

Python's role in enabling dynamic diversification is


substantial. Through libraries like scipy and scikit-learn,
Python can facilitate cluster analysis and principal
component analysis—techniques that allow traders to
identify unique sources of risk and return within a dataset,
enabling the construction of a diversified portfolio that is
dynamic and adaptive to market conditions.

Implementing risk management techniques in Python


involves calculating various risk metrics such as Value at
Risk (VaR), Conditional Value at Risk (CVaR), and volatility
measures. These metrics provide insights into the potential
loss the portfolio could incur over a specified period, under
normal market conditions (VaR), or under extreme
conditions (CVaR).

Consider a factor-based trading strategy that selects stocks


based on characteristics such as size, value, and
momentum. Python can be utilized to construct a long-short
equity portfolio where stocks are chosen based on their
factor scores, and weights are assigned in a manner that
neutralizes the portfolio's exposure to these common
factors. This strategy inherently includes a diversification
component by neutralizing factor risks and can be
augmented with risk management overlays that ensure the
portfolio remains within predefined risk parameters.
Further, the book will explore the concept of portfolio
optimization using techniques like the Black-Litterman
model and the mean-variance optimization framework. We'll
integrate these powerful models into our Python scripts,
enabling the reader to balance the expected returns against
the risks in a systematic way.

The interplay between diversification and risk management


is subtle yet profound. A strategy's success hinges not just
on the individual performance of assets but on how they
interact to affect the portfolio's volatility and drawdowns.
This section will bridge the gap between theory and
practice, showcasing how Python enables the seamless
integration of diversification and risk management
strategies into the trading algorithm's decision-making
process.

Diversification and risk management are the backbone of


any sustainable algorithmic trading strategy. They are the
disciplines that ensure longevity in the face of market
adversities. As we progress through the intricacies of these
essential practices, we will shed light on Python's critical
role in actualizing the theories of diversification and risk
management into tangible, executable strategies. The
reader will gain insights into creating diversified portfolios
that are not only resistant to individual asset volatility but
also attuned to the symphony of the broader market
dynamics.
1.3 FUNDAMENTALS OF
ALGORITHM DESIGN
Crafting an algorithm is akin to composing a symphony,
where each line of code, like a musical note, must
harmoniously interact to produce a desired outcome
efficiently and effectively. The design of a robust trading
algorithm necessitates a foundational understanding of
numerous key principles, which integrate financial theory,
statistical methods, and computer science.

The cornerstone of algorithm design is the clear definition of


the algorithm's objective. In the realm of algorithmic
trading, the goal may range from executing trades to
maximize profit, to minimizing market impact, or achieving
optimal asset allocation. Defining the objective with
precision is paramount, as it influences every subsequent
decision in the algorithm's design and implementation.

Efficiency in algorithm design refers to the resourcefulness


with which the algorithm performs its tasks. This includes
considerations of both time complexity, which relates to the
speed of execution, and space complexity, which concerns
the amount of memory utilized. Algorithmic trading
demands high efficiency due to the need for rapid decision-
making and execution in fast-paced financial markets.

Statistical methods underpin the predictive aspects of


algorithm design. They enable the identification of patterns,
the forecasting of market movements, and the
quantification of uncertainty. Techniques such as regression
analysis, time series analysis, and probability models are
integral to creating strategies that can adapt to evolving
market conditions.

The incorporation of machine learning into algorithm design


has become increasingly prevalent in financial applications.
These models, ranging from decision trees to deep neural
networks, are capable of learning from data and improving
their predictions over time. The design of such algorithms
must carefully balance the trade-off between model
complexity and overfitting, ensuring that the algorithm
remains generalizable to unseen market data.

A robust backtesting framework is crucial for validating the


performance of trading algorithms based on historical data.
It should simulate real-world trading with high fidelity,
including aspects such as transaction costs, market liquidity,
and slippage. Backtesting provides a sandbox for fine-tuning
the algorithm's parameters before exposing it to live
markets.

An often underemphasized aspect of algorithm design is the


integration of risk controls and contingencies to safeguard
against unexpected market conditions. These include
setting limits on position sizes, implementing stop-losses,
and developing fail-safes to halt trading in response to
extreme volatility or system malfunctions.

Python serves as an excellent tool for designing trading


algorithms due to its ecosystem of libraries for data analysis
(pandas), machine learning (scikit-learn, TensorFlow), and
scientific computing (NumPy). With Python, a trader can
prototype and iterate on algorithm designs rapidly, moving
from conceptual frameworks to concrete implementations
with relative ease.

Algorithm design is not a one-off task, but rather an ongoing


process of refinement. It involves an iterative cycle of
hypothesis generation, testing, analysis, and enhancement.
Each iteration leverages new data, insights, and
technological advancements to improve the algorithm's
performance and resilience against market changes.

Algorithms must be designed with adaptability in mind.


Financial markets are dynamic, and an algorithm that is
rigidly fixed to a specific set of conditions is likely to become
obsolete. Thus, the design must incorporate mechanisms for
the algorithm to evolve, whether through parameter
updates, retraining of models, or automatic adaptation to
shifts in market behavior.

Algorithm design in finance is both an art and a science. It


requires a meticulous blending of theoretical knowledge,
empirical testing, and creative problem-solving. Through
detailed Python examples and case studies, this section will
provide the reader with a deep dive into the intricacies of
algorithm design, equipping them with the tools necessary
to build, test, and refine sophisticated trading algorithms in
the pursuit of enhanced financial performance.

Defining Trading Strategies

The strategy is the schema by which a program navigates


the tumultuous sea of market data, seeking ports of
profitability in waves of information. The meticulous
definition of trading strategies is the keystone of successful
algorithmic trading. In this section, we will delve into the
formulation, testing, and implementation of trading
strategies using Python.

The strategic objective must be crystal clear. Is the strategy


seeking to capitalize on market inefficiencies, follow trends,
or act on price differences across markets? The algorithm's
intended purpose determines the data it requires, the
models it employs, and the metrics by which its success is
measured.

Quantitative analysis provides a solid foundation for


strategy definition. It involves the application of
mathematical models to historical market data to discern
probable future outcomes. The use of Python's numpy and
pandas libraries allows for the manipulation and analysis of
large datasets, which is essential for identifying trade
signals that are statistically robust.

Trading strategies fall into several categories, each with its


own set of characteristics. We have mean reversion
strategies, which bank on the principle that prices will revert
to their historical average. Trend-following strategies, on the
other hand, aim to profit from the continuation of existing
market trends. Python's matplotlib and seaborn libraries are
indispensable tools for visualizing data trends and patterns
as part of the strategy development process.

Technical indicators are crucial components of many trading


strategies. They provide objective measures of market
conditions, such as momentum, volatility, and market
strength. Python's TA-Lib package offers a wide array of
technical analysis indicators that can be integrated into
algorithmic strategies to automate trade decisions based on
pre-defined criteria.
Machine learning models take strategy definition beyond
traditional statistical methods. These models can uncover
complex nonlinear patterns in data that may elude
traditional analysis. Python's scikit-learn library provides
access to a suite of machine learning algorithms that can be
trained on financial data to predict market movements and
inform trading decisions.

Optimization is the process of fine-tuning a strategy's


parameters to maximize performance. Python's scipy library
offers optimization algorithms that can adjust these
parameters to improve the strategy's returns, reduce risk, or
achieve other specified performance targets.

Backtesting is the act of simulating a trading strategy using


historical data to assess its potential viability. Python's
backtrader and pybacktest libraries provide frameworks for
backtesting, allowing traders to evaluate the effectiveness
of a strategy before risking capital in live markets.

Integral to the definition of a trading strategy is an approach


to risk and money management. Strategies should be
designed to maintain predetermined risk thresholds and
adapt to changing market conditions to preserve capital.
Python can aid in the construction of risk management
models that monitor exposure and adjust positions to align
with risk tolerance levels.

A trading strategy is never static; it requires ongoing


refinement to stay relevant. Python's ability to rapidly
prototype and modify code makes it an ideal environment
for the iterative testing and enhancement of trading
strategies.
Before implementing a strategy in a live environment,
several considerations must be addressed. These include
the strategy's scalability, its impact on market conditions,
and its compliance with regulatory guidelines.

The process of defining trading strategies is at the heart of


algorithmic trading. It demands a disciplined approach that
melds rigorous quantitative analysis with creative strategic
thinking. This section, rich with Python code examples, has
guided you through each step in the development of a
trading strategy, from its inception to its live execution. As
we continue to sculpt these strategies, we must remember
that the markets are ever-evolving, and so too must our
algorithms be, to navigate the shifting tides of finance
successfully.

Incorporating Market Indicators

The landscape of market indicators is vast, with each


serving a different purpose and providing unique insights. In
selecting indicators, the algorithmic trader must consider
the strategy's objectives and the types of signals required.
Common categories of indicators include trend, momentum,
volatility, and volume indicators, each contributing to a
comprehensive market analysis.

Trend Indicators

Trend indicators, such as moving averages and the MACD


(Moving Average Convergence Divergence), help in
identifying the market's direction. Python's pandas library
allows for the efficient calculation of these indicators,
smoothing out price data to reveal the underlying trend and
potential entry or exit points for trades.

Momentum Indicators

Momentum indicators like the RSI (Relative Strength Index)


and the Stochastic Oscillator gauge the speed and change
of price movements. Through Python, traders can integrate
these indicators to pinpoint overbought or oversold
conditions, suggesting potential reversals that a strategy
might capitalize on.

Volatility Indicators

Volatility indicators, such as Bollinger Bands and the


Average True Range (ATR), measure the market's instability
and the magnitude of price fluctuations. Utilizing Python's
capabilities, we can incorporate these indicators to adjust
trade sizes and stop-losses, aligning with current market
volatility and thus managing risk more effectively.

Volume Indicators

Volume indicators like the OBV (On-Balance Volume) provide


insights into the intensity behind price movements by
correlating volume with price changes. With Python, these
indicators can be synthesized into algorithms to confirm
trends or signal breakouts based on trading volume.

Integrating market indicators into trading strategies


involves more than simply applying a formula. It requires a
synthesis of indicator outputs with market context. Python's
flexibility in handling data from various sources enables the
creation of composite indicators that combine insights from
multiple single indicators, offering a more robust signal for
decision-making.

Sometimes existing indicators fall short, and the


development of custom indicators becomes necessary.
Python shines here, allowing traders to experiment with new
mathematical models and data inputs to craft proprietary
indicators that offer a competitive edge.

While including various market indicators can provide a


multifaceted view of the market, performance
considerations must be considered. Overloading a strategy
with indicators can lead to complexity, overfitting, and
conflicting signals. Python's data visualization libraries, such
as matplotlib, can assist in evaluating the performance and
correlation of indicators to prevent redundancy and improve
strategy efficacy.

Incorporating market indicators into a Python-driven


algorithm is a starting point. Real-world testing through
paper trading or simulated environments is critical to
validate the practical application of these indicators. This
phase tests the indicators' predictive power and the
strategy's overall responsiveness to real market conditions.

Market conditions are dynamic, and so should be the use of


market indicators. Python's programming environment
supports the creation of adaptive algorithms that can adjust
indicator parameters in response to market regime shifts,
ensuring that the strategy remains attuned to current
market realities.

Market indicators are invaluable tools that, when deftly


incorporated into algorithmic trading strategies using
Python, illuminate the path toward strategic trade decisions.
This section has explored the various types of indicators and
provided insights into effectively integrating them into
algorithmic models. As we advance to the next section, we
carry with us the understanding that the intelligent
application of market indicators is not a static process but a
continuous evolution, much like the markets themselves.

Risk and Money Management Features

Before a single line of code is written, it is essential to


define the risk parameters that will guide the trading
strategy. These parameters, typically expressed as a
percentage of capital at stake on any given trade, ensure
that losses can be absorbed without jeopardizing the trading
account's longevity. Python's numerical computing libraries,
like NumPy, offer the precision and flexibility needed to
implement these calculations.

Position sizing algorithms determine the number of shares,


lots, or contracts to trade based on the predefined risk
parameters and the specifics of the trading signal. Whether
implementing a fixed fractional, Kelly Criterion, or a
volatility-adjusted position sizing method, Python provides
the tools to encode these complex mathematical models
into actionable trading logic.

Stop-loss and take-profit mechanisms are critical in defining


the exit points for trades. The former limits losses on
adverse trades, while the latter secures profits when price
targets are met. Python, with its control structures and
ability to interface with trading platforms via API, is well-
suited to automating these protective features.
Drawdown measures the decline from a portfolio's peak to
its trough and is an important metric in monitoring
performance degradation. Python's data analytics prowess
allows traders to monitor drawdown in real-time and to
implement strategies that reduce exposure or cease trading
when certain thresholds are crossed.
Monte Carlo simulations, used to assess the impact of risk
and uncertainty in prediction and forecasting models, can
be an invaluable part of the risk management toolkit.
Python's computational libraries enable the simulation of
thousands of trading scenarios based on historical data to
evaluate the strategy's robustness under varied market
conditions.

Risk-reward ratios help in gauging the potential reward of a


trade against its risk. Python can automate the calculation
of risk-reward metrics to inform trade execution decisions,
ensuring that only trades with favorable ratios are entered.

Algorithmic trading strategies also need to account for the


psychological endurance of the trader or investment team.
Leveraging Python’s machine learning capabilities, it is
possible to model and predict the behavioral impacts of
drawdowns and volatility on decision-making processes,
thus aligning trading intensity with psychological resilience.

Money management is not a static component of an


algorithmic strategy. Using optimization techniques, Python
can fine-tune money management parameters to maximize
the strategy's performance. Techniques such as genetic
algorithms can be deployed to iteratively adjust position
sizes and risk thresholds in alignment with changing market
dynamics.
In an environment of constant change, adaptive risk
management remains key. Python's ability to process real-
time data feeds allows for the dynamic adjustment of risk
parameters in response to market volatility spikes or news
events that impact asset prices. This adaptability is crucial
for strategies aiming to weather turbulent market periods.

The essence of integrating risk and money management


features into an algorithmic trading strategy lies in the
ability to maintain control over the trade lifecycle. Through
Python’s computational and analytical strength, we can
instill a disciplined approach to managing the uncertainties
of the market. The next section will build upon these risk
management foundations, diving into the specifics of trade
execution and order types within the algorithmic framework.

Execution and Order Types

An order type is the instruction a trader gives to a broker,


detailing how to enter or exit the market. The most basic
are market orders, executed at the current market price,
and limit orders, which are set to execute at a specified
price or better. Python's versatility allows traders to
construct sophisticated order execution algorithms that can
respond dynamically to changing market conditions.

Market orders are the most immediate method of entering


or exiting the market, used when the speed of execution is
paramount. While Python scripts can't control the market
price, they can be coded to trigger these orders based on
time-based or event-based conditions.
Limit orders are designed to buy or sell at a specific price,
offering better control over the price of execution. Stop
orders, on the other hand, are intended to limit losses by
setting a sell order once a certain price level is hit. Python
can be used to calculate these price points dynamically,
factoring in volatility measurements and predictive models.

Conditional orders combine several order types based on a


set of criteria. For example, a stop-limit order places a limit
order once a certain stop price is hit. Python's logical
operators and conditional statements enable the
programming of these complex order types to act according
to a predefined trading logic.

Beyond these standard order types, algorithmic trading can


utilize specialized orders like iceberg or TWAP (Time-
Weighted Average Price) orders. Iceberg orders conceal the
actual order quantity by breaking it into smaller lots,
disguising the trader's intentions. TWAP orders aim to
minimize market impact by executing smaller orders at
regular intervals over a specified time frame. Python’s
looping and timing functions are well-suited for
implementing such algorithmic order types.

Python's interaction with brokerage API means that it can


send order requests directly to the market. Libraries like
`ccxt` for cryptocurrency markets or `ib_insync` for
interactive brokers provide an interface for handling order
execution. With these tools, Python can place orders in
milliseconds, a critical advantage in fast-moving markets.

It is crucial to backtest strategies with the order types they


will use live. This ensures that the strategy accounts for
slippage—the difference between the expected and the
actual execution price—and market impact. Python’s
backtesting libraries can simulate these factors, giving a
more accurate picture of strategy performance.

Smart order routing (SOR) systems use algorithms to choose


the best path for an order across different trading venues.
Python can be used to write SOR algorithms that consider
factors like execution price, speed, and the likelihood of
order fill to optimize trade execution.

A crucial consideration is the market impact of large orders.


Traders can mitigate this by breaking up large orders and
using algorithms to determine the most opportune moments
to execute, reducing the price movement caused by the
trades. Python's ability to analyze high-frequency data
streams makes it an ideal tool for developing these
strategies.

When developing order execution algorithms, it is important


to simulate a range of market conditions, including low
liquidity or high volatility periods. Python, with its rich
ecosystem for simulation, including libraries such as
`pandas` and `numpy`, allows traders to stress-test their
execution algorithms against historical market shocks or
hypothetical scenarios.

Adept orchestration of order types is fundamental to the


success of algorithmic trading strategies. In Python, we
have a potent tool for not just defining the logic of when to
trade, but the strategy of how to trade—refining both the
timing and the manner of market entry and exit. In the
following section, we pivot from the theory of order types to
their real-world applications, focusing on the regulatory
landscape that governs them—an ever-present backdrop to
the symphony of algorithmic trading.
1.4 REGULATORY AND
ETHICAL
CONSIDERATIONS
Algorithmic trading, by its nature, falls under intense
regulatory scrutiny. This scrutiny ensures fairness and
transparency in markets, protecting against abusive
practices like market manipulation. In the US, regulatory
bodies such as the Securities and Exchange Commission
(SEC) and the Commodity Futures Trading Commission
(CFTC) have established guidelines that must be adhered to.
In Europe, the Markets in Financial Instruments Directive
(MiFID II) provides a regulatory framework for investment
services across the European Economic Area.

Traders must understand the implications of these


regulations on their trading activities. Python can be utilized
to implement compliance checks into trading algorithms.
For instance, to adhere to regulations like the National Best
Bid and Offer (NBBO), traders can use Python to develop
algorithms that verify trade orders against current market
quotes to ensure they are within compliance.

Ethical considerations in algorithmic trading go beyond legal


compliance. They encompass the responsibility of algorithm
designers to prevent unintended consequences. For
example, an algorithm designed to execute trades quickly
could inadvertently cause flash crashes if not carefully
monitored and controlled. Python's capabilities in data
analysis and machine learning can be leveraged to simulate
potential scenarios where an algorithm might behave
erratically and to establish safety mechanisms.

With great power comes great responsibility, and in the case


of algorithms, this means transparency and accountability.
While proprietary trading algorithms are closely guarded
secrets, the ethical use of such algorithms requires a level
of transparency that allows for auditability. Python’s
modularity and documentation practices enable developers
to build in clear, auditable trails within their code to
facilitate this process.

Algorithms can be programmed to execute trades at speeds


and volumes beyond human capabilities. This raises
concerns about market integrity and the concept of a level
playing field. Ethical algorithmic trading prioritizes the
health and fairness of the financial markets over individual
gain. Python developers can incorporate checks within
algorithms to prevent practices like quote stuffing or
spoofing, which can distort market realities and
disadvantage other market participants.

Algorithmic traders often rely on vast amounts of data,


some of which may be sensitive. Python programmers must
ensure that data privacy laws, such as the General Data
Protection Regulation (GDPR), are respected. Secure coding
practices, encryption, and data anonymization techniques
within Python frameworks are essential to protecting client
data and preventing unauthorized access.

The culture surrounding algorithmic trading should be one of


ethical consciousness. This culture can be fostered through
education, where Python serves as both the medium and
Random documents with unrelated
content Scribd suggests to you:
L'accident joue au quatorzième siècle un rôle plus grand qu'à
n'importe quelle autre époque. C'est le moment où la vie moderne
commence et où l'éclat superficiel d'une nouvelle civilisation vient
modifier la société du sommet à la base. La confiance est plus
grande; on se fortifie moins bien chez soi, le château crénelé se
transforme en villa ou en hôtel, pendant que la hutte se change en
maison. On prend plus de mesures qu'autrefois pour empêcher les
méfaits; mais les accidents sont nombreux qui viennent détruire ce
commencement de sécurité. Au fond, la société n'est ni calme ni
bien assise, et beaucoup de ses membres sont encore à moitié
sauvages. On peut prendre à la lettre le terme «à moitié», c'est-à-
dire que, si on faisait une liste des qualités de tel individu, on
trouverait que la première partie appartient à un monde très civilisé,
et la deuxième à un monde très barbare. De là ces contrastes: d'un
côté, l'ordre, qu'il y aurait peut-être injustice à ne pas considérer
comme l'état normal; et, de l'autre, les fréquents soubresauts de
l'élément indompté. C'est ainsi, par exemple, qu'on peut voir un
seigneur et les siens attendant, au coin d'une route, une caravane
de marchands. Le texte même de la pétition des victimes donne tous
les détails de la rencontre [83].
La scène se passe en 1342. Des marchands de Lichfield exposent à
«lur seigneur le counte de Arundel» qu'un certain vendredi ils
envoyèrent deux domestiques et deux chevaux chargés «de
especerie et mercerie», valant quarante livres, à Stafford, pour le
marché du lendemain. Quand leurs gens «vinrent dessout le boys
del Canoke», ils rencontrèrent «sire Robert de Rideware, chivaler»,
qui les attendait en compagnie de deux valets de sa suite et qui se
saisit des domestiques, des chevaux et du butin pour emmener le
tout au prieuré de Lappeley. Malheureusement pour lui, pendant le
trajet, un des domestiques s'échappa. Au prieuré, la bande trouve
«sire Johan de Oddyngesles, Esmon de Oddyngesles et pluseurs
autres, auxi bien chivalers come autres gentz». On voit que c'était
un coup monté et soigneusement organisé; tout se passe suivant les
règles: «entre eux tous départirent les avantditz mercerie e
especerie, chescun de sa porcion solump son estat.» Cela fait, la
compagnie quitte Lappeley et chevauche jusqu'au prieuré de
Blythebury, occupé par des nonnes. Le chevalier Robert déclare à
l'abbaye qu'ils sont gens du roi «moud travaillés» et demande
l'hospitalité comme cela se faisait couramment. Mais la troupe,
paraît-il, avait mauvaise apparence; l'abbesse refuse. Les chevaliers,
voyant ce fâcheux accueil, enfoncent la porte des fenières, donnent
«feyn et aveignes» à leurs chevaux et passent ainsi la nuit.
Mais ils n'étaient pas seuls à bien occuper leur temps. Le domestique
échappé les avait suivis de loin et, quand il les vit installés au
prieuré, il revint en toute hâte à Lichfield avertir le bailli, qui ne tarda
pas à réunir sa troupe et à courir à la poursuite des voleurs. Ceux-ci,
gens d'épée, dès qu'ils furent rejoints, «se tournèrent à défense», et
un vrai combat s'engagea, dans lequel ils eurent d'abord le dessus et
«naffrèrent» plusieurs de leurs ennemis. A la fin cependant ils
perdent pied et s'enfuient; on leur prend toutes les épices et quatre
de leur compagnie, qui sont décapités sur place immédiatement.
Robert de Rideware n'était pas au nombre des victimes et n'était pas
découragé. Il rencontre, pendant que le bailli regagnait Lichfield, son
parent Gautier de Rideware, seigneur de Helmstale-Rideware, avec
des gens de sa suite; tous ensemble tournent bride et se mettent à
la poursuite du bailli: nouvelle bataille; cette fois, l'officier du roi a le
dessous et s'enfuit, pendant que les seigneurs lui reprennent
définitivement les épices.
Quelle ressource restait-il aux malheureux Guillaume et Richard,
auteurs de la pétition? S'adresser à la justice? C'est ce qu'ils
voulurent faire. Mais, comme ils se rendaient pour cela à Stafford,
capitale du comté, ils trouvèrent, aux portes de la ville, des «genz de
la maintenance» de leurs persécuteurs qui leur barrèrent le passage,
les attaquèrent même et si vivement qu'ils eurent grand'peine à
échapper «saunz grevure». Ils rentrent à Lichfield, surveillés par
leurs ennemis, et mènent une existence digne de pitié. «E sire, les
avant ditz William e Richard e plusours gentz de la ville de Lichfield
sount menacé desditz larons e lour meintenours, qu'ils n'osent null
part aler hors de ladite ville.»
Ce document juridique, dont l'original existe encore, est, on le voit,
passablement caractéristique, et l'on peut juger que ces seigneurs et
leurs aides n'étaient pas sans ressemblance avec ceux des Promessi
sposi et leurs terribles bravi. Ici, presque tout est à noter: le sang-
froid et la détermination des chevaliers, que la mort de quatre
d'entre eux ne déconcerte pas; l'attaque à la faveur d'un bois; le
choix des victimes: des valets de riches marchands; la demande de
l'hospitalité dans un prieuré sous prétexte qu'on voyage pour le
service du roi; la justice expéditive du bailli et la surveillance
obstinée à laquelle les démarches des victimes sont soumises par
leurs tyrans.
Ces faits ne sont pas uniques, et Robert de Rideware n'était pas seul
à faire le guet dans les taillis au bord des routes. Beaucoup d'autres
seigneurs étaient entourés connue lui d'hommes dévoués et prêts
pour toutes les entreprises. On leur donnait des capes et des livrées
aux couleurs du maître, qui permettaient de les reconnaître
aisément; un lord bien entouré de ses partisans se considérait
comme au-dessus du droit commun, et la justice n'avait pas beau
jeu à vouloir se faire respecter de lui. La coutume d'avoir à soi
quantité de serviteurs déterminés portant vos couleurs devint
universelle à la fin du règne d'Édouard III et sous Richard II; elle
subsista, malgré les statuts [84], pendant tout le quinzième siècle, et
contribua grandement à rendre les guerres seigneuriales de cette
époque acharnées et sanglantes.
Mais, même en dehors des périodes de guerre civile, les méfaits
commis par certains barons et leurs fidèles ou même simplement par
leurs fidèles agissant pour leur propre compte sous couvert de la
cape aux couleurs du lord, étaient parfois si fréquents et si graves
qu'on eût pu dans beaucoup de comtés se croire en guerre. Les
considérants d'un statut de la deuxième année de Richard II [85] font
de ces désordres un tableau un peu exagéré peut-être pour mieux
justifier les mesures de rigueur, mais dont le fond doit être vrai: on y
voit (et le roi l'a appris à la fois par les pétitions formelles adressées
au parlement et par la rumeur publique) que certaines gens dans
plusieurs parties du royaume prétendent avoir droit à «diverses
terres, tenementz et autres possessions, et aucuns espiants dames
et damoiselles nient mariez, et aucuns desirantz à faire maintenance
en lour marchees, se coillent ensemble à grant nombre des gentz
armez et archiers à fier de guerre, et soi entrelient par serment, et
par autre confederacie». Ces gens-là, n'ayant aucune «consideration
à Dieu, ne as loys de Seintz Eglise, ne de la terre ne à droit, ne à
justice, einz refusantz et entrelessants tout procès de ley, chivachent
en grantz routes en plusours parties d'Engleterre, et preignent
possession et se mettent einz en diverses manoirs, terres et autres
possessions, de lour propre auctoritée, et les tiegnent longement à
tiel force, y feisants mou des maners d'apparaillementz de guerre et
en aucuns lieux ravissent dames et damoiselles et les enmesnent en
estraunge paiis où lour plest; et en aucuns lieux en tieux routes
gisent en agaite et batent, mahaiment et mordrent et tuont les genz
pur lour femmes et biens avoir, et celles femmes et biens reteignont
à lour propre oeps; et à la foitz preignent à force les liges le roi en
lour propre maisons et les amesnent et detiegnent come prisoners,
et au darrien les mettont à fyn et à raunceone come ceo fuis en
terre de guerre; et à la foitz viegnent devant justices en lour
sessions, a tielle guise ove grant force, paront les justices sont
moeltz esbaiez ou ne sont hardiz de faire la ley; et plusours autres
riotes et horribles malx faitz y font; paront le roialme en diverses
parties est mys en grant troboill à grant meschef et anientissement
de povre poeple [86]...» Au Bon Parlement, en 1376, les communes
avaient déjà fait des plaintes semblables: «Item supplie la commune
qe come ore de novel grande riote si comence par pluseurs gentz en
diverses parties d'Engleterre, qe chivachent ove grand nombre des
gentz armez,» etc. [87]...
A côté de ces bandes organisées et quasi seigneuriales, il y avait les
voleurs ordinaires, contre lesquels Édouard Ier avait pris en 1285 des
mesures spéciales dans son statut de Winchester. Il est constaté
dans cet acte que les malfaiteurs ont coutume de se «tapir» dans les
fossés, taillis ou buissons du voisinage des routes, surtout de celles
qui relient deux villes marchandes. C'est qu'en effet c'était le lieu de
passage de victimes faciles et richement chargées. Aussi le roi
ordonne-t-il que le bord des grands chemins sera défriché à une
distance de deux cents pieds de chaque côté, de façon qu'il n'y reste
ni taillis, ni buisson, ni creux, ni fosse qui puisse servir à abriter des
malfaiteurs. On pourra seulement laisser subsister les gros arbres
tels que les chênes. C'est au propriétaire du sol à faire ces travaux;
s'il les néglige, il sera responsable des vols et des meurtres et payera
amende au roi. Si la route traverse un parc, même obligation pour le
seigneur, à moins qu'il ne consente à le clore par un mur ou par une
haie si épaisse ou par un fossé si large et si profond que les voleurs
ne puissent le franchir ou y trouver un abri avant ou après leurs
attaques.
Mais, à mesure qu'on avance dans le quatorzième siècle, on trouve
que ces larrons vulgaires ont découvert un meilleur emploi de leurs
énergies sans changer tout à fait d'état. Ils s'allient, tantôt
secrétement et tantôt ouvertement, aux bandes seigneuriales et ne
sont plus désormais gens sans aveu pour qui personne ne peut
répondre. C'est ce dont se plaignent encore les communes: «Item
prie ladite commune qe come notoriment soit conuz par touz les
countées d'Engleterre qe robeours, larons et autres meffesours, à
pée et à chival, vont et chivachent à grant route par tote la terre en
diverses lieus, et font larcines et roberies; qe plaise à nostre
seigneur le roi charger les grantz de la terre que nul tiel soit
meyntenuz par eux, en privé n'en apert; mes qu'ils soient en eaide
de arester et prendre tiels malveyses [88].» Au précédent parlement,
les mêmes plaintes avaient été faites, et le roi avait déjà promis qu'il
ordonnerait «tiel remedie qe [serrait] pleisaunt à Dieu et à
homme [89].»
Tous ces malfaiteurs, sans compter l'appui des grands, avaient de
beaux privilèges. On en rencontrait quelquefois qui suivaient les
routes, une croix à la main: à ceux-là il était défendu de toucher de
par le roi et sainte Église; c'étaient des gens qui avaient forjuré le
royaume. Quand un voleur, un meurtrier, un félon quelconque se
sentait serré de trop près, il se jetait dans une église et se trouvait
en sûreté. L'église était un lieu sacré, et quiconque en avait franchi
le seuil était couvert par la protection de Dieu. En tirer les gens était
un sacrilège qui emportait excommunication. Nicolas le Porter avait
aidé à arracher de l'église des Carmes de Newcastle des laïques qui
s'y étaient réfugiés «pro vitæ suæ securitate», et qui, une fois livrés
à l'autorité civile, avaient été exécutés. Il lui fallut, pour obtenir son
pardon, employer l'intermédiaire du nonce du pape et se soumettre
à une pénitence publique bien contraire aux coutumes d'aujourd'hui:
«Nous ordonnons, écrit l'évêque Richard au curé de Saint-Nicolas de
Durham, que les lundi, mardi et mercredi de la semaine de la
Pentecôte qui vient, il aille recevoir, en chemise, nu-tête et nu-pieds,
devant le portail de votre église, en présence de la foule du peuple,
le fouet de vos mains publiquement [90]. Il y proclamera lui-même, en
anglais, le motif de sa pénitence et avouera sa faute, et quand il
aura reçu ainsi le fouet, ledit Nicolas se rendra à l'église cathédrale
de Durham, nu-tête, nu-pieds et vêtu comme dessus; il marchera
devant, vous le suivrez, et vous le fustigerez de même devant la
porte de la cathédrale, ces trois mêmes jours, et il y recommencera
les déclarations que j'ai dites» (Ap. 16).
Pour les voleurs, ce droit d'asile était précieux. Ils s'échappaient de
prison, couraient à l'église et avaient la vie sauve: «En cele an (18
Éd. II), disent les Croniques de London [91], X personnes eschaperent
hors de Neugate, des queux V furent remenez e IIIJ eschaperent à
l'esglise Seint-Sépulcre et un à l'esglise Seint-Bride et après, touz
forsjurerent Engleterre.» Mais quand les malheureux étaient guettés
dans l'église par leurs ennemis personnels, leur situation devenait
dangereuse. C'est ce que montrent les statuts du royaume en 1315-
1316. Les auteurs d'une pétition [92] exposent au roi que des gens
armés s'établissent dans le cimetière et jusque dans le sanctuaire
pour surveiller le fugitif, et le gardent si étroitement qu'il ne peut
même pas sortir pour satisfaire à ses besoins naturels. On empêche
la nourriture de lui arriver; si le félon se décide à jurer qu'il quittera
le royaume, ses ennemis le suivent sur la route et, malgré la
protection de la loi, l'en arrachent et le décapitent sans jugement. Le
roi réforme tous ces abus [93] et prescrit l'application des règlements
anciens sur l'abjuration, c'est-à-dire des suivants: «Lorsqu'un voleur,
un homicide ou un malfaiteur quelconque a fui dans une église et
qu'il a reconnu son crime, que le coroner fasse faire l'abjuration
ainsi: le félon sera conduit à la porte de l'église, et un port rapproché
ou non lui sera assigné et un terme fixé pour quitter le royaume.
Tant qu'il sera en route, il tiendra une croix à la main et ne s'écartera
du grand chemin ni à droite ni à gauche, mais le suivra jusqu'à ce
qu'il ait quitté le royaume, et il n'y reviendra pas sans que le roi lui
ait fait grâce [94].»
Le félon jurait en ces termes: «Entends ceci, sire coroner, moi N. j'ai
volé des moutons ou tel autre animal, ou j'ai tué une ou plusieurs
personnes et je suis félon à notre seigneur le roi d'Angleterre. Et
pour avoir commis quantité de méfaits, larcins, etc., dans sa terre,
j'abjure la terre de notre seigneur E. roi d'Angleterre. Et je me
hâterai d'aller à tel port que tu m'as fixé; je ne quitterai pas la
grand'route, et si je le fais, je consens à être pris et traité en voleur
et félon de notre seigneur le roi. Dans tel port, je chercherai
activement passage et n'y resterai que l'espace d'une marée si je
peux trouver passage; et si je ne peux trouver passage pendant ce
délai, j'irai tous les jours dans la mer jusqu'aux genoux, essayant de
traverser, et si je ne peux, au bout de quarante jours, je rentrerai
dans une église comme voleur et félon de notre seigneur le roi. Et
que Dieu m'aide!»
A l'église, les voleurs se trouvaient en compagnie des débiteurs
insolvables. Ceux-ci, avant d'y venir, faisaient des donations
générales de tous leurs biens, et les créanciers qui les citaient en
justice se trouvaient n'avoir aucune prise sur eux. En 1379 [95],
Richard II remédie à cet inconvénient. Pendant cinq semaines, une
fois par semaine, le débiteur sera sommé, par proclamation faite à la
porte du sanctuaire, de comparaître en personne ou par attorney
devant les juges du roi. S'il s'abstient jusqu'au bout, on passera
outre; un jugement sera rendu, et les biens qu'il avait donnés seront
partagés entre ses créanciers.
Ce ne fut encore qu'un remède temporaire. Dans les premières
années du règne suivant, nous trouvons les communes présentant
au roi leurs doléances sur ces mêmes abus: des apprentis quittent
leurs maîtres avec les biens de ceux-ci, des marchands endettés, des
voleurs s'enfuient à Saint-Martin-le-Grand et y vivent tranquillement
de l'argent qu'ils ont dérobé. Ils emploient les loisirs que leur laisse
cette existence paisible à fabriquer patiemment des chartes,
obligations et quittances fausses, imitant les signatures et cachets
des marchands honnêtes de la cité. Quant aux brigands et
meurtriers, ils sont là bien à leur aise pour préparer de nouveaux
crimes; ils sortent de nuit pour les exécuter et rentrent au matin, en
parfaite sécurité, dans leur inviolable repaire. Le roi se borne à
promettre vaguement que «raisonable remedie ent serra fait».
Un clerc qui fuyait dans une église n'était pas obligé de quitter
l'Angleterre; il jurait qu'il était clerc et «jouissait du privilège
ecclésiastique, suivant la louable coutume du royaume» (9 Éd. II,
ch. XV). Mais l'Église, qui accordait à tous venants le bénéfice de
l'asile, se réservait la faculté de l'enlever: «En cele an (14 Éd. II),
une femme qe avoit noun Isabele de Bury tua le clerk de l'esglise de
Toutz Seintz près del mur de Loundres et ele se tint en mesme
l'esglise V jours, taunt que l'esvesque de Loundres maunda sa lettre
qe le esglise ne la voleit saver, par quei ele fut mené hors de l'esglise
à Neugate et le tierze jour après ele fut pendu [96].»
Dans ce temps où les émeutes et les révolutions n'étaient pas rares,
le droit d'asile pouvait servir à tous; aussi c'était bien en vain que
Wyclif protestait et en demandait la suppression. Un évêque, si
sacrée que fût sa personne, pouvait être exposé lui-même à presser
son cheval de l'éperon et à fuir vers une église pour sauver sa tête.
Ce fut le cas pour l'évêque d'Exeter, lorsque Isabelle et son fils
vinrent renverser Édouard II [97]: «Taunt tost, mesme le jour, vint un
sire Wauter de Stapulton, qe fu eveske de Exestre, et l'an devant le
tresorer le roy, chivachant vers son hostel en Eldedeaneslane, à son
manger, et là fut il escrié traitour; et il le voyaunt, chivacha à la fuite
devers l'esglise Seint-Poul et fut là encountré et tost deschivaché et
mené en Chepe et là fut il despouillé et sa teste coupé.»
Sous Richard III, on put voir une reine et un fils de roi refuser de
quitter l'enceinte sacrée de Westminster et garder un temps la vie
sauve grâce à la sainteté du lieu. Sir Thomas More a laissé dans son
histoire de l'usurpateur, la première véritable histoire en langage
national que compte la littérature anglaise, un tableau saisissant du
courage de la veuve d'Édouard IV et de la grande querelle suscitée
par Richard pour arracher de l'abbaye le second enfant du feu roi.
Aux demandes réitérées qui lui étaient faites, la reine répondait: «Où
donc croirais-je mon fils en sûreté, si ce n'est dans ce sanctuaire
qu'aucun tyran n'a été jusqu'ici assez diabolique pour violer?...
Certes il a trouvé un bon subterfuge: ce lieu, qui peut sauvegarder
un voleur, ne pourrait pas protéger un innocent?...» Le subterfuge
de Richard III consistait simplement à faire abolir le droit de
sanctuaire. Dans son discours en faveur de la mesure, qui vise en
particulier les asiles de Saint-Paul et de Westminster, le duc de
Buckingham fait une peinture très vive et, du reste, exacte des
désordres que ce droit de refuge entretenait: «Quel ramassis de
voleurs, dit-il, de meurtriers, de traîtres odieux et perfides ne voit-on
pas dans ces deux asiles en particulier!.. Des femmes y courent avec
l'argenterie de leurs maris et disent qu'elles n'osent pas demeurer
chez elles, de crainte d'être battues. Les larrons y apportent le
produit de leurs vols et vivent avec. Ils y trament de nouveaux
méfaits; ils sortent la nuit, volent, pillent, tuent et rentrent, comme
si ces lieux, non seulement les rendaient quittes pour le mal qu'ils
ont fait, mais leur donnaient licence d'en faire davantage.» Le clergé
ne nie aucun de ces abus; mais il trouve regrettable qu'une atteinte
soit portée à un droit aussi ancien et aussi sacré (Ap. 17).
Pourtant ce privilège subsista et survécut même à l'introduction de la
réforme en Angleterre; il fut toutefois moins respecté à partir de ce
moment. Le chancelier Bacon cite le sanctuaire de Colnham, près
Abingdon, qui fut jugé «insuffisant» pour des traîtres; on y saisit
sans façon, sous Henri VII, plusieurs criminels politiques qui s'y
étaient réfugiés et l'un d'eux fut exécuté [98]. Divers sanctuaires
furent supprimés en 1697; ceux qui restaient disparurent à leur tour
sous Georges Ier, époque à laquelle l'asile de Saint-Pierre à
Westminster fut démoli.
Avec toutes leurs sévérités pénales, la loi et l'usage donnaient
encore aux malfaiteurs d'autres encouragements. Ils recevaient
fréquemment des chartes de pardon; la chancellerie royale les
accordait volontiers parce qu'il fallait payer pour les avoir, et les
communes renouvelaient sans se lasser leurs plaintes contre ces
criants abus. Il est certain que ces chartes se vendaient. Le clerc
Jean Crochille expose au roi en parlement que, pendant qu'il était à
la cour de Rome, il a été mis hors la loi et à son retour emprisonné.
Le chancelier lui a accordé une charte de pardon; mais il est «taunt
enpoveri q'i n'ad de qi pur l'avaunt dit chartre paier [99]».
Les chartes se donnaient ainsi aux innocents pour de l'argent et aux
«communes felonnes et murdrers» de même, ce qui avait deux
résultats: d'abord le nombre des brigands augmentait en raison de
l'impunité; ensuite on n'osait plus poursuivre en justice les criminels
les plus redoutables, de crainte de les voir revenir pardonnés et
prêts à se venger terriblement. Malheureusement, outre le bénéfice
des taxes perçues, il y avait pour le maintien de cet abus l'intérêt
que les seigneurs gardaient à sa continuation. Inséparables de leurs
hommes, ils savaient les défendre en justice comme ceux-ci les
défendaient dans la rue ou sur la route, et le meilleur moyen de
sauver ces bravi des suites de quelque assassinat était de leur
obtenir, de leur acheter une charte de pardon. Les communes ne
l'ignoraient pas et rappelaient au roi que souvent les seigneurs,
protecteurs de scélérats, obtenaient pour eux des chartes en
affirmant qu'ils étaient à l'étranger, occupés à se battre pour le
prince. La charte obtenue, les brigands revenaient et
recommençaient leurs méfaits [100], sans peur d'être inquiétés par
personne. Pour toutes ces causes, le voyageur n'aurait pas été
prudent s'il n'avait pas prévu au départ le cas d'une mauvaise
rencontre et s'il ne s'était pas armé en conséquence. C'était là une
nécessité reconnue, et c'est pour cela que le chancelier de
l'université d'Oxford défendait strictement aux étudiants de porter
des armes, sauf en cas de voyage [101].
On n'était donc guère en sûreté contre les voleurs, et on ne l'était
même pas toujours contre les gens du shériff. A cette époque de
défiance où les rôdeurs étaient si nombreux, il suffisait d'être
étranger au pays, surtout si c'était la nuit, pour que, sur un soupçon,
on fût envoyé à la geôle, comme on le voit par un statut d'Édouard
III [102]. Rien de plus général que les termes de cette loi; le pouvoir
de faire arrêter est presque sans limites: «Item come en l'estatut fait
à Wincestre en temps meisme le roi l'ael [103] soit contenuz qe si nul
estraunge passe par pais de nuyt de qi homme ait suspecion, soit
maintenant arestu et livré au visconte, et demoerge en gard tant q'il
soit duement delivrés; et diverses roberies, homicides et felonies ont
esté faitz einz ces heures par gentz qi sont appelez Roberdsesmen,
Wastours, Draghlacches...» Que quiconque soupçonne un passant
d'appartenir à une de ces bandes, «soit il de jour, soit il de nuyt,» le
fasse arrêter sur-le-champ; on le mènera au constable de la ville
prochaine, qui le gardera en prison et fera enquête en attendant que
le justice vienne. Or, supposez qu'un étranger passe de nuit par la
ville; la garde l'arrête, il se voit déjà en prison «jusqu'à ce que le
justice vienne» et se met à courir au lieu de se laisser prendre: le
statut a prévu le cas [104]: «Si eus ne soeffrent pas estre aresteuz,
seit heu e cri levé sur eus, e ceus qi funt la veille les siwent o tute la
ville ove les visnées viles o heu e cri de vile en vile jesqes taunt q'il
serra pris et livrez au viscunte.» Singulier tableau!... C'est au milieu
de la nuit, l'étranger est un voleur peut-être, peut-être un honnête
homme qui a perdu sa route ne connaissant pas la ville; sa faute est
de n'être pas rentré au couvre-feu; il cherche à tâtons son chemin
dans les ruelles obscures; la garde l'aperçoit et l'interpelle; il fait les
réflexions qu'on imagine, et voilà la huée et le cri qui commencent,
la garde qui court, la ville qui s'éveille, les lumières qui paraissent et,
petit à petit, les plus zélés qui se mettent à sa poursuite. Si la ville
est fortifiée, les poternes sont fermées depuis longtemps, et il sera
sûrement pris. A peine peut-il espérer se jeter dans quelque porte
mal jointe à un tournant de rue et se tenir blotti derrière, écoutant,
la main tremblante, le cœur battant, la garde qui passe lourdement,
au pas de charge, entourée comme d'un nuage de clameurs
furieuses. Le nombre des pas diminue et les clameurs se font moins
entendre, puis vont s'éteignant, perdues dans les profondeurs de la
cité.
Mais si la ville n'est qu'une bourgade non close de murs, le premier
mouvement du fugitif sera de gagner la campagne, et alors, qu'il ne
craigne pas les marais, les fossés, les haies; qu'il sache, à un pli de
terrain, quitter la grand'route et profiter d'un endroit où l'on aura
mal appliqué le statut de Winchester. Sans cela il est perdu; la garde
le suit, la ville le suit, la huée continue, et au prochain village la
scène du départ va recommencer. Les habitants, avertis par la
clameur, allument déjà leurs lanternes, et les voilà eux aussi en
chasse. Avant le bout de la grand'rue, quelque paysan plus alerte se
trouvera prêt au passage pour barrer la route. Tous y ont intérêt,
tous ont été volés, ou leurs parents ou leurs amis; quelqu'un des
leurs a été blessé, assassiné sur la route comme il revenait du
marché. Tout le monde a entendu parler de mésaventures pareilles
et se sent menacé personnellement. De là ce zèle à se mettre en
chasse au bruit de la huée et la conviction que, pour courir si fort et
faire courir tant de monde, le fugitif doit être un brigand redoutable
qu'attend le gibet [105].

DEUXIÈME PARTIE
LA VIE NOMADE

«Qui ne s'adventure n'a cheval ni


mule, ce
dist Salomon.—Qui trop s'adventure
perd cheval
et mule, respondit Malcon.»

L'aspect et l'état habituel des routes anglaises étant connus, il faut


prendre à part les principaux types de la classe errante et voir quel
genre de vie menait le nomade et quelle sorte d'importance il avait
dans la société ou dans l'État.
Les nomades appartenant à la vie civile étaient, en premier lieu, les
marchands de drogues, les bouffons, les jongleurs, les musiciens et
les chanteurs ambulants, puis, dans un ordre plus important au point
de vue social, les outlaws, les larrons de toute sorte et les ouvriers
errants.—A la vie ecclésiastique appartenaient les prêcheurs, les
frères mendiants et ces étranges marchands d'indulgences qu'on
appelait pardonneurs.—Enfin il y avait les pèlerins, dans les rangs
desquels, comme dans le livre de Chaucer, clercs et laïques allaient
confondus.
Certains de ces individus, les frères notamment, avaient, il est vrai,
un point d'attache; mais leur existence s'écoulait en majeure partie
sur les routes; ils n'avaient pas de but fixe et quêtaient à l'aventure;
ils avaient pris à la longue les mœurs et le parler des véritables
nomades et, dans l'opinion commune, ils se confondaient le plus
souvent avec ceux-ci: c'est à cette famille d'êtres qu'ils se rattachent.
Quant à la race étrange que nous voyons, aujourd'hui encore, errer
de pays en pays et qui, la dernière, représentera parmi nous la caste
des errants, elle n'avait pas encore fait son apparition dans le monde
britannique et nous n'avons pas à nous en occuper. Bohémiens ou
gipsies demeurent jusqu'au quinzième siècle entièrement inconnus
en Angleterre.
CHAPITRE I
HERBIERS, CHARLATANS, MÉNESTRELS ,
CHANTEURS ET BOUFFONS

Le guérisseur ambulant.—L'herbier de Rutebeuf.—


Les charlatans et les médecins en Angleterre.—Le
saltimbanque de Ben Jonson.—Le charlatan
d'aujourd'hui.
Les jongleurs et les ménestrels.—Leur popularité.—
En quoi consistent leurs chants.—Leur rôle dans
les fêtes seigneuriales et dans les festins.—Les
troupes au service du roi.—Les troupes au service
des nobles.—Les instruments de musique.
La concurrence.—La guild des ménestrels et son
monopole.—Les faux ménestrels.—Rôle des
ménestrels dans les mouvements populaires, leurs
doctrines libérales.—Le noble tolère ces doctrines;
le peuple se les assimile.
Causes de la disparition des ménestrels.—L'invention
de l'imprimerie.—Le perfectionnement de l'art
théâtral.
Les bouffons et les faiseurs de tours.—Grossièreté
de leurs jeux.—Ils s'associent aux ménestrels.—La
réprobation publique les atteint les uns et les
autres à la Renaissance.

Les plus populaires de tous les errants étaient naturellement les plus
gais ou ceux qui passaient pour les plus bienfaisants. Ceux-ci étaient
les gens à panacée universelle, très nombreux au moyen âge; ils
couraient le monde vendant la santé. Les jours de chômage ils
s'établissaient sur la place des villages, étendaient à terre un tapis
ou un morceau d'étoffe, étalaient leurs drogues et commençaient à
haranguer le peuple. On peut entendre encore aujourd'hui des
discours pareils à ceux qu'ils tenaient, au quatorzième siècle, en
Angleterre, en France, en Italie; leur profession est une de celles qui
ont le moins changé. Au treizième siècle, l'herbier de Rutebeuf
parlait comme le saltimbanque de Ben Jonson au seizième siècle,
comme le charlatan qui attirait hier, à cent pas de nos portes, la
foule à ses tréteaux. Grandes paroles, récits merveilleux, éloge de
leurs origines nobles, lointaines, énumération des guérisons
extraordinaires qu'ils ont faites, étalage d'un dévouement sans
bornes au bien public, d'un complet désintéressement pécuniaire, on
retrouve cela et on le retrouvera à jamais dans les discours de tous
ces nomades insinuants.
«Belles gens, disait, il y a six cents ans, le marchand d'herbes
médicinales de Rutebeuf, je ne suis pas de ces pauvres prêcheurs ni
de ces pauvres herbiers qui vont par devant ces moutiers, avec leurs
pauvres chappes mal cousues, qui portent boites et sachets et
étendent un tapis.... Sachez que de ceux-là ne suis-je pas, mais suis
à une dame, qui a nom madame Trote de Salerne, qui fait couvre-
chef de ses oreilles, et les sourcils lui pendent à chaînes d'argent
par-dessus les épaules; et sachez que c'est la plus sage dame qui
soit dans les quatre parties du monde. Ma dame nous envoie en
diverses terres et en divers pays, en Pouille, en Calabre.... en
Bourgogne, en la forêt des Ardennes pour occire les bêtes sauvages
et en traire les bons oignements, pour donner médecines à ceux qui
ont des maladies au corps.... Et pour ce qu'elle me fit jurer sur les
saints quand je me départis d'elle, je vous apprendrai à guérir du
mal des vers si vous voulez ouïr. Voulez-vous ouïr?
«.... Ôtez vos chaperons, tendez les oreilles, regardez mes herbes
que ma dame envoie en ce pays et en cette terre; et pour ce qu'elle
veut que les pauvres y puissent aussi bien avenir comme les riches,
elle me dit que j'en fisse denrée (que je les vendisse par portions
d'un denier), car tel a un denier en sa bourse qui n'y a pas cinq
livres; et elle me dit et me commanda que je prisse un denier de la
monnaie qui courrait dans le pays et la contrée où je viendrais....
«Ces herbes, vous ne les mangerez pas; car il n'est si fort bœuf en
ce pays ni si fort destrier qui, s'il en avait aussi gros qu'un pois sur la
langue, ne mourût de male mort, tant sont fortes et amères.... Vous
les mettrez trois jours dormir en bon vin blanc; si vous n'avez blanc,
prenez vermeil; si vous n'avez vermeil, prenez de la belle eau claire,
car tel a un puits devant son huis qui n'a pas un tonneau de vin en
son cellier. Si vous en déjeûnez par treize matins.... vous serez
guéris des diverses maladies... Car si mon père et ma mère étaient
en péril de mort et ils me demandaient la meilleure herbe que je leur
pusse donner, je leur donnerais celle-là.
«En telle manière vends-je mes herbes et mes oignements: qui
voudra en prenne; qui n'en voudra les laisse [106].»
Cet herbier était de ceux qu'en France et en Angleterre les
ordonnances royales poursuivaient pour exercice illégal de la
médecine. Philippe le Bel, en 1311, Jean le Bon, en 1352, avaient
rendu contre eux des arrêts sévères. Ils leur reprochaient «d'ignorer
le tempérament des hommes, le temps et la manière convenables
pour opérer, les vertus des médecines, surtout des médecines
laxatives, en lesquelles gît péril de mort». Ces gens-là, «venus
souvent de l'étranger,» parcouraient la ville et les faubourgs et se
permettaient d'administrer aux malades trop confiants «clisteria
multum laxativa et alia eis illicita [107]», ce dont l'autorité royale était
justement indignée.
En Angleterre, les vendeurs de drogues ambulants n'avaient pas
meilleure réputation; les chants et les satires populaires nous les
montrent toujours frayant dans les tavernes avec la pire société.
Pour se faire une idée de ce que pouvaient être leurs recettes, il faut
se rappeler ce qu'était la médecine protégée par les statuts du
royaume. Il faut se dire que Jean de Gaddesden, médecin de la cour
É
sous Édouard II, faisait disparaître les traces de la petite vérole en
enveloppant le malade dans des draps rouges; il avait traité ainsi
l'héritier même du trône. Il avait été longtemps embarrassé pour
guérir la pierre: «A la fin, dit-il dans sa Rosa Anglica, je pensai à
faire recueillir une bonne quantité de ces scarabées qu'on trouve en
été dans la fiente des bœufs, et de ces cigales qui chantent aux
champs: je coupai les têtes et les ailes des cigales et les mis avec les
scarabées et de l'huile ordinaire dans un pot; je le couvris et le
laissai ensuite, pendant un jour et une nuit, dans un four à pain. Je
retirai le pot et le chauffai à un feu modéré; je broyai le tout et
frottai enfin les parties malades; en trois jours la douleur avait
disparu;» sous l'influence des scarabées et des cigales, la pierre
s'était brisée en morceaux. C'est presque toujours ainsi, par une
illumination subite, que ce médecin découvre ses remèdes les plus
efficaces; madame Trote de Salerne ne confiait pas à ses agents
dans les diverses parties du monde le secret de recettes plus
merveilleuses et plus inattendues (Ap. 18).
N'importe, entre un médecin de cour et un charlatan de carrefour, la
loi distinguait fort nettement. Un Gaddesden avait, pour appliquer
aux patients ses médicaments étranges, l'appui d'une renommée
établie et il offrait la garantie de sa haute situation. Il avait étudié à
Oxford et il faisait autorité; un médecin sérieux comme le docteur de
Chaucer, qui s'était tant enrichi pendant la peste, ne négligeait pas
de lire et de méditer ses écrits. Sans avoir moins de science ni
surtout d'ingéniosité, l'herbier errant était moins avantageusement
connu; il ne pouvait pas, comme le médecin du roi, s'autoriser de sa
bonne réputation pour faire avaler des vers luisants à ses malades,
les frotter de scarabées et de cigales, leur donner en remède «sept
têtes de chauves-souris grasses [108]»; le législateur se précautionnait
en conséquence. A la campagne, de même que la plupart des autres
nomades, le guérisseur sans brevet trouvait moyen presque toujours
d'échapper à la rigueur des statuts; mais malheur à lui s'il se
hasardait à tenter publiquement des cures en ville! Pour avoir voulu
guérir une femme en lui faisant porter sur la poitrine un certain
parchemin, le malheureux Roger Clerk se vit poursuivre en 1381
pour pratique illégale de la médecine dans Londres. Il fut mené au
pilori, «par la ville au son des instruments», à cheval sur un cheval
sans selle, son parchemin au cou; de plus, aussi au cou, un vase de
nuit et une pierre à aiguiser, en signe qu'il avait menti; un autre vase
de nuit lui pendait dans le dos [109].
Inquiet de la recrudescence de ces abus, Henri V rendit, en 1421,
une Ordinance encontre les entremettours de fisik et de surgerie,
«pur ouster meschieves et perils qi longement ont continuez dedeinz
le roialme entre les gentz parmi ceux q'ont usez l'arte et le practik de
fisik et surgerie, pretendantz soi bien et sufficeaument apris de
mesmes les arts, où de vérité n'ont pas estez». Désormais il y aura
des châtiments sévères pour tous les médecins qui n'auront pas été
approuvés en leur art, «c'est assavoir, ceux de fisik en les
universitées, et les surgeons entre les mestres de cell arte [110]». Les
désordres se renouvellent comme avant, ou peu s'en faut; pour
donner plus d'autorité à la médecine reconnue par l'État, Édouard IV,
la première année de son règne, constitue en corporation la société
des barbiers de Londres.
La Renaissance arrive et trouve les barbiers, les charlatans, les
empiriques, les sorciers, continuant de prospérer sur le sol
britannique. Henri VIII le constate avec regret et promulgue de
nouveaux règlements: «La science et l'art de la médecine et de la
chirurgie, dit le roi dans son statut, à la parfaite connaissance
desquels sont nécessaires à la fois de profondes études et une mûre
expérience, sont journellement appliqués dans ce royaume par une
multitude d'ignorants. Beaucoup d'entre eux n'ont aucune notion de
ces sciences, ni connaissances d'aucune sorte; il en est même qui ne
savent pas lire: si bien qu'on voit des artisans ordinaires, des
forgerons, des tisserands, des femmes, entreprendre avec audace et
constamment des cures importantes et des choses de grande
difficulté. A l'accomplissement de quoi ils usent, partie de sortilèges
et incantations, partie de remèdes si impropres que les maladies
augmentent: au grand déplaisir de Dieu....» En conséquence, toute
personne qui voudra pratiquer la médecine dans Londres ou à six
milles à la ronde devra auparavant subir un examen devant l'évêque
de la capitale, ou devant le doyen de Saint-Paul, assisté de quatre
«doctours of phisyk». En province l'examen aura lieu devant
l'évêque du diocèse ou son vicaire général. En 1540, le même prince
fusionne la corporation des barbiers et la société des chirurgiens, et
accorde chaque année à la nouvelle association les cadavres de
quatre criminels pour étudier sur eux l'anatomie.
A peine tous ces privilèges étaient-ils concédés, qu'un revirement
complet se fait dans l'esprit des législateurs, et qui s'avise-t-on de
regretter? précisément ces anciens guérisseurs non brevetés, ces
possesseurs de secrets infaillibles, ces empiriques de village si
durement traités dans le statut de 1511. Une nouvelle ordonnance
est rendue, qui n'est qu'un long réquisitoire contre les médecins
autorisés: ces docteurs certifiés empoisonnent leurs clients tout
aussi bien que les anciens charlatans, seulement ils prennent plus
cher. «Préoccupés de leurs propres gains, et nullement du bien des
malades, ils ont poursuivi, troublé et harcelé diverses honnêtes
personnes, hommes et femmes, à qui Dieu avait accordé l'intuition
de la nature et des effets de certaines herbes, racines et eaux....
lesquelles personnes cependant ne prennent rien en récompense de
leur savoir et de leur habileté, mais administrent les remèdes aux
pauvres en bons voisins, pour l'amour de Dieu, par pitié et charité.
On sait de reste, au contraire, que les médecins certifiés ne veulent
guérir personne s'ils ne sont assurés d'une rémunération plus élevée
que la cure ne mérite; car s'ils consentaient à traiter pour rien les
malades, on ne verrait pas un si grand nombre de ceux-ci pourrir et
languir jusqu'à la mort, comme on voit chaque jour, faute des
secours de la médecine.» D'ailleurs, malgré les examens de l'évêque
de Londres, «la plupart des personnes de cette profession ont bien
peu de savoir»; c'est pourquoi tous les sujets du roi ayant, «par
spéculation ou pratique», connaissance des vertus des plantes,
racines et eaux, pourront, comme auparavant, nonobstant les édits
contraires, guérir au moyen d'emplâtres, cataplasmes et onguents
toutes les maladies apparentes à la surface du corps, cela «dans
tout le royaume d'Angleterre ou dans toute autre des possessions du
roi [111]».
Le changement, comme on voit, était radical: les secrets des
villageoises n'étaient plus des secrets de sorcières, c'étaient des
recettes précieuses dont elles avaient reçu de Dieu l'intuition; les
pauvres, exposés à mourir sans médecin, se réjouirent; les
charlatans respirèrent. Ben Jonson, ce marcheur intrépide qui, parti
de Londres, un bâton à la main, alla à pied par plaisir jusqu'en
Écosse, qui connaissait si bien les habitués des fêtes anglaises, nous
a laissé le vivant portrait d'un charlatan, portrait qui est spécialement
celui d'un Vénitien du dix-septième siècle, mais qui demeure vrai
encore aujourd'hui et le sera, pour tous les pays, dans tous les
temps. Les caractères de cette sorte sont presque immuables; le
héros de Jonson est le même individu que celui dont Rutebeuf, trois
siècles et demi plus tôt, avait relevé les discours. Sûrement, dans ses
visites à Smithfield en temps de foire, le dramaturge avait entendu
maint empirique s'écrier, la voix émue, les yeux au ciel: «Ah! santé!
santé! la bénédiction du riche! la richesse du pauvre! qui peut
t'acheter trop cher, puisqu'il n'est sans toi de plaisir en ce monde?»
Sur quoi l'orateur de Jonson raille ses collègues, vante sa panacée
incomparable, dans laquelle entre un peu de graisse humaine, qui
vaut mille couronnes, mais qu'il laissera pour huit couronnes, non,
pour six, enfin pour six pence. Mille couronnes, c'est ce que lui ont
payé les cardinaux Montalto et Farnèse et le grand-duc de Toscane
son ami; mais il méprise l'argent, et pour le peuple il fait des
sacrifices. Il a également un peu de la poudre qui a rendu Vénus
belle et Hélène aussi; un de ses amis, grand voyageur, lui en a
envoyé, qu'il a trouvée dans les ruines de Troie. Cet ami en a
expédié encore un peu à la cour de France, mais cette partie était
mélangée, et les dames qui s'en servent n'en obtiennent pas d'aussi
bons effets [112].
Trois ans plus tard, un Anglais qui ne connaissait pas la comédie de
Jonson, se trouvant à Venise, s'émerveillait des discours des
saltimbanques italiens et, croyant donner à ses compatriotes des
détails nouveaux sur cette race plus florissante dans la péninsule
qu'en aucun pays d'Europe, traçait d'après nature un portrait tout
semblable à celui qu'avait dessiné l'ami de Shakespeare. «Souvent,
écrit Coryat, j'ai vraiment admiré ces orateurs improvisés; ils
débitent leurs contes avec une si merveilleuse volubilité, une grâce si
agréable, même quand ils parlent ex tempore, avec un
assaisonnement si varié de rares plaisanteries et de traits piquants,
qu'ils remplissent de surprise l'étranger inaccoutumé à leurs
harangues.» Ils vendent des «huiles, des eaux souveraines, des
ballades amoureuses imprimées, des drogues et un monde d'autres
menus objets.... J'en ai vu un tenir une vipère à la main et jouer un
quart d'heure de suite avec son aiguillon sans être piqué.... Il nous
donna à croire que cette même vipère descendait généalogiquement
de la famille du reptile qui sauta du feu sur la main de saint Paul,
dans l'île de Melita, aujourd'hui appelée Malte [113].»
Sans doute la faconde, la volubilité, la conviction momentanée, la
grâce, le ton insinuant, la gaieté légère, ailée, du charlatan
méridional ne se retrouvaient pas aussi complets, aussi charmants
dans les fêtes de la vieille Angleterre. Ces fêtes étaient joyeuses
pourtant, elles étaient fort suivies, et l'on y rencontrait maint
personnage rusé, railleur et amusant comme Autolycus, ce type du
colporteur, coureur de fêtes paysannes, à qui Shakespeare a fait une
place dans la galerie de ses immortels. Les travailleurs de la
campagne allaient en foule à ces réunions essuyer des lazzi qui leur
faisaient plaisir et acheter des onguents qui leur feraient du bien: on
peut les y voir encore. A l'heure présente, chez nous, et en
Angleterre aussi, la foule continue de s'attrouper devant les
marchands de remèdes qui guérissent infailliblement les maux de
dents et effacent quelques autres douleurs de moindre importance.
Les certificats abondent autour de la boutique; il semble que tous les
gens illustres qui soient au monde aient déjà bénéficié de la
découverte; au reste s'adresse maintenant le vendeur. Il gesticule, il
s'anime, se penche en avant, a le ton grave et la voix forte. Les
paysans se pressent autour, la bouche béante, l'œil inquiet,
incertains si l'on doit rire ou s'il faut avoir peur, et finissant par
prendre confiance. Ils tirent leur bourse d'un air gauche; leur large
main s'embarrasse dans leur habit neuf; ils tendent leur pièce et
reçoivent la médecine, et leur œil qui brille et leur physionomie
indécise disent assez que la malice et le sens pratique habituel font
ici défaut, que ces âmes fort rusées, invincibles dans leur domaine
propre, sont les victimes de tous, en pays inconnu. Le vendeur
s'agite, et, aujourd'hui comme autrefois, triomphe de l'indécision au
moyen d'interpellations directes.
En Angleterre, c'est à l'incomparable foire de l'oie, à Nottingham,
qu'il faut de préférence aller chercher ces spectacles. Ils brillent là
dans toute leur infinie variété: on y pourra constater que les
charlatans d'aujourd'hui n'ont pas perdu grand'chose de leur verve
héréditaire; on y reconnaîtra que le peuple anglais n'est pas toujours
maussade et soucieux; car dans ce jour de folie et d'inconcevable
liberté on verra en action, éclairée il est vrai d'une lumière bien
différente, cette grande kermesse de Rubens qui est au Louvre.
Plus grande encore était, au moyen âge, la popularité des nomades
qui venaient non pas guérir, mais simplement égayer la foule, et qui
apportaient avec eux, sinon les remèdes aux maladies, du moins
l'oubli des maux: c'étaient les ménestrels, les faiseurs de tours, les
jongleurs et les chanteurs. Ménestrels et jongleurs, sous des noms
différents, exerçaient la même profession, c'est-à-dire qu'ils
psalmodiaient des romans et des chansons en s'accompagnant de
leurs instruments (Ap. 19). Dans un temps où les livres étaient rares
et où le théâtre proprement dit n'existait pas, la poésie et la musique
voyageaient avec eux par les grands chemins; de tels hôtes étaient
toujours les bienvenus. On trouvait ces nomades dans toutes les
fêtes, dans tous les festins, partout où l'on devait se réjouir; on leur
demandait, comme on faisait au vin ou à la bière, d'endormir les
soucis et de donner la joie et l'oubli. Ils s'y prenaient de plusieurs
manières; la plus recommandable consistait à chanter et à réciter,
les uns en français, d'autres en anglais, les exploits des anciens
héros.
Ce rôle était noble et tenu en grande révérence; les jongleurs ou
ménestrels qui se présentaient au château, la tête pleine d'histoires
belliqueuses ou de contes d'amour ou de prestes chansons où il n'y
avait qu'à rire, étaient reçus avec la dernière faveur. A leur arrivée ils
s'annonçaient du dehors par des airs gais qui s'entendaient du fond
des salles; bientôt venait l'ordre de les introduire; on les alignait
dans le fond du hall et l'on prêtait l'oreille (Ap. 20). Ils préludaient
sur leurs instruments et bientôt commençaient à psalmodier. Comme
Taillefer à la bataille d'Hastings, ils disaient les prouesses de
Charlemagne et de Roland, ou bien ils parlaient d'Arthur ou des
héros de la guerre de Troie, aïeux incontestés des Bretons
d'Angleterre (Ap. 21). Au quatorzième siècle, tous ces anciens
romans héroïques, rudes, puissants ou touchants, avaient été
remaniés et rajeunis; on y avait ajouté des descriptions fleuries, des
aventures compliquées, des merveilles extraordinaires; beaucoup
avaient été mis en prose et, au lieu de les chanter, on les lisait [114].
Le seigneur écoutait avec complaisance, et son goût qui se blasait
de plus en plus lui faisait trouver du charme aux enchevêtrements
bizarres dont chaque événement était désormais enveloppé. Il vivait
maintenant d'une vie plus complexe qu'autrefois; étant plus civilisé,
il avait plus de besoins, et les peintures simples et tout d'une pièce
de poèmes comme la chanson de Roland n'étaient plus faites pour
flatter son imagination. Les héros de romans se virent imposer des
tâches de plus en plus difficiles et durent triompher des
enchantements les plus merveilleux. En outre, comme la main
devenait moins lourde, on les peignit avec plus de raffinement, on se
complut dans leurs aventures amoureuses et on leur donna, autant
qu'on put, ce charme à la fois mystique et sensuel dont les images
sculptées du quatorzième siècle ont gardé une marque si prononcée.
L'auteur de Sir Gawayne met une complaisance extrême à décrire les
visites que son chevalier reçoit [115], à peindre sa dame si douce, si
jolie, aux mouvements souples, au gai sourire; il y emploie tout son
soin, toute son âme, il trouve des mots qui semblent des caresses,
et tels de ses vers brillent d'une lueur dorée comme celle de parfums
qui se consument.
Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.

More than just a book-buying platform, we strive to be a bridge


connecting you with timeless cultural and intellectual values. With an
elegant, user-friendly interface and a smart search system, you can
quickly find the books that best suit your interests. Additionally,
our special promotions and home delivery services help you save time
and fully enjoy the joy of reading.

Join us on a journey of knowledge exploration, passion nurturing, and


personal growth every day!

ebookbell.com

You might also like