Download as pdf or txt
Download as pdf or txt
You are on page 1of 54

Python Fundamentals for Finance: A

survey of Algorithmic Options trading


with Python Van Der Post
Visit to download the full and correct content document:
https://ebookmass.com/product/python-fundamentals-for-finance-a-survey-of-algorith
mic-options-trading-with-python-van-der-post/
More products digital (pdf, epub, mobi) instant
download maybe you interests ...

Power Trader: Options Trading with Python Van Der Post

https://ebookmass.com/product/power-trader-options-trading-with-
python-van-der-post/

Financial Architect: Algorithmic Trading with Python: A


comprehensive Guide for 2024 Van Der Post

https://ebookmass.com/product/financial-architect-algorithmic-
trading-with-python-a-comprehensive-guide-for-2024-van-der-post/

Algorithmic Essentials: Trading with Python: Your


Comprehenive Guide for 2024 Van Der Post

https://ebookmass.com/product/algorithmic-essentials-trading-
with-python-your-comprehenive-guide-for-2024-van-der-post/

Market Master: Trading with Python Van Der Post

https://ebookmass.com/product/market-master-trading-with-python-
van-der-post/
Financial Analyst: A Comprehensive Applied Guide to
Quantitative Finance in 2024: A Holistic Guide to:
Python for Finance, Algorithmic Options Trading, Black
Scholes, Stochastic Calculus & More Van Der Post
https://ebookmass.com/product/financial-analyst-a-comprehensive-
applied-guide-to-quantitative-finance-in-2024-a-holistic-guide-
to-python-for-finance-algorithmic-options-trading-black-scholes-
stochastic-calculus-more-van-de/

Health Analytics with Python: A Comprehensive Guide for


2024 Van Der Post

https://ebookmass.com/product/health-analytics-with-python-a-
comprehensive-guide-for-2024-van-der-post/

The Python Advantage: Python for excel in 2024 Hayden


Van Der Post

https://ebookmass.com/product/the-python-advantage-python-for-
excel-in-2024-hayden-van-der-post/

Data Universe: Organizational Insights with Python:


Embracing Data Driven Decision Making Van Der Post

https://ebookmass.com/product/data-universe-organizational-
insights-with-python-embracing-data-driven-decision-making-van-
der-post/

Python for Finance: A Crash Course Modern Guide: Learn


Python Fast Bisette

https://ebookmass.com/product/python-for-finance-a-crash-course-
modern-guide-learn-python-fast-bisette/
PYTHON
F U N D A M E N TA L S F O R
FINANCE

Hayden Van Der Post

Reactive Publishing
CONTENTS

Title Page
Chapter 1: Introduction to Options in Finance
Chapter 2: Python Programming Fundamentals for Finance
Chapter 3: Python-based Market Data Analysis
Chapter 4: Enforcing Black Scholes in Python
Chapter 5: Advanced Concepts in Trading and Python
Additional Resources
How to install python
Python Libraries for Finance
Key Python Programming Concepts
How to write a Python Program
Financial Analysis with Python
Trend Analysis
Horizontal and Vertical Analysis
Ratio Analysis
Cash Flow Analysis
Scenario and Sensitivity Analysis
Capital Budgeting
Break-even Analysis
Creating a Data Visualization Product in Finance
Data Visualization Guide
Algorithmic Trading Summary Guide
Financial Mathematics
Black-Scholes Model
The Greeks Formulas
Stochastic Calculus For Finance
Brownian Motion (Wiener Process)
Itô's Lemma
Stochastic Differential Equations (SDEs)
Geometric Brownian Motion (GBM)
Martingales
CHAPTER 1:
INTRODUCTION TO
OPTIONS IN FINANCE
In the extensive array of financial markets, options trading is an art form
that offers a wide range of opportunities for both experienced traders and
beginners. At its essence, options trading involves buying or selling the
right to purchase or sell an asset at a predetermined price within a specific
timeframe. This intricate financial instrument comes in two main forms:
call options and put options.

A call option grants the owner the ability to buy an asset at a set price
before the option expires, while a put option gives the owner the right to
sell the asset at the strike price. The allure of options lies in their flexibility,
as they can be used for conservative or speculative purposes based on one's
appetite for risk. Investors can use options to safeguard their portfolio
against market declines, while traders can leverage them to take advantage
of market predictions. Options also serve as a powerful tool for generating
income through strategies like writing covered calls or creating complex
spreads that benefit from an asset's volatility or time decay.

The pricing of options involves various factors, such as the current price of
the underlying asset, the strike price, the time until expiration, volatility,
and the risk-free interest rate. The interaction of these elements determines
the option's premium, which is the price paid to acquire the option.

To navigate the options market successfully, traders must familiarize


themselves with its distinctive terminology and metrics. Terms like "in the
money," "out of the money," and "at the money" express the relationship
between the asset's price and the strike price. Meanwhile, "open interest"
and "volume" indicate the level of trading activity and liquidity in the
market.

Additionally, the risk and return profile of options is asymmetrical. Buyers


can only lose the premium paid, but their profit potential can be substantial,
especially for call options if the underlying asset's price rises significantly.
However, sellers of options face greater risk, as they receive the premium
upfront but can suffer substantial losses if the market goes against them.

Understanding the multitude of factors influencing options trading is akin to


mastering a complex strategic game. It requires a combination of theoretical
knowledge, practical skills, and an analytical mindset. As we delve deeper
into the mechanics of options trading, we will examine these components
closely, providing a solid foundation for the strategies and analyses to
come.

In the following sections, we will delve into the complexities of call and put
options, shed light on the vital significance of options pricing, and introduce
the renowned Black Scholes Model—a mathematical guide that helps
traders navigate through market uncertainties. Our journey will be based on
empirical evidence, rooted in the powerful libraries of Python, and enriched
with examples that bring the concepts to life. At each step, readers will not
only gain knowledge but also acquire practical tools to apply these theories
in real-world trading.

Understanding Call and Put Options: The Foundations of Options Trading

As we embark on the exploration of call and put options, we find ourselves


at the core of options trading. These two fundamental instruments serve as
the building blocks upon which options strategies are constructed.

A call option can be compared to holding a key to a treasure chest, with a


predetermined time to decide whether to unlock it. If the treasure (the
underlying asset) increases in value, the holder of the key (the call option)
stands to profit by exercising the right to buy at a previously agreed price,
selling it at the higher current price, and enjoying the resulting gain.
However, if the expected appreciation fails to materialize before the option
expires, the key becomes worthless, and the holder's loss is limited to the
amount paid for the option, known as the premium.

```python
# Calculating Call Option Profit
return max(stock_price - strike_price, 0) - premium

# Example values
stock_price = 110 # Current stock price
strike_price = 100 # Strike price of the call option
premium = 5 # Premium paid for the call option

# Calculate profit
profit = call_option_profit(stock_price, strike_price, premium)
print(f"The profit from the call option is: ${profit}")
```

Contrastingly, a put option is similar to an insurance policy. It grants the


policyholder the freedom to sell the underlying asset at the strike price,
protecting against a decline in the asset's value. If the market price drops
below the strike price, the put option gains value, enabling the holder to sell
the asset at a price higher than the prevailing market rate. However, if the
asset maintains or increases its value, the put option, akin to an unnecessary
insurance policy, expires—resulting in a loss equal to the premium paid for
this protection.

```python
# Calculating Put Option Profit
return max(strike_price - stock_price, 0) - premium

# Example values
stock_price = 90 # Current stock price
strike_price = 100 # Strike price of the put option
premium = 5 # Premium paid for the put option

# Calculate profit
profit = put_option_profit(stock_price, strike_price, premium)
print(f"The profit from the put option is: ${profit}")
```

The intrinsic value of a call option is determined by the extent to which the
stock price exceeds the strike price. Conversely, the intrinsic value of a put
option is determined by how much the strike price surpasses the stock price.
In both cases, if the option is "in the money," it holds intrinsic value. If not,
its value is purely extrinsic, representing the probability that it may become
profitable before it expires.

The premium itself is not a random number but is carefully calculated using
models that consider the asset's current price, the option's strike price, the
time remaining until expiration, the asset's expected volatility, and the
prevailing risk-free interest rate. These calculations can be easily
implemented in Python, offering a hands-on approach to comprehend the
dynamics of option pricing.

As we progress, we will break down these pricing models and learn how the
Greeks—dynamic measures of an option's sensitivity to various market
factors—can guide our trading choices. Through these concepts, traders can
develop strategies that range from simple to extremely intricate, always
keeping risk management and profit-seeking in mind.

Delving deeper into options trading, we will explore the strategic


applications of these instruments and the ways in which they can be used to
achieve various investment objectives. With Python as our analytical ally,
we will unravel the enigmas of options and illuminate the path to becoming
skilled traders in this captivating domain. The model takes into account
various factors, including the current stock price, the strike price of the
option, the time to expiration, the risk-free interest rate, and the volatility of
the stock. By inputting these variables into the Black Scholes formula,
traders can calculate the fair market value of an option.

The Black Scholes Model is based on several assumptions, including the


efficient market hypothesis, constant volatility, and continuous trading.
While these assumptions may not hold true in real-world scenarios, the
model still provides a valuable framework for understanding options
pricing.

One key concept of the Black Scholes Model is the idea of delta, which
measures the sensitivity of the option price to changes in the price of the
underlying asset. Delta can help traders gauge the likelihood of an option
expiring in-the-money or out-of-the-money.

The model also takes into account the concept of implied volatility, which is
derived from the market price of an option. Implied volatility reflects the
market's expectation of future price movements and can provide insights
into investor sentiment.

Overall, the Black Scholes Model revolutionized options pricing, enabling


traders to make more informed decisions and better understand the risks and
opportunities associated with options trading. While the model has its
limitations, it remains a fundamental tool in the world of finance.

In conclusion, options pricing plays a vital role in options trading, serving


as a guide for traders and providing insights into the future of underlying
assets. The Black Scholes Model is a key framework for valuing options,
allowing traders to determine the fair value of an option and make informed
decisions. Understanding options pricing and the factors that influence it is
essential for success in the world of finance and trading. The Black Scholes
Model is based on the assumption of a liquid market where the option and
its underlying asset can be continuously traded. It assumes that the prices of
the underlying asset follow a geometric Brownian motion, characterized by
constant volatility and a normal distribution of returns. This stochastic
process forms the basis of the model's probabilistic approach to pricing.

```python
import numpy as np
from scipy.stats import norm

# S: current stock price


# K: strike price of the option
# T: time to expiration in years
# r: risk-free interest rate
# sigma: volatility of the underlying asset

# Calculate d1 and d2 parameters


d1 = (np.log(S / K) + (r + 0.5 * sigma**2) * T) / (sigma * np.sqrt(T))
d2 = d1 - sigma * np.sqrt(T)

# Calculate the price of the European call option


call_price = (S * norm.cdf(d1)) - (K * np.exp(-r * T) * norm.cdf(d2))
return call_price

# Example values for a European call option


current_stock_price = 50
strike_price = 55
time_to_expiration = 0.5 # 6 months
risk_free_rate = 0.01 # 1%
volatility = 0.25 # 25%

# Calculate the European call option price


european_call_price = black_scholes_european_call(current_stock_price,
strike_price, time_to_expiration, risk_free_rate, volatility)
print(f"The European call option price is: ${european_call_price:.2f}")
```
The Black Scholes equation utilizes a risk-neutral valuation method, which
implies that the expected return of the underlying asset is not a direct factor
in the pricing formula. Instead, the risk-free rate becomes the crucial
variable, suggesting that the expected return on the asset should align with
the risk-free rate when adjusted for risk through hedging.

Within the essence of the Black Scholes Model, we discover the 'Greeks,'
which are sensitivities related to derivatives of the model. These consist of
Delta, Gamma, Theta, Vega, and Rho. Each Greek elucidates how different
financial variables impact the option's price, providing traders with
profound insights into risk management.

The Black Scholes formula is elegantly straightforward, yet its implications


are profound. It has facilitated the development of the options market by
establishing a common language for market participants. The model has
become a cornerstone of financial education, an indispensable tool in the
trader's arsenal, and a benchmark for new pricing models that relax some of
its restrictive assumptions. The significance of the Black Scholes Model
cannot be overstated. It serves as the catalyst that transforms the raw data of
the market into valuable knowledge.

As we embark on this journey of exploration, let us embrace the Black


Scholes Model as more than a mere equation—it is a testament to human
ingenuity and a guiding light in the intricate realm of financial markets.

Harnessing the Potential of the Greeks: Navigating the Waters of Options


Trading

In the voyage of options trading, comprehending the Greeks is comparable


to a captain mastering the winds and currents. These mathematical
indicators are named after the Greek letters Delta, Gamma, Theta, Vega,
and Rho, and each plays a pivotal role in navigating the volatile waters of
the markets. They offer traders profound insights into how various factors
influence the prices of options and, consequently, their trading strategies.

Delta (\(\Delta\)) acts as the helm of the options ship, indicating the
expected movement in the price of an option for every one-point change in
the underlying asset's price. A Delta approaching 1 indicates a strong
correlation between the option's price and the stock's movements, while a
Delta close to 0 suggests little sensitivity to the stock's fluctuations. In
addition to guiding traders in hedging, Delta is also useful in assessing the
likelihood of an option ending up in-the-money. To calculate Delta for a
European Call Option using the Black-Scholes Model, we can use the
following formula:

d1 = (log(S / K) + (r + sigma**2 / 2) * T) / (sigma * sqrt(T))


delta = norm.cdf(d1)
return delta

Applying the calculate_delta function with the parameters from the


previous example will give us the Delta of the European call option, which
is: {call_option_delta:.2f}

Gamma (\(\Gamma\)) provides insight into the curvature of an option's


price trajectory by charting the rate of change in Delta. A high Gamma
indicates that Delta is highly sensitive to changes in the underlying asset's
price, implying that the option's price may change rapidly. This information
is valuable for traders who need to adjust their positions to maintain a delta-
neutral portfolio.

Vega (\(\nu\)) measures the impact of volatility on an option's price. Even a


slight change in volatility can lead to significant fluctuations in the option's
price. Vega helps traders understand the risk and potential reward associated
with volatile market conditions by indicating the option's sensitivity to
shifts in the underlying asset's volatility.

Theta (\(\Theta\)) represents the rate at which an option's value erodes as


the expiration date approaches. Theta reminds traders that options are
wasting assets, and their value decreases over time. It is crucial for traders
to stay vigilant as Theta erosion can diminish potential profits.

Rho (\(\rho\)) measures the sensitivity of an option's price to changes in the


risk-free interest rate. While usually less influential than the other Greeks,
Rho becomes more significant during periods of fluctuating interest rates,
especially for long-term options.

These Greeks, both individually and collectively, serve as a sophisticated


navigational system for traders. They offer a dynamic framework to manage
positions, hedge risks, and exploit market inefficiencies. Incorporating these
measures into trading decisions provides a quantitative edge, empowering
those who can skillfully interpret and act on the information the Greeks
provide.

As we explore the role of the Greeks in trading, we will uncover their


interactions with one another and the market as a whole. This will shed
light on complex risk profiles and enable the development of robust trading
strategies. In the upcoming sections, we will delve into the practical
applications of the Greeks, from single options trades to intricate portfolios,
showcasing how they inform decisions and guide actions in the pursuit of
profitability.

Understanding the Greeks is not simply a matter of mastering equations and


calculations; it is about cultivating an intuition for the ebb and flow of
options trading. It involves learning to communicate fluently and
confidently in the language of the markets. Let us continue our journey
armed with the knowledge of the Greeks, prepared to embrace the
challenges and opportunities presented by the options market. Building a
solid foundation: Fundamental Trading Strategies Using Options

When entering the world of options trading, it is crucial to have a collection


of strategies, each with its own advantages and situational benefits.
Foundational trading strategies using options are the fundamental building
blocks upon which more intricate tactics are built. These strategies act as
the bedrock for safeguarding one's investment portfolio and speculating on
future market movements.

In this section, we will delve into a selection of essential options strategies,


clarifying their mechanics and appropriate usage.
The Long Call, a straightforward and optimistic strategy, involves buying a
call option with the expectation that the underlying asset will appreciate
significantly before the option expires. This strategy provides limitless
potential for profit with limited risk—the most one can lose is the premium
paid for the option.

```python
# Calculation of Payoff for Long Call Option
return max(0, S - K) - premium

# Example: Calculating the payoff for a Long Call with a strike price of $50
and a premium of $5
stock_prices = np.arange(30, 70, 1)
payoffs = np.array([long_call_payoff(S, 50, 5) for S in stock_prices])

plt.plot(stock_prices, payoffs)
plt.title('Payoff of Long Call Option')
plt.xlabel('Stock Price at Expiration')
plt.ylabel('Profit / Loss')
plt.grid(True)
plt.show()
```

The Long Put is the mirror image of the Long Call and is suitable for those
anticipating a decline in the price of the underlying asset. By buying a put
option, one gains the right to sell the asset at a predetermined strike price,
potentially profiting from a market downturn. The maximum loss is limited
to the premium paid, while the potential profit can be substantial but
restricted to the strike price minus the premium and the underlying asset's
value falling to zero.

Covered Calls provide a method to generate income from an existing stock


position. By selling call options against already owned stock, one can
collect the option premiums. If the stock price remains below the strike
price, the options expire worthless, enabling the seller to retain the premium
as profit. If the stock price exceeds the strike price, the stock may be called
away, but this strategy is often utilized when a significant rise in the
underlying stock's price is not expected.
```python
# Calculation of Payoff for Covered Call
return S - stock_purchase_price + premium
return K - stock_purchase_price + premium

# Example: Calculating the payoff for a Covered Call


stock_purchase_price = 45
call_strike_price = 50
call_premium = 3

stock_prices = np.arange(30, 70, 1)


payoffs = np.array([covered_call_payoff(S, call_strike_price,
call_premium, stock_purchase_price) for S in stock_prices])

plt.plot(stock_prices, payoffs)
plt.title('Payoff of Covered Call Option')
plt.xlabel('Stock Price at Expiration')
plt.ylabel('Profit / Loss')
plt.grid(True)
plt.show()
```

Protective Puts are used to protect a stock position against a decline in


value. By owning the underlying stock and simultaneously purchasing a put
option, one can set a bottom limit on potential losses without capping the
potential gains. This strategy functions as an insurance policy, ensuring that
even in the worst-case scenario, losses cannot exceed a certain level.
These foundational strategies are merely the tip of the iceberg in options
trading. Each strategy serves as a tool, effective when used wisely and in
the appropriate market context. By understanding the mechanics of these
strategies and their intended purposes, traders can approach the options
market with increased confidence. Furthermore, these strategies act as the
cornerstones for more sophisticated tactics that traders will encounter as
they progress in their journey.

The appeal of options trading lies in its adaptability and the imbalance of
risk and reward it can provide. However, the very characteristics that make
options attractive also require a comprehensive understanding of risk. To
master the art of options trading, one must become skilled at balancing the
potential for profit against the likelihood of loss.

The notion of risk in options trading is multifaceted, varying from the basic
risk of losing the premium on an option to more intricate risks connected to
specific trading strategies. To unravel these risks and potentially capitalize
on them, traders utilize various measurements, commonly known as the
Greeks. While the Greeks aid in managing the risks, there are inherent
uncertainties that every options trader must confront.

One of the primary risks is the time decay of options, known as Theta. As
each day goes by, the time value of an option diminishes, leading to a
decrease in the option's price if all other factors remain constant. This decay
accelerates as the option nears its expiration date, making time a crucial
factor to consider, especially for options buyers.

Volatility, or Vega, is another crucial risk element. It measures an option's


price sensitivity to changes in the volatility of the underlying asset. High
volatility can result in larger swings in option prices, which can be both
advantageous and detrimental depending on the position taken. It's a dual-
sided sword that requires careful thought and management.

Liquidity risk is another factor to consider. Options contracts on less liquid


underlying assets or those with wider bid-ask spreads can be more
challenging to trade without affecting the price. This can lead to difficulties
when entering or exiting positions, potentially resulting in suboptimal trade
executions.

On the other hand, the potential for returns in options trading is also
substantial and can be realized in various market conditions. Directional
strategies, such as the Long Call or Long Put, allow traders to harness their
market outlook with defined risk. Non-directional strategies, such as the
iron condor, aim to profit from minimal price movement in the underlying
asset. These strategies can generate returns even in a stagnant market, as
long as the asset's price remains within a specific range. Beyond individual
tactical risks, the consideration of portfolio-level factors also comes into
play. Utilizing a variety of options strategies can help mitigate risk.

For example, protective puts can safeguard an existing stock portfolio,


while covered calls can enhance returns by generating income. The
interplay between risk and return in options trading is a delicate balance.
The trader must act as both a choreographer and performer, carefully
composing positions while remaining adaptable to market changes.

This section has provided an insight into the dynamics of risk and return
that are central to options trading. As we progress, we will explore
advanced risk management techniques and methods to optimize returns,
always maintaining a careful balance between the two.

A Rich Tapestry of Trade: The Historical Evolution of Options Markets

Tracing the lineage of options markets reveals a captivating tale that


stretches back to ancient times. The origins of modern options trading can
be found in the tulip mania of the 17th century, where options were utilized
to secure the right to buy tulips at a later date. This speculative frenzy laid
the foundation for the contemporary options markets we are familiar with
today.

However, the formalization of options trading occurred much later. It was


not until 1973 that the Chicago Board Options Exchange (CBOE) was
established, marking the first organized exchange to facilitate the trading of
standardized options contracts. The arrival of the CBOE ushered in a new
era for financial markets, creating an environment where traders could
engage in options trading with greater transparency and oversight.

The introduction of the Black-Scholes model coincided with the


establishment of the CBOE, providing a theoretical framework for pricing
options contracts that revolutionized the financial industry. This model
offered a systematic approach to valuing options, taking into account
variables such as the current price of the underlying asset, the strike price,
time to expiration, volatility, and the risk-free interest rate.

```python
# Black-Scholes Formula for European Call Option
from scipy.stats import norm
import math

# S: spot price of the underlying asset


# K: strike price of the option
# T: time to expiration in years
# r: risk-free interest rate
# sigma: volatility of the underlying asset

d1 = (math.log(S / K) + (r + 0.5 * sigma ** 2) * T) / (sigma *


math.sqrt(T))
d2 = d1 - sigma * math.sqrt(T)

call_price = S * norm.cdf(d1) - K * math.exp(-r * T) * norm.cdf(d2)


return call_price

# Example: Calculating the price of a European Call Option


S = 100 # Current price of the underlying asset
K = 100 # Strike price
T = 1 # Time to expiration (1 year)
r = 0.05 # Risk-free interest rate (5%)
sigma = 0.2 # Volatility (20%)

call_option_price = black_scholes_call(S, K, T, r, sigma)


print(f"The Black-Scholes price of the European Call Option is:
${call_option_price:.2f}")
```

Following in the footsteps of the CBOE, other exchanges around the globe
began to emerge, such as the Philadelphia Stock Exchange and the
European Options Exchange, establishing a worldwide framework for
options trading. These exchanges played a crucial role in fostering liquidity
and diversity in the options market, which in turn spurred innovation and
sophistication in trading strategies. The stock market crash of 1987 was a
turning point for the options market. It highlighted the need for robust risk
management practices, as traders turned to options for hedging against
market downturns. This event also emphasized the importance of
understanding the intricacies of options and the variables that impact their
prices. As technology progressed, electronic trading platforms emerged,
allowing access to options markets to become more inclusive. These
platforms facilitated faster transactions, improved pricing, and expanded
reach, enabling retail investors to join institutional traders in participating.

Today, options markets are an essential part of the financial ecosystem,


providing various tools for managing risk, generating income, and engaging
in speculation. The markets have adapted to cater to a diverse group of
participants, ranging from those looking to hedge their positions to those
seeking arbitrage opportunities or speculative gains.

The development of options markets throughout history showcases human


innovation and the pursuit of financial advancements. As we navigate the
ever-changing landscape of the financial world, we should remember the
resilience and adaptability of the markets by drawing lessons from the past.
Traders and programmers armed with the computational power of Python
and the strategic foresight honed over centuries of trading are writing the
next chapter in this story.
The Lexicon of Leverage: Terminology for Options Trading

Entering the world of options trading without a solid grasp of its specialized
vocabulary is like navigating a labyrinth without a map. To trade
effectively, one must be well-versed in the language of options. In this
article, we will decode the essential terms that form the foundation of
options discourse.

**Option**: A financial derivative that grants the holder the right, but not
the obligation, to buy (call option) or sell (put option) an underlying asset at
a predetermined price (strike price) before or on a specified date (expiration
date).

**Call Option**: A contract that gives the buyer the right to purchase the
underlying asset at the strike price within a specific timeframe. The buyer
expects the asset's price to rise.

**Put Option**: On the other hand, a put option grants the buyer the right
to sell the asset at the strike price within a set period. This is typically used
when the buyer anticipates a decline in the asset's price.

**Strike Price (Exercise Price)**: The pre-determined price at which the


option buyer can execute the purchase (call) or sale (put) of the underlying
asset.

**Expiration Date**: The date on which the option contract expires. After
this point, the option cannot be exercised and ceases to exist.

**Premium**: The price paid by the buyer to the seller (writer) of the
option.

This fee is paid for the rights granted by the option, regardless of whether
the option is exercised. Mastering this vocabulary is an essential step for
any aspiring options trader. Each term encapsulates a specific concept that
helps traders analyze opportunities and risks in the options market. By
combining these definitions with mathematical models used in pricing and
risk assessment, traders can develop precise strategies, leveraging the
powerful computational capabilities of Python to unravel the intricacies
inherent in each term.

In the following sections, we will continue to build on these fundamental


terms, incorporating them into broader strategies and analyses that make
options trading a potent and nuanced domain of the financial world.

Navigating the Maze: The Regulatory Framework of Options Trading

In the realm of finance, regulation serves as the guardian, ensuring fair play
and preserving market integrity. Options trading, with its complex strategies
and potential for significant leverage, operates within a network of
regulations that are essential to understand for compliance and successful
participation in the markets.

In the United States, the Securities and Exchange Commission (SEC) and
the Commodity Futures Trading Commission (CFTC) hold the position of
primary regulators for options market oversight. The SEC regulates options
traded on stocks and index assets, while the CFTC oversees options dealing
with commodities and futures. Other jurisdictions have their own regulatory
bodies, such as the Financial Conduct Authority (FCA) in the United
Kingdom, which enforce their own distinct sets of rules.

Options are primarily traded on regulated exchanges, such as the Chicago


Board Options Exchange (CBOE) and the International Securities
Exchange (ISE), which are also overseen by regulatory agencies. These
exchanges provide a platform for standardizing options contracts,
improving liquidity, and establishing transparent pricing mechanisms.

The OCC acts as both the issuer and guarantor of option contracts, adding a
layer of security by ensuring contractual obligations are met. The OCC's
role is vital in maintaining trust in the options market, as it mitigates
counterparty risk and allows for confident trading between buyers and
sellers.

FINRA, a non-governmental organization, regulates brokerage firms and


exchange markets, playing a crucial role in protecting investors and
ensuring fairness in the U.S. capital markets. Traders and firms must adhere
to a strict set of rules that govern trading activities, including proper
registrations, reporting requirements, audits, and transparency. Key rules
such as 'Know Your Customer' (KYC) and 'Anti-Money Laundering'
(AML) are essential in preventing financial fraud and verifying client
identities.

Options trading carries significant risk, and regulatory bodies require


brokers and platforms to provide comprehensive risk disclosures to
investors. These disclosures inform traders about potential losses and the
complexity of options trading.

```python
# Example of a Regulatory Compliance Checklist for Options Trading

# Create a simple function to check compliance for options trading


def check_compliance(trading_firm):
compliance_status = {
}

if not trading_firm['provides_risk_disclosures_to_clients']:
print(f"Compliance issue: {requirement} is not met.")

print("All compliance requirements are met.")


return True

trading_firm = {
'provides_risk_disclosures_to_clients': True
}

# Check if the trading firm meets all compliance requirements


compliance_check = check_compliance(trading_firm)
This code snippet demonstrates a hypothetical, simplified compliance
checklist that could be part of an automated system. It's important to
acknowledge that regulatory compliance is complex and ever-changing,
often requiring specialized legal expertise. Understanding the regulatory
framework goes beyond simply following the laws; it involves recognizing
the safeguards these regulations provide in preserving market integrity and
protecting individual traders.

As we delve deeper into the mechanics of options trading, it is crucial to


keep these regulations in mind, as they guide the development and
execution of trading strategies. Looking ahead, the interaction between
regulatory frameworks and trading strategies will become more apparent as
we explore how compliance is integrated into our trading methodologies.
CHAPTER 2: PYTHON
PROGRAMMING
FUNDAMENTALS FOR
FINANCE
A well-configured Python environment is fundamental for efficient
financial analysis using Python. Setting up this foundation ensures that the
necessary tools and libraries for options trading are readily available.

The initial step entails the installation of Python itself. The most up-to-date
rendition of Python can be acquired from the official Python website or
through package managers such as Homebrew for macOS and apt for
Linux. It is crucial to ensure that Python is correctly installed by executing
the 'python --version' command in the terminal.

An integrated development environment (IDE) is a software suite that


consolidates the necessary tools for software development. For Python,
well-known IDEs include PyCharm, Visual Studio Code, and Jupyter
Notebooks. Each offers distinct features, such as code completion,
debugging tools, and project management. The choice of IDE often depends
on personal preferences and project-specific requirements.

Virtual environments in Python are enclosed systems that allow the


installation of project-specific packages and dependencies without affecting
the global Python installation. Tools like venv and virtualenv aid in
managing these environments. They are particularly significant when
simultaneously working on multiple projects with different requirements.
Packages enhance the functionality of Python and are indispensable for
options trading analysis. Package managers like pip are used to install and
manage these packages. For financial applications, notable packages
include numpy for numerical computing, pandas for data manipulation,
matplotlib and seaborn for data visualization, and scipy for scientific
computing.

```python
# Illustration of setting up a virtual environment and installing packages

# Import necessary module


import subprocess

# Establish a new virtual environment named 'trading_env'


subprocess.run(["python", "-m", "venv", "trading_env"])

# Activate the virtual environment


# Note: Activation commands vary depending on the operating system
subprocess.run(["trading_env\\Scripts\\activate.bat"])
subprocess.run(["source", "trading_env/bin/activate"])

# Install packages using pip


subprocess.run(["pip", "install", "numpy", "pandas", "matplotlib",
"seaborn", "scipy"])

print("Python environment setup accomplished with all requisite packages


installed.")
```

This script showcases the creation of a virtual environment and the


installation of vital packages for options trading analysis. This automated
setup guarantees an isolated and consistent trading environment, which is
particularly advantageous for collaborative projects. With the Python
environment now established, we are ready to delve into the very lexicon
and constructs that make Python an influential tool in financial analysis.

Exploring the Lexicon: Fundamental Python Syntax and Operations

As we embark on our journey through Python's diverse landscape, it


becomes imperative to grasp its syntax—the rules that govern the structure
of the language—alongside the fundamental operations that underpin
Python's capabilities. Python's syntax is renowned for its readability and
simplicity. Code blocks are delineated by indentation rather than braces,
promoting a neat layout.

- Variables: In Python, variables do not require explicit declaration to


reserve memory space. The assignment operator "=" is used to assign
values to variables.
- Arithmetic Operations: Python supports basic arithmetic operations such
as addition (+), subtraction (-), multiplication (*), and division (/). The
modulus operator (%) returns the remainder of a division, while the
exponent operator (**) is used for power calculations.
- Logical Operations: Logical operators in Python include 'and', 'or', and
'not'. These operators are essential for controlling program flow with
conditional statements.
- Comparison Operations: Comparison operations in Python include equal
(==), not equal (!=), greater than (>), less than (<), greater than or equal to
(>=), and less than or equal to (<=).
- Conditional Statements: In Python, conditional statements like 'if', 'elif',
and 'else' control the execution of code based on boolean conditions.
- Loops: Python provides 'for' and 'while' loops to facilitate the execution of
a block of code multiple times. 'for' loops are often used with the 'range()'
function, while 'while' loops continue as long as a condition remains true.
- Lists: Lists in Python are ordered, mutable collections that can hold
various object types.
- Tuples: Python tuples are similar to lists but are immutable. Python
dictionaries are key-value pairs that are unordered, changeable, and
indexed.

Python sets are unordered collections of unique elements.

# Example showcasing fundamental Python syntax and operations

# Variables and arithmetic operations


num1 = 10
num2 = 5
sum_result = num1 + num2
difference_result = num1 - num2
product_result = num1 * num2
quotient_result = num1 / num2

# Logical and comparison operations


is_num_equal = (num1 == num2)
is_num_not_equal = (num1 != num2)
is_num_greater_than = (num1 > num2)

# Control structures
if is_num_greater_than:
print("num1 is greater than num2")
else:
print("num1 is not greater than num2")

if num1 < num2:


print("num1 is less than num2")
else:
print("num1 is not less than num2")

if is_num_equal:
print("num1 and num2 are equal")

# Loops
for i in range(5): # Iterates from 0 to 4
print(i)

counter = 5
while counter > 0:
print(counter)
counter -= 1

# Data structures
list_example = [1, 2, 3, 4, 5]
tuple_example = (1, 2, 3, 4, 5)
dict_example = {'one': 1, 'two': 2, 'three': 3}
set_example = {1, 2, 3, 4, 5}

print(sum_result, difference_result, product_result, quotient_result,


is_num_equal, is_num_not_equal, is_num_greater_than)
print(list_example, tuple_example, dict_example, set_example)

This code snippet demonstrates the basic syntax and operations of Python,
providing insights into the language's structure and use cases. A solid grasp
of these fundamentals enables the manipulation of data, algorithm creation,
and the construction of foundations for more intricate financial models.
Moving forward, we will delve into Python's object-oriented nature, which
empowers us to encapsulate data and functions into manageable, reusable
components. This programming paradigm holds immense value as we
develop adaptable and dynamic financial models and simulations to
navigate the ever-changing landscape of options trading.

Discovering Structures and Paradigms: Python's Object-Oriented


Programming
Within the realm of software development, object-oriented programming
(OOP) emerges as a foundational paradigm that not only structures code but
also conceptualizes it in terms of tangible objects found in the real world.
Python, with its adaptable nature, wholeheartedly embraces OOP,
bestowing developers with the ability to forge modular and scalable
financial applications.

Classes: Classes serve as blueprints in Python, laying the groundwork for


object creation. A class encompasses the data for the object and techniques
to manipulate that data.

Objects: A representation of a particular instance of the idea defined by the


class.

Inheritance: The capability for one class to inherit qualities and techniques
from another, promoting the reuse of code.

Encapsulation: The packaging of data with the techniques that operate on


that data. It confines direct access to certain components of an object, which
is crucial for secure data management.

Polymorphism: The ability to present the same interface for different


underlying forms (data types). A class is defined using the 'class' keyword
followed by the class name and a colon. Inside, techniques are defined as
functions, with the initial parameter traditionally named 'self' to refer to the
instance of the class.

# Establishing a basic class in Python

# A straightforward class to represent an options agreement

self.type = type # Call or Put


self.strike = strike # Strike price
self.expiry = expiry # Expiration date

# Placeholder technique to calculate option premium


# In real applications, this would involve intricate calculations
return "Premium calculation"

# Creating an object
call_option = Option('Call', 100, '2023-12-17')

# Accessing object attributes and techniques


print(call_option.type, call_option.strike, call_option.get_premium())

The above example introduces a simple 'Option' class with a constructor


technique, `__init__`, to initialize the attributes of the object. It also
includes a placeholder technique for determining the premium of the option.
This structure provides the basis upon which we can construct more
advanced models and techniques. In the above code snippet, scikit-learn can
be used to implement machine learning models that can accurately predict
market movements, identify trading signals, and perform other tasks. This
demonstrates the versatility of Python's ecosystem and its ability to assist in
various facets of financial analysis and modeling. These classes serve as
blueprints for objects that encapsulate data and methods specific to a certain
concept or entity. In the realm of financial analysis, custom classes can be
used to represent entities such as portfolios, transactions, or even complex
financial instruments. By leveraging classes, one can create reusable and
modular code that enhances readability and maintainability.

Another crucial aspect of Python's data types and structures is their ability
to handle data manipulation and analysis. Python provides a rich ecosystem
of libraries and packages that specialize in data science and financial
analysis. For instance, the Pandas library excels at manipulating and
analyzing structured data, making it an essential tool for financial analysis
tasks such as data cleaning, transformation, and aggregation. When
combined with libraries like NumPy and Matplotlib, which provide
powerful numerical computing and visualization capabilities, Python
becomes an invaluable tool for financial analysts.

Python's data types and structures, along with its extensive library
ecosystem, form the foundation of robust and efficient financial analysis.
Another random document with
no related content on Scribd:
Next morning, at the first break of day, she sprang up out of bed and
hurried to look at the cushion, but there lay the rosebud a rosebud
still, and not a Princess, as she thought it would be.
Queen Flora was very much disappointed,
particularly as the King laughed at her folly for
believing she had seen a faery, when
suddenly a shaft of golden sunlight shone
through the window right on to the cushion,
and in an instant, instead of the flower there
appeared a beautiful naked baby, who laughed and crowed gaily.
The Queen was nearly mad with joy, and took the baby up in her
arms to show the King, who was equally delighted.
“You see there are faeries after all,” he said to the Queen.
“I always thought so,” replied the Queen.
“Oh, my dear!” said the King, who was quite shocked at such a story.
“Pooh!” answered Queen Flora, tossing the baby up in her arms, and
this ended the conversation.
II.

THE ROSE-PRINCESS IS LOST.

Of course there was great joy when it came to be known that Queen
Flora was the mother of a lovely Princess, and all the bells in the city
were set ringing, while the poor people, for once, had as much food
as they could eat. The ladies of the Queen admired the beautiful
baby very much indeed, and there was no doubt the little Princess
was really a charming child. By the advice of the King, however,
Queen Flora told nobody about the transformation which took place
at sundown, and always put the Princess to bed herself every night.
Then, as the sunlight died out of the western skies, the pretty baby
would change into a delicate white rosebud, and rested on a velvet
cushion beside the Queen’s bed every night. At the first golden ray
of the sun the bud changed to a beautiful Princess once more, and
no one ever knew that she was only a flower transformed for the day
into a human being.
As the years rolled on, the Rose-Princess grew into a tall, slender
girl, with golden hair, blue eyes, and the most beautiful complexion,
white and pink, flushed like a delicate rose. When she walked she
swayed like a graceful lily, and always dressed in a green gown with
a girdle of white roses, which were her favourite flowers.
She also wore a silver circlet on her golden
hair, upon which were fastened diamond
roses and leaves made out of bright green
emeralds, which made her look so beautiful
that all who beheld her fell in love on the spot.
Many princes heard of her beauty and wanted
to marry her, but she did not care for any of
her suitors, which pleased Queen Flora very
much, for she was anxious her Princess
should marry the great-grandson of the exiled
King, and cease to change into a rosebud.
The King made a proclamation that if the descendant of the old
dynasty came to the palace, he would marry his daughter and be
heir to the throne; but no one ever came forward to claim the hand of
the Princess, which showed that the Faery Rosina spoke truly when
she said the exiled Prince knew nothing about his royal blood.
The Princess was christened Rose by the Queen, because she
really was the offspring of the white rose tree, but her complexion
was so delicate, and her love for roses so great, that every one
called her the Rose-Princess instead of the Princess Rose.
Now, on the seventeenth birthday of the Rose-Princess, there was a
mighty revolution in the city of Buss, and a great multitude of men
and women marched to the palace in order to dethrone the King. He
was not a bad King as kings go, but, not knowing how to govern, he
did nothing but amuse himself with balls and fêtes, letting his
courtiers govern as they pleased. As the courtiers were all very
greedy, and wanted money, they put such heavy taxes on the
people, that at last the King’s subjects could stand it no longer, and
while a ball was taking place in the great hall of the palace, in honour
of the Rose-Princess’s birthday, the doors were burst open, and the
mob rushed in. The ball was being given in the day-time, so that the
Rose-Princess could attend, because, of course, she could not
dance when changed into a flower. The music was sounding most
beautifully, the King and Queen sat on their thrones with golden
crowns, and the Rose-Princess was dancing gaily, when the noisy
crowd of ragged men and women rushed into the beautiful palace.
Oh, it was really a terrible scene! All the gaily dressed lords and
ladies were seized by the dirty hands of the people, and stripped of
their beautiful jewels. The great mirrors were all smashed, the lovely
blue hangings torn down and trampled on by the mob, the gorgeous
gardens were all destroyed, and these rioters, breaking into the
King’s wine-cellars, began to drink the fine wine of which he was so
proud.
All the women of the city collected a lot of velvet couches, gorgeous
dresses, and rich curtains into a heap in the garden, and, setting fire
to it, danced about in a ring, singing loudly—
“High to low
Down must go;
Low to high
Now must fly.
All the lords and ladies dead,
Let us eat their costly bread,
While beneath our feet we tread
Every proud and haughty head.”

You may be sure the King and Queen did not wait to face these
terrible people, but, disguising themselves in mean garments, fled
from the palace, leaving all their beautiful things to be destroyed by
the mob, who chose a President, and proclaimed a Republic, then
began to kill all the lords and ladies they could find. The whole nation
seemed to go mad, and there was no law or order anywhere, but
every one did exactly as they pleased, so that the entire kingdom
was brought to the verge of ruin.
And the Rose-Princess?—ah, poor lady! she also fled in dismay from
the terrible people, and sought refuge in her own room. It was still
early in the afternoon, so she could not change into a rose, and thus
escape the fury of the mob; and, as her parents had deserted her,
she stood trembling in her beautiful chamber, thinking she would be
found and torn to pieces. Besides, being ignorant of her nightly
transformation, she was afraid to go to bed, lest she should be killed
while asleep.
As she stood weeping and wringing her hands in despair, she
suddenly saw a tall handsome lady standing before her, looking at
her kindly. This was the Faery Rosina, who had come to save the
Rose-Princess from the people, as it was not her fault that they had
rebelled against the King.
“Do not weep, Rose-Princess,” she said in a kind tone; “though
things seem to be going wrong just now, they will all come right.”
“But my dear parents!” cried the Rose-Princess, weeping.
“They have left the palace,” said the faery in a severe tone, “and will
now endure hardship, to punish them for the way in which they have
neglected their office; but when they have learnt a lesson, they will
come back again.”
“But what will become of me?” cried the Rose-Princess, as the noise
of the mob came nearer and nearer.
“You will be quite safe,” replied the faery; “and the people who are
now crying out to kill you, will soon be cheering you on your
wedding-day, when you are married.”
“Married to whom?” asked the trembling Princess.
“Ah, that you must find out!” answered the Faery Rosina, as the
crowd commenced to batter at the door of the room. “But now I must
save you from the people, or they will certainly kill you.”
As she said this, she touched the Princess, who immediately
changed into a white rosebud, and lay on the dark green carpet like
a snowflake. Then the Faery Rosina vanished, and the door was
burst open, as the mob rushed in.
Of course they now saw nothing, and never for a moment dreamt
that the white rose lying on the carpet was their beautiful Princess,
so they commenced to pull down all the costly things in the room,
and would have trampled the rosebud under their feet, only a young
student picked it up.
He was a handsome fellow of twenty, this young student, with a
slender figure and a dark, splendid-looking face. His name was
Ardram, and he was one of the leaders of the revolt, although he did
not wish the people to destroy everything as they were doing.
Ardram was a very learned youth, and the son of a poor sick woman,
of whom he was very fond. He had seen all the misery of the poor
people who were in want of bread, and the sinful luxury of the court,
so thought it but right that a change should be made. Therefore he
led the people to the palace, to ask justice of the King, but they had
become too strong for him, and he was already regretting that he
had not let them stay where they were. However, it was too late now
for regrets, but he determined not to take any part in the follies of the
mob, so walked home to his own little room in the city, with the white
rosebud in his button-hole.
All night long he saw the flames rising from burning dwellings, and
heard the shrieks of people being killed, so he felt very sad to think
that he was the original cause of it all, though he certainly had no
intention of letting such things be done. Then he determined on the
morrow to talk to the people, and try and persuade them to stop their
plundering and cruelty, but, in the meantime, went to bed and slept
for an hour in an uneasy manner.
He forgot all about the white rosebud, which had fallen on the floor,
as he flung himself, dressed as he was, on his bed, but when he
awoke in the morning, he was much surprised to find seated beside
him a beautiful woman, who was weeping bitterly.
“Who are you?” asked Ardram, springing to his feet; “and how did
you come here?”
“I am the Rose-Princess,” she replied sadly; “but I do not know how I
came here. You will let me stay, will you not? I am so afraid of those
terrible people who broke into the palace.”
“Oh, I won’t let them harm you, Princess,” said Ardram, who had
fallen in love with her beautiful face; “but you must not leave this
room, or else I cannot protect you.”
“I’ll stay here,” said the Rose-Princess obediently; “but will you
please give me something to eat?—I feel rather hungry.”
So Ardram brought out some bread and wine, off which the Princess
made a hearty meal, talking to her host all the time she was eating.
“I saw you in the palace yesterday,” she said, looking straight at
Ardram.
“Yes,” replied the student, blushing; “I was with the people. We only
wanted justice, and I did not think they would go on like they did. The
people were too strong for me, so I left them.”
“And will you put my father on the throne again?” asked the Rose-
Princess eagerly.
“I’m afraid that will be impossible, Princess,” said Ardram quietly,
“unless he promises to govern better. You see, many years ago, a
king was deposed for governing badly, and your grandfather was put
on the throne—now they’ll offer the crown to some one else.”
“Perhaps they’ll offer it to you?” suggested the Rose-Princess.
“I don’t think so,” said Ardram, laughing, as he arose to his feet; “but
if I did become king, I would take care that all my subjects were well
off. Now I’ll go out, Princess, and you stay here.”
“Very well,” answered the Rose-Princess; “and do look for my
parents.”
“I will—though I daresay they’ve left the city,” said Ardram, and he
went away more in love with the Princess than ever.
Meanwhile the Rose-Princess was left alone, and thought how noble
and brave Ardram was.
“If he was only the Prince I was to marry!” she sighed; “but then the
faery said everything would come right, so, perhaps, he is to be my
husband after all.”
She waited all through the long day for the return of Ardram, but he
did not return till sundown, and just as his hand was on the door, the
Princess changed into a white rosebud, so, when he entered, he
found the room empty.
“Princess, Princess, where are you?” he called out in alarm; but of
course no Princess answered him, and Ardram asked every one in
the house if they had seen a beautiful lady go out, but no one had
done so.
“I’ll go and see my mother,” said Ardram in perplexity, for his mother
was a very wise woman, although at present she was lying on a bed
of sickness. As soon as Ardram made up his mind to ask his
mother’s advice, he put on his cap to go, when he spied the white
rosebud on the floor.
“Hullo!” he cried, picking it up; “this is the rose I found in the palace
yesterday—my mother is fond of flowers, so I’ll take it to her;” and he
went away.
The streets were quite full of people, all in a great state of
excitement, for the King, Queen, and Princess had vanished, and, as
all the ministers were beheaded, there was no one to rule, so the
whole kingdom was in a dreadful state.
Ardram reached his mother’s house, and found her in bed, very ill,
but when she saw him she was much delighted.
“How are things going?” she asked, after he had kissed her.
“Very badly,” replied Ardram; “no one is able to rule, and I’m afraid
we will have a civil war.”
“Oh no, we won’t,” said his mother quickly. “If the people won’t have
their present King, perhaps the exiled Prince of the old royal family
will be found.”
“I’m afraid not,” replied her son, smiling; “but if he is, I hope he’ll rule
wisely.”
“I hope so too,” said his mother pointedly.
“Who gave you that beautiful rose, Ardram?”
“I picked it up in the palace, mother,” he
answered, and, taking it out of his button-hole,
he gave it to her to smell. Then he told her all
about the beautiful Princess, and his mother
was very much astonished that the poor lady
had left the safe shelter of his room, and
perhaps been torn to pieces by the angry
people in the street.
At last Ardram went away, leaving the rosebud with his mother, who
laid it on her pillow and went to sleep. Next morning, when the
beams of the sun were shining into her chamber, she awoke, and
found the Rose-Princess sleeping beside her.
“Are you not the Rose-Princess?” she asked, for of course she
recognised the King’s daughter at once by her crown.
“Yes,” answered the Rose-Princess quickly; “but how did I get here?
The last thing I remember before I went to sleep, was standing in
Ardram’s room.”
“You must have walked here in your sleep, then,” said the sick
woman, looking at her, “because he has been searching for you
everywhere.”
“Oh, I’m so sorry!” said the Rose-Princess, rising. “I would not like
him to think I’d run away, because I am so fond of him.”
“Are you fond enough of him to marry him?” asked the mother sadly.
“Yes, I am,” answered the Princess, blushing; “but I’m afraid he
would not marry me. Besides, you know, I am to marry the exiled
Prince of the old royal family, as soon as he is found.”
“He is found,” said the sick woman quietly. “Ardram is my son, and
the great-grandson of the King who was driven from the throne, so, if
you marry him, he will be able to regain his throne again.”
“And my father and mother?” asked the Princess in a faltering voice.
“I’m afraid they’re not fit to reign, if all I have heard is true,” said the
mother in a melancholy tone; “and if you and my son, Prince Ardram,
ascend the throne, I hope you will govern more wisely. Now, to prove
the truth of what I say, pull out that wooden box from under my bed.”
The Rose-Princess did as she was told, and, on lifting up the lid, saw
a most beautiful crown, all over diamonds, and rubies, and great
blue sapphires, sparkling like the stars.
“That is the old royal crown,” said the sick woman, as the Princess
put it on her head, “and Ardram will be crowned with it.”
“But if your son is the Prince, why did you not send him to the palace
to marry me?” asked the Rose-Princess, who looked truly royal, as
she stood in the room with the great crown on her golden head.
“Because I wanted him to see the misery of the people, before ruling
over them,” said the mother quickly. “Now he knows what poor
people endure, he will be a wise king, and govern well. Now, I will
sleep until my son comes back, then we will see about getting you
married.”
So she turned her face away, in order to sleep, and the Princess put
away the royal crown, and began to sing to the sick woman in a low,
sweet voice. This is what she sang:
“Roses red, in the red, red dawn,
Open your hearts to the sun, I pray;
The dew lies heavy upon the lawn,
Westward rises the golden day.

Roses, droop in the hot noon-tide,


Scatter your petals of red and white,
Far in the depths of your green leaves hide,
Till to the eastward the sun takes flight.

Roses white, at the shut of day,


Close your blossoms thro’ sunless hours;
The moon rides high in the sky so grey.
Night brings sleep to the weary flowers.”

Then she also fell asleep, and, as night came on, she was once
more changed into the white rosebud, and lay on the pillow beside
the grey head of Ardram’s mother. When the doctor, a gruff old man
called Mux, came in, the sick woman awoke, and asked at once for
the Princess.
“What princess?” asked Mux gruffly. “There’s no princess here. So
much the better, as I’d cut her head off if I saw her.”
“But she was here when I went to sleep,” said Ardram’s mother
angrily.
“Well, she isn’t here now,” retorted the doctor. “I expect she’s left you
to look for the King and Queen. But never mind about her—how do
you feel yourself?”
But the sick woman was much agitated over the loss of the Rose-
Princess, and when her son entered, she told him how the Princess
had been with her all day, and again vanished; whereupon Ardram
rushed out into the streets, to see if he could find the poor Rose-
Princess again.
When Mux was taking his leave, Ardram’s mother said she had no
money to pay him.
“Never mind,” said the doctor gruffly, for he was really very kind-
hearted; “I’ll take this rose as payment;” and he picked up the white
rose off the pillow.
“It’s very kind of you, doctor,” said the sick woman gratefully. “Take
the rose by all means—my son gave it to me. But, doctor, do try and
find the Princess; if you do, I will reward you better than you think.”
“Stuff!” said the gruff Mux; and he went away home with the white
rosebud fastened in his coat.
III.

THE ROSE-PRINCESS FULFILLS HER DESTINY.

Gruff Dr. Mux took the white rosebud home with him, little thinking
it was the lost Princess, which was perhaps just as well, seeing that
he was such an enemy to the royal family. At least every one thought
he was, but everybody was wrong to think so, as, in spite of the
names he called them, he was really a great upholder of the throne,
and in his humble house the exiled King and Queen had been
hidden all the time of the revolution. No one thought of looking for
them in the house of such a red republican as Dr. Mux, so they were
as safe there as though they were guarded by stone walls and
faithful soldiers.
When Dr. Mux arrived home, he went straight to bed, but arose very
early in the morning, before the sun was up, and called the King and
Queen.
“Sire and madam,” he said, bowing before them, “as I came through
the streets, I noticed that the people were talking about re-
establishing the throne.”
“Oh, then we will go back to our palace,” said the Queen joyfully.
“And make an example of all traitors,” observed the King sternly.
“Nothing of the sort, sire and madam,” said the doctor, bowing again.
“From what I heard, I think the people want to put your daughter on
the throne.”
“Nonsense!” said the King.
“Pooh!” said the Queen.
“You think so?” observed the doctor severely. “Listen.”
They did listen, and heard a roar in the distance coming nearer and
nearer, then a great mass of people came sweeping up the street,
crying out, “Long live Queen Rose!” “Let us see our new Queen!”
“Where is the Rose-Princess?”
“Ah, where indeed?” cried the Queen, weeping. “I have not seen our
beautiful daughter since the mob attacked the palace.”
“She would easily be recognised,” said the doctor.
“I’m not so sure of that,” replied the King, looking at the Queen. “You
know our Princess is enchanted by the faeries.”
“Faeries?” echoed the doctor; “I never saw one.”
“But I did,” said the Queen.
“Excuse me, my dear madam—dyspepsia,” returned the doctor
gravely, for you see he did not know how the Princess changed to a
rosebud every night.
The Queen was very angry, but dared not say anything, lest the
doctor should deliver her up to the mob, who were now surging in
the wide street, listening to a man who was speaking.
“That is Ardram the student,” said the doctor. “I saw his sick mother
last night—she gave me this rosebud.”
“Ah,” sighed the Queen, as she took the rosebud from the doctor,
“how like my poor lost daughter!”
“I do not see the resemblance, sire and madam,” said the doctor;
“but listen to Ardram;” and he went out of the room, leaving the King
and Queen to hearken to the man who had taken their throne from
them. He was talking in a loud tone to the mob, and telling them they
ought to elect the Rose-Princess for their Queen, as she would know
how to govern better than her parents. The sun was just rising, and
the golden beams were shining on his face, so that he looked truly
noble.
“A seditious traitor!” cried the King.
“Cut his head off!” said the Queen.
But they had not the power to do so, and, amid cries of “Long live
Queen Rose!” Ardram leaped from his standing-place, and all the
mob swept down the street to look for the lost Princess.
The King and Queen turned from the window in great anger, when
they saw to their surprise that the Rose-Princess was standing in the
room.
“My child, my child!” said the King, kissing her.
“It was your rosebud, then?” said the Queen, folding the beautiful girl
in her arms.
“What rosebud?” asked the Rose-Princess in surprise; “and how did
I come here?”
“The doctor brought you,” said the King.
“Did he carry me through the streets?” asked the Princess, very
much astonished. “I wonder I was not recognised.”
“No one could recognise you as you were then,” said the Queen, and
nodded wisely, but she did not tell the Princess that she had been a
rosebud when she was carried by the doctor.
“I’ve had such a lot of adventures,” said the Rose-Princess; “but I
don’t know how I came from one place to the other. First, I was in the
palace, then in Ardram’s room, then by his sick mother’s bedside,
and now here. It must be the faeries.”
“It is the faeries,” observed the Queen, kissing her daughter again.
“You’ll know all about it when you marry the exiled Prince, and break
the spell.”
“Oh, I can break whatever spell there is when I marry Ardram,” said
the Rose-Princess; “he is the exiled Prince.”
“Nonsense!” said the King, frowning.
“Pooh!” said the Queen in an angry tone.
“Oh, but he is,” cried the Rose-Princess gaily. “I saw his crown, for
his mother showed it to me.”
“Then, if he is the real Prince,” said the King, “you had better marry
him, and break the enchantment.”
“What enchantment?” asked the Rose-Princess.
“You will find it all out,” began the Queen, “when”—
“When you marry Prince Ardram,” finished the King.
All day the three royal people sat in the humble room of the doctor,
and talked about their troubles. Rose-Princess told her parents all
about the misery of the people, and how they ought to govern, but
the King and Queen only laughed, which showed that the severe
lesson of exile was lost on them. Gruff Dr. Mux was very much
astonished to see the Rose-Princess, and told her how she had
been proclaimed Queen by Ardram.
“Then I’ll marry him,” said the Rose-Princess promptly, “for I love him
very much. Where is he?”
“Coming up the street,” said the doctor. Then all four went to the
window, and saw that the crowd of people were coming back,
looking very disappointed because they had not found the Princess.
Ardram mounted on a great stone in front of the church door, for the
cathedral of the city was just opposite the doctor’s house. When the
Rose-Princess saw him, she ran out of the room, down the stairs,
and across to where the student was standing.
“Ardram, Ardram, I am here!” she cried, and climbed up beside him.
The people recognised their beautiful Princess at once, and cried
out,—
“Long live Queen Rose!”
“And King Ardram,” said the Princess loudly; “if you make me
Queen, you must make him King, and we will both rule wisely.”
“She never thinks of us,” said her father.
“Ungrateful child!” cried the Queen.
But no one heard them, for the mob began to roar, “Long live King
Ardram and Queen Rose!” and the red light of the setting sun shone
on the handsome couple as they stood on the stone. Ardram was
beside himself with joy, not at being made King, but because the
beautiful Rose-Princess had her white arms round his neck, and was
saying how much she loved him.
Suddenly the red light in the sky vanished and the sun set, leaving
Ardram standing alone on the stone with a white rose in his hand.
“Where is the Queen?” roared the mob.
“I don’t know,” cried Ardram, looking at the white rosebud in a
bewildered manner; “she is gone.”
“He wants to be King alone,” cried the people, “and has made the
Queen disappear by magic.”
“No, no,” said Ardram. “I love her too much for that.”
“Kill him! kill him! he’s a magician!” yelled the people, and they all
pressed forward to tear Ardram off the stone, but, seeing his danger,
he jumped down and ran into the church, closing the great doors
after him. There he was safe, for the mob dared not to break into the
church, but all night roared round it like a stormy sea round a little
boat.
The King and Queen left the window, and told the gruff doctor all
about the enchantment of the Rose-Princess, which he was now
inclined to believe, as he had seen her disappear so suddenly before
his eyes. He recommended the Queen to call on the Faery Rosina,
which she did, and in a moment the faery, a tall, beautiful woman, in
a robe of shining green, was standing before them. Then the doctor
did believe in faeries, because he now really saw one for the first
time, and was much astonished.
“Well, are you sorry you lost your throne?” asked the faery severely.
“Very,” said the King and Queen together.
“If you go back, will you rule wisely?” she said, looking at them.
“We will rule just as we ruled before,” they replied.
“Then you are not fit to go back,” said Rosina sadly. “I see I have not
cured you after all.”
“Nonsense!” said the King.
“Pooh!” said the Queen, and they both thought the faery was very
rude.
“I’ll settle everything to-morrow morning,” said the faery, quite angry
at their folly. “I can do nothing till the Rose-Princess becomes a
woman again—she will of course marry the Prince Ardram to break
the spell.”
“Is he really the Prince?” asked the King and Queen together.
“Yes, he is,” retorted the faery shortly, and then vanished, leaving
them quite disconsolate, as they thought they would never get back
their throne.
Meanwhile Ardram walked up and down the dark church all night,
listening to the roaring of the crowd outside, and wondering how the
Princess kept vanishing and appearing so strangely. He was more in
love with her than ever, and at last went fast asleep on the altar
steps, dreaming about his lovely bride, who said he would rule as
King with her. The rosebud lay on the steps beside him, but Ardram
never thought for a moment that his charming Princess was so near
him.
Next morning he awoke in the early grey dawn, before the sun was
up, and found himself surrounded by the King, the Queen, Dr. Mux,
his mother, now looking strong and well, and a beautiful tall woman,
in a green robe, with a wand made of white roses.
“I am the Faery Rosina,” she said to him in a low, sweet voice, “and I
am come to put things to rights, Prince Ardram.”
“Why do you call me ‘Prince’ Ardram?” asked the student, looking
puzzled.
“The Rose-Princess will tell you,” said the faery, smiling.
“But where is she?” asked Ardram, looking around.
“There,” said the faery, pointing with her wand to the white rosebud,
which lay on the floor where Ardram had flung it the previous night.
“Impossible!” he said in astonishment.
“Not at all,” cried the King, coming forward; “nothing is impossible to
a royal princess. That rosebud is my daughter.”
“Given to the King and Queen by me,” said Rosina sweetly. “They
did not know how to rule, and as I knew this revolution would take
place, I wanted to provide an heir to the throne.”
“But the white rose cannot reign,” said Ardram, rather bewildered.
“Not now, but wait till the sun rises,” cried the fairy. “Ah, here is the
first yellow beam! Now look.”
Every one looked at the white rosebud lying on the floor, and then a
yellow beam which struck through a painted window, creeping nearer
and nearer till it shone on the white bud. In an instant that vanished,
and in its place stood the Rose-Princess, looking tall and beautiful.
On seeing Ardram, she bounded towards him and put her arms
round his neck.
ON SEEING ARDRAM SHE BOUNDED TOWARD
HIM AND PUT HER ARMS ROUND HIS NECK

“Good morning, my Prince,” she said sweetly.


“But I am no prince,” cried Ardram, clasping her to his breast.
“Yes, you are,” said the Rose-Princess merrily; “you are the great-
grandson of the King who was deposed.”
“Is this true, mother?” asked Ardram.
“Perfectly true,” she replied, producing the crown. “Here is the royal
crown; you are the real King, but I did not dare to tell you till the
Faery Rosina gave me permission.”
“And I waited till now because I wanted you to marry the Princess
Rose,” said the faery, as Ardram placed the crown on his head. “The
Princess is enchanted, and turns into a rose every night, so in order
to break the spell she must marry you.”
“When?” asked both lovers together.
“Now,” said the faery, and, touching Ardram’s dress, it changed into
beautiful royal robes all of gold, and at the same moment the Rose-
Princess appeared dressed in wedding garments, with her crown of
silver and diamonds on her head. The organ rolled out a bridal
march, and the priests came forth in a long procession. In a few
minutes the Princess Rose was married to Ardram, and then her
silver crown rolled off.
“You must not wear silver any more,” said the faery, “because the
spell is now broken, and you will never change to a rosebud again.”
So saying, she touched the Rose-Princess’s head with her wand,
and immediately there appeared a beautiful golden crown, as
gorgeous as that worn by Ardram.
“Now you are King and Queen,” said Rosina graciously, “so you will
go to the palace and govern wisely.”
“Oh yes, we will,” cried the new King and Queen joyfully and then
they kissed one another as they stood in their royal crowns and
splendid garments before the great altar.
“But what is to become of us?” said the old King and Queen.
“You are not fit to govern,” said the faery severely, “and only care for
pleasure, so you will go away to the other end of the kingdom, to a
city of your own, where the people are as fond of pleasure as you
are, and there you will be happy.”
“Nonsense!” said the King.
“Pooh!” replied the Queen.
Nevertheless, both of them were secretly very delighted, as they
would now be able to enjoy themselves as they pleased. Then the
faery ordered the doors of the cathedral to be thrown wide open, the
organ played a triumphal march, and the new King and Queen
walked slowly down the church, looking the handsomest couple in
the world. The gruff doctor and the old mother followed, but the
deposed King and Queen had vanished with the Faery Rosina, who
transported them to their own city, where they ruled and enjoyed
themselves for many years.
Then all the people in the city saw the new King and Queen standing
before them with their royal crowns, and the bells rang, the streets
were made clear again, and as the young couple moved through the
crowd, which strewed flowers before them, the people cried,—
“Long live King Ardram and Queen Rose!”
And the Rose-Princess never changed into a flower again, but
became a true, loving wife to the King, who ruled well and wisely, for
he had seen the hardships of his subjects when he was a poor
student. They reigned long and happily, and had many children, but
in all their prosperity the Queen never forgot how she had been an
enchanted Rose-Princess.

You might also like