PP calculation wrong

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #226968 quote
    killerplatuze
    Participant
    New

    Hi,

     

    i need a indicator which show den last 3 PP’s. I wrote this one, but something is wrogn. The red line in the picture is the PP form my PP calculations for the current day, the black line is the PP from antoher indicator from pro Real Trader. Don’t knwo whats wrong. It would be nice if someone can help me.

     

    Timeframe (1 Day)
    PPCurrentDay = (High[1] + Low[1] + Close[1])/3 //PP of the current Day
    PPoneDaybefore = (High[2] + Low[2] + Close[2])/3 //PP Tradeday before
    PPtwoDaybefore = (High[3] + Low[3] + Close[3])/3 //PP two Tradedays before
    
    //checked if the PP one Tradeday ago was reached
    If High[1] > PPoneDaybefore and low[1] < PPoneDaybefore then
    PPoneDaybeforereached = 1
    else
    PPoneDaybeforereached = 0
    endif
    
    //checked if the PP two Tradedays ago was reached
    If High[3] > PPtwoDaybefore and low[3] < PPtwoDaybefore then
    PPtwoDaybeforereached = 1
    else
    PPtwoDaybeforereached = 0
    endif
    
    Timeframe (60 Minutes)
    If High > PPCurrentDay and Low < PPCurrentDay then
    PPreached = 1
    else
    PPreached = 0
    endif
    
    PRINT(PPoneDaybefore) as "PPoneDaybefore" COLOURED("Black") FILLCOLOR("Green")
    PRINT(PPtwoDaybefore) as "PPtwoDaybefore" COLOURED("Black") FILLCOLOR("Green")
    PRINT(PPCurrentDay) as "PPCurrentDay" COLOURED("Black") FILLCOLOR("Green")
    //PRINT(PPoneDaybeforereached) as "PPoneDaybeforereached" COLOURED("Black") FILLCOLOR("Green")
    //PRINT(PPtwoDaybeforereached) as "PPtwoDaybeforereached" COLOURED("Black") FILLCOLOR("Green")
    
    Return PPCurrentDay
    
    PP_wrong.jpg PP_wrong.jpg
    #226970 quote
    killerplatuze
    Participant
    New

    The problem is allways at the first day of the week, The problem occurs on Mondays, if it is a holiday then Tuesday.

    #226972 quote
    killerplatuze
    Participant
    New

    This could be a part pf the prblem, PP on Sunday? Never ever, but its every Sunday.

    Screenshot_1-1.jpg Screenshot_1-1.jpg
    #226976 quote
    LucasBest
    Participant
    Average

    It is because of sunday of course. Here’s the formula i made to find the good Pivot Point (same pivot point as prorealtime embeded ones), which works in any time frame below 1 day. You don’t need to use timeframe instruction to get the Daily Pivot Point.

    IF (DAYOFWEEK=DAYOFWEEK[1] and DAYOFWEEK<>DAYOFWEEK[2] and dayofweek>1) or (dayofweek<DAYOFWEEK[1]) then
    IF dayofweek <> 1 or (dayofweek<DAYOFWEEK[1]) THEN
    DailyPP = (DHigh(1) + DLow(1) + DClose(1)) / 3
    Elsif dayofweek = 1 then
    DailyPP = (DHigh(2) + DLow(2) + DClose(2)) / 3
    endif
    drawvline(barindex)
    endif
    
    Return DailyPP

    I have an other code that is even more accurate (in my point of view)… Because, Prorealtime Pivot Point is little wrong every Tuesday. It does not take into account the low of the first candle of sunday (whatever the timeframe).

    Nicolas and killerplatuze thanked this post
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.

PP calculation wrong


ProBuilder: Indicators & Custom Tools

New Reply
Author
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by LucasBest
2 years, 1 month ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 01/27/2024
Status: Active
Attachments: 2 files
Logo Logo
Loading...