Calculating overnight fees, interest, and dividends

Forums ProRealTime English forum General trading discussions Calculating overnight fees, interest, and dividends

Viewing 4 posts - 1 through 4 (of 4 total)
  • #243755

    We add spread to our systems in the PRT platform, but what about overnight broker fees, interest, and the impact of dividends?

    I’ve developed some code that calculates the cost of overnight fees, interest, and the impact of dividends. I use it across all my systems since these factors can really add up over time.

    Below, you’ll find the code based on the DAX 40. It should be simple to integrate into your own systems and customise as needed. The code is designed to work on any intraday time frame, you’ll just need to adjust the CurrentTime = 220000 to match the fee application time in your own time zone.

    This version is designed for the UK, with IG, and assumes an interest rate of 4.75% plus a broker fee of 3.0%. It also includes an approximate calculation for dividends (accounting for both positive values for longs and negatives for shorts). It then plots the results on a graph, and if a position is held on a Friday night, the fee is calculated as three times the standard value.

    5 users thanked author for this post.
    #243756

    Link to above added as Log 393 here …
    Snippet Link Library

    2 users thanked author for this post.
    #243918

    Thanks for this nice code.

    But, it is hard to get accurate results over time as SOFR% (or LIBOR rates) changes every day…

    Also, note that in IG Markets i found 2 different formula :
    Sometimes it is written : Nights held x (market closing price x trade size x ( relevant interest rate benchmark+/- admin fee*)) / 365.
    And sometimes : Number of contracts x value per contract x price x (3% admin fee+/-SOFR%*) ÷ 360

    What is the value of the contrat ?

    Also for the week end it is written in french IG Markets website that 3 days of interest are applied for the week end, not only 2…
    “Veuillez noter que les positions maintenues ouvertes après 23h (heure de Paris) le vendredi seront ajustées pour trois jours de financement afin de couvrir le week-end.”

    #243926

    3 days of interest are applied for the week end, not only 2…

    Friday overnight, Sat overnight and Sun overnight.

    What is the value of the contract ?

    Mid-price x 1?  E.g. Value of 1 Contract on DJI is currently 44503 (DJI mid-price is 44503 as of Friday close).

Viewing 4 posts - 1 through 4 (of 4 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login