TradingView
OnSkop
1 Jun 2020 pukul 15.48

Options Decay Speed for 0DTE 

S&P 500SP

Huraian

Use only for:
SPX, 5 minutes time frame
This indicator is complementing options 0DTE strategy - selling options for SPX index in the same day as they are expiring. Output of the indicator (red or green color of the curve) indicates whether is profitable to sell options at given moment at delta and VIX specified in the parameters. Changing parameter "Candles" is not recommended.

Main thought is that options expire with certain speed (theta decay) when stock doesnt move. When stock moves in unfavorable direction slowly enough, decay speed can compensate for disadvantage coming from option delta. Intuitively there must be certain speed of stock value change (expressed in stock value per 5 minutes) that is exactly compensating theta decay. This indicator calculates those two values (details below) and shows, where theta decay is faster than stock movement in the last hour and thus favorable to sell options.
Indicator gets its result from comparing two values:
1) volatility in the form of highest high and lowest low for past 12 candles (one hour in total) divided by 12 - meaning average movement of stock expressed in [stock move per 5 minutes]
2) speed of options value decay in form of combination of theta decay and option delta. Formulas are approximation of Black-Scholes model as Pine script doesnt allow for advanced functions. Approximations are accurate to 2 decimal points from market open to one hour before market close and will not indicate green when accuracy is not sufficient. Its value is also expressed in [stock move per 5 minutes] so its mutualy comparable.

My focus was not on code elegance but on practical usability.
Written by Ondřej Škop.
Komen
hirenpatel127
When chart show red, it means not to sell options?
OnSkop
@hirenpatel127, when chart shows red, its dangerous to sell put options on SPX with given delta and volatility that have less than one day to expiration. This indicator is not concerned with other options or expiration times.
mohamedaarafa
Thank you for sharing. this is a great metric that i was trying to codify recently.
my question to you is, which strike level are you using the Theta measurement for? the reason is, based on the strike level, theta will differ.
OnSkop
@mohamedaarafa, hi, you are right, different strikes yield different theta. Every expiration day I am selling strikes that have delta between 5-10. Delta you are about to open is actually one of the input parameters to the indicator (default value 5).
mirahtrader
Ahoj chtěl bych se zeptat, čekáš tedy až DecaySpeed zezelená a až pak vypisuješ put opci na SPX na deltě 5-10 ? Když se na to tak dívám, tak DSPeed zezelená většinou až tak v polovině obchodní seance, tzn mám čekat až do cca 19h a pak vstupovat ? Vypisuješ kondory, batrfláje ... ?
OnSkop
Ahoj, je to na put vertical (ideálně se stop lossem na -200%), long put aby stál 5usd a short put vychází 50-80usd cca aby jsi dostal kýžených 5-10 delta. A ano, podle všech výzkumů to vychází nejlíp až později večer, klidně až osmá půl devátá. Je to spíš support skript, samořejmě nebude fungovat před FOMC meeetingem, kdy je to celý den klidný a pak v 8 začne divočina. Nicméně obecně podstata je v tom, že když je ten den klid, tak to nejspíš v klidu i dojede do expirace. A skript ti ukáže kvantitativně, co znamená dostatečný klid.
doctradez
Question: any script available such as this for smaller accnts; ie those that cannot sell spx options.. rather buy calls/puts?
Arroway1997
Can someone convert it to TOS script?
docpi
u say 'at the vix and delta specified,,,' wher edo i find that ? are u selling a specuifcic delta? do i select the option a=i am trying to sell? I sell 0 dter every day for 3+ yeares ,,, lately i use gamma levels
tengosed_
Can I ask why you are using the values you are for y = expression?
What made you choose 1570.4, 3347.2, 566.61 for instance and why divide by 30? I can understand why you are dividing by 86,400,000 to essentially divide by 100 in for the unix timestamp.
I'm just not sure about the floats chosen as well as the floats chosen for limit.

I'm working on modifying this for multiple time frames as well as making it more stock friendly rather than SPX based.
Lebih