Sidechair

location.* constants

Browse the reference

Where plotshape() and plotchar() place a marker: above or below the bar, at the top or bottom of the pane, or at an absolute price.

Try it in the editor

location.* constants go in the location argument of plotshape and plotchar. location.abovebar and location.belowbar attach the marker to the bar's high or low, so it follows price. location.top and location.bottom pin it to the edge of the pane, which suits signals in a separate indicator pane. location.absolute puts it at the value of the plotted series itself.

With location.abovebar, location.belowbar, location.top and location.bottom the marker's vertical position ignores the series value; only whether the series is true matters. With location.absolute the series value is the price.

Constants

NameValueDescription
location.abovebarAbove the bar's high; the default.
location.absoluteAt the price given by the plotted series.
location.belowbarBelow the bar's low.
location.bottomPinned to the bottom edge of the pane.
location.topPinned to the top edge of the pane.

Remarks

  • location.abovebar is the default.
  • Use location.absolute when you want to mark a specific level, such as the exact price of a signal.

Example

Pine ScriptMarker placementOpen in editor
//@version=6
indicator("Locations", overlay = true)
hi = ta.highest(high, 20)
lo = ta.lowest(low, 20)
plotshape(high == hi, "New high", shape.arrowdown, location.abovebar, color.red)
plotshape(low == lo, "New low", shape.arrowup, location.belowbar, color.green)
plotshape(hi, "Top level", shape.circle, location.absolute, color.new(color.gray, 60), size = size.tiny)

See also

Runs on Sidechair