High Low Mid during trading hour
Forums › ProRealTime English forum › ProOrder support › High Low Mid during trading hour
- This topic has 15 replies, 3 voices, and was last updated 9 months ago by Annchow8052014.
-
-
02/11/2024 at 4:35 AM #227899
Hi All,
Can anyone help me to find the highest, lowest point and middle point during my trading hour, since I find that DHigh or Dlow record the highest point or lowest point before the trading hour, and my trading hour is 091500 to 030000.
Thanks in advance.
02/11/2024 at 1:59 PM #227917Hi,
From 091500 to 030000 is 17.75 hours or 71 x 15 minutes.
When using a 15-minute timeframe:
TimeFrame(15 minutes)
If Time=030000 then
xHighest=Highest[71](High)
xLowest=Lowest[71](Low)
EndIf
xMiddle=(xHighest + xLowest)/2
Return xHighest as “Highest”, xLowest as “Lowest”, xMiddle as “Middle”
02/13/2024 at 3:44 AM #228022Hi JS,
Thank you for reply.
Since I am using 1 minute time frame, and I want to have these high, low and middle during the trading hour, can you amend the code for me with thanks in advance.
02/13/2024 at 8:52 PM #228110Hi Annchow,
If you want the indicator to be “Live”, you will have to choose a certain look-back period…
Try this… (period subject to change)
Highest Lowest Middle1234567891011121314151617181920212223DefParam DrawOnLastBarOnly=True//Period=100If Time<091500 and Time>030000 thenxHighest=HighxLowest=LowxMiddle=(High+Low)/2EndIfIf Time>=091500 or Time<=030000 THENxHighest=Highest[Period](High)DrawText("Highest=#xHighest#",-75,100,SansSerif,Bold,16)Coloured("Green") Anchor(Bottom)xLowest=Lowest[Period](Low)DrawText("Lowest=#xLowest#",-75,50,SansSerif,Bold,16)Coloured("Red") Anchor(Bottom)xMiddle=(xHighest+xLowest)/2DrawText("Middle=#xMiddle#",-75,75,SansSerif,Bold,16)Coloured("Blue") Anchor(Bottom)EndIfReturn xHighest Coloured("Green") as "High",xLowest Coloured("Red") as "Low",xMiddle Coloured("Blue") as "Middle"02/14/2024 at 6:56 AM #228126Hi JS,
Thanks for your kindness and quick support .
It is working good.
02/14/2024 at 7:13 AM #228128Hi JS,
Further to my study, I find that the highest point have something wrong which record the highest point before 9:15, can you help me to amend it with thanks.
02/14/2024 at 7:42 AM #228130Hi JS,
Further to my study, I find that it record the highest point and lowest point during the 03:00 to 09:15 at the beginning of the trading hour. Please help me to amend it with thanks.
02/14/2024 at 8:51 AM #228140Hi Annchow,
I’m a bit confused because you write in the beginning that you want to have the values during your trading hours (091500-030000)…
So the indicator only shows the values during your trading hours and beyond that it is “just” the High and the Low of the price…
02/14/2024 at 8:56 AM #228142Hi JS,
Sorry for any confusion. Actually, I want to have the highest , lowest and middle point during my trading hour, however, your code provide me the highest or lowest point is not correct, it record the wrong highest point or lowest point especially during the beginning of the trading hour, please check with the pictures provided, please amend it for me with thanks.
02/14/2024 at 9:19 AM #228145Hi Annchow,
The code works with a certain look-back period, at the beginning (091500) this look-back period will also be used, (with data from before 0915000) and the output will be influenced by this…
This is inevitable or you must leave the beginning blank until only date from after 0915000 is used…
Hope it’s clear…
02/14/2024 at 11:27 AM #22815902/14/2024 at 1:10 PM #228168Hi JS,
Is it possible to design a loop to eliminate the look back ?
02/14/2024 at 2:55 PM #22817002/14/2024 at 4:32 PM #228179Hi JS,
Further to my trying to reset the trading hour, it is quite difficult and not easy to setup after trial. Thanks for your support .
02/15/2024 at 10:29 AM #228211Hi,
Currently in prooder forum, that’s ok if you’re after a code snippet to include without a “return” line in a backtest/automatic strategy and are just visualising the code behaviour through an indicator, but in case you just wanted an indicator in the first place (please confirm) then I would move the topic to the probuilder forum.
I hope I didn’t misunderstand the query, my understanding is you want customised highest and lowest (and their middle) starting at 9:15 in the morning, and going all the way to 3AM, and want to ignore what happens between 3 in the morning and 9:15 in the morning, with a code that works for 1 mn timeframe, is that correct? If yes, maybe you could try this:
123456789101112131415if opentime[1]<091500 and opentime>=091500 thenhh=highll=lowendifif opentime>=091500 or opentime<030000 thenhh=max(high,hh)ll=min(low,ll)mid=(ll+hh)/2else// in case you want to "park" hh and ll between 3AM and 9:15AM, you can choose any value you like, here high and low but can be anything else, like both on close if you preferhh=highll=lowmid=(ll+hh)/2endifreturn ll as "My lowest", mid as "My middle", hh as "My highest"1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on