Hi,
I’m looking for this kind of indicator that would plot two or three major levels to upside and downside of the current price. Please see my screenshot. This is a static indicator that I’ve done but I have now idea how to make it dynamic, for example, if DAX is 9500 then the upper levels would be 9600, 9700 and lower levels would be 9400, 9300. Below is my static code for reference which is used in the chart. “Midpoint” is “price3” variable
Thank you for any ideas or code samples!
defparam drawonlastbaronly = true
price1 = 10100
price2 = 10000
price3 = 9900
price4 = 9800
price5 = 9700
xoffset=100
DRAWHLINE(price1)coloured(0,200,0)
DRAWTEXT("#price1#",barindex-xoffset,price1,SansSerif,Bold,16)coloured(153,153,0)
DRAWHLINE(price2)coloured(0,200,0)
DRAWTEXT("#price2#",barindex-xoffset,price2,SansSerif,Bold,16)coloured(153,153,0)
DRAWHLINE(price3)coloured(0,200,0)
DRAWTEXT("#price3#",barindex-xoffset,price3,SansSerif,Bold,16)coloured(153,153,0)
DRAWHLINE(price4)coloured(0,200,0)
DRAWTEXT("#price4#",barindex-xoffset,price4,SansSerif,Bold,16)coloured(153,153,0)
DRAWHLINE(price5)coloured(0,200,0)
DRAWTEXT("#price5#",barindex-xoffset,price5,SansSerif,Bold,16)coloured(153,153,0)
RETURN