Change stop loss and profit to match with dividends adjustment

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #199786 quote
    Amin1233Amin1233
    Participant
    Junior

    Hi
    there is dividends adjustment for indices that is applied at the close time of each market in IG. It can be from 1 point to 50 points sometimes. So if I have a system in 5 min chart with a few positions open that the stop loss and take profits are less than the diviadjustment level, my positions will be closed regardless if I am in profit or loss. I need a code to add the dividends adjustment points to all of my open positions Can anyone help me with this? The tricky part is that if I am short on market the target should change right before dividends adjustment eg 15:55 but the stop should change after dividends adjustment eg 16:05. And for all long positions the stop loss should change right before eg 15:55 and target right after .
    cheers

    #199787 quote
    Amin1233Amin1233
    Participant
    Junior

    The adjustment points are always deducted from the indice, for example if a buy positions open at 12000 with target of 100 and stops if 200 and dividends adjustment is 50 then the new target is 12050 and new stop is 11750.

    #199845 quote
    JSJS
    Participant
    Master
    Once ExDividendDate = 000000
    Once ExDividendLevel = 00
    
    If Date = ExDividendDate then
    If ShortOnMarket and CurrentTime = 155500 then
    MyTarget = MyTarget - ExDividendLevel
    ElsIf ShortOnMarket and CurrentTime = 160500 then
    MyStop = MyStop + ExDividendLevel
    EndIf
    If LongOnMarket and CurrentTime = 155500 then
    MyStop = MyStop - ExDividendLevel
    ElsIf LongOnMarket and CurrentTime = 160500 then
    MyTarget = MyTarget + ExDividendLevel
    EndIf
    EndIf
    Hi @Amin1233

    You will first have to know and enter the ex-Dividend dates and the corresponding Dividend levels and then you can supplement the code of your trading system with, for example, the code above:

    #199849 quote
    Amin1233Amin1233
    Participant
    Junior
    thanks , i will give it a go
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

Change stop loss and profit to match with dividends adjustment


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Amin1233 @amin1233 Participant
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by Amin1233Amin1233
4 years ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 08/29/2022
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...