How to get/calculate future ex-date for SPY?

Discussion in 'Data Sets and Feeds' started by taotree, Dec 9, 2023.

  1. taotree

    taotree

    My broker's API provides historical dividends dates, but not the next one, which I need. Is there some way to calculate or a source (programmatically accessible) to get the next ex-date for SPY?
     
  2. Matt_ORATS

    Matt_ORATS Sponsor

  3. newwurldmn

    newwurldmn

    matt must be joking.

    every march, June, sep, Dec third Friday (options expiry)
     
    Matt_ORATS likes this.
  4. MarkBrown

    MarkBrown

    you can have chat gpt convert this into any code you wish



    function for multicharts

    inputs:
    Series( numericsimple ) ;

    variables:
    var0( 0 ),
    var1( 0 ),
    var2( 0 ),
    var3( 0 ),
    var4( 0 ),
    var5( 0 ),
    var6( 0 ),
    var7( 0 ),
    var8( 0 ),
    var9( 0 ),
    var10( 0 ) ;



    var0 = DayOfMonth( Date ) ;
    var1 = Month( Date ) ;
    var2 = Year( Date ) ;

    var3 = DayOfWeek( var2 * 10000 + var1 * 100 + 1 ) ;
    if var3 < 6 then
    var4 = 6 - var3
    else
    var4 = 7 ;

    var5 = var4 + 14 ;
    if var5 > var0 then
    var7 = var1 + Series - 1
    else
    var7 = var1 + Series ;

    if var7 > 12 then
    begin
    var7 = var7 - 12 ;
    var8 = var2 + 1 ;
    end
    else
    var8 = var2 ;

    var3 = DayOfWeek( var8 * 10000 + var7 * 100 + 1 ) ;
    if var3 < 6 then
    var4 = 6 - var3
    else if var3 = 6 then
    var4 = 7 ;
    var6 = var4 + 14 ;
    var9 = DateToJulian( var8 * 10000 + var7 * 100 + var6 ) ;
    var10 = DateToJulian( Date ) ;
    Next3rdFriday = var9 - var10 ;



    indicator for multicharts

    condition1 = Next3rdFriday( 1 )[1] = 1 ;
    if condition1 then
    begin
    PlotPaintBar( High, Low, "Expir" ) ;
    Alert ;
    end ;
     
  5. Q.E.D.

    Q.E.D.

  6. Matt_ORATS

    Matt_ORATS Sponsor

    I am referring more to the 2000 other stocks with variable dates and amounts. WSH does a good job updating the changing estimates for upcoming dividends, and we technology for seasonal patters and have a dividend person dedicated to updating and overriding where appropriate.

     
    newwurldmn likes this.
  7. newwurldmn

    newwurldmn

    Stop giving away trading opportunities!
     
  8. taotree

    taotree

    Thank you!
    I figured it was something like that, but didn't see it specifically confirmed like that. I just realized, that's probably what the prospectus is for... Yep, here it is on page 75 (77 in viewer):
    "The regular quarterly ex-dividend date for Units is the third (3rd) Friday in each of
    March, June, September and December, unless such day is not a Business Day, in
    which case the ex-dividend date is the immediately preceding Business Day
    (“Ex-Dividend Date”)"