Skip to content

NTSL function reference

This page is generated automatically from the TMChart interpreter: everything listed here is accepted by the editor, and anything not listed is rejected with an error message. Names are not case-sensitive. For the structure of a script and examples, see NTSL.

Used without parentheses; Close[1] is the previous bar close.

Name Arguments Notes
Abertura — (no parentheses)
Close — (no parentheses)
Date — (no parentheses)
Fechamento — (no parentheses)
High — (no parentheses)
Low — (no parentheses)
Maxima — (no parentheses)
Minima — (no parentheses)
MinPriceIncrement — (no parentheses)
Open — (no parentheses)
Quantidade — (no parentheses)
Quantity — (no parentheses)
Time — (no parentheses)
Volume — (no parentheses)

Values computed from the current bar, simple averages and chart information.

Name Arguments Notes
AvgPrice 0–1
BarCount 0
CurrentBar 0
GetPlotColor 1
GetPlotWidth 1
GraphicInterval 0
GraphicOffset 0
Highest 2
LastBarOnChart 0
Leader 0–1
Lowest 2
MaxBarsBack 0
MaxBarsForward 0
Media 2
MediaExp 2
MedianPrice 0–1
MyPrice 0–1
PriorCote 1
Range 0–1
RangeLeader 0–1
RGB 3
TrueHigh 0–1
TrueLow 0–1
TrueRange 0–1
TrueRangeCustom 3
TypicalPrice 0–1
WeightedClose 0–1

Dates in the 1YYMMDD format (10/27/2026 = 1261027) and times in the HHMM format.

Name Arguments Notes
BarAnnualization 0
BarDuration 0
BarDurationF 0
Bartype 0
CalcDate 2
CalcTime 2
CalcWorkingDate 2
CloseD 1
CloseM 1
CloseW 1
CloseY 1
CurrentAssetDate 0
CurrentDate 0
CurrentTime 0
DayOfMonth 1
DayOfWeek 1
DaysToExpiration 2
ELDate 3
ELDate_Consol 1
FindBar 2
FirstWorkingDayOfMonth 0–1
FirstWorkingDayOfWeek 0–1
FirstWorkingDayOfYear 0–1
Friday 0
HighD 1
HighM 1
HighW 1
HighY 1
IsWorkingDay 0–1
LastCalcDate 0
LastCalcTime 0
LastDayOfMonth 1
LastWorkingDayOfMonth 0–1
LastWorkingDayOfWeek 0–1
LastWorkingDayOfYear 0–1
LowD 1
LowM 1
LowW 1
LowY 1
MinutesIntoWeek 2
Monday 0
Month 1
Next3rdFriday 1
OpenD 1
OpenM 1
OpenW 1
OpenY 1
QuarterEnd 1
QuarterStart 1
RS_BarsPerDay 0
Saturday 0
Sunday 0
Thursday 0
TimeExchange 0
TimeToMinutes 1
Today 0
Tuesday 0
VolumeD 1
VolumeM 1
VolumeW 1
VolumeY 1
Wednesday 0
Year 1
Yesterday 0

Numeric, rounding, comparison and text functions.

Name Arguments Notes
ABS 1
Arctangent 1
BoolToString 1
Ceiling 1
Combination 2
CompareFloat 2–3
Cos 1
Cosine 1
Cotangent 1
Exp 1
ExpValue 1
Factorial 1
FloatToString 1–2
Floor 1
FracPortion 1
GCD 2
IntPortion 1
Log 1
LogN 2
Max 2
Min 2
MinutesToTime 1
Mod 2
Neg 1
NumUnits 2
Permutation 2
Pos 1
Power 2
PowerF 2
Random 1
Round 1
Round2Fraction 1
Sign 1
Sin 1
Sine 1
Sqrt 1
Square 1
StringContains 2
StringCopy 2–3
StringEndsWith 2
StringPos 2
StringStartsWith 2
SubString 2–3
Tangent 1

Ready-made indicators. Those with more than one line use Name(...)|n| to pick the line.

Name Arguments Notes
AccuDistr 0
AccuDistrW 0
AdaptiveMovingAverage 3
ADX 2
AllTimeHigh 0
AllTimeLow 0
ArmsEaseOfMov 2
AroonLin 1 2 lines (|0| to |1|)
AroonOsc 1
AutoFibonacci 2 8 lines (|0| to |7|)
AutoFibonacciCustom 2
AvgSeparation 2
AvgTrueRange 2
BalanceOfPower 2
BearPower 3
BollingerBands 3 2 lines (|0| to |1|)
BollingerBandW 3
BollingerBPerc 3
BullPower 3
CCI 1
ChaikinMoneyFlow 1
ChaikinOsc 2
ContadorDeCandle 0
DiDiIndex 6 2 lines (|0| to |1|)
DiPDiM 1 2 lines (|0| to |1|)
DonchianCH 1 3 lines (|0| to |2|)
DTOscillator 5 2 lines (|0| to |1|)
EMA 1–2
Envelope 3 3 lines (|0| to |2|)
FastStochastic 1–3 2 lines (|0| to |1|)
FastWMA 1
FinancialVol 1–2
ForceIndex 2
FullStochastic 1–3 2 lines (|0| to |1|)
HeikinAshi 2 4 lines (|0| to |3|)
HiLoActivator 1 2 lines (|0| to |1|)
HistVolatility 2
HullMovingAverage 1
IchimokuCloud 3 5 lines (|0| to |4|)
KeltnerCH 3 2 lines (|0| to |1|)
KVO 3 2 lines (|0| to |1|)
LinearRegressionChannel 5 3 lines (|0| to |2|)
Macd 3 2 lines (|0| to |1|)
MFI 0
Momentum 3 2 lines (|0| to |1|)
MomentumStochastic 1
MoneyFlowIndex 1
OBV 0
OBVAvg 2
OnBalanceTR 0
OpenDaily 1
ParabolicSAR 2
Pivot 2 7 lines (|0| to |6|)
PriceOsc 4
PriceVolumeTrend 0
QuantityVol 1–2
Ravi 2
ROC 3 2 lines (|0| to |1|)
RSI 2
RsiStochastic 1
SafeZoneDownTrend 3
SafeZoneUpTrend 3
SlowStochastic 1–3 2 lines (|0| to |1|)
SMA 1–3
StdDevConstPeriod 2
StopATR 3 2 lines (|0| to |1|)
Tilson 2
TopBottomDetector 1 2 lines (|0| to |1|)
Trades 0
Trix 2
TRIXM 2
VWAP 1
VWAPDate 2
VWAPMonthly 0
VWAPWeekly 0
VWMA 1
Williams 1

Work on a series (price, variable or indicator) over a period.

Name Arguments Notes
Cum 1
ExtremePriceRatio 2
FastD 1
FastK 1
FastKCustom 4
HarmonicMean 2
HighestBar 2
LowestBar 2
MidPoint 2
PercentChange 2
PercentR 1
PriceOscillator 3
RateOfChange 2
SlowD 1
SlowK 1
StdDevs 2
Summation 2
TriAverage 2
UlcerIndex 2
UltimateOscillator 3
Volatility 1
VolumeOsc 2
VolumeROC 1
WAverage 2
WellesSum 2–3
XAverage 2

Recognize candlestick patterns on the current bar.

Name Arguments Notes
C_3WhSolds_3BlkCrows 4
C_BullEng_BearEng 3
C_Doji 1
C_Hammer_HangingMan 4
C_MornDoji_EveDoji 4
C_MornStar_EveStar 3
C_PierceLine_DkCloud 3
C_ShootingStar 2

Data of the chart symbol. Those marked “live” have no history: they hold only on the current bar.

Name Arguments Notes
AskPrice 0–1 live (no history)
AskSize 0–1 live (no history)
BidPrice 0–1 live (no history)
BidSize 0–1 live (no history)
BookSpread 0–1 live (no history)
GetAsset 0–1
GetFeed 0–1
IsBMF 0
Lote 0–1
MinOrderIncrement 0–1
MinOrderQty 0–1
TotalBuyQtd 0–2 live (no history)
TotalSellQtd 0–2 live (no history)

Order commands. They only take effect in the Backtest and in Automations; on the chart they are ignored.

Name Arguments Notes
BuyAtMarket 0–1
BuyLimit 1–3
BuyStop 1–4
BuyToCoverAtMarket 0–1
BuyToCoverLimit 1–2
BuyToCoverStop 1–3
CancelPendingOrders 0
ClosePosition 0
ReversePosition 0
SellShortAtMarket 0–1
SellShortLimit 1–3
SellShortStop 1–4
SellToCoverAtMarket 0–1
SellToCoverLimit 1–2
SellToCoverStop 1–3
SendOrder 3–5
XRay 2–6

Outside the Backtest and Automations they return neutral values (no position, result 0).

Name Arguments Notes
AutomationResult — (no parentheses)
AvgTradeResult — (no parentheses)
AvgTradeResultDaily — (no parentheses)
BuyPosition — (no parentheses)
BuyPositionQty — (no parentheses)
BuyPrice — (no parentheses)
DailyResult — (no parentheses)
HasPendingOrders — (no parentheses)
HasPosition — (no parentheses)
IsBought — (no parentheses)
IsSold — (no parentheses)
LastTradeResult — (no parentheses)
NumberOfPendingOrders — (no parentheses)
OpenResult — (no parentheses)
Position — (no parentheses)
PositionQty — (no parentheses)
Price — (no parentheses)
SellPosition — (no parentheses)
SellPositionQty — (no parentheses)
SellPrice — (no parentheses)

Commands that paint candles, draw plots, lines and texts, or write to the console.

Name Arguments Notes
Alert 1
ConsoleLog 1–2
HorizontalLine 1–2
HorizontalLineCustom 5–12
LineSegment 6–13
NoPlot 1
PaintBar 1
Plot 1 also Plot2 … Plot99
PlotCandle 4–7
PlotN 2
PlotText 2–5
SetPlotColor 2
SetPlotStyle 2
SetPlotType 2
SetPlotWidth 2
VerticalLine 1–2
VerticalLineCustom 4–9

Names that stand for fixed numbers in function arguments.

  • Indicators (average type, value type, volume type): kaADX, kaArithmetic, kaExponential, kaWeighted, kaWelles, tvClose, tvMax, tvMin, tvOpen, vtFinancial, vtQuantity, vtTrades
  • Comparison (result of CompareFloat): EqualsValue, GreaterThanValue, LessThanValue
  • Chart (styles, types and positions): igHistogram, igLine, posBottom, posCenter, posTop, psDash, psDashDot, psDashDotDot, psDot, psSolid, tpBottomLeft, tpBottomRight, tpTopLeft, tpTopRight
  • Orders (side and type, for SendOrder): osBuy, osSell, otLimit, otMarket, otStopLimit
  • Colors (also RGB(r, g, b)): clAmarelo, clAqua, clAzul, clBlack, clBlue, clBranco, clCiano, clCinza, clFuchsia, clFucsia, clGray, clGreen, clGrey, clLaranja, clLimao, clLime, clMagenta, clMarinho, clMaroon, clMarrom, clNavy, clOliva, clOlive, clOrange, clPrata, clPreto, clPurple, clRed, clRoxo, clSilver, clTeal, clVerde, clVermelho, clWhite, clYellow

Manual functions that TMChart does not offer

Section titled “Manual functions that TMChart does not offer”

These functions exist in the NTSL manual, but the editor rejects them, for the reason below.

Name Reason
AccAgressSaldo aggression (buyer/seller): needs data that the broker’s MT5 does not provide
AgressionVolBalance aggression: needs data that the broker’s MT5 does not provide
AgressionVolBuy aggression: needs data that the broker’s MT5 does not provide
AgressionVolSell aggression: needs data that the broker’s MT5 does not provide
AssetHasValue depends on Asset (another symbol): not available yet
Averan indicator with a proprietary formula (not published in the manual)
AvgAgent data by broker: needs data that the broker’s MT5 does not provide
AvgAgrBuySell aggression: needs data that the broker’s MT5 does not provide
AvgAgrTotal aggression: needs data that the broker’s MT5 does not provide
BalanceAgent data by broker: needs data that the broker’s MT5 does not provide
BidAsk bid/ask history: needs data that the broker’s MT5 does not provide
BTCPrice exchange quotes (NeloCripto package): needs data that the broker’s MT5 does not provide
BTCSpread exchange quotes (NeloCripto package): needs data that the broker’s MT5 does not provide
BuyOfferCount the MT5 book only has price and quantity per level, without the number of offers
ChainSetup indicator with a proprietary formula (not published in the manual)
CohenPriceWave indicator with a proprietary formula (not published in the manual)
CohenWeisWave indicator with a proprietary formula (not published in the manual)
DarvasBox indicator with a proprietary formula (not published in the manual)
DecisionPoints indicator with a proprietary formula (not published in the manual)
DivergenceDetector indicator with a proprietary formula (not published in the manual)
Euroinvest indicator with a proprietary formula (not published in the manual)
FgzRobot indicator with a proprietary formula (not published in the manual)
FrassonATR indicator with a proprietary formula (not published in the manual)
FrassonVH indicator with a proprietary formula (not published in the manual)
FuraChao indicator with a proprietary formula (not published in the manual)
FuraTeto indicator with a proprietary formula (not published in the manual)
HighestVolume volume at price (Volume Profile): needs data that the broker’s MT5 does not provide
HighestVolumePrice volume at price (Volume Profile): needs data that the broker’s MT5 does not provide
ImpliedVolatility options functions: not available yet
LSVolatilityIndex indicator with a proprietary formula (not published in the manual)
MadridMovingAverage indicator with a proprietary formula (not published in the manual)
MadridTrendSqueeze indicator with a proprietary formula (not published in the manual)
MagoMACD indicator with a proprietary formula (not published in the manual)
MagoMedias indicator with a proprietary formula (not published in the manual)
MIMA indicator with a proprietary formula (not published in the manual)
MIMAROC indicator with a proprietary formula (not published in the manual)
MoneyFlow formula not described in the manual
NelogicaBottomFinder indicator with a proprietary formula (not published in the manual)
NelogicaPullBackFinder indicator with a proprietary formula (not published in the manual)
NelogicaWeisWave indicator with a proprietary formula (not published in the manual)
OpenInterest open interest: needs data that the broker’s MT5 does not provide
Phibo indicator with a proprietary formula (not published in the manual)
PowerMeter aggression: needs data that the broker’s MT5 does not provide
PriceNery indicator with a proprietary formula (not published in the manual)
PTAX Central Bank PTAX: needs data that the broker’s MT5 does not provide
PTAXFuturo PTAX: needs data that the broker’s MT5 does not provide
Rafi indicator with a proprietary formula (not published in the manual)
RBG indicator with a proprietary formula (not published in the manual)
RenkoVTwo indicator with a proprietary formula (not published in the manual)
SampleAverage strategy example from the manual with no defined return value
SampleBollinger strategy example from the manual with no defined return value
SampleMACD strategy example from the manual with no defined return value
SampleRSI strategy example from the manual with no defined return value
SampleStochastic strategy example from the manual with no defined return value
SampleVWAP strategy example from the manual with no defined return value
Santo indicator with a proprietary formula (not published in the manual)
SellOfferCount the MT5 book only has price and quantity per level, without the number of offers
SomosRenkoTrendMPonto indicator with a proprietary formula (not published in the manual)
TendencyTracker indicator with a proprietary formula (not published in the manual)
TimeAgrBuySell aggression: needs data that the broker’s MT5 does not provide
TimeAgrSellBuy aggression: needs data that the broker’s MT5 does not provide
TimeAgrTotal aggression: needs data that the broker’s MT5 does not provide
ToscanaBrunello indicator with a proprietary formula (not published in the manual)
ToscanaPiccola indicator with a proprietary formula (not published in the manual)
ToscanaPiccolo indicator with a proprietary formula (not published in the manual)
ToscanaProdutividade indicator with a proprietary formula (not published in the manual)
ToscanaRT indicator with a proprietary formula (not published in the manual)
TradenciaTrendVariation indicator with a proprietary formula (not published in the manual)
TrendAverage indicator with a proprietary formula (not published in the manual)
TrendCloud indicator with a proprietary formula (not published in the manual)
TrendDifusor indicator with a proprietary formula (not published in the manual)
TrendFlow indicator with a proprietary formula (not published in the manual)
TrendSniper indicator with a proprietary formula (not published in the manual)
TrendSoldier indicator with a proprietary formula (not published in the manual)
TrendVolAg indicator with a proprietary formula (not published in the manual)
TRPTAX PTAX: needs data that the broker’s MT5 does not provide
TRPTAXFuturo PTAX: needs data that the broker’s MT5 does not provide
TwoMVAggression indicator with a proprietary formula (not published in the manual)
TwoMVPower indicator with a proprietary formula (not published in the manual)
TwoMVVolatility indicator with a proprietary formula (not published in the manual)
Valerie indicator with a proprietary formula (not published in the manual)
VolumeAgent data by broker: needs data that the broker’s MT5 does not provide
VolumeAtPrice volume at price (Volume Profile): needs data that the broker’s MT5 does not provide
VSS indicator with a proprietary formula (not published in the manual)

Total: 480 names.