Plot Yesterday’s High, Low and Close
Forums › ProRealTime English forum › ProBuilder support › Plot Yesterday’s High, Low and Close
- This topic has 21 replies, 5 voices, and was last updated 7 years ago by AVT.
-
-
07/25/2017 at 7:34 AM #41535
Hi
Could somebody please help with the creation of the following indicator.
Plot Yesterday’s High, Low and Close. The instrument trades 24 hours so the parameters necessary for calculating the indicator: Open- 083000 Close 160000. Must display on lower timeframe charts.
Thank you
07/25/2017 at 9:57 AM #41545Hi,
This exists as an indicator in your PRT platform per default.
If I translate it from french it should be called “price line”. You can select “previous period” which will display yesterday’s values. According to your wish, you will create 3 indicators like this : one for the Close, one for the Highest, one for the Lowest (select “close”, “high” “low” in the indicator properties).
BR,
07/25/2017 at 10:14 AM #4155007/26/2017 at 1:58 PM #41679Actually this is not what you asked for. The inbuilt PRT function works quite OK (there is also little problems) for high and low of the last 24h but open and close will not give you the open at 8:30 or whichever open you mean. The open tex for the Dax will give you the price from 0:00 since IG gives you a price for the dax 24h.
So if you want an indicator that shows yesterdays open at 8:30 you will have to code it yourself and this will only work on timeframes 30min or lower. Same for the close, though if you want to have it from 16:00 1h timeframe will of course also work.
07/26/2017 at 3:36 PM #4169007/27/2017 at 8:44 AM #41764Would you please tell me exactely what lines you need? Yesterdays high, low, close is something differen than 8h open and 16h close. Or do you want all those lines, and for how long do need them in the chart?. I am plotting a lot of such lines in my window, so maybe I could change my code to your needs.
07/27/2017 at 8:55 AM #4176607/27/2017 at 4:59 PM #4183107/27/2017 at 5:41 PM #4183307/27/2017 at 6:03 PM #41835The first part is easy, so get at least some lines automatic painted, I give you the code for painting the closing of yesterday and todays open.
yesterdays close and todays open1234567891011121314151617MarketRange = (time>=083000 AND time<=163000) // 8:30-16:30// --- the trick for this is to go until midnight and start at midnight againPrintCloseRange = ( (time>=000000 AND time<=162959) OR (time>163100 AND time<235959) )IF Time = 083000 THENEightHOpenVal = open // 8:30 openELSIF Time = 163000 THENXClose = close // 16:30 closeENDIFIF MarketRange THEN // 8:30 orangeDRAWSEGMENT(barindex-1,EightHOpenVal,barindex,EightHOpenVal) coloured(255,128,0)ENDIFIF PrintCloseRange THEN // yesterday-today 16:30 blackDRAWSEGMENT(barindex-1,XClose,barindex,XClose) coloured(0,0,0)ENDIFRETURNI know there’s a trick to get the other too, still working on that one, cause I don’t paint yesterdays high/low into todays chart (my own limit would be short before today opens, because I have enough lines in my day chart).
Check the first two, would be for now 2 lines less, if it works the way you wanted.
07/28/2017 at 3:40 PM #41904I think I got it working. Would you please test if it works as we want it. Thanks. Code:
yesterday high/low/close today open in todays chart123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263MarketRange = (time>=083000 AND time<=163000) // 8:30-16:30// --- the trick for this is to go until midnight and start at midnight againPrintCloseRange = ( (time>=000000 AND time<=162959) OR (time>163100 AND time<235959) )//PrintHighLowRange = ( (time>=163100 AND time<=000000) OR (time>=000001 AND time<=163000) )IF Time = 083000 THENEightHOpenVal = open // 8:30 openELSIF Time = 163000 THENXClose = close // 16:30 closeENDIFIF MarketRange THEN // 8:30 orangeDRAWSEGMENT(barindex,EightHOpenVal,barindex+1,EightHOpenVal) coloured(255,128,0)ENDIFIF PrintCloseRange THEN // yesterday-today 16:30 blackDRAWSEGMENT(barindex-1,XClose,barindex,XClose) coloured(0,0,0)ENDIFOnce MyDayOfWeek=CurrentDayOfWeek // returns 5Drawtext("wd#MyDayOfWeek#",barindex-20,0.4)IF (IntradayBarIndex=0) AND (DayOfWeek[0]<>MyDayOfWeek) THEN // DayOfWeek[0] returns 4 yesterdayYhighestPrice = 0 // Y ultimate lowYlowestPrice = close * 1000 // Y ultimate highENDIFIF Marketrange THEN //YhighestPrice = max(YhighestPrice,high)YlowestPrice = min(YlowestPrice,low)YHighest = YhighestPriceYLowest = YlowestPriceENDIFif BarIndex < 3 thenMyDay=opendaydayminutes = 1440*(MyDay-MyDay[1])MyHour=openhourhourminutes = 60*(MyHour-MyHour[1])MyMin=openminutebarminutes = MyMin - MyMin[1] + hourminutes + dayminutesbarminutes=abs(barminutes)Mybarminutes = lowest[1](barminutes)[1]endifIF Mybarminutes = 1 THENFuture=480ELSIF Mybarminutes = 5 THENFuture=100ELSIF Mybarminutes = 10 THENFuture=48ELSIF Mybarminutes = 15 THENFuture=34ELSIF Mybarminutes = 30 THENFuture=18ELSIF Mybarminutes = 60 THENFuture=9ELSIF Mybarminutes = 120 THENFuture=4ELSEFuture=1ENDIFIF (time>=170000 AND time<245959) OR (time>=00000 AND time<=082959) THEN // yesterday blueDRAWSEGMENT(barindex,YHighest,barindex+Future,YHighest) coloured(0,0,255)DRAWSEGMENT(barindex,YLowest,barindex+Future,YLowest) coloured(0,0,255)ENDIFRETURNSorry that comments are not as usual, is just my “working sheet”. 😉
07/28/2017 at 4:03 PM #4190507/28/2017 at 4:40 PM #4190807/29/2017 at 11:32 AM #4194208/02/2017 at 11:22 AM #42309Hello,
I have similar request, I need to draw 2 segments (or a rectangle) to see the levels of 8:00 and 9:00 in my 15 minutes or hourly chart (cf. screenshot)
please advice how to implement this (ideally in a flexible way so that I can change the interval…).
-
AuthorPosts
Find exclusive trading pro-tools on