• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
Finance Train

Finance Train

High Quality tutorials for finance, risk, data science

  • Home
  • Data Science
  • CFA® Exam
  • PRM Exam
  • Tutorials
  • Careers
  • Products
  • Login

Options Strategy: Create Bull Call Spread with R Language

Data Science, Derivatives

This lesson is part 14 of 15 in the course Derivatives with R

Bull Call Spread is an options trading strategy that involves the purchase of two call options with the same expiration and different strike prices. In the strategy, the trader buys one call option with a lower strike price and sells another call option with a higher strike price. Both calls have the same underlying security. The strategy has a limited potential profit and loss as it has a ceiling for the profits and a floor for losses. In this article we will simulate the bull call spread with R.

The inputs and the strategy code for bull call spread with R are provided below. Note that for the purpose of the example, we are generating our own data, i.e., a sequence of numbers using the seq() function in R. We create the strategy with two call options one with a low strike price of 450 and another with a high strike price of 500. We also have the premium amounts of these two. We calculate the intrinsic value and payoff from each call option and then we calculate the strategy payoff. Then we plot the strategy payoff at different prices using the ggplot function in R. 

prices <- seq(400, 550,1) # Vector of prices
k_low = 450  # Low Strike price for call
k_high = 500 # High Strike Price for call 
premium_low = 10
premium_high = 1
# Intrinsic Value and Payoff long call
intrinsicValueLongCall <- prices - k_low - premium_low
payoffLongCall <- pmax(-premium_low,intrinsicValueLongCall)
# Intrinsic Value and Payoff short call
intrinsicValueShortCall <- prices - k_high - premium_high
payoffShortCall <- pmin(premium_high,-intrinsicValueShortCall)
# Strategy Payoff
payoff <- rowSums(cbind(payoffLongCall,payoffShortCall))f
# Generate a dataframe with the payoffLongCall, payoffShortCall and payoff vectors
# in order to plot the strategy payoffs using ggplot
results <- data.frame(cbind(payoffLongCall,payoffShortCall,payoff))
ggplot(results, aes(x=prices)) + 
  geom_line(aes(y = payoffLongCall, color = "LongCall")) + 
  geom_line(aes(y = payoffShortCall, color="ShortCall"))+
  geom_line(aes(y=payoff, color = 'Payoff')) +
  scale_colour_manual("", 
                      breaks = c("LongCall", "ShortCall", "Payoff"),
                      values = c("darkred", "darkblue", "darkgreen")) + ylab("Payoff")+
  ggtitle("Bull Call Spread Payoff")  

The following graph shows the payoff from the bull call spread.

Bull Call Spread

In the above graph, the blue line represents the payoff from the strategy, which is a range. For the long call, the options trader pays a premium which is the maximum loss from the long call. For the short call, the trader receives a premium. The difference between the two premiums is called the spread. The maximum profit from the strategy is limited to the differences between the strike prices minus the net spread (after adjusting commissions paid to brokers). The maximum loss from the strategy is the net spread.In the above graph, the blue line represents the payoff from the strategy, which is a range. For the long call, the options trader pays a premium which is the maximum loss from the long call. For the short call, the trader receives a premium. The difference between the two premiums is called the spread.

The maximum profit from the strategy is limited to the differences between the strike prices minus the net spread (after adjusting commissions paid to brokers). The maximum loss from the strategy is the net spread. The strategy breaks even at the strike price of the long call (the lower strike) plus the net premium paid. The strategy is best suited for bullish scenarios where the price of the underlying stock is expected to rise above the strike price of the short call option.In the above graph, the blue line represents the payoff from the strategy, which is a range. For the long call, the options trader pays a premium which is the maximum loss from the long call. For the short call, the trader receives a premium. The difference between the two premiums is called the spread. The maximum profit from the strategy is limited to the differences between the strike prices minus the net spread (after adjusting commissions paid to brokers). The maximum loss from the strategy is the net spread.

Previous Lesson

‹ Understanding Options Greeks

Next Lesson

Options Strategy: Create Long Straddle with R Language ›

Join Our Facebook Group - Finance, Risk and Data Science

Posts You May Like

How to Improve your Financial Health

CFA® Exam Overview and Guidelines (Updated for 2021)

Changing Themes (Look and Feel) in ggplot2 in R

Coordinates in ggplot2 in R

Facets for ggplot2 Charts in R (Faceting Layer)

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

In this Course

  • Overview of Derivatives with R Tutorial
  • How to Create Futures Continuous Series
  • Exploring Crude Oil (CL) Future Data from Quandl in R
  • R Visualization of Statistical Properties of Future Prices
  • Comparing Futures vs Spot Prices for WTI Crude Oil
  • Different Parties in the Futures Market
  • Creating Term Structure of Futures Contracts Using R
  • Contango and Backwardation
  • Exploring Open Interest for Futures Contracts with R
  • Review of Options Contracts
  • Black Scholes Options Pricing Model in R
  • Binomial Option Pricing Model in R
  • Understanding Options Greeks
  • Options Strategy: Create Bull Call Spread with R Language
  • Options Strategy: Create Long Straddle with R Language

Latest Tutorials

    • Data Visualization with R
    • Derivatives with R
    • Machine Learning in Finance Using Python
    • Credit Risk Modelling in R
    • Quantitative Trading Strategies in R
    • Financial Time Series Analysis in R
    • VaR Mapping
    • Option Valuation
    • Financial Reporting Standards
    • Fraud
Facebook Group

Membership

Unlock full access to Finance Train and see the entire library of member-only content and resources.

Subscribe

Footer

Recent Posts

  • How to Improve your Financial Health
  • CFA® Exam Overview and Guidelines (Updated for 2021)
  • Changing Themes (Look and Feel) in ggplot2 in R
  • Coordinates in ggplot2 in R
  • Facets for ggplot2 Charts in R (Faceting Layer)

Products

  • Level I Authority for CFA® Exam
  • CFA Level I Practice Questions
  • CFA Level I Mock Exam
  • Level II Question Bank for CFA® Exam
  • PRM Exam 1 Practice Question Bank
  • All Products

Quick Links

  • Privacy Policy
  • Contact Us

CFA Institute does not endorse, promote or warrant the accuracy or quality of Finance Train. CFA® and Chartered Financial Analyst® are registered trademarks owned by CFA Institute.

Copyright © 2021 Finance Train. All rights reserved.

  • About Us
  • Privacy Policy
  • Contact Us