ucsgears

UCS_Fridays

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")
Nice work -- I have to admit I got super excited when I saw the title because I was trying to program a OPEX marker, but was only able to determine every Friday, not every third Friday because despite all the choices there is no ' ' weekokmonth ' variable. Admittedly I didn't spend an inordinate amount of time on it, but now that you;ve jogged my memory maybe I'll try again this afternoon.

Good stuff.
+1 Reply
ucsgears PRO SPYderCrusher
a year ago
I am starting to work on it as well. Primarily for options.
+1 Reply
SPYderCrusher PRO ucsgears
a year ago
Sweet. I outlined a thought process for how one could do it below, curious to see what you come up with or if that was basically your plan as well. Cheers.
Reply
cool...and I remember there is a script in the library that colors each day too, so perhaps a different color for each Friday through the month. I use the same notification for FX and Fix rates.
+1 Reply
I guess you could do weekofyear, and do like a if <4 then 3, if > 4, then n placeholder +3 something along those lines
Reply
SPYderCrusher PRO SPYderCrusher
a year ago
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 PRO SPYderCrusher
a year ago
I was thinking more basic, dayofmonth and friday. It should work theoretically.
Reply
SPYderCrusher PRO ucsgears
a year ago
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.
Reply
ucsgears PRO SPYderCrusher
a year ago
I don't know, it works for me....
snapshot
Reply
SPYderCrusher PRO ucsgears
a year ago
haha well then occams razor wins again -- error on my part :D

nice work
Reply
ucsgears PRO SPYderCrusher
8 months ago
UCS_Option Expiry
+1 Reply
TimKutch ucsgears
8 months ago
can you please share script for every third Friday?
Reply
ucsgears PRO TimKutch
8 months ago
UCS_Option Expiry
Reply
ucsgears PRO TimKutch
8 months ago
Monthly Expiry - True. Will be the third Friday
Reply
ucsgears PRO
a year ago

UCS_3rd Friday


UCS_3rd Friday
Reply
TimKutch
8 months ago
any ideas for plotting expirations for future dates? not just current bar and previous.
Reply
Ideas Scripts Chart
United States
United Kingdom
India
España
Italia
Brasil
Россия
Türkiye
日本
한국
Home Stock Screener Economic Calendar How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter
Private Messages Chat Ideas Published Followers Following Priority Support Public Profile Profile Settings Billing Sign Out