DRAW RECTANGLE – How to draw past 00:00 times
- This topic has 4 replies, 3 voices, and was last updated 5 years ago by .
Viewing 5 posts - 1 through 5 (of 5 total)
Viewing 5 posts - 1 through 5 (of 5 total)
Forums › ProRealTime English forum › ProBuilder support › DRAW RECTANGLE – How to draw past 00:00 times
Hi, i’m using the draw rectangle code but i want to use this on different time frames that run through the 00:00 time
eg 173000 – 060000
when i set this the rectangle does not draw.
is there a way to do this?
thanks
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
period = 20 boxheight = 0.0020 hh = highest[period](high) ll = lowest[period](low) if hh-ll <= boxheight then for i = 0 to period do if high[i]=hh then x2 = barindex[i] endif if low[i]=ll then x1 = barindex[i] endif next if ABS(x2-x1) >= period then DRAWRECTANGLE(x1,ll,x2,hh)coloured(255,10,10) endif endif RETURN |
… but you are finding the highest high and lowest low in the last 20 bars and then if they are have a difference of less than or equal to 20 pips then line 15 has a condition that only lets you draw a rectangle if the HH and LL are 20 or more bars apart. Surely this condition is very rarely going to be hit as they cannot be over 20 bars apart as that is your look back period to find them within! So in reality we are looking for a HH and LL less than 20 pips in difference where the HH and LL are exactly 20 bars apart.