Global functions

31 functions. Each has a page of its own.

FunctionSummary
alertRaises an alert from inside your own logic, with a message you build.
alertconditionDeclares a condition the platform can offer to the reader. It raises nothing by itself.
barcolorRecolours the chart’s own price bars. It draws no value of its own.
bgcolorShades the pane’s background. Like barcolor it adds no value to the chart.
boolA true-or-false value. The two constants true and false are the literals for it.
colorA colour. You can write one directly as a hex literal — six digits for the colour, eight to carry alpha as well.
dayofmonthThe day of the month of the bar being evaluated.
dayofweekThe day of the week of the bar being evaluated.
fillShades the band between two plots, or between two horizontal lines. It has two forms and no mixed one, so you cannot fill between a plot and a level, and like the other output calls it must sit at the top level.
fixnanTakes a series and hands back a series of the same type, with na values dealt with.
floatA number with a fractional part, written 1.5. It has no fields.
hlineThe value hline gives back once it has drawn a horizontal level.
hourThe hour of the bar being evaluated.
indicatorDeclares the script and names it. Put it first.
inputEleven functions, one per kind of setting the reader can change from the chart: bool, colour, float, int, price, session, source, string, text area, time and timeframe.
intA whole number. One of the five data types the grammar names directly.
minuteThe minute of the bar being evaluated.
monthThe month of the bar being evaluated.
naTests whether a value is absent. It takes any type and gives back a bool.
nzTakes a value and an alternative of the same type, and stands in for the value where it is absent.
plotThe value plot gives back once it has drawn a series.
plotarrowDraws an arrow on each bar, sized from a number you supply.
plotbarDraws bars from the same four required series that plotcandle takes.
plotcandleDraws candles from four series of your own rather than from the chart’s bars.
plotcharThe same marker as plotshape, with one character in place of a shape from the fixed set.
plotshapeMarks the bars on which a condition holds, using a shape from a fixed set.
secondThe second of the bar being evaluated.
stringA piece of text, written between double quotes: "length".
timestampAssembles a time from its parts - the other direction from the eight functions that take a time apart.
weekofyearThe week of the year of a time you supply.
yearThe year of the bar being evaluated.

Part of the function index.

Ready to put this into practice?
Try GoCharting Premium
Unlock advanced orderflow, market profile, options desk, and real-time data — everything you just read about, live in your charts.
Upgrade