I started using parts of the code found on the site and on the PRT documentation but there are several problems:
1. The code is unstable.
Sometimes it displays the open/close of the previous day but these levels are erased a few seconds later.
2. The previous day’s highs/lows are not at the right levels.
3. When I try to put the bollinger bands on when they tighten they don’t show up anymore.
4. I don’t know how to display the levels only on the lower TFs.
@nicolas, @vonasi and @robertogozzi, do you know how to solve these problems ?
// Open/High/Low/Close/Bollinger Bands
defparam drawonlastbaronly = true
HighVT = DHigh(1)
LowVT = DLow(1)
OpenVT = DOpen(1)
LowVT = DLow(1)
BBU = BollingerUp[20](close)
BBD = BollingerDown[20](close)
IF TIME =220000 AND date=yesterday THEN
CloseVT = Close
else
IF TIME =153000 AND date=yesterday THEN
OpenVT = Open
Endif
endif
//vertical offset to draw text correctly over horizontal lines
Voffset = 0*pipsize
//draw Open/High/Low/Close/Bollinger Bands Text
DRAWTEXT("D-1 Close",barindex-54,CloseVT+Voffset,SansSerif,Standard,10)coloured(153,51,255)
DRAWTEXT("D-1 High",barindex-54,HighVT+Voffset,SansSerif,Standard,10)coloured(0,204,51)
DRAWTEXT("D-1 Low",barindex-54,LowVT+Voffset,SansSerif,Standard,10)coloured(0,204,51)
DRAWTEXT ("D-1 Open", barindex-54,OpenVT+Voffset,SansSerif,Standard,10)coloured(153,51,255)
DRAWTEXT ("BBU", barindex-54,BBU+Voffset,SansSerif,Standard,10)coloured(153,51,255)
DRAWTEXT ("BBD", barindex-54,BBD+Voffset,SansSerif,Standard,10)coloured(153,51,255)
//draw Open/High/Low/Close/Bollinger Bands lines without extensions
DRAWSEGMENT(barindex-50,CloseVT,barindex,CloseVT) coloured(153,51,255)
DRAWSEGMENT(barindex-50,HighVT,barindex,HighVT) coloured(0,204,51)
DRAWSEGMENT(barindex-50,LowVT,barindex,LowVT) coloured(0,204,51)
DRAWSEGMENT(barindex-50,OpenVT,barindex,OpenVT) coloured(153,51,255)
DRAWSEGMENT(barindex-50,BBU,barindex,BBU) coloured(153,51,255)
DRAWSEGMENT(barindex-50,BBD,barindex,BBD) coloured(153,51,255)
RETURN