Automated Delta Hedging Replicating Portfolio using Selenium, Cron, Microsoft Azure SQL( GitHub )
Project Overview
Created a Cron-automated Delta Hedging Replicating Portfolio using Selenium, XML, Microsoft Azure SQL
Created a Python program to scrape financial data based on the Nvidia dividend-paying stock (NVDA) and its call options on Yahoo Finance, based on Selenium and ChromeDriver automation via XML.
Obtained relevant data on NVDA's stock and call option, such as stock price, call price, time to maturity, 20-day annual volatility, delta, Black-Scholes-Merton call price, etc.
Created a replicating portfolio from shorting an NVDA call option by trading in the underlying NVDA stock and a risk-free instrument (bank account), via a delta neutral position in the portfolio.
Parsed the scraped Pandas Dataframe of the replicating portfolio into a CSV file.
Utilised Cron in Ubuntu Linux to automate the Python script to run and adjust the position of the replicating portfolio every 5 minutes, following the US market trading hours of 9:30am to 4:00pm (GMT-04) using pytz, with automatic adjustment of daylight time.
Utilised the pyodbc driver to truncate outdated data within the dbo.NVDA table in the Microsoft Azure SQL database.
Bulk Copy updated NVDA CSV file via BCP Utility command to update Microsoft Azure SQL cloud database every 5 minutes with the new position of the replicating portfolio, calculating potential profit with each position from closing the short position of the call option.