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

MATHEMATICS FOR STOCK TRADING

Submitted in partial fulfillment of requirement for the degree

of

MASTER OF SCIENCE (APPLIED MATHEMATICS)


OF
UNIVERSITY OF MUMBAI

Submitted by

ASHAR MOHD.ASHRAF GHAWTE


4
M.Sc. (2021 – 2023)

Department of Mathematics
B. K. Birla College of Arts, Science and Commerce
(Autonomous), Kalyan

1
Project on

MATHEMATICS FOR STOCK TRADING

Presented By

ASHAR MOHD. ASHRAF GHAWTE


4
M.Sc. (2021-2023)

For

B. K. Birla College of Arts, Science and Commerce


(Autonomous), Kalyan

Affiliated to

University of Mumbai

2
CERTIFICATE

This is to certify that Mr./ Ms ………………………………………………….

………………………………………………………………………………….,

Roll No. ……………………………… of the Master of Science (Applied

Mathematics) Programme course, has satisfactorily completed his SEM IV Project as

prescribed by B. K. Birla College of Arts, Science and Commerce (Autonomous) for

getting the degree under the University of Mumbai, 2021 – 2023.

Prof. Dr. Seema Purohit Prof. Prakash Sansare

Prof. in Charge Head of the Department

3
CERTIFICATE

This is to certify that Mr. /Ms. …………………………………………………………

with Roll No. ……………… of the Final year M. Sc. (Applied Mathematics) has

successfully completed the project titled, “……………………………………………….

……………………….……………………………………………………………………

…………………………………………………………………………………………….

as partial fulfillment of his/her project work for the fourth Semester of the Master of

Science Programme as prescribed by B. K. Birla College of Arts, Science and

Commerce (Autonomous) under the University of Mumbai for the A.Y. 2021 –

2023.

Internal Examiner External Examiner

Prof. …………… Prof. …………………….

Date: ……………….. Date: ……………………

4
INDEX

SR NO. TOPICS PAGE NO.


1 INTRODUCTION 6
2 LITERATURE REVIEW 7-8
3 TIME SERIES ANALYSIS 9-11
4 TRADING & INVESTMENT 12-16
5 PROBABLITY 17-19
6 REGRESSION ANALYSIS 20-23
7 TRENDS 24-26
8 BLACK SHOLES MODEL 27-28
9 OPTION PRICING 29-32
10 POTFOLIO 33-35
11 PERCENTAGE LOSS 36-37
12 CONCLUSION 38

5
INTRODUCTION

Mathematics plays a crucial role in stock market analysis and decision-making. It


provides investors and traders with tools and techniques to analyse data, make
predictions, and manage risk Here are some key mathematical concepts and their
applications in stock market analysis

1. Statistics: Statistical analysis helps investors understand the distribution, trends, and
patterns in stock market data. Concepts such as mean, standard deviation, correlation,
and regression analysis are used to measure and analyse historical returns, volatility,
and relationships between different securities.

2. Probability theory: Probability theory is employed to assess the likelihood of


various outcomes in the stock market. It helps investors calculate the probability of a
stock's price reaching a certain level or the probability of an event occurring based on
historical data or market conditions.

3. Time series analysis: Time series analysis is used to study and predict stock price
movements over time. Techniques such as moving averages, exponential smoothing,
and autoregressive integrated moving average (ARIMA) models are employed to
identify patterns, trends, and seasonality in stock market data.

It is important to note that while mathematics provides valuable tools for stock market
analysis, it is not a guarantee of accurate predictions or guaranteed profits. The stock
market is influenced by various factors, including economic conditions, geopolitical
events, and investor sentiment, which may go beyond mathematical models' scope.
Sound judgment, experience, and an understanding of market dynamics are equally
important for successful stock market investing.

6
LITERATURE REVIEW
This literature review examines the role of mathematics in stock market analysis. It
explores various mathematical concepts, models, and techniques used in understanding
and predicting stock market behaviour. The review focuses on the application of
mathematics in areas such as financial modeling, risk management, portfolio
optimization, and quantitative trading strategies. The findings highlight the significance
of mathematics in providing valuable insights and tools for investors and traders in the
stock market.

1. Introduction
- Overview of the stock market and its complexities
- Importance of mathematics in stock market analysis

2. Financial Modeling
- Stochastic calculus and its role in modeling stock prices
- Brownian motion and geometric Brownian motion
- Black-Scholes-Merton model for option pricing
- Monte Carlo simulation for risk assessment

3. Time Series Analysis


- Autoregressive Integrated Moving Average (ARIMA) models
- GARCH (Generalized Autoregressive Conditional Heteroskedasticity) models
- Volatility forecasting using ARCH (Autoregressive Conditional Heteroskedasticity)
models

4. Portfolio Optimization
- Modern Portfolio Theory (MPT) and the mean-variance framework
- Markowitz's efficient frontier and the Capital Asset Pricing Model (CAPM)
- Portfolio diversification and the benefits of risk reduction

7
5. Risk Management
- Value at Risk (VaR) calculations
- Conditional Value at Risk (CVaR) as an extension of VaR
- Copula functions for modeling dependence between assets

6. Quantitative Trading Strategies


- Momentum strategies based on mathematical indicators
- Statistical arbitrage and pairs trading
- Machine learning and algorithmic trading approaches

7. Market Microstructure Analysis


- Order book modeling and limit order books
- Market impact and liquidity modeling
- High-frequency trading and market microstructure considerations

9. Data Science and Machine Learning


- Predictive modeling using regression, decision trees, and neural networks
- Natural language processing for sentiment analysis
- Reinforcement learning and genetic algorithms in trading strategies

This literature review provides an overview of the diverse mathematical techniques and
models employed in stock market analysis. It emphasizes the importance of
mathematics in understanding market dynamics, managing risk, optimizing portfolios,
and developing quantitative trading strategies. By incorporating these mathematical
tools, investors and traders can make informed decisions and gain a competitive edge in
the stock market.

8
TIME SERIES ANALYSIS

Time series analysis is a branch of statistics and mathematics that focuses on the study
of data points collected over successive time intervals. It involves analysing and
modeling the temporal patterns, trends, and dependencies present in the data to
understand and make predictions about future values
Mathematically, time series analysis involves the study of a sequence of observations or
measurements {y₁, y₂, y₃, ..., yₙ}, where each observation yᵢ corresponds to a specific
time point tᵢ. The goal is to characterize the underlying structure and dynamics of the
time series by applying various mathematical techniques.

concepts in time series analysis:

1. Time Series Data: It refers to a sequence of observations or data points collected


over time. The data can be collected at regular intervals (e.g., hourly, daily, monthly) or
irregular intervals (e.g., sales data).

2. Trend: Trend refers to the long-term pattern or direction in the data. It represents
the overall upward or downward movement in the series. Trends can be linear (constant
slope) or nonlinear (curved).

3. Seasonality: Seasonality refers to the regular and repeating patterns in the data that
occur within fixed time intervals. For example, retail sales might exhibit a seasonal
pattern, with increased sales during holiday seasons.

4. Stationarity: A time series is said to be stationary if its statistical properties, such


as mean, variance, and autocovariance, remain constant over time. Stationarity is an
important assumption in many time series models.

9
5. Autocorrelation: Autocorrelation measures the relationship between an
observation and a lagged version of itself. It helps identify patterns in the data that
persist over time. Autocorrelation is often represented by the autocorrelation function
(ACF) and partial autocorrelation function (PACF).

6. Time Series Models: Various models are used to analyse and forecast time series
data. Some common models include autoregressive integrated moving average
(ARIMA), exponential smoothing models, and seasonal decomposition of time series
(STL).

7. Forecasting: Time series analysis enables forecasting future values based on


historical patterns. Forecasting methods use the past data to estimate future values,
taking into account trends, seasonality, and other factors.

8. Model Evaluation: It involves assessing the accuracy and performance of time


series models. Evaluation metrics include mean absolute error (MAE), root mean
square error (RMSE), and mean absolute percentage error (MAPE).

Time series analysis provides valuable insights into the behaviour of data over time,
helping analysts make informed decisions and predictions based on historical patterns
and trends.

Example: A real-life example of time series analysis is forecasting stock prices.


Many investors and financial analysts use time series analysis techniques to predict the
future movements of stock prices based on historical data.

In this scenario, the historical data consists of daily or intraday stock price values over a
specific period. By applying time series analysis techniques, such as autoregressive

10
integrated moving average (ARIMA), exponential smoothing models, or machine
learning algorithms like recurrent neural networks (RNNs), analysts can identify
patterns and trends in the data and make predictions about future stock prices.

These predictions can be used by investors to make informed decisions about buying or
selling stocks. For example, if the analysis suggests that a stock's price is likely to
increase in the near future, an investor may decide to buy that stock. On the other hand,
if the analysis indicates a potential decline in stock price, an investor may choose to sell
their holdings.

It's important to note that stock price forecasting is a complex task and involves many
factors beyond just historical price data, such as market news, company performance,
and global events. Time series analysis serves as a valuable tool to help understand and
analyse the historical patterns in stock prices, but it's not a guarantee of future
performance.
Mathematical formula:

11
TRADING & INVESTMENT

Stock market trading and investment involve buying and selling stocks or other
securities with the goal of generating a profit. It can be a complex and dynamic field,
but here is a basic introduction to help you understand the key concepts:

1. Stocks: Stocks represent ownership shares in a company. When you buy shares of a
company's stock, you become a partial owner and have the potential to profit from the
company's success.

2. Stock Exchanges: Stock exchanges are platforms where stocks are bought and
sold. Examples include the New York Stock Exchange (NYSE) and the NASDAQ.
Stock exchanges provide a regulated marketplace for investors to trade stocks.

3. Brokers: To trade stocks, you typically need a brokerage account. A broker is a


financial institution or an online platform that facilitates the buying and selling of
stocks on your behalf. They charge fees or commissions for their services.

4. Investment Strategies: There are different investment strategies you can follow,
such as:

a. Long-term Investing: This strategy involves buying stocks with the intention of
holding them for an extended period, often years or even decades. The goal is to benefit
from the company's growth over time.

b. Value Investing: Value investors look for undervalued stocks, believing that
their true worth is higher than the market currently reflects. They aim to buy stocks at a
discount and hold them until the market recognizes their value.

12
c. Growth Investing: Growth investors focus on companies that are expected to
experience rapid growth in the future. They prioritize stocks of companies with strong
earnings potential and reinvestment plans.

d. Day Trading: Day traders aim to take advantage of short-term price fluctuations
within a single trading day. They buy and sell stocks rapidly, attempting to profit from
small price movements.

5. Fundamental Analysis: Fundamental analysis involves assessing a company's


financial health, including its earnings, revenue, assets, and liabilities. By analysing
these factors, investors can determine the intrinsic value of a stock and make informed
decisions.

6. Technical Analysis: Technical analysis involves studying historical price and


volume data to identify patterns and trends. Traders use various technical indicators and
chart patterns to predict future price movements.

7. Risk Management: It's essential to manage risk when trading or investing in the
stock market. Diversification, setting stop-loss orders, and having a clear risk tolerance
are some strategies to mitigate risk

Mathematical formula:

1. Return on Investment (ROI) Formula:


ROI measures the return on an investment relative to its cost. It is calculated using the
formula:
ROI = (Net Profit / Cost of Investment) x 100
Where: Net Profit = Total Profit - Cost of Investment

13
2. Sharpe Ratio Formula:
The Sharpe ratio is a measure of risk-adjusted return. It is calculated using the
formula:
Sharpe Ratio = (Rp - Rf) / σp
Where: Rp = average return of the investment
Rf = risk-free rate of return
σp = standard deviation of the investment's return

3. Capital Asset Pricing Model (CAPM) Formula:


The CAPM is used to determine the expected return on an investment based on its
risk and the risk-free rate. It is calculated using the formula:
Expected Return = Rf + β x (Rm - Rf)
Where: Rf = risk-free rate of return
β = beta coefficient of the investment
Rm = average return of the market

4. Moving Average Formula:


The moving average is a commonly used technical analysis indicator. The simple
moving average is calculated by summing up a set of prices over a specific period and
dividing it by the number of periods. The formula is:
Simple Moving Average = (Sum of Prices over a Period) / Number of Periods

14
PYTHON CODE FOR TRADING & INVESTMENT

INPUT:
import numpy as np
def calculate_returns(prices):
returns = np.diff(prices) / prices[:-1]
return returns

def calculate_average_return(returns):
average_return = np.mean (returns)
return average_return

def calculate_volatility(returns):
volatility = np.std(returns)
return volatility

def calculate_sharpe_ratio(returns, risk_free_rate):


average_return = calculate_average_return(returns)
volatility = calculate_volatility(returns)
sharpe_ratio = (average_return - risk_free_rate) / volatility
return sharpe_ratio

# Sample stock prices data


stock_prices = [100, 105, 98, 110, 115, 105, 100, 112, 108, 120]

# Set risk-free rate (e.g., 0.03 for 3%)


risk_free_rate = 0.03

15
# Calculate returns
returns =lculate_returns(stock_prices)

# Calculate average return


average_return = calculate_average_return(returns)
print("Average daily return:", average_return)

# Calculate volatilit
volatility = calculate_volatility(returns)
print("Volatility:", volatility)

# Calculate Sharpe ratio


sharpe_ratio = calculate_sharpe_ratio(returns, risk_free_rate)
print("Sharpe ratio:", sharpe_ratio)

OUTPUT:

Average daily return: 0.019


Volatility: 0.0584
Sharpe ratio: -0.129002464305

16
PROBABLITY

Probability plays a significant role in the stock market as it helps investors and traders
assess and manage risk, make informed decisions, and understand the potential
outcomes of their investments. By understanding probability, market participants can
evaluate the likelihood of various events occurring, such as price movements, earnings
reports, or market trends.

In the context of the stock market, probability refers to the chance or likelihood of a
particular event happening. It involves quantifying uncertainty and estimating the
likelihood of different outcomes. By analysing historical data, market trends, and
various indicators, investors attempt to determine the probabilities associated with
different investment scenarios.

One common approach to probability in the stock market is through statistical analysis.
Investors often use historical price data to calculate probabilities based on patterns and
trends. For example, they may analyse the frequency and magnitude of price
fluctuations to assess the likelihood of future price movements.

Probability is also relevant in assessing the risk and potential returns of investments.
Investors use tools like standard deviation, beta, and correlation to measure the
volatility of stocks and portfolios. These measures help investors understand the
probability of a particular investment's performance deviating from the expected
returns.

1.Standard deviation:
A standard deviation (or σ) is a measure of how dispersed the data is in relation to the
mean. Low standard deviation means data are clustered around the mean, and high
standard deviation indicates data are more spread out.

17
Formula: Standard Deviation = √ (Σ (xi - μ) ² / N)

Where:

xi represents each data point


μ represents the mean (average)
Σ represents the sum of the values
N represents the total number of data points

2. Compound interest:
Compound interest refers to the process of earning or accruing interest on an initial
amount of money, called the principal, as well as on any previously earned interest. In
other words, it is interest calculated on both the initial investment and the accumulated
interest from previous periods.

18
Formula:

A = P (1 + r/n) nt
Where:
A = the future value of the investment/loan, including interest
P = the principal amount (the initial investment/loan amount)
r = the annual interest rate (expressed as a decimal)
n = the number of times that interest is compounded per year
t = the number of years

Example:

19
REGRESSION ANALYSIS

Regression analysis is a statistical technique used to model and analyse the relationship
between a dependent variable and one or more independent variables. It is commonly
employed to understand the impact of changes in the independent variables on the
dependent variable.

In regression analysis, the dependent variable, also known as the outcome variable or
response variable, is the variable of interest that we want to predict or explain. The
independent variables, also referred to as predictor variables or explanatory variables, are
the factors that may influence or contribute to the variation in the dependent variable.

The goal of regression analysis is to find a mathematical relationship, typically represented


by an equation or a model, that best fits the observed data. The equation expresses the
expected value of the dependent variable as a function of the independent variables, along
with associated coefficients.

The most common form of regression analysis is linear regression, where the relationship
between the variables is assumed to be linear. However, there are also other types of
regression analysis, such as polynomial regression, multiple regression, logistic regression,
and so on, that accommodate different types of relationships and variable types.

By analysing the regression model, researchers can estimate the effect of each independent
variable on the dependent variable, test hypotheses about the significance of the
relationships, make predictions for new observations, and assess the overall goodness of fit
of the model to the data

20
Formula:

Regression analysis involves examining the relationship between a dependent variable and
one or more independent variables. The formula for a simple linear regression, which
involves a single independent variable, is as follows:

Y = β₀ + β₁X + ε

Where:

- Y represents the dependent variable (also known as the response or outcome variable).
- X represents the independent variable
- β₀ represents the y-intercept
- β₁ represents the slope or coefficient of the independent variable X
- ε represents the error term or residual (the difference between the observed value of Y and
the predicted value of Y).

The goal of regression analysis is to estimate the values of β₀ and β₁ that best fit the data,
minimizing the sum of the squared errors (ε) between the observed and predicted values of
Y.

For multiple linear regression, where there are more than one independent variables, the
formula expands as follows:

Y = β₀ + β₁X₁ + β₂X₂ + ... + βₚXₚ + ε

Where:
- X₁, X₂, ..., Xₚ represent the p independent variables.
- β₁, β₂, ..., βₚ represent the corresponding coefficients for each independent variable.

21
In practice, statistical software packages like R or Python's scikit-learn provide tools to
perform regression analysis and estimate the coefficients (β₀, β₁, β₂, ..., βₚ) based on the
given data.

Example:

22
Python code:
Input:

23
TRENDS:

Trends in the stock market refer to the general direction or movement of stock prices
over a specific period of time. Analysing and identifying trends is an essential aspect of
stock market analysis as it helps investors, traders, and analysts make informed
decisions about buying, selling, or holding stocks. Here are some common trends
observed in the stock market:

1.Uptrend: An uptrend occurs when stock prices show a consistent upward movement
over time. It indicates a positive market sentiment, with buyers outnumbering sellers.
Uptrends are characterized by higher highs and higher lows on price charts.

2.Downtrend: A downtrend occurs when stock prices exhibit a sustained downward


movement. It indicates a negative market sentiment, with sellers dominating the market.
Downtrends are characterized by lower highs and lower lows on price charts.

3.Sideways or Range-bound: In a sideways or range-bound market, stock prices


move within a relatively narrow range without a clear upward or downward trend.
Prices tend to fluctuate between a support level (lower boundary) and a resistance level
(upper boundary).

4.Bull Market: A bull market is characterized by a sustained period of rising stock


prices, typically accompanied by strong investor confidence and positive economic
indicators. Bull markets are associated with overall market optimism and often lead to
increased buying activity.

5.Bear Market: A bear market refers to a prolonged period of declining stock prices,
typically accompanied by negative economic indicators and widespread pessimism

24
among investors. Bear markets are associated with overall market pessimism and often
lead to increased selling activity.

6.Volatility: Volatility refers to the degree of price fluctuations in the market. High
volatility indicates significant price swings, while low volatility suggests relatively
stable price movements. Volatile markets can present opportunities for higher potential
gains but also come with increased risk.

7.Reversal: Reversal trends occur when the prevailing trend in stock prices changes
direction. For example, an uptrend may reverse and transition into a downtrend, or vice
versa. Reversals can indicate a shift in market sentiment and present opportunities for
traders to adjust their positions.

Trend Line formula:

A trend line is a line drawn on a price chart to connect successive higher lows in an
uptrend or lower highs in a downtrend. The general formula to calculate a trend line is:
Y = mx + c
Where:
Y represents the value of the dependent variable (usually the stock price).
x represents the value of the independent variable
m represents the slope of the trend line.
c represents the y-intercept of the trend line.
The slope (m) and y-intercept (c) can be determined using various statistical techniques,
such as linear regression, to minimize the sum of squared errors between the data points
and the trend line.

25
Input:

26
BLACK SHOLES MODEL

The Black-Scholes method, also known as the Black-Scholes-Merton model, is a


mathematical framework used to calculate the theoretical price of financial options, such as
stock options. It was developed by economists Fischer Black and Myron Scholes in 1973,
with contributions from Robert C. Merton.

The Black-Scholes model provides a way to estimate the fair value of options by taking
into account various factors, including the current price of the underlying asset, the strike
price of the option, the time to expiration, the risk-free interest rate, and the volatility of the
underlying asset's price.

The underlying principle behind the Black-Scholes model is that it assumes financial
markets are efficient and that the price of the underlying asset follows a geometric
Brownian motion. This means that the asset's price changes randomly over time but follows
a specific statistical distribution.

The Black-Scholes formula provides a mathematical equation to calculate the price of a


European call or put option, which can only be exercised at the expiration date. It takes into
account the current price of the underlying asset, the strike price, the time to expiration, the
risk-free interest rate, and the volatility.

The Black-Scholes method revolutionized the field of options pricing and has been widely
adopted by financial institutions and investors. However, it is important to note that the
model has certain assumptions and limitations. For example, it assumes constant volatility,
which may not hold true in all market conditions. It also assumes no transaction costs,
dividends, or restrictions on short-selling. Nevertheless, the Black-Scholes method remains
a fundamental tool in options pricing and has paved the way for further advancements in
quantitative finance.

27
Formula:

Example:
One real-life example of the Black-Scholes model in action is the pricing of options on
stocks or other financial instruments. The Black-Scholes model is a mathematical formula
used to calculate the theoretical price of an option based on various factors such as the
current stock price, the strike price of the option, the time remaining until expiration, the
volatility of the underlying asset, and the risk-free interest rate.

Let's consider a hypothetical scenario where you have a call option on a stock. The Black-
Scholes model can be used to estimate the fair value of that call option based on the inputs
mentioned above. For example, if the stock price is $100, the strike price of the option is
$110, the time to expiration is 30 days, the volatility is 20%, and the risk-free interest rate is
2%, you can plug these values into the Black-Scholes formula to calculate the theoretical
price of the option.

The Black-Scholes model provides a framework for valuing options and is widely used by
traders, investors, and financial institutions in the real world. It helps in determining
whether an option is overpriced or under-priced relative to its theoretical value, and it also
assists in assessing the risk associated with options trading.

28
OPTION PRICING

Option pricing is a financial concept that involves determining the value of a financial
instrument called an option. Options are derivative contracts that give 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) within a specified period (expiration date).

The price of an option is influenced by several factors, including the current price of the
underlying asset, the strike price, the time remaining until expiration, the volatility of the
underlying asset's price, and the risk-free interest rate.

The primary models used for option pricing are the Black-Scholes model and the Binomial
model.

1. Black-Scholes Model: The Black-Scholes model, developed by economists Fischer


Black and Myron Scholes in 1973, is widely used for valuing European-style options. It
assumes that the underlying asset follows a geometric Brownian motion and that the market
is efficient. The model takes into account factors such as the current price of the underlying
asset, the strike price, time to expiration, risk-free interest rate, and volatility. It provides a
formula to calculate the theoretical price of an option.

The Black-Scholes model is widely used due to its simplicity and analytical solution for
European options. However, it assumes constant volatility and does not account for early
exercise possibilities or transaction costs. The binomial model, on the other hand, can
handle a wider range of option types and allows for incorporating factors like dividends and
early exercise. However, it can be computationally intensive, especially for options with
longer time periods.

29
It's important to note that option pricing models provide estimates of option values and
serve as a starting point for determining fair prices. Market conditions and other factors can
cause actual option prices to deviate from the model's estimates. Traders and investors use
option pricing models to assess the relative value of options and make informed decisions
regarding buying, selling, or hedging options positions.

Formula:

30
Example:

Let's consider an example of option pricing using the Black-Scholes model, one of the
widely used models for valuing European-style options. Here's an example scenario:

Assume we have a stock with the following parameters:

Current stock price (S): $100


Strike price (K): $110
Time to expiration (T): 1 year
Risk-free interest rate (r): 5%
Volatility (σ): 20%
Using the Black-Scholes formula, we can calculate the value of a call option.

The Black-Scholes call option pricing formula is:

C = S * N(d1) - K * e^(-rT) * N(d2)

where:

C is the call option price


N(d1) and N(d2) are cumulative standard normal distribution values, calculated based on
d1 and d2
d1 = (ln(S/K) + (r + (σ^2)/2) * T) / (σ * sqrt(T))
d2 = d1 - σ * sqrt(T)
Now, let's plug in the values into the formula:

d1 = (ln (100/110) + (0.05 + (0.20^2)/2) * 1) / (0.20 * sqrt (1))


= -0.105 + (0.05 + 0.02) * 1 / 0.20
= -0.105 + 0.07 / 0.20

31
= -0.105 + 0.35
= 0.245

d2 = 0.245 - 0.20 * sqrt (1)


= 0.245 - 0.20
= 0.045

Using the cumulative standard normal distribution table (or a calculator), we can find the
values of N(d1) and N(d2) corresponding to 0.245 and 0.045, respectively.

Assuming N(d1) = 0.5962 and N(d2) = 0.5159, we can calculate the call option price:

C = 100 * 0.5962 - 110 * e^ (-0.05 * 1) * 0.5159


= 59.62 - 110 * e^ (-0.05) * 0.5159
= 59.62 - 110 * 0.9512 * 0.5159
= 59.62 - 51.25
= 8.37

Therefore, the estimated value of the call option, based on the Black-Scholes model, is
$8.37.

32
PORTFOLIO

A stock portfolio refers to a collection of stocks or securities held by an individual or an


entity. It represents the combined ownership of various stocks, typically with the goal of
diversifying investments and achieving desired financial objectives. A stock portfolio can
vary in size, composition, and strategy depending on the investor's preferences and
investment goals.

1.Stock Selection: Investors typically choose stocks for their portfolio based on various
factors such as company fundamentals, industry outlook, growth potential, dividend yield,
risk tolerance, and investment strategy. The portfolio may consist of stocks from different
sectors, sizes (large-cap, mid-cap, small-cap), or geographic regions to spread the risk.

2.Diversification: Diversification is an important principle in portfolio management. By


spreading investments across multiple stocks, investors aim to reduce the overall risk and
avoid overexposure to a single stock or industry. Diversification can be achieved by
investing in stocks from different sectors, asset classes, or geographical regions.

3.Portfolio Allocation: Portfolio allocation involves determining the appropriate


allocation of funds to different stocks within the portfolio. This allocation is typically based
on factors such as risk tolerance, investment goals, and the investor's outlook on different
stocks or sectors. Allocation decisions may also consider the investor's desired balance
between growth and income stocks.

4.Risk Management: Managing risk is crucial in stock portfolio management. Investors


employ various risk management strategies, such as setting stop-loss orders, regularly
monitoring and rebalancing the portfolio, and implementing hedging techniques to mitigate
potential losses.

33
5.Performance Monitoring: Regular monitoring and evaluation of the portfolio's
performance is essential. Investors may compare their portfolio returns to benchmark
indices, track individual stock performance, and assess the portfolio's overall risk and
return characteristics. Adjustments may be made based on market conditions, changing
investment goals, or new investment opportunities.

6.Long-Term Approach: Building a successful stock portfolio often requires a long-


term approach. Investors aim to achieve capital appreciation and growth over an extended
period, while also considering the potential for dividends or income generation from their
investments.

Example:

Let's calculate the total value of a stock portfolio in Indian Rupees (INR) using an example:

Assume an investor holds the following stocks in their portfolio:

Company A: 300 shares at a price of ₹150 per share.


Company B: 200 shares at a price of ₹250 per share.
Company C: 150 shares at a price of ₹180 per share.
To calculate the total value of the portfolio in INR, we multiply the number of shares by the
respective share prices and then sum them up:

Total Value of Company A = 300 shares * ₹150 per share = ₹45,000


Total Value of Company B = 200 shares * ₹250 per share = ₹50,000
Total Value of Company C = 150 shares * ₹180 per share = ₹27,000

Total Portfolio Value = ₹45,000 + ₹50,000 + ₹27,000 = ₹122,000

Therefore, the total value of the stock portfolio in Indian Rupees is ₹122,000.

34
35
PERCENTAGE LOSS

Percentage loss in the stock market refers to the decrease in the value of an investment or
portfolio expressed as a percentage of the initial investment or portfolio value. It is a
measure of the extent to which the value has declined over a specific period.

To calculate the percentage loss, you need two values: the initial value (before the decline)
and the final value (after the decline). The formula to calculate the percentage loss is as
follows:

Percentage Loss = ((Initial Value - Final Value) / Initial Value) * 100

Here's an example to illustrate how to calculate the percentage loss:

Assume an investor initially invested ₹50,000 in a stock and the current value of the
investment has decreased to ₹40,000.

Percentage Loss = ((₹50,000 - ₹40,000) / ₹50,000) * 100


= (₹10,000 / ₹50,000) * 100
= 0.20 * 100
= 20%

36
Code:

# Profit and Loss

# Function to calculate Profit.


def Profit(costPrice, sellingPrice) :

profit = (sellingPrice - costPrice)

return profit

# Function to calculate Loss.


def Loss(costPrice, sellingPrice) :

Loss = (costPrice - sellingPrice)

return Loss

# Driver code
if __name__ == "__main__" :

costPrice, sellingPrice = 1500, 2000

if sellingPrice == costPrice :
print("No profit nor Loss")

elif sellingPrice > costPrice :


print(Profit(costPrice,
sellingPrice), "Profit")

else :
print(Loss(costPrice,
sellingPrice), "Loss")

Output:
500 profit.

37
Conclusion

In conclusion, mathematics plays a significant role in the stock market. It provides essential
tools and concepts for analysing and understanding the dynamics of stock prices, risk
management, portfolio optimization, and option pricing. Here are some key points to
consider:

1.Data Analysis: Mathematics helps in analysing historical stock price data, identifying
patterns, and extracting meaningful insights. Statistical techniques, such as regression
analysis, correlation, and time series analysis, can be applied to uncover relationships and
trends in the market.

2.Portfolio Optimization: Mathematical techniques, including optimization models and


efficient frontier analysis, assist in constructing well-diversified portfolios that balance risk
and return. Optimization algorithms can identify the optimal allocation of assets to
maximize expected returns for a given level of risk.

3.Option Pricing: Mathematical models, such as the Black-Scholes model, are used to
price options and derivatives. These models take into account factors such as the underlying
stock price, strike price, time to expiration, interest rates, and volatility to determine the fair
value of options.

4.Technical Analysis: Mathematical tools, such as moving averages, trendlines, and


chart patterns, are employed in technical analysis to identify price trends, support and
resistance levels, and potential entry and exit points for trading decisions.

Mathematics provides a quantitative framework for investors and traders to make informed
decisions based on data-driven analysis and calculations.

38

You might also like