Types
shape
The twelve markers `plotshape` can draw: `xcross`, `cross`, `triangleup`, `triangledown`, `flag`, `circle`, `arrowup`, `arrowdown`, `labelup`, `labeldown`, `square` and `diamond`. Written `shape.triangleup` and so on. The interpreter records which member you named and leaves the drawing to the chart.
Fields / Members
xcross Shape style for plotshape function. cross Shape style for plotshape function. triangleup Shape style for plotshape function. triangledown Shape style for plotshape function. flag Shape style for plotshape function. circle Shape style for plotshape function. arrowup Shape style for plotshape function. arrowdown Shape style for plotshape function. labelup Shape style for plotshape function. labeldown Shape style for plotshape function. square Shape style for plotshape function. diamond Shape style for plotshape function. Example
//@lipi=2
indicator("Shape Example", overlay=true)
// Define bullish and bearish engulfing conditions
bullishEngulfing = close > open and close[1] < open[1] and close > close[1] and open < open[1]
bearishEngulfing = close < open and close[1] > open[1] and close < close[1] and open > open[1]
// Plot a triangle up for bullish engulfing
plotshape(series=bullishEngulfing, location=location.belowbar, shape=shape.triangleup, color=color.green, title="Bullish Engulfing")
// Plot a triangle down for bearish engulfing
plotshape(series=bearishEngulfing, location=location.abovebar, shape=shape.triangledown, color=color.red, title="Bearish Engulfing")
// Plot a cross at every bar where the close is equal to the open (Doji)
doji = close == open
plotshape(series=doji, location=location.abovebar, shape=shape.cross, color=color.blue, title="Doji")