Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create a REST API to calculate the price and Greeks of a European option on an underlying stock using the Black-Scholed Model. Required Files :
Create a REST API to calculate the price and Greeks of a European option on an underlying stock using the Black-Scholed Model.
Required Files :
api.py: The endpoint routes bs.py: Black-Scholes implementation (can be copied from previous HW) including additional Greeks calculations
The endpoint should be structured in the following way : GET /hw5/black-scholes/(str: ticker) Given a provided ticker, computes the Black-Scholes option price and greeks.
- iscall (bool) - True if call otherwise put - strike (float) - The strike price of the option - rate (float) - The continuous risk-free rate - div (float) - The continuous dividend yield - vol (float) - The volatility parameter to use - expiry (float) - The time to expiry - date (string) - (optional) The as of date of the pricing calculation, if not provided use the latest closing price. Status Codes: - 200 OK-ok - 404 Not Found - ticker not foundStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started