From 817de00cceaf42dfa6929cdf53ac26b2e0b0f3c5 Mon Sep 17 00:00:00 2001 From: Brian Sakal Date: Fri, 11 Mar 2022 09:49:49 -0500 Subject: [PATCH] started procedures.js --- README.md | 11 +++++++++-- procedures.js | 24 ++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 procedures.js diff --git a/README.md b/README.md index 4e631bc..a18a21c 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,10 @@ -# calendar-optimizer +# Calendar Optimizer -Options Calendar-spread optimizer, based on projected underlying price range and IV smiles at different expiries. \ No newline at end of file +Options Calendar-spread optimizer, based on projected underlying price range and IV smiles at different expiries. + +# Steps + +1. Choose front-month expiry for which you have an opinion on underlying price range. +2. Draw expected IV Skew for various underlying prices for various back-month expiries, at front-month expiry. For example, if price would be way lower than it is now, it's probably because some scary event happened that makes investors nervous, so IV would be relatively high (even ATM), and would be skewed towards calls, since the market is expecting a comeback by the back-month expiry. The UI would have a slider for underlying price (one slider per back-month expiry). A portion of the slider would be highlighted, to signify that the current drawing applies to that range of underlying prices at front-month expiry. There's a slidable arrow that acts as a cursor. Whatever price it falls on dictates the numbers on the axes of the drawing, so it's easy to imagine actual prices on the x-axis instead of percentages-from-the-money. There's a 'Split Range' button to split the current range on the slider into two, by adding a slidable boundary in the middle of it (at the cursor). +3. Choose the desired strike prices at which to open calendars, using a final 'price strip/slider'. +4. Now that the front-month expiry is chosen, and the strikes of the calendars, the application can now choose the best back-month expiries for each individual calendar. It can optimize for one of two things: cheapest combo, highest max profit \ No newline at end of file diff --git a/procedures.js b/procedures.js new file mode 100644 index 0000000..1021bed --- /dev/null +++ b/procedures.js @@ -0,0 +1,24 @@ +// 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(){ + + } \ No newline at end of file