Closing Price January Higher than December Close

Forums ProRealTime English forum ProOrder support Closing Price January Higher than December Close

  • This topic has 27 replies, 3 voices, and was last updated 4 days ago by avatarLambo.
Viewing 13 posts - 16 through 28 (of 28 total)
  • #232606

    Thank you very much Roberto.

    It Works.

    Do you have an idea how i can integrate the Idea buy “day>24”, because with the code you buy this year on 30.1 , 29.2. and 28.3, right would be 25.1, 26.2 and 25.3.

    Thanks a lot

    #232686

    Hello Roberto,

    i Failed to change the code for another January Strategie. Perhaps you can help me:

    If Close of January is higher than Open of January than it is allowed to buy

    on First Trading day of February and on every 25 th of every month until the end of the year

    Close trade is the same a new 200 Day High

    and SL SMA200 *0,97

     

    Thanks a lot

    It is very difficult with the tally for me.

     

    #236419

    Thank you very much Roberto.

    It Works.

    Do you have an idea how i can integrate the Idea buy “day>24”, because with the code you buy this year on 30.1 , 29.2. and 28.3, right would be 25.1, 26.2 and 25.3.

    Thanks a lot

    Sorry for the Delay!

    #236420

    Hello Roberto,

    i Failed to change the code for another January Strategie. Perhaps you can help me:

    If Close of January is higher than Open of January than it is allowed to buy

    on First Trading day of February and on every 25 th of every month until the end of the year

    Close trade is the same a new 200 Day High

    and SL SMA200 *0,97

    Thanks a lot

    It is very difficult with the tally for me.

    There you go:

    #245998

    Hello Roberto,

    the code doesn’t work as estimated

    TimeFrame(Yearly)
    ClosePreviousYear = Close[1]

    with this parameter i get the information for the hole year.

    How can I get a yes for a if /else  when I prove the condition in january but I am actually in april?

    // Prüfen, ob mindestens ein Schlusskurs zwischen dem 6. und 12. Januar höher ist als der Schlusskurs des Vorjahres
    IF (Month = 1 AND (Day >= 6 AND Day <= 12) AND Close > ClosePreviousYear) THEN
    Januarbarometer = 1 // Speichert die Bedingung für das ganze Jahr

    else

    Januarbarometer = 0
    ENDIF

    // Kauforder am 25. jedes Monats, wenn Bedingung erfüllt ist
    IF NOT LongOnMarket AND Day = 25 AND Januarbarometer = 1 THEN
    BUY 1 CONTRACT AT MARKET
    ENDIF

    I didn’t get it with this one

     

    #246001

     

     

    #246002

    I found the mistake. I changed something in your origine code which worked. sorry

    but one thing doesn’t worked

    if the code get stopped out it buys again. The code only have to buy on the first trading day =24

    #246004

    // Setze den TimeFrame auf jährlich, um den Schlusskurs des Vorjahres zu speichern
    TimeFrame(Yearly)
    ClosePreviousYear = Close[1]

    // Zurück zur täglichen Zeitebene
    TimeFrame(Daily)

    ONCE EntryDay = 24
    ONCE MonthDay1 = 9
    ONCE MonthDay2 = 11
    ONCE Tally = 0
    ONCE AboveFlag = 0

    // ate the beginning of each year save the closing price of the previous year
    IF OpenYear <> OpenYear[1] THEN
    YearClose = close[1]
    AboveFlag = 0
    ENDIF

    // at the beginning of each Month reset the tally of trading days to zero
    IF (OpenMonth <> OpenMonth[1]) THEN
    Tally = 0
    ENDIF

    // each new day updates the tally
    IF (OpenDay <> OpenDay[1]) THEN
    Tally = Tally + 1
    ENDIF

    // between day 5 and day 10 check if the price is above the previous Year’s closing price
    IF (Tally >= MonthDay1) AND (Tally <= MonthDay2) AND (OpenMonth = 1) THEN AboveFlag = max(AboveFlag,close > YearClose)
    ENDIF

    // enter after trading day 24 if conditions are met
    IF (OpenDay >= EntryDay) AND AboveFlag AND Not and day<28 and day>24 THEN
    BUY 1 CONTRACT AT MARKET
    ENDIF

    if longonmarket and day>4 then
    sell at market
    endif

    #246005

    I use this code

    in SUP Index  i have this situation:

    ON 10 January the close is under the close of 2024. But the code buy on 27.1

     

    #246235

    What use is NOT in this line:

    ?

    #246255

    Good Morning Roberto, thanks for answering. I am on SP500 Daily, so i have backtesting since 1950.

    #246256
    #246257

    there was missing not on market… i put the code here.

    1 user thanked author for this post.
Viewing 13 posts - 16 through 28 (of 28 total)

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