Sidechair

splits.* constants

Browse the reference

The fields request.splits can return: splits.numerator and splits.denominator of a stock split ratio.

Try it in the editor

splits.numerator and splits.denominator go in the field argument of request.splits. A 3-for-2 split has numerator 3 and denominator 2. The function returns the figure on the bar of the split date and na on every other bar unless gaps is off.

Divide the numerator by the denominator to get the split factor: 2 for a 2-for-1, 0.1 for a 1-for-10 reverse split.

Constants

NameValueDescription
splits.denominatorThe bottom number of the split ratio.
splits.numeratorThe top number of the split ratio.

Remarks

  • Both fields are series float. Request them with the same symbol and gaps setting so they line up.
  • On Sidechair: request.splits is not supported yet; it warns once and returns na.

Example

Pine ScriptSplit ratio on the chartOpen in editor
//@version=6
indicator("Splits")
num = request.splits(syminfo.tickerid, splits.numerator, barmerge.gaps_on)
den = request.splits(syminfo.tickerid, splits.denominator, barmerge.gaps_on)
plot(num / den, "Split factor", color.orange, style = plot.style_circles)
plot(close, "Close", color.gray)

See also

Runs on Sidechair