Built-in variables

These names resolve to a series without being called. Prices and volume come from the bars currently loaded on the chart.

NameMeaning
CLOSE, CClose price.
OPEN, OOpen price.
HIGH, HHigh price.
LOW, LLow price.
VOL, VVolume.
AMOUNT, AMOTurnover.
ISUP / ISDOWN / ISEQUAL1 when the bar closes up / down / flat.
TRTrue range of the bar.
DRAWNULL, NULLThe invalid value. Assign it to hide a point on a line.
CURRBARSCOUNTNumber of bars from this bar to the last bar.
TOTALBARSCOUNTTotal number of bars loaded.
BARPOS1-based index of the bar from the start of the data.
ISLASTBAR1 on the most recent bar only.
BARSTATUS1 = first bar, 2 = last bar, 0 = anywhere in between.
PERIODTimeframe code: 0 day, 1 week, 2 month, 3 year, 9 quarter, 4 1-min, 5 5-min, 6 15-min, 7 30-min, 8 60-min, 11 tick-level.
DATEBar date as YYYYMMDD minus 19000000.
DATETIMECombined date and time value.
TIMEBar time as HHMMSS.
YEAR / MONTH / DAYCalendar parts of the bar.
HOUR / MINUTEClock parts of the bar.
WEEK, WEEKDAYDay of week, 0 = Sunday.
CODESymbol code as a string.
STKNAMESymbol name as a string.
FROMOPENMinutes elapsed since the session open.
TOTALFZNUMTotal trading minutes in the session.
MACHINEDATEThe local machine date, in the same encoding as DATE.
MACHINETIMEThe local machine clock time as HHMMSS.
MACHINEWEEKThe local machine day of week, 0 = Sunday.
TIME2Bar time in the alternate encoding used by intraday data.
WEEKOFYEARWeek number within the year.
DAYSTOTODAYCalendar days from the bar to today.
AUTOFILTERSignal de-duplication flag used by the scanner.

The variables below are accepted by the compiler but are served by a China A-share style feed. On the current market data source they resolve to nothing, so a script that uses one draws an empty pane rather than reporting an error.

NameMeaning — legacy feed only
VOLRVolume ratio against the recent average.
VOLINSTK, OPIOpen interest (futures).
SETTLE, QHJSJSettlement price (futures).
ZSTJJIntraday average price line; valid on intraday timeframes.
CAPITALFree-float share capital, in lots.
TOTALCAPITALTotal share capital, in lots.
EXCHANGE, HSLTurnover rate.
SETCODEMarket type code.
TQFLAGCurrent adjustment mode: 0 none, 1 back-adjusted, 2 forward-adjusted.
INDEXO / INDEXH / INDEXL / INDEXC / INDEXV / INDEXAOpen, high, low, close, volume and turnover of the market index.
INDEXADV / INDEXDECAdvancing and declining counts in the market index.
HY_INDEXO … HY_INDEXDECThe same eight fields for the symbol's sector index.
ADVANCE / DECLINEAdvancing and declining counts for the symbol's own index.
HYBLOCK / DYBLOCK / GNBLOCKSector, region and concept block names.
FGBLOCK / ZSBLOCK / ZHBLOCK / ZDBLOCKStyle, index, combination and custom block names.
GNBLOCKNUM / FGBLOCKNUM / ZSBLOCKNUM / ZHBLOCKNUM / ZDBLOCKNUMHow many blocks of each kind the symbol belongs to.
HYZSCODEIndex code of the symbol's sector.
HYSYL / HYSJLSector price/earnings and price/book ratio.
DYNA_NOWLast price from the live quote; falls back to the previous close before the open.
DYNA_ZAF / DYNA_ZASLive change ratio and rate of change; multiply by 100 for a percentage.
DYNA_LBLive volume ratio.
BUYVOL / SELLVOLOutside and inside volume from the live quote.
ACTINVOL / ACTOUTVOLAggressive buy and sell volume.
LARGEINTRDVOL / LARGEOUTTRDVOLLarge-order buy and sell volume.
TRADENUM / TRADEINNUM / TRADEOUTNUMTotal, buy-side and sell-side trade counts.
LARGETRDINNUM / LARGETRDOUTNUMLarge-order buy and sell trade counts.
CUR_BUYORDER / CUR_SELLORDERTotal resting bid and ask size.
BIDORDERVOL / BIDCANCELVOLCumulative bid volume placed and cancelled.
OFFERORDERVOL / OFFERCANCELVOLCumulative ask volume placed and cancelled.
AVGBIDPX / AVGOFFERPXLatest average bid and ask price.
DOPEN / DHIGH / DLOW / DCLOSE / DVOLOpen, high, low, close and volume of a caller-defined custom timeframe.