0
votes

.

I have the sense that what I am hoping to do is not possible, but I thought I would throw out this question for anyone who might have some proposals (or can give me a strict "no").

Instead of the standard hollow/filled candlesticks, I would like to create triangular candlesticks that (in addition to filling the body) point in the direction of price movement from open to close -- in accordance with the fill.

Furthermore, wicks would extend beyond the point and base of each triangular candle.

Another way of describing this would be to say that the body of each candle would taper towards the close

For example, the plot conditions would be:

Green Hollow Upward Triangle (close[0] > close[1]) and (open[0] < close[0])

Red Filled Downward Triangle (close[0] < close[1]) and (open[0] > close[0])

--

Green Filled Downward Triangle (close[0] > close[1]) and (open[0] > close[0])

Red Hollow Upward Triangle (close[0] < close[1]) and (open[0] < close[0])

In the absence of the ability to send a sketch of the idea, hopefully that explanation is clear enough.

Is there any chance we can do something like this within the current framework of Pine Script?

Thanks in advance for any suggestions on how we might achieve this.

See below for a sketch of the idea.

enter image description here

1

1 Answers

0
votes

Plotting a triangle can be done using plotchar, plotshape or label.new, however, it is not possible to control precisely the top and base position of the triangle.

The hollow effect can be made by plotting a white shape in front of a bigger one, for example:

avg = avg(close,open)
plotshape(avg,style=shape.triangleup,location=location.absolute,
  color=close>open?#0cb51a:na,size=size.normal)
plotshape(avg,style=shape.triangleup,location=location.absolute,color=
  close>open?color.white:na,size=size.small)

So you are better of using plotcandle which is specifically designed to plot candles.