high[1] = ‘previous dhigh’. How?
Forums › ProRealTime English forum › ProScreener support › high[1] = ‘previous dhigh’. How?
- This topic has 8 replies, 3 voices, and was last updated 1 month ago by
robertogozzi.
-
-
01/04/2025 at 3:17 PM #242148
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?
01/05/2025 at 12:24 AM #242171I 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)
2 users thanked author for this post.
01/05/2025 at 12:18 PM #242176Actually, 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:
1RETURN high AS "Hogh",DHigh(0) AS "DHigh"1 user thanked author for this post.
01/05/2025 at 3:16 PM #242194It 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:
12345IF high[1] = dhigh(0) AND dhigh(0) = ‘previous dhigh van CURRENT DAY’.THENSignal = 10.000000screener [ signal > 0 ] sort by signal as "10 min"ENDIFI 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.
01/06/2025 at 5:03 PM #242229This is the code I wrote, but I am not sure to have understood what you want:
1234567891011121314151617ONCE CurrDHigh = DHigh(0)ONCE PrevDHigh = DHigh(0)ONCE temp = DHigh(0)IF OpenDay <> OpenDay[1] THENCurrDHigh = DHigh(0)PrevDHigh = DHigh(0)ENDIFIF temp <> DHigh(0) THENPrevDHigh = CurrDHighCurrDHigh = DHigh(0)ENDIFtemp = DHigh(0)Signal = 0IF high[1] = dhigh(0) AND dhigh(0) = PrevDHigh THENSignal = 10.000000ENDIFscreener [signal] sort by signal as "10 min"01/17/2025 at 3:03 PM #242723Thank 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 😊
01/18/2025 at 5:33 PM #242786This version should do:
123456myDHigh = DHigh(0)Signal = 0IF high >= myDHigh[1] THENSignal = 10.000000ENDIFscreener [signal] sort by signal as "10 min"1 user thanked author for this post.
01/21/2025 at 3:20 PM #242923We 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.
01/22/2025 at 10:12 AM #242937There you go:
123456789101112myDHigh = DHigh(0)Signal = 0IF high >= myDHigh[1] THENSignal = 10.000000FOR i = 1 TO 255IF high[i] = myDHigh[1] THENbars = BarIndex - BarIndex[i]breakENDIFNEXTENDIFscreener [signal](bars AS "Bars in between") -
AuthorPosts