StaticNoiseLog

Last Friday of Month

This script marks the last Friday of the month in a daily chart because this is the day when BTC and ETH options expire according to Deribit.
I only found a script that highlights the 3rd Friday of the month, which is not what I wanted.
This script tries to figure out the correct number of days per month but is not aware of holidays which might displace the expiry date.
Release Notes:

This script tries to mark the last Friday of the month in the chart with a vertical line and/or a label.
It is meant for use on a daily BTC chart.

Price may tend toward a level known as the "max pain point" when options expire. See these articles:
https://www.coindesk.com/bitcoin-options...
https://insights.deribit.com/education/m...

Deribit is a place where you can trade BTC and ETH options. Monthly and quarterly options expiry
dates are relevant. From https://www.deribit.com/pages/informatio...
Daily options expire every day at 08:00 UTC.
Weekly options expire on each Friday of each week at 08.00 UTC.
Monthly options expire on the last Friday of each calendar month at 08.00 UTC.
Quarterly options expire on the last Friday of each calendar quarter at 08.00 UTC.
Release Notes: UPDATE: Now also shows the expiration Friday for the current month even if it lies in the future.
Release Notes: Added the URL where you can look up the max pain point in the comment.
(It is https://metrics.deribit.com/options?inde...)
Release Notes:
  • Fixed the logic for finding Fridays.
  • No output if timeframe is different from 1 day.
  • Extended the description in the header of the source code.
Apologies, dudes and dudesses. The previous version was pretty broken.
How hard can it be to find the Fridays? Well, pretty hard for me, it seems... :-)
Release Notes: Another bug fix for the future last Friday of the month (how embarrasing).
Added highlighting of past quadruple witching Fridays (future dates not working, yet).
Converted to Pine Script v5.
Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?