Skip to content

Instantly share code, notes, and snippets.

@jonathanpeterwu
Last active April 15, 2020 19:43
Show Gist options
  • Save jonathanpeterwu/8685a20aac8da3c614ba81954a6ba484 to your computer and use it in GitHub Desktop.
Save jonathanpeterwu/8685a20aac8da3c614ba81954a6ba484 to your computer and use it in GitHub Desktop.
let opt = document.getElementsByClassName('grid-5')
const delta = parseFloat(opt[1].children[0].children[2].textContent)
const gamma = parseFloat(opt[1].children[1].children[2].textContent)
const theta = parseFloat(opt[1].children[2].children[2].textContent)
const vega = parseFloat(opt[1].children[3].children[2].textContent)
const rho = parseFloat(opt[1].children[4].children[2].textContent)
let price = parseFloat(document.getElementsByClassName('up')[0].children[0].children[0].textContent.replace( /[^0-9]/, '' ))
alert(`Current Price $${price}`)
alert(`Delta: ${delta * 100 * 100}`)
alert(`Gamma: ${gamma * price * 100}`)
alert(`Theta: ${theta * price * 100}`)
alert(`Vega: ${vega * price * 100}`)
alert(`Rho: ${rho * price * 100}`)
@jonathanpeterwu
Copy link
Author

WIP RH - greek conversion through the console. Warning this may be brittle due to element design changes on the website

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment