KaciParticipant
Junior
Hi all,
I’m trying to build an indicator but I’m not sure it is possible to draw a rectangle in the middle of barindex ?
I mean when I’m using the DRAWRECTANGLE it actually display the rectangle at the beginning of the barindex so it’s kind of “offset”. Whereas when I use the chart configurator I manage to get the black rectangle in the middle of the barindex (C.f. Screenshot)
Also is it possible to get a specific color between the two red and green lines in the code directly ? Or is it only possible in the chart configuration ?
Many thanks !
Kaci.
As you can see from the attached pics you can draw rectangles in 3 ways:
defparam drawonlastbaronly = true //#1 it will only show on the current bar, so it's almost invisible (you can only change the bordercolor)
drawrectangle(barindex,low,barindex,high)
RETURN
defparam drawonlastbaronly = true //#2 you can start from a previous bar
drawrectangle(barindex-1,low,barindex,high)
RETURN
defparam drawonlastbaronly = true //#3 you can also end on a future bar and change both border and inside colours (v11.x ONLY)
drawrectangle(barindex-1,low,barindex+1,high) coloured (0,255,0,32) bordercolor(0,0,255,255)
RETURN
KaciParticipant
Junior
Hi Robert,
Thanks I will try which one is the best !
Kaci.