Looking for PP monthly

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #222539 quote
    Inertia
    Participant
    Master
    // POINT PIVOT HEBDOMADAIRE
    IF dayofweek < dayofweek[1] THEN
    weekhigh = prevweekhigh
    weeklow = prevweeklow
    weekclose = prevweekclose
    prevweekhigh = high
    prevweeklow = low
    ENDIF
     
    prevweekhigh = max(prevweekhigh, high)
    prevweeklow = min(prevweeklow, low)
    prevweekclose = close
     
    PPWeek = (weekhigh + weeklow + weekclose) / 3
      
    // POINT PIVOT JOURNALIER
    IF dayofweek = 1 THEN
    dayhigh = DHigh(2)
    daylow = DLow(2)
    dayclose = DClose(2)
    ENDIF
     
    IF dayofweek >=2 and dayofweek < 6 THEN
    dayhigh = DHigh(1)
    daylow = DLow(1)
    dayclose = DClose(1)
    ENDIF
     
    PPDay = (dayhigh + daylow + dayclose) / 3
     
     
    RETURN PPWeek COLOURED(50,50,220) AS"Pivot Week", PPDay COLOURED (220,50,50) as "Point Pivot"

    Hello all !

    How do I make it monthly please? (on top of the current daily and weekly)

     

    Thank you

    Damien

    #222540 quote
    Inertia
    Participant
    Master

    The Line 2 might be the issue?

    If so I will replace after your solution “week” by “month”.

    #222561 quote
    robertogozzi
    Moderator
    Master

    I used your code and I can’t see any gap, as from my pics.

    It may be due to some settings.

    You may want to test your indicator also on another instrument.

    Inertia thanked this post
    #222569 quote
    Inertia
    Participant
    Master

    Thank you Roberto.

    But how do have the PP Monthly please?

    This is the weekly one for the example.

    Kind regards,

    Damien

    #222570 quote
    robertogozzi
    Moderator
    Master

    Sorry, I misunderstood your request. There you go:

    // POINT PIVOT MENSUEL
    IF openmonth <> openmonth[1] THEN
       monthhigh = prevmonthhigh
       monthlow = prevmonthlow
       monthclose = prevmonthclose
       prevmonthhigh = high
       prevmonthlow  = low
    ENDIF
     
    prevmonthhigh = max(prevmonthhigh, high)
    prevmonthlow = min(prevmonthlow, low)
    prevmonthclose = close
     
    PPmonth = (monthhigh + monthlow + monthclose) / 3
    
    Res3 = Res1 + (monthhigh - monthlow)
    Res2 = PPmonth + monthhigh - monthlow
    Res1 = (2 * PPmonth) - monthlow
    Sup1 = (2 * PPmonth) - monthhigh
    Sup2 = PPmonth - (monthhigh - monthlow)
    Sup3 = Sup1 - (monthhigh - monthlow)
    
    Return Res1        AS "Res1"      coloured("green"), Res2        AS "Res2"      coloured("green"), Res3        AS "Res3"      coloured("green"), PPmonth        AS "Pivot"      coloured("black"), Sup1        AS "Sup1"      coloured("red"), Sup2        AS "Sup2"      coloured("red"), Sup3        AS "Sup3"      coloured("red"), PPmonth COLOURED(50,50,220) AS"Pivot month"
    Inertia and KumoNoJuzza thanked this post
    #222572 quote
    Inertia
    Participant
    Master

    That is just PERFECT Robeto!

    Big thanks !

    Damien

    robertogozzi thanked this post
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.

Looking for PP monthly


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
Inertia @inertia Participant
Summary

This topic contains 5 replies,
has 2 voices, and was last updated by Inertia
2 years, 3 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 10/17/2023
Status: Active
Attachments: 2 files
Logo Logo
Loading...