high[1] = ‘previous dhigh’. How?

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #242148 quote
    Robin81
    Participant
    Junior

    I am thinking of something but I can’t figure it out…
    The idea: I want to receive a notification in Proscreener if the high of the most recently closed candle is equal to the ‘existing dhigh’. In other words: the high of the most recently closed candle is equal to the ‘existing high’ of the day.

    The line of thought is, I think:
    IF high[1] = dhigh AND dhigh = ‘previous dhigh’.

    The previous dhigh is the highest of this day, before the high of the most recently closed candle is set.

    In this case, by ‘existing high’ I mean the dhigh of the CURRENT day.

    Who can help me in the right line of thought to make the ‘previous dhigh’ in the right way?

    Question-PRT-dhigh.jpg Question-PRT-dhigh.jpg
    #242171 quote
    phoentzs
    Participant
    Master

    I think what you are looking for is the following:

     

    myCond = dhigh(0) = dhigh(1)

     

    Although there will never or rarely be an exactly the same high. So this will be more practical:

     

    myCond = dhigh(0) >= dhigh(1)

    robertogozzi and Iván González thanked this post
    #242176 quote
    robertogozzi
    Moderator
    Master

    Actually, in an UPtrend, there will be a moment when the HIGH is equal to DHIGH(0), no matter what timeframe is on the chart.

    Try this indicator:

    RETURN high AS "Hogh",DHigh(0) AS "DHigh"
    Iván González thanked this post
    #242194 quote
    Robin81
    Participant
    Junior

    It is indeed true that the price will once be as high as the Dhigh in an uptrend. I must therefore explain my question a little more specifically.
    I want a Proscreener where I get a notification if the high of the closed candle (TF 10) is exactly the same as the previous highest point of TODAY. Under certain conditions this can become resistance at day level.

    This is the line of thought:

    IF high[1] = dhigh(0) AND dhigh(0) = ‘previous dhigh van CURRENT DAY’.
    THEN
    Signal = 10.000000
    screener [ signal > 0 ] sort by signal as "10 min"
    ENDIF
    

    I can’t figure out how that Hogh gets a place in this?

    My intention with high[1] = dhigh(0) AND dhigh(0) = ‘previous dhigh of CURRENT DAY’.: If the high[1] of the closed 10-minute candle has become the dhigh(0), it should be checked whether the dhigh(0) is also equal to the highest high of the previous 10-minute candles of TODAY.

    If I need to explain further, please let me know.

    Question-PRT-dhigh-1.jpg Question-PRT-dhigh-1.jpg
    #242229 quote
    robertogozzi
    Moderator
    Master

    This is the code I wrote, but I am not sure to have understood what you want:

    ONCE CurrDHigh = DHigh(0)
    ONCE PrevDHigh = DHigh(0)
    ONCE temp      = DHigh(0)
    IF OpenDay <> OpenDay[1] THEN
       CurrDHigh = DHigh(0)
       PrevDHigh = DHigh(0)
    ENDIF
    IF temp <> DHigh(0) THEN
       PrevDHigh = CurrDHigh
       CurrDHigh = DHigh(0)
    ENDIF
    temp   = DHigh(0)
    Signal = 0
    IF high[1] = dhigh(0) AND dhigh(0) = PrevDHigh THEN
       Signal = 10.000000
    ENDIF
    screener [signal] sort by signal as "10 min"
    Iván González and Robin81 thanked this post
    #242723 quote
    Robin81
    Participant
    Junior

    Thank you very much for thinking along. I tested the code, but it doesn’t work yet. It now gives a message if the condition high[1] = dhigh(0) is correct. In other words: the previous high[1] is the highest of the day.
    The other part (dhigh(0) = PrevDHigh) doesn’t seem to work. The idea is to scan if the dhigh(0) is equal to the previous highest high of THIS day, see also my previous screenshot. It seems that PRT gets confused with this script.

    Now I’m thinking of the following idea to hopefully make it work:
    -Timeframe 10, so 144 candles per day.
    – IF (high[1] = dhigh(0) -> look at previous highs (candle 4 and further back) of the CURRENT day to see if there is a previous equal highest with the same value as high[1].
    For example by: highest[144](high[4]) = high[1].

    Problem: candles from the previous day are also looked at, and I don’t want that. What should I add to find the highest only on the CURRENT day, so ‘less’ looking back than the theoretical 144 candles.

    I hope you have an idea, then I can try, think and test further 😊

    Question-PRT-dhigh-2.jpg Question-PRT-dhigh-2.jpg
    #242786 quote
    robertogozzi
    Moderator
    Master

    This version should do:

    myDHigh = DHigh(0)
    Signal = 0
    IF high >= myDHigh[1] THEN
       Signal = 10.000000
    ENDIF
    screener [signal] sort by signal as "10 min"
    Robin81 thanked this post
    #242923 quote
    Robin81
    Participant
    Junior

    We are almost there 🙂 I tested it and your idea works. Only the last part I can’t solve/think of.

    In the attachment a sketch of what I mean. I would like at least 10 candles between the equal highs. This prevents sideways market. So up to 10 candles no valid signal, but only with 11 candles back or more. Can the results between candle 0 and 10 be ignored with a handy idea?

    Thank you in advance for your time and effort.

    20250121_151150-scaled.jpg 20250121_151150-scaled.jpg
    #242937 quote
    robertogozzi
    Moderator
    Master

    There you go:

    myDHigh = DHigh(0)
    Signal = 0
    IF high >= myDHigh[1] THEN
       Signal = 10.000000
       FOR i = 1 TO 255
          IF high[i] = myDHigh[1] THEN
             bars = BarIndex - BarIndex[i]
             break
          ENDIF
       NEXT
    ENDIF
    screener [signal](bars AS "Bars in between")
Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.

high[1] = ‘previous dhigh’. How?


ProScreener: Market Scanners & Detection

New Reply
Author
author-avatar
Robin81 @robin81 Participant
Summary

This topic contains 8 replies,
has 3 voices, and was last updated by robertogozzi
1 year, 1 month ago.

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 01/04/2025
Status: Active
Attachments: 4 files
Logo Logo
Loading...