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")
any ideas for plotting expirations for future dates? not just current bar and previous.
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
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
I was thinking more basic, dayofmonth and friday. It should work theoretically.
Reply
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
I don't know, it works for me....
snapshot
Reply
haha well then occams razor wins again -- error on my part :D

nice work
Reply
ucsgears PRO SPYderCrusher
UCS_Option Expiry
+1 Reply
TimKutch ucsgears
can you please share script for every third Friday?
Reply
United States
United Kingdom
India
Deutschland
España
France
Italia
Polska
Brasil
Россия
Türkiye
Indonesia
Malaysia
日本
한국
中国
Home Stock Screener Forex Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators Website & Broker Solutions Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter
Profile Profile Settings Account and Billing Priority Support Ideas Published Followers Following Private Messages Chat Sign Out