0

I want to draw a line in the middle (based on the calculation) of each candlestick.

study(title="Middle-Line", shorttitle="ML", overlay=true)
mLine = hlc3
plot(mLine, color=red, title="ML", style=line)

The line will be drawn based on the hlc3 formula calculation. enter image description here

André
  • 380
  • 4
  • 9
user2670674
  • 87
  • 3
  • 14

2 Answers2

3

You can have a similar result by using plotchar

enter image description here

plotchar(hl2,char="——",color=#2157f3,location=location.absolute)

where hl2 is the position of the character, you can use different characters if you want.

alexgrover
  • 1,023
  • 1
  • 4
  • 6
0

hm, that's likely going to be pretty tricky. lines usually go across the chart from the center of the candle.

you could try playing with my answer here to draw a very short vertical line:

How to draw a vertical line in TradingView pine script?

André
  • 380
  • 4
  • 9