MQL5 is the C-like language many traders use for desktop indicators. You can paste an MQL5 indicator (a .mq5 file) into the ZoroCharts script editor and run it on any chart. Plots, levels, settings, chart objects, buttons and timers work.

In plain words
  • Indicators only. Scripts can draw and calculate. They can never place, change or close orders.
  • It runs in a sandbox in your browser. The code has no access to your account, your files or the network. A script that runs too long or uses too much memory is stopped.
  • Our own engine runs it. TradeZoro reads the MQL5 source and runs it with its own engine. Results can differ in small ways from other platforms (see "Known differences").

Education only. Not financial advice.

1. Paste and run

  1. Open ZoroCharts and press the script editor button in the toolbar.
  2. At the top of the editor pick MQL5.
  3. Press New, select all the text and paste your indicator. Or use More, Import file to open a .mq5 file.
  4. The editor checks the code as you type. Problems show with their line number; click one to jump to it.
  5. Press Add to chart. Give it a name and press Save to keep it in My scripts.

Each input and sinput becomes a setting. Open the indicator's settings on the chart to change them; the indicator recalculates straight away. input group "Name" lines become headings in the settings.

Five examples are in the editor's Examples tab: a moving-average cross with buttons, RSI with levels, a Bollinger fill, session boxes, and a bar countdown.

2. What is supported

AreaSupported
Languageint, uint, long, ulong, short, char, uchar, double, float, bool, string, datetime, color; enums; structs with fields; fixed and dynamic arrays, ArraySetAsSeries; functions with references and default values; static and const; #property, #define (also with arguments), #include of standard headers (built in, nothing to install).
EventsOnInit, both forms of OnCalculate (all price arrays, or one price[]), OnDeinit, OnTimer with EventSetTimer / EventSetMillisecondTimer, OnChartEvent (object click, chart click, key press, object drag, edit finished, chart change). prev_calculated works, so only new bars are recalculated on each update.
PlotsDRAW_LINE, DRAW_SECTION, DRAW_HISTOGRAM, DRAW_HISTOGRAM2, DRAW_ARROW, DRAW_ZIGZAG, DRAW_FILLING, DRAW_BARS, DRAW_CANDLES and every DRAW_COLOR_* type; INDICATOR_DATA, INDICATOR_COLOR_INDEX, INDICATOR_CALCULATIONS; colours, styles, widths, labels, empty value, draw begin, shift; chart window or own window; levels, minimum and maximum.
Indicator handlesiMA (all four methods), iRSI, iMACD, iBands, iATR, iStochastic, iCCI, iADX, iMomentum, iSAR, iEnvelopes, iStdDev and more (list below), read with CopyBuffer. iCustom runs another MQL5 indicator saved in your My scripts, by its name.
Chart objectsHorizontal and vertical lines, trend lines, rectangles, text, arrows, and the on-screen objects: labels, buttons (with on/off state), edit boxes and rectangle labels, placed by corner and distance. Buttons and edit boxes can be clicked and typed in, and raise OnChartEvent.
MessagesPrint goes to the browser console, Comment shows on the chart, Alert shows a chart message and plays the alert sound.

3. Not supported

These give one clear message with the line number, "not supported in indicators on TradeZoro":

  • Trading: OrderSend, the trade classes, positions, orders, deals and account functions.
  • Files, DLL imports, web requests, sockets, e-mail and push messages.
  • Expert advisor and script events such as OnTick, OnTrade, OnStart.
  • Classes, struct methods, templates and pointers to objects. Write plain functions that take a struct by reference instead.

4. Known differences

  • Prices come from the chart you are looking at. Other symbols or timeframes in iClose, CopyRates and handles use the chart's own bars.
  • Tick volume is the chart's volume, and spread is 0.
  • Timers pause while the browser tab is hidden and catch up once when you come back.
  • Fonts are matched to the closest font your device has.

5. Built-in functions

416 built-in functions in 14 groups. Hover a name to see its form.

Arrays 22

  • ArrayBsearch
  • ArrayCompare
  • ArrayCopy
  • ArrayFill
  • ArrayFree
  • ArrayGetAsSeries
  • ArrayInitialize
  • ArrayInsert
  • ArrayIsDynamic
  • ArrayIsSeries
  • ArrayMaximum
  • ArrayMinimum
  • ArrayPrint
  • ArrayRange
  • ArrayRemove
  • ArrayResize
  • ArrayReverse
  • ArraySetAsSeries
  • ArraySize
  • ArraySort
  • ArraySwap
  • ZeroMemory

Chart 32

  • ChartFirst
  • ChartGetDouble
  • ChartGetInteger
  • ChartGetString
  • ChartID
  • ChartIndicatorName
  • ChartIndicatorsTotal
  • ChartNavigate
  • ChartNext
  • ChartPeriod
  • ChartPriceOnDropped
  • ChartRedraw
  • ChartSetDouble
  • ChartSetInteger
  • ChartSetString
  • ChartSetSymbolPeriod
  • ChartSymbol
  • ChartTimeOnDropped
  • ChartTimePriceToXY
  • ChartWindowFind
  • ChartWindowOnDropped
  • ChartXOnDropped
  • ChartXYToTimePrice
  • ChartYOnDropped
  • WindowBarsPerChart
  • WindowFind
  • WindowFirstVisibleBar
  • WindowOnDropped
  • WindowPriceMax
  • WindowPriceMin
  • WindowRedraw
  • WindowsTotal

Common 28

  • Alert
  • CheckPointer
  • Comment
  • DebugBreak
  • EventChartCustom
  • EventKillTimer
  • EventSetMillisecondTimer
  • EventSetTimer
  • GetLastError
  • IsConnected
  • IsDllsAllowed
  • IsOptimization
  • IsStopped
  • IsTesting
  • IsVisualMode
  • MarketInfo
  • MQLInfoInteger
  • MQLInfoString
  • PlaySound
  • Print
  • PrintFormat
  • ResetLastError
  • SetUserError
  • TerminalInfoDouble
  • TerminalInfoInteger
  • TerminalInfoString
  • TranslateKey
  • UninitializeReason

Conversion 24

  • CharArrayToString
  • CharToStr
  • CharToString
  • ColorToARGB
  • ColorToString
  • DoubleToStr
  • DoubleToString
  • EnumToString
  • IntegerToStr
  • IntegerToString
  • NormalizeDouble
  • ShortArrayToString
  • ShortToString
  • StringToCharArray
  • StringToColor
  • StringToDouble
  • StringToInteger
  • StringToShortArray
  • StringToTime
  • StrToDouble
  • StrToInteger
  • StrToTime
  • TimeToStr
  • TimeToString

Custom indicators 10

  • IndicatorDigits
  • IndicatorSetDouble
  • IndicatorSetInteger
  • IndicatorSetString
  • IndicatorShortName
  • PlotIndexGetInteger
  • PlotIndexSetDouble
  • PlotIndexSetInteger
  • PlotIndexSetString
  • SetIndexBuffer

Date and time 28

  • Day
  • DayOfWeek
  • DayOfYear
  • GetMicrosecondCount
  • GetTickCount
  • GetTickCount64
  • Hour
  • Minute
  • Month
  • Seconds
  • Sleep
  • StructToTime
  • TimeCurrent
  • TimeDay
  • TimeDaylightSavings
  • TimeDayOfWeek
  • TimeDayOfYear
  • TimeGMT
  • TimeGMTOffset
  • TimeHour
  • TimeLocal
  • TimeMinute
  • TimeMonth
  • TimeSeconds
  • TimeToStruct
  • TimeTradeServer
  • TimeYear
  • Year

Global variables 11

  • GlobalVariableCheck
  • GlobalVariableDel
  • GlobalVariableGet
  • GlobalVariableName
  • GlobalVariablesDeleteAll
  • GlobalVariableSet
  • GlobalVariableSetOnCondition
  • GlobalVariablesFlush
  • GlobalVariablesTotal
  • GlobalVariableTemp
  • GlobalVariableTime

Math 55

  • acos
  • asin
  • atan
  • atan2
  • ceil
  • cos
  • cosh
  • exp
  • fabs
  • floor
  • fmax
  • fmin
  • fmod
  • log
  • log10
  • MathAbs
  • MathArccos
  • MathArccosh
  • MathArcsin
  • MathArcsinh
  • MathArctan
  • MathArctan2
  • MathArctanh
  • MathCeil
  • MathCos
  • MathCosh
  • MathExp
  • MathExpm1
  • MathFloor
  • MathIsValidNumber
  • MathLog
  • MathLog10
  • MathLog1p
  • MathMax
  • MathMin
  • MathMod
  • MathPow
  • MathRand
  • MathRound
  • MathSin
  • MathSinh
  • MathSqrt
  • MathSrand
  • MathSwap
  • MathTan
  • MathTanh
  • pow
  • rand
  • round
  • sin
  • sinh
  • sqrt
  • srand
  • tan
  • tanh

MovingAverages.mqh 8

  • ExponentialMA
  • ExponentialMAOnBuffer
  • LinearWeightedMA
  • LinearWeightedMAOnBuffer
  • SimpleMA
  • SimpleMAOnBuffer
  • SmoothedMA
  • SmoothedMAOnBuffer

Objects 17

  • ObjectCreate
  • ObjectDelete
  • ObjectFind
  • ObjectGetDouble
  • ObjectGetInteger
  • ObjectGetString
  • ObjectGetTimeByValue
  • ObjectGetValueByTime
  • ObjectMove
  • ObjectName
  • ObjectsDeleteAll
  • ObjectSetDouble
  • ObjectSetInteger
  • ObjectSetString
  • ObjectsTotal
  • TextGetSize
  • TextSetFont

Series and symbol 39

  • Bars
  • CopyClose
  • CopyHigh
  • CopyLow
  • CopyOpen
  • CopyRates
  • CopyRealVolume
  • CopySpread
  • CopyTickVolume
  • CopyTime
  • Digits
  • iBars
  • iBarShift
  • iClose
  • iHigh
  • iHighest
  • iLow
  • iLowest
  • iOpen
  • iRealVolume
  • iSpread
  • iTickVolume
  • iTime
  • iVolume
  • Period
  • PeriodSeconds
  • Point
  • RefreshRates
  • SeriesInfoInteger
  • Symbol
  • SymbolExist
  • SymbolInfoDouble
  • SymbolInfoInteger
  • SymbolInfoString
  • SymbolInfoTick
  • SymbolIsSynchronized
  • SymbolName
  • SymbolSelect
  • SymbolsTotal

Statistics 72

  • MathAverageDeviation
  • MathBeta
  • MathBinomialCoefficient
  • MathCorrelationPearson
  • MathCorrelationSpearman
  • MathCumulativeDistributionBinomial
  • MathCumulativeDistributionCauchy
  • MathCumulativeDistributionExponential
  • MathCumulativeDistributionLogistic
  • MathCumulativeDistributionLognormal
  • MathCumulativeDistributionNormal
  • MathCumulativeDistributionPoisson
  • MathCumulativeDistributionUniform
  • MathCumulativeDistributionWeibull
  • MathCumulativeMax
  • MathCumulativeMin
  • MathCumulativeProduct
  • MathCumulativeSum
  • MathFactorial
  • MathGamma
  • MathIdentical
  • MathInterquartileRange
  • MathKurtosis
  • MathLog2
  • MathLogGamma
  • MathMean
  • MathMedian
  • MathMoments
  • MathOrder
  • MathPowInt
  • MathProbabilityDensityBinomial
  • MathProbabilityDensityCauchy
  • MathProbabilityDensityExponential
  • MathProbabilityDensityLogistic
  • MathProbabilityDensityLognormal
  • MathProbabilityDensityNormal
  • MathProbabilityDensityPoisson
  • MathProbabilityDensityUniform
  • MathProbabilityDensityWeibull
  • MathProduct
  • MathQuantile
  • MathQuantileBinomial
  • MathQuantileCauchy
  • MathQuantileExponential
  • MathQuantileLogistic
  • MathQuantileLognormal
  • MathQuantileNormal
  • MathQuantilePoisson
  • MathQuantileUniform
  • MathQuantileWeibull
  • MathQuickSortAscending
  • MathQuickSortDescending
  • MathRandomBinomial
  • MathRandomCauchy
  • MathRandomExponential
  • MathRandomLogistic
  • MathRandomLognormal
  • MathRandomNormal
  • MathRandomPoisson
  • MathRandomUniform
  • MathRandomWeibull
  • MathRange
  • MathRank
  • MathReplicate
  • MathReverse
  • MathSequence
  • MathSkewness
  • MathStandardDeviation
  • MathSum
  • MathTrunc
  • MathUnique
  • MathVariance

Strings 22

  • StringAdd
  • StringBufferLen
  • StringCompare
  • StringConcatenate
  • StringFill
  • StringFind
  • StringFormat
  • StringGetChar
  • StringGetCharacter
  • StringInit
  • StringLen
  • StringReplace
  • StringReserve
  • StringSetCharacter
  • StringSetLength
  • StringSplit
  • StringSubstr
  • StringToLower
  • StringToUpper
  • StringTrim
  • StringTrimLeft
  • StringTrimRight

Technical indicators 48

  • BarsCalculated
  • CopyBuffer
  • iAC
  • iAD
  • iADX
  • iADXWilder
  • iAlligator
  • iAO
  • iATR
  • iBands
  • iBandsOnArray
  • iBearsPower
  • iBullsPower
  • iBWMFI
  • iCCI
  • iCCIOnArray
  • iChaikin
  • iCustom
  • iDEMA
  • iDeMarker
  • iEnvelopes
  • iEnvelopesOnArray
  • iForce
  • iFractals
  • iGator
  • iIchimoku
  • iMA
  • iMACD
  • iMAOnArray
  • iMFI
  • iMomentum
  • iMomentumOnArray
  • IndicatorCreate
  • IndicatorParameters
  • IndicatorRelease
  • iOBV
  • iOsMA
  • iRSI
  • iRSIOnArray
  • iRVI
  • iSAR
  • iStdDev
  • iStdDevOnArray
  • iStochastic
  • iTEMA
  • iTriX
  • iVolumes
  • iWPR

Education only. Not financial advice.