A simple script to show the Fridays (Weekly Option Expiry), of course this is a basic script we can make a few more improvement.

One of many ways to utilize the "dayofweek" variable.

Currently there are no options to draw a vertical line, you can do a background color for the candle.

Future plans - Include monthly option expiry.
Remove from Favorite Scripts Add to Favorite Scripts
// Created by UCSgears
// Simple script to show you Fridays (Weekly Options Expiry)
// Will release a version for Monthly Option Expiry

study("UCS_Fridays", overlay = true)

x = dayofweek == 6 ? 1 : 0

plotshape(x, style = shape.xcross, location = location.top, title="Show Me Fridays")
any ideas for plotting expirations for future dates? not just current bar and previous.
I guess you could do weekofyear, and do like a if <4 then 3, if > 4, then n placeholder +3 something along those lines
SPYderCrusher SPYderCrusher
greater than and less than symbols didnt show but it should be if less than 4 then n is 3 and if greater than 4 then n placeholder plus 3 (on the assuming 3 would be the third week of the year + friday, then can just add four to that to get February's third friday etc).
+1 Reply
ucsgears SPYderCrusher
I was thinking more basic, dayofmonth and friday. It should work theoretically.
If I recall, that was what I tried but whatever I was doing didn't match the calendar? LIke I think I looked at the calendar and said, ok, the earliest possible Friday was the 15 and the latest the 22, so 'dayofmonth greater than 14 and less than 23' and somehow it didn't end of being correct?

Of course it may have just been an error on my part, I didnt ... spend a lot of time on it, but yeah, good luck and look forward to seeing what you come up with.
ucsgears SPYderCrusher
I don't know, it works for me....
haha well then occams razor wins again -- error on my part :D

nice work
ucsgears SPYderCrusher
+1 Reply
TimKutch ucsgears
can you please share script for every third Friday?
EN English
EN English (UK)
EN English (IN)
DE Deutsch
FR Français
ES Español
IT Italiano
PL Polski
SV Svenska
TR Türkçe
RU Русский
PT Português
ID Bahasa Indonesia
MS Bahasa Melayu
TH ภาษาไทย
VI Tiếng Việt
JA 日本語
KO 한국어
ZH 简体中文
ZH 繁體中文
AR العربية
Home Stock Screener Forex Signal Finder Cryptocurrency Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators Website & Broker Solutions Widgets Stock Charting Library Feature Request Blog & News FAQ Help & Wiki Twitter
Profile Profile Settings Account and Billing My Support Tickets Contact Support Ideas Published Followers Following Private Messages Chat Sign Out