Modify this Range box indicator please
Forums › ProRealTime English forum › ProBuilder support › Modify this Range box indicator please
- This topic has 17 replies, 5 voices, and was last updated 5 years ago by robertogozzi.
-
-
03/19/2019 at 7:33 PM #94072
Hello, can someone please modify this indicator.
It currently shows 000000=080000
I want it to show 163000-163000
Thanks!
03/21/2019 at 1:55 PM #9429304/11/2019 at 3:49 PM #9611812345678910111213141516171819//defparam drawonlastbaronly = trueif intradaybarindex=0 thenmaxvalue=0minvalue=Dclose(0)*5endiftimerange = time>000000 and time<=080000if timerange thenmaxvalue = max(maxvalue , high)minvalue = min(minvalue , low)if intradaybarindex=0 thenx1=barindexendifif time=080000 thenx2=barindexDRAWRECTANGLE(x1,maxvalue,x2,minvalue) coloured(0,0,0,0)endifendifRETURNThat is the code for the current 0000-0800 box.
What i would like is the code modified to show 1630-1630, I’ve tried and it’s not playing fair.
04/11/2019 at 3:51 PM #96120Also, if anyone could modify/make code to show a weekly box, it would be for the DAX, so showing Sunday 2200- Friday 2100, I’ve added an image of what i Manually put on the chart.
Thank you to anyone who can help!
04/11/2019 at 3:56 PM #9612304/11/2019 at 4:09 PM #96129If it’s not possible 1630-1630 then 1700-1600, possible?
04/11/2019 at 4:19 PM #96130I think that this simple code would do the trick:
12345678910111213StartEndHour = 163000maxvalue = max(maxvalue , high)minvalue = min(minvalue , low)if time = StartEndHour thenDRAWRECTANGLE(x1,maxvalue,barindex,minvalue) coloured(0,0,0,0)x1=barindexmaxvalue=0minvalue=Dclose(0)*5endifRETURN04/11/2019 at 4:24 PM #96134Good man, could you do a weekly for me?
04/11/2019 at 4:46 PM #96138Try this version:
1234567891011121314maxvalue = max(maxvalue , high)minvalue = min(minvalue , low)if opentime=220000 and dayofweek=0 thenx1=barindexmaxvalue=0minvalue=Dclose(0)*5endifif time = 210000 and dayofweek=5 thenDRAWRECTANGLE(x1,maxvalue,barindex,minvalue) coloured(0,0,0,0)endifRETURN04/11/2019 at 4:55 PM #96140It looks a bit different, I cant view on any timeframe higher than 1hr..
04/11/2019 at 5:21 PM #96145Are the Friday bar at 210000 and Sunday bar at 220000 visible on your chart? If not, the calculation cannot be done.
1 user thanked author for this post.
04/11/2019 at 5:39 PM #96146This adaptation of Nicolas’ code might be what you want? It resets the rectangles on the first Sunday candle or first trading candle of the week if there are non trading Sundays, Mondays etc. It does not draw a rectangle until a week is completed. Works on any time frame from daily or faster.
1234567891011maxvalue = max(maxvalue , high)minvalue = min(minvalue , low)if opendayofweek < opendayofweek[1] thenDRAWRECTANGLE(x1,maxvalue,barindex-1,minvalue) coloured(0,0,0,0)x1=barindexmaxvalue=highminvalue=lowendifRETURN1 user thanked author for this post.
04/12/2019 at 2:00 PM #96267Are the Friday bar at 210000 and Sunday bar at 220000 visible on your chart? If not, the calculation cannot be done.
Nope, I’ve tried the code below and that works for me, thanks for your help with the other box coding!
This adaptation of Nicolas’ code might be what you want? It resets the rectangles on the first Sunday candle or first trading candle of the week if there are non trading Sundays, Mondays etc. It does not draw a rectangle until a week is completed. Works on any time frame from daily or faster.
1234567891011maxvalue = max(maxvalue , high)minvalue = min(minvalue , low)if opendayofweek < opendayofweek[1] thenDRAWRECTANGLE(x1,maxvalue,barindex–1,minvalue) coloured(0,0,0,0)x1=barindexmaxvalue=highminvalue=lowendifRETURN
Works for me, thanks mate!04/28/2019 at 3:36 PM #97301Hello Nicolas,
I tried just to change time , so that I get box from 09.00h to 10.00h…by typing “09000” and 010000″..but it displayed boxes over several days long…?
Please how can I add a simple time change to :
12345678910111213141516171819//defparam drawonlastbaronly = trueif intradaybarindex=0 thenmaxvalue=0minvalue=Dclose(0)*5endiftimerange = time>000000 and time<=080000if timerange thenmaxvalue = max(maxvalue , high)minvalue = min(minvalue , low)if intradaybarindex=0 thenx1=barindexendifif time=080000 thenx2=barindexDRAWRECTANGLE(x1,maxvalue,x2,minvalue) coloured(0,0,0,0)endifendifRETURNThe box should be displayed from 09.00h to 10.00h in the morning.
Merci beacucoup, Nicola!
Regards Micha
04/28/2019 at 4:07 PM #97304Try uncommenting line 1 and move line 15 to line 18.
-
AuthorPosts
Find exclusive trading pro-tools on