Skip to content

lucasgday/oilfuturesdata

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NEEDS UPDATING

Oil Futures Data Plotting

Easy plot WTI oil futures data.

This repo includes two files:

  • oil_futures.py
  • oil_functions.py

oil_futures.py

This file includes the main function which is based on oil_functions.py. It outputs two plots, as the following (e.g. for 4 forward years):

Prices Plot

Prices Plot Example

Volume Plot

Volume Plot Example

oil_functions.py

This file includes 3 functions:

  • getdata(period): it gets the futures data for the years requested and with the trading history of the requested period. When executed, it requests an input, which must be an integer representing the number of years of future prices we want to download. It downloads data using yfinance. It outputs two DataFrames with prices and volumes traded in the period.
  • price_plot(prices): plots yesterday's prices
  • volume_plot(volume): plots yesterday's traded volume in log scale

About

Easy plot WTI oil futures data

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages