You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
987 B
JavaScript
24 lines
987 B
JavaScript
// EXAMPLE STATE:
|
|
const state = {
|
|
front_months: { // front months, i.e. calendar expiry, at which the user has an opinion on where the underlying price may be
|
|
"2022-03-11": {
|
|
underlying_ranges: [ // underlying-price ranges, at which the user thinks the underlying price may be, at expiry (i.e. front-month)
|
|
{
|
|
from: 300,
|
|
to: 400,
|
|
back_months: { // back months, for which the user has an opinion on what the IV-smile will look like, given that the underying price is within range
|
|
"2022-04-17": {
|
|
iv_fn: someFn // signature: (underlying_price, strike_price, dte); the function internally stores the shape of the IV-smile as a function of percentage-diff-between-underlying-and-strike, so that the function can be run for any underlying value in the range, and of course any strike.
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
export const calculateBestCombinationOfCalendars(){
|
|
|
|
} |