The fields request.splits can return: splits.numerator and splits.denominator of a stock split ratio.
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
| Name | Value | Description |
|---|---|---|
splits.denominator | The bottom number of the split ratio. | |
splits.numerator | The 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.splitsis not supported yet; it warns once and returns na.
Example
//@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