Type/to search
Getting Started
Welcome to FMZ Quant Trading Platform
Quick Start
Key Security
Platform Basics
Account and Billing
Live Robot Billing and Top-up
Sub-accounts
Exchange
General Protocol
Local Credential Files
Exchange-Specific Notes
Securities and Futures
Crypto
Docker
Strategy Library
Live Trading
Writing Strategies
Development Tools
Backtesting System
Advanced Topics
Data and Research
Integrations

Every function, structure and constant of the API reference, grouped by its category, with a one-line description; click a name for the full page. This page is generated from the reference by doc_tools/gen_api_index.py.

Built-in Functions

Global

NameDescription
VersionReturns the current system version number.
IsVirtualUsed to determine whether the strategy's runtime environment is the backtesting system.
GetOSRetrieves the operating system information of the device hosting the bot.
GetPidGet the ID of the live trading process.
GetMetaGet the Meta value written when generating the strategy registration code.
SleepThe sleep function pauses program execution for a specified period of time.
UnixGet the second-level timestamp of the current moment.
UnixNanoGet the nanosecond-level timestamp of the current moment.
_DConvert a millisecond-level timestamp or a Date object into a time string.
GetCommandGet the strategy's interactive command.
GetLastErrorRetrieves the most recent error message.
SetErrorFilterFilters error logs.
_NFormat a floating-point number.
_CA retry function used for fault-tolerant handling of interface calls.
_CrossReturns the number of crossover periods between array arr1 and array arr2.
JSON.parseThe JSON.parse function is a method of the ECMAScript standard built-in object JSON, used to decode (parse) a JSON string.
JSON.stringifyThe JSON.stringify function is a method of the ECMAScript standard built-in object JSON, used to convert JavaScript values to JSON strings.
EncodeThis function encodes data according to the parameters passed in.
MD5Calculate the MD5 hash of the parameter data.
UUIDCreate a UUID.

Log

NameDescription
LogThe Log() function is used to output logs.
LogStatusOutputs information to the status bar on the backtesting system or the live trading page.
LogProfitRecords and prints the profit/loss value, and plots the equity curve based on the profit/loss value.
LogProfitResetClear all profit logs and the profit chart.
LogResetClear the logs.
LogVacuumUsed to reclaim the storage space occupied by deleted data in SQLite after clearing logs with the LogReset() function.
EnableLogEnable or disable logging of order information.
ChartCustom chart plotting function.
KLineChartThis function is used to perform custom drawing while a strategy is running, using a drawing approach similar to the Pine language.
console.logUsed to output debug information in the "Debug Info" section of the live trading page.
console.errorUsed to output error messages in the "Debug Information" section of the live trading page.
exchange.LogThe exchange.Log() function is used to output order placement and cancellation logs in the log column area.

Market

NameDescription
exchange.GetTickerRetrieves the Ticker structure (i.e., the market data) corresponding to the spot or contract of the currently configured trading pair and contract code.
exchange.GetTickersThe exchange.GetTickers() function is used to retrieve aggregated market data from the exchange (an array of Ticker structures).
exchange.GetDepthGets the Depth structure, i.e.
exchange.GetTradesGets the Trade structure array of the spot or futures corresponding to the currently set trading pair and contract code, i.e.
exchange.GetRecordsGet the Record structure array (i.e.
exchange.GetMarketsThe exchange.GetMarkets() function is used to retrieve market information from the exchange.
exchange.GetRawJSONGet the raw content returned by the most recent rest request from the current exchange object (exchange, exchanges).
exchange.SetDataThe exchange.SetData() function is used to set the data loaded when the strategy is running.
exchange.GetDataThe exchange.GetData() function is used to retrieve data loaded by the exchange.SetData() function, or data provided by an external link.

Trade

NameDescription
exchange.BuyThe exchange.Buy() function is used to place a buy order.
exchange.SellThe exchange.Sell() function is used to place a sell order.
exchange.CreateOrderexchange.CreateOrder() function is used to place orders.
exchange.ModifyOrderThe exchange.ModifyOrder() function is used to modify an existing regular order, allowing you to modify the order's price and quantity.
exchange.CancelOrderThe exchange.CancelOrder() function is used to cancel an order.
exchange.GetOrderThe exchange.GetOrder() function is used to obtain order information.
exchange.GetOrdersThe exchange.GetOrders() function is used to obtain the current unfilled orders.
exchange.GetHistoryOrdersexchange.GetHistoryOrders() function is used to retrieve the historical orders of the current trading pair or contract, and supports specifying a parti...
exchange.CreateConditionOrderThe exchange.CreateConditionOrder() function is used to create a conditional order.
exchange.ModifyConditionOrderThe exchange.ModifyConditionOrder() function is used to modify an existing conditional order, allowing modification of the order amount, trigger condit...
exchange.CancelConditionOrderexchange.CancelConditionOrder() function is used to cancel a conditional order.
exchange.GetConditionOrderThe exchange.GetConditionOrder() function is used to retrieve information about a specified conditional order.
exchange.GetConditionOrdersexchange.GetConditionOrders() function is used to obtain unfinished conditional orders (conditional orders that have not yet been triggered or canceled).
exchange.GetHistoryConditionOrdersThe exchange.GetHistoryConditionOrders() function is used to retrieve the historical conditional orders (including triggered, canceled, and expired con...

Account

NameDescription
exchange.GetAccountThe exchange.GetAccount() function is used to request the exchange account information.
exchange.GetAssetsThe exchange.GetAssets function is used to request the asset information of the exchange account.

Futures

NameDescription
exchange.SetContractTypeThe exchange.SetContractType() function is used to set the current contract code of the exchange exchange object.
exchange.GetContractTypeThe exchange.GetContractType() function is used to get the contract code currently set for the exchange exchange object.
exchange.SetDirectionThe exchange.SetDirection() function is used to set the order direction when calling the exchange.Buy function or exchange.Sell function to place futur...
exchange.SetMarginLevelThe exchange.SetMarginLevel() function is used to set the leverage value for the trading pair or contract specified by the symbol parameter.
exchange.GetPositionsexchange.GetPositions() function is used to get position information; the GetPositions() function is a member function of the exchange object exc...
exchange.GetFundingsThe exchange.GetFundings() function is used to obtain the funding rate data for the current period.

Exchange

NameDescription
exchange.GetNameThe exchange.GetName() function is used to get the name of the exchange bound to the current exchange object.
exchange.GetLabelThe exchange.GetLabel() function is used to obtain the custom label set when configuring the exchange object.
exchange.GetCurrencyThe exchange.GetCurrency() function is used to get the currently set trading pair.
exchange.SetCurrencyThe exchange.SetCurrency() function is used to switch the current trading pair of the exchange object exchange.
exchange.GetQuoteCurrencyThe exchange.GetQuoteCurrency() function is used to get the name of the quote currency of the current trading pair, i.e.
exchange.GetPeriodRetrieves the K-line period configured on the FMZ Quant Trading platform website page when running a strategy in backtesting or live trading, i.e., the defau...
exchange.SetMaxBarLenSet the maximum length of the K-line (candlestick chart).
exchange.SetPrecisionThe exchange.SetPrecision() function is used to set the precision of the price and order amount for the exchange exchange object.
exchange.GetRateGet the exchange rate currently set for the exchange object.
exchange.SetRateSets the current exchange rate for the exchange object.
exchange.SetBaseThe exchange.SetBase() function is used to set the base URL of the exchange API interface used by the exchange exchange object.
exchange.GetBaseThe exchange.GetBase() function is used to get the base address of the current exchange API interface.
exchange.SetProxyThe exchange.SetProxy() function is used to configure the proxy settings of the exchange exchange object.
exchange.SetTimeoutThe exchange.SetTimeout() function is used to set the timeout for rest requests of the exchange exchange object.
exchange.EncodeThe exchange.Encode() function is used to perform signature and encryption computations.

IO

NameDescription
exchange.IOexchange.IO() function is used to call other interfaces related to the exchange object.
exchange.IO("api", ...)exchange.IO("api", ...) calls a raw REST endpoint of the exchange that has no wrapper function; the platform signs the request.
exchange.IO("currency", ...)exchange.IO("currency", ...) switches the current trading pair of the exchange object at runtime.
exchange.IO("base", ...)exchange.IO("base", ...) switches the base address of the trading API, and exchange.IO("mbase", ...) that of the market data API.
exchange.IO(mode, value)exchange.IO(mode, value) switches trading modes of the exchange: simulated or live, cross or isolated margin, hedge or one-way positions, unified accou...
exchange.IO("rate", ...)exchange.IO("rate", ...) and exchange.IO("quota", ...) limit how often API functions are called.

Network

NameDescription
HttpQuerySends an HTTP request.
HttpQuery_GoSends an Http request.
DialUsed for raw Socket access, supporting the tcp, udp, tls, and unix protocols.
MailSend an email.
Mail_GoAsynchronous version of the Mail function.

Storage

NameDescription
_GPersistently store data.
DBExecDatabase interface function.
SetChannelDataPublishes the latest status data to a channel.
GetChannelDataSubscribes to the channel data of a specified live trading bot.

Threads

NameDescription
exchange.GoMulti-threaded asynchronous support function that can convert the operations of all supported functions into asynchronous concurrent execution.
EventLoopListens for events and returns when any WebSocket has readable data, or when concurrent tasks such as exchange.Go() or HttpQuery_Go() compl...

Threads/threading

NameDescription
ThreadThe Thread() function is used to create concurrent threads.
getThreadThe getThread() function is used to get a thread object based on the specified thread ID.
mainThreadThe mainThread() function is used to get the thread object of the main thread, which is the thread where the main() function in the strategy is l...
currentThreadThe currentThread() function is used to get the thread object of the current thread.
LockThe Lock() function is used to create a thread lock object.
ConditionThe Condition() function is used to create a condition variable object, which is used to implement synchronization and communication between threads in...
EventThe Event() function is used to create a thread event object, which is used for synchronization between threads, allowing one thread to wait for noti...
DictThe Dict() function is used to create a dictionary object for passing and sharing data between concurrent threads.
ServeThe Serve() function starts an HTTP, TCP or WebSocket (over HTTP) service inside the strategy process and returns a Server object.
pendingThe pending function is used to get the number of concurrent threads currently running in the strategy program.

Threads/Thread

NameDescription
peekMessageThe peekMessage() function is used to receive messages from a thread.
postMessageThe postMessage() function is used to send messages to a thread.
joinThe join() function is used to wait for a thread to exit and reclaim system resources.
terminateThe terminate() function is used to forcibly terminate a thread and release the hardware resources occupied when the thread was created.
getDataThe getData() function is used to access variables recorded in the thread environment.
setDataThe setData() function is used to store variables in the thread environment.
idThe id() function is used to return the threadId of the current multi-threaded object instance.
nameThe name() function is used to return the name of the current multi-threaded object instance.
eventLoopThe eventLoop() function is used to listen for events received by the current thread.

Threads/ThreadLock

NameDescription
acquireThe acquire() function is used to request a thread lock (acquire lock).
releaseThe release() function is used to release a thread lock (unlock).

Threads/ThreadEvent

NameDescription
setThe set() function is used to set an event signal.
clearThe clear() function is used to clear the signal.
waitThe wait() function is used to set event (signal) waiting, which will block until the event (signal) is set; supports setting timeout parameters.
isSetThe isSet() function is used to determine whether an event (signal) has been set.

Threads/ThreadCondition

NameDescription
notifyThe notify() function is used to wake up one waiting thread (if any exists).
notifyAllThe notifyAll() function is used to wake up all waiting threads.
waitThe wait() function is used to put a thread into a waiting state under specific conditions.
acquireThe acquire() function is used to request a thread lock (acquire lock).
releaseThe release() function is used to release the thread lock (unlock).

Threads/ThreadDict

NameDescription
getThe get() function is used to retrieve the value of a key recorded in a dictionary object.
setThe set() function is used to set key-value pairs.

Threads/Server

NameDescription
addrThe addr() function returns the address and port the service actually listens on.
closeThe close() function stops accepting new connections; handlers already running finish normally (graceful shutdown).
stopThe stop() function closes the service (as close()) and then terminates every handler thread that is still running.
joinThe join() function waits until the service is closed and no handler is running.
pendingThe pending() function returns the number of handlers currently running, i.e.

Web3

NameDescription
exchange.IO("abi", ...)On the FMZ Quant Trading Platform, various blockchain-related functions and calls are mainly implemented through the exchange.IO() function.
exchange.IO("api", blockChain, ...)The exchange.IO("api", "eth", ...) calling method is used to call Ethereum RPC methods (select eth when configuring the Web3 exchange object).
exchange.IO("encode", ...)The exchange.IO("encode", ...) function is called in this way for data encoding.
exchange.IO("encodePacked", ...)The exchange.IO("encodePacked", ...) function is used to perform encodePacked encoding operations.
exchange.IO("decode", ...)The exchange.IO("decode", ...) calling method is used to decode data.
exchange.IO("hash", ...)The exchange.IO("hash", ...) call computes hash digests and HMACs, signs with the private key configured on the exchange object, and so on.
exchange.IO("key", ...)The exchange.IO("key", ...) function is used to switch the private key calling method.
exchange.IO("sign", ...)The exchange.IO("sign", ...) calling method is used to sign a 32-byte hash with a secp256k1 private key and returns signature data such as r, s, and v.
exchange.IO("signTypedData", ...)The exchange.IO("signTypedData", ...) calling method is used to sign structured data according to the EIP-712 standard.
exchange.IO("signMessage", ...)The exchange.IO("signMessage", ...) calling method is used to sign messages according to the EIP-191 standard (personal_sign).
exchange.IO("api", ...)The exchange.IO("api", ...) calling method is used to call methods of smart contracts.
exchange.IO("call", ...)The exchange.IO("call", ...) calling method simulates the execution of any smart contract method (including write methods that modify on-chain state) v...
exchange.IO("multicall", ...)The exchange.IO("multicall", ...) calling method is used to batch-read the results of multiple contract calls in a single request through the Multicall...
exchange.IO("logs", ...)The exchange.IO("logs", ...) calling method is used to query the event logs of a contract (eth_getLogs) and decode them according to the ABI.
exchange.IO("waitReceipt", ...)The exchange.IO("waitReceipt", ...) calling method is used to wait for a transaction to be included on-chain and reach the specified number of confirma...
exchange.IO("nonce", ...)The exchange.IO("nonce", ...) function call is used to query, synchronize, or set the nonce counter used when sending transactions.
exchange.IO("speedUp", ...)The exchange.IO("speedUp", ...) call is used to resend a stuck transaction (one that has not been mined for a long time) with a higher fee: the recipie...
exchange.IO("cancelTx", ...)The exchange.IO("cancelTx", ...) calling method is used to cancel a transaction that has not yet been included on-chain: it sends a zero-amount transac...
exchange.IO("toUnits", ...)The exchange.IO("toUnits", ...) function call is used to convert a human-readable amount into an on-chain integer.
exchange.IO("fromUnits", ...)The exchange.IO("fromUnits", ...) calling method is used to convert an on-chain integer value into a human-readable amount.
exchange.IO("uniswapV3", ...)The exchange.IO("uniswapV3", ...) calling method is used for concentrated liquidity (Uniswap V3) related calculations, including conversions between ti...
exchange.IO("contracts", ...)The exchange.IO("contracts", ...) call is used to obtain commonly used contract addresses on the current chain (or a specified chain), including mainst...
exchange.IO("address")The exchange.IO("address") call returns the address of the wallet configured on the exchange object.
exchange.IO("base", ...)The exchange.IO("base", ...) calling method is used to set the RPC node address, and supports setting multiple nodes as backups for each other.
exchange.IO("sendBase", ...)The exchange.IO("sendBase", ...) call is used to set a node dedicated solely to broadcasting transactions.

Uniswap

NameDescription
exchange.IO("transfer", ...)The exchange.IO("transfer", ...) call transfers the chain's native coin (such as ETH or BNB) or an ERC20 token out of the wallet configured on the Unis...
exchange.IO("receipt", ...)When called as exchange.IO("receipt", ...), this function queries the receipt of a transaction sent by the Uniswap exchange object (such as an order or...
exchange.IO("route", ...)The exchange.IO("route", ...) call requests quotes on a Uniswap exchange object.
exchange.IO("simulate", ...)The exchange.IO("simulate", ...) call builds a swap transaction using the same order logic as the Uniswap exchange object (route selection, quoting and...
exchange.IO("token", ...)The exchange.IO("token", ...) call is used to register a token on a Uniswap exchange object, or to list the token table.
exchange.IO("wrap", ...)The exchange.IO("wrap", ...) call wraps the native coin (ETH, BNB) into the wrapped coin (WETH, WBNB) on a Uniswap exchange object: 1:1, no slippage, o...
exchange.IO("unwrap", ...)The exchange.IO("unwrap", ...) call unwraps the wrapped coin (WETH, WBNB) into the native coin (ETH, BNB) on a Uniswap exchange object: 1:1, no slippag...
exchange.IO("approve", ...)When called as exchange.IO("approve", ...), this function sets the token approval mode on a Uniswap exchange object.
exchange.IO("slippage", ...)When called this way, exchange.IO("slippage", ...) sets slippage protection for market orders on a Uniswap exchange object.
exchange.IO("deadline", ...)The exchange.IO("deadline", ...) call sets the transaction deadline on a Uniswap exchange object.
exchange.IO("gasMultiplier", ...)exchange.IO("gasMultiplier", ...) is used to set the gas limit multiplier on a Uniswap exchange object.

TA

NameDescription
TA.MACDThe TA.MACD() function is used to calculate the Moving Average Convergence Divergence (MACD) indicator.
TA.KDJThe TA.KDJ() function is used to calculate the Stochastic Oscillator (KDJ).
TA.RSIThe TA.RSI() function is used to calculate the Relative Strength Index (RSI).
TA.ATRThe TA.ATR() function is used to calculate the Average True Range indicator (ATR).
TA.OBVTA.OBV() function is used to calculate the On-Balance Volume (OBV).
TA.MAThe TA.MA() function is used to calculate the Moving Average indicator (Moving Average).
TA.EMAThe TA.EMA() function is used to calculate the Exponential Moving Average (EMA) indicator.
TA.BOLLThe TA.BOLL() function is used to calculate the Bollinger Bands indicator.
TA.AlligatorTA.Alligator() function is used to calculate the Alligator indicator.
TA.CMFThe TA.CMF() function is used to calculate the Chaikin Money Flow (CMF) indicator.
TA.HighestThe TA.Highest() function is used to calculate the highest price within a period.
TA.LowestThe TA.Lowest() function is used to calculate the lowest price over a period.
TA.SMAThe TA.SMA() function is used to calculate the Simple Moving Average (SMA) indicator.

Talib/OverlapStudies

NameDescription
talib.BBANDSThe talib.BBANDS() function is used to calculate Bollinger Bands.
talib.DEMAThe talib.DEMA() function is used to calculate Double Exponential Moving Average.
talib.EMAThe talib.EMA() function is used to calculate Exponential Moving Average.
talib.HT_TRENDLINEThe talib.HT_TRENDLINE() function is used to calculate Hilbert Transform - Instantaneous Trendline.
talib.KAMAThe talib.KAMA() function is used to calculate Kaufman Adaptive Moving Average.
talib.MAThe talib.MA() function is used to calculate Moving average.
talib.MAMAThe talib.MAMA() function is used to calculate the MESA Adaptive Moving Average.
talib.MIDPOINTThe talib.MIDPOINT() function is used to calculate MidPoint over period.
talib.MIDPRICEThe talib.MIDPRICE() function is used to calculate Midpoint Price over period.
talib.SARThe talib.SAR() function is used to calculate the Parabolic SAR (Stop and Reverse) indicator.
talib.SAREXTThe talib.SAREXT() function is used to calculate Parabolic SAR - Extended.
talib.SMAThe talib.SMA() function is used to calculate Simple Moving Average.
talib.T3The talib.T3() function is used to calculate Triple Exponential Moving Average (T3).
talib.TEMAThe talib.TEMA() function is used to calculate Triple Exponential Moving Average.
talib.TRIMAThe talib.TRIMA() function is used to calculate Triangular Moving Average.
talib.WMAThe talib.WMA() function is used to calculate Weighted Moving Average.

Talib/MomentumIndicators

NameDescription
talib.ADXThe talib.ADX() function is used to calculate the Average Directional Movement Index.
talib.ADXRThe talib.ADXR() function is used to calculate the Average Directional Movement Index Rating.
talib.APOThe talib.APO() function is used to calculate Absolute Price Oscillator.
talib.AROONThe talib.AROON() function is used to calculate Aroon (Aroon Indicator).
talib.AROONOSCThe talib.AROONOSC() function is used to calculate the Aroon Oscillator.
talib.BOPThe talib.BOP() function is used to calculate Balance Of Power.
talib.CCIThe talib.CCI() function is used to calculate the Commodity Channel Index.
talib.CMOThe talib.CMO() function is used to calculate the Chande Momentum Oscillator.
talib.DXThe talib.DX() function is used to calculate the Directional Movement Index.
talib.MACDThe talib.MACD() function is used to calculate Moving Average Convergence/Divergence.
talib.MACDEXTThe talib.MACDEXT() function is used to calculate MACD with controllable MA type.
talib.MACDFIXThe talib.MACDFIX() function is used to calculate Moving Average Convergence/Divergence Fix 12/26.
talib.MFIThe talib.MFI() function is used to calculate Money Flow Index.
talib.MINUS_DIThe talib.MINUS_DI() function is used to calculate the Minus Directional Indicator.
talib.MINUS_DMThe talib.MINUS_DM() function is used to calculate Minus Directional Movement.
talib.MOMThe talib.MOM() function is used to calculate Momentum (Momentum Indicator).
talib.PLUS_DIThe talib.PLUS_DI() function is used to calculate the Plus Directional Indicator.
talib.PLUS_DMThe talib.PLUS_DM() function is used to calculate Plus Directional Movement.
talib.PPOThe talib.PPO() function is used to calculate Percentage Price Oscillator.
talib.ROCThe talib.ROC() function is used to calculate the *Rate of Change indicator: ((price/prevPrice)-1)100.
talib.ROCPThe talib.ROCP() function is used to calculate Rate of change Percentage: (price-prevPrice)/prevPrice.
talib.ROCRThe talib.ROCR() function is used to calculate Rate of change ratio: (price/prevPrice).
talib.ROCR100The talib.ROCR100() function is used to calculate *Rate of change ratio 100 scale: (price/prevPrice)100.
talib.RSIThe talib.RSI() function is used to calculate the Relative Strength Index.
talib.STOCHThe talib.STOCH() function is used to calculate the Stochastic Oscillator (STOCH indicator).
talib.STOCHFThe talib.STOCHF() function is used to calculate Stochastic Fast.
talib.STOCHRSIThe talib.STOCHRSI() function is used to calculate the Stochastic Relative Strength Index.
talib.TRIXThe talib.TRIX() function is used to calculate 1-day Rate-Of-Change (ROC) of a Triple Smooth EMA.
talib.ULTOSCThe talib.ULTOSC() function is used to calculate the Ultimate Oscillator.
talib.WILLRThe talib.WILLR() function is used to calculate Williams' %R (Williams Percent Range).

Talib/VolumeIndicators

NameDescription
talib.ADThe talib.AD() function is used to calculate the Chaikin A/D Line (Accumulation/Distribution Line indicator).
talib.ADOSCThe talib.ADOSC() function is used to calculate Chaikin A/D Oscillator.
talib.OBVThe talib.OBV() function is used to calculate On Balance Volume.

Talib/VolatilityIndicators

NameDescription
talib.ATRThe talib.ATR() function is used to calculate the Average True Range indicator.
talib.NATRThe talib.NATR() function is used to calculate Normalized Average True Range.
talib.TRANGEThe talib.TRANGE() function is used to calculate the True Range indicator.

Talib/CycleIndicators

NameDescription
talib.HT_DCPERIODThe talib.HT_DCPERIOD() function is used to calculate Hilbert Transform - Dominant Cycle Period.
talib.HT_DCPHASEThe talib.HT_DCPHASE() function is used to calculate the Hilbert Transform - Dominant Cycle Phase.
talib.HT_PHASORThe talib.HT_PHASOR() function is used to calculate Hilbert Transform - Phasor Components.
talib.HT_SINEThe talib.HT_SINE() function is used to calculate Hilbert Transform - SineWave.
talib.HT_TRENDMODEThe talib.HT_TRENDMODE() function is used to calculate Hilbert Transform - Trend vs Cycle Mode.

Talib/PriceTransform

NameDescription
talib.AVGPRICEThe talib.AVGPRICE() function is used to calculate Average Price.
talib.MEDPRICEThe talib.MEDPRICE() function is used to calculate Median Price.
talib.TYPPRICEThe talib.TYPPRICE() function is used to calculate Typical Price.
talib.WCLPRICEThe talib.WCLPRICE() function is used to calculate Weighted Close Price.

Talib/StatisticFunctions

NameDescription
talib.LINEARREGThe talib.LINEARREG() function is used to calculate the Linear Regression indicator.
talib.LINEARREG_ANGLEThe talib.LINEARREG_ANGLE() function is used to calculate Linear Regression Angle.
talib.LINEARREG_INTERCEPTThe talib.LINEARREG_INTERCEPT() function is used to calculate the Linear Regression Intercept.
talib.LINEARREG_SLOPEThe talib.LINEARREG_SLOPE() function is used to calculate Linear Regression Slope.
talib.STDDEVThe talib.STDDEV() function is used to calculate Standard Deviation.
talib.TSFThe talib.TSF() function is used to calculate Time Series Forecast.
talib.VARThe talib.VAR() function is used to calculate Variance.

Talib/MathTransform

NameDescription
talib.ACOSThe talib.ACOS() function is used to calculate Vector Trigonometric ACos.
talib.ASINThe talib.ASIN() function is used to calculate Vector Trigonometric ASin.
talib.ATANThe talib.ATAN() function is used to calculate Vector Trigonometric ATan.
talib.CEILThe talib.CEIL() function is used to calculate Vector Ceil.
talib.COSThe talib.COS() function is used to calculate Vector Trigonometric Cos.
talib.COSHThe talib.COSH() function is used to calculate Vector Trigonometric Cosh.
talib.EXPThe talib.EXP() function is used to calculate Vector Arithmetic Exp.
talib.FLOORThe talib.FLOOR() function is used to calculate Vector Floor.
talib.LNThe talib.LN() function is used to calculate Vector Log Natural.
talib.LOG10The talib.LOG10() function is used to calculate Vector Log10 (logarithm function).
talib.SINThe talib.SIN() function is used to calculate Vector Trigonometric Sin.
talib.SINHThe talib.SINH() function is used to calculate Vector Trigonometric Sinh.
talib.SQRTThe talib.SQRT() function is used to calculate Vector Square Root.
talib.TANThe talib.TAN() function is used to calculate Vector Trigonometric Tan.
talib.TANHThe talib.TANH() function is used to calculate Vector Trigonometric Tanh.

Talib/MathOperators

NameDescription
talib.MAXThe talib.MAX() function is used to calculate the Highest value over a specified period.
talib.MAXINDEXThe talib.MAXINDEX() function is used to calculate the Index of highest value over a specified period.
talib.MINThe talib.MIN() function is used to calculate the Lowest value over a specified period.
talib.MININDEXThe talib.MININDEX() function is used to calculate the Index of lowest value over a specified period.
talib.MINMAXThe talib.MINMAX() function is used to calculate the Lowest and highest values over a specified period.
talib.MINMAXINDEXThe talib.MINMAXINDEX() function is used to calculate Indexes of lowest and highest values over a specified period.
talib.SUMThe talib.SUM() function is used to calculate Summation.

Talib/PatternRecognition

NameDescription
talib.CDL2CROWSThe talib.CDL2CROWS() function is used to calculate Two Crows (K-line pattern - Two Crows).
talib.CDL3BLACKCROWSThe talib.CDL3BLACKCROWS() function is used to calculate Three Black Crows (K-line pattern - Three Black Crows).
talib.CDL3INSIDEThe talib.CDL3INSIDE() function is used to calculate Three Inside Up/Down (Candlestick Pattern: Three Inside Up/Down).
talib.CDL3LINESTRIKEThe talib.CDL3LINESTRIKE() function is used to calculate Three-Line Strike (Candlestick Pattern: Three-Line Strike).
talib.CDL3OUTSIDEThe talib.CDL3OUTSIDE() function is used to calculate Three Outside Up/Down (Candlestick Pattern: Three Outside).
talib.CDL3STARSINSOUTHThe talib.CDL3STARSINSOUTH() function is used to calculate Three Stars In The South (Candlestick Pattern: Three Stars In The South).
talib.CDL3WHITESOLDIERSThe talib.CDL3WHITESOLDIERS() function is used to calculate Three Advancing White Soldiers (K-line pattern: Three White Soldiers).
talib.CDLABANDONEDBABYThe talib.CDLABANDONEDBABY() function is used to calculate Abandoned Baby (Candlestick Pattern: Abandoned Baby).
talib.CDLADVANCEBLOCKThe talib.CDLADVANCEBLOCK() function is used to calculate Advance Block (Candlestick Pattern: Advance Block).
talib.CDLBELTHOLDThe talib.CDLBELTHOLD() function is used to calculate Belt-hold (Candlestick Pattern: Belt-hold).
talib.CDLBREAKAWAYThe talib.CDLBREAKAWAY() function is used to calculate Breakaway (Candlestick Pattern: Breakaway Pattern).
talib.CDLCLOSINGMARUBOZUThe talib.CDLCLOSINGMARUBOZU() function is used to calculate the Closing Marubozu candlestick pattern.
talib.CDLCONCEALBABYSWALLThe talib.CDLCONCEALBABYSWALL() function is used to calculate Concealing Baby Swallow (Candlestick Pattern: Concealing Baby Swallow).
talib.CDLCOUNTERATTACKThe talib.CDLCOUNTERATTACK() function is used to calculate Counterattack Lines (K-Line Pattern: Counterattack).
talib.CDLDARKCLOUDCOVERThe talib.CDLDARKCLOUDCOVER() function is used to calculate Dark Cloud Cover candlestick pattern.
talib.CDLDOJIThe talib.CDLDOJI() function is used to calculate Doji (K-line pattern: Doji Star).
talib.CDLDOJISTARThe talib.CDLDOJISTAR() function is used to calculate Doji Star (Candlestick Pattern: Doji Star).
talib.CDLDRAGONFLYDOJIThe talib.CDLDRAGONFLYDOJI() function is used to calculate Dragonfly Doji (Candlestick Pattern: Dragonfly Doji).
talib.CDLENGULFINGThe talib.CDLENGULFING() function is used to calculate Engulfing Pattern.
talib.CDLEVENINGDOJISTARThe talib.CDLEVENINGDOJISTAR() function is used to calculate Evening Doji Star (K-line pattern: Evening Doji Star).
talib.CDLEVENINGSTARThe talib.CDLEVENINGSTAR() function is used to calculate the Evening Star candlestick pattern.
talib.CDLGAPSIDESIDEWHITEThe talib.CDLGAPSIDESIDEWHITE() function is used to calculate **Up/Down-gap side-by-side white lines (K-line pattern: Up/Down-gap side-by-side white li...
talib.CDLGRAVESTONEDOJIThe talib.CDLGRAVESTONEDOJI() function is used to calculate the Gravestone Doji candlestick pattern.
talib.CDLHAMMERThe talib.CDLHAMMER() function is used to calculate Hammer (Candlestick Pattern: Hammer).
talib.CDLHANGINGMANThe talib.CDLHANGINGMAN() function is used to calculate Hanging Man (Candlestick Pattern: Hanging Man).
talib.CDLHARAMIThe talib.CDLHARAMI() function is used to calculate Harami Pattern (K-line chart: bullish/bearish pattern).
talib.CDLHARAMICROSSThe talib.CDLHARAMICROSS() function is used to calculate Harami Cross Pattern (Candlestick Pattern: Harami Cross).
talib.CDLHIGHWAVEThe talib.CDLHIGHWAVE() function is used to calculate High-Wave Candle (Candlestick Pattern: High Wave Candle).
talib.CDLHIKKAKEThe talib.CDLHIKKAKE() function is used to calculate Hikkake Pattern (Candlestick: Trap Pattern).
talib.CDLHIKKAKEMODThe talib.CDLHIKKAKEMOD() function is used to calculate Modified Hikkake Pattern (Candlestick: Modified Hikkake Pattern).
talib.CDLHOMINGPIGEONThe talib.CDLHOMINGPIGEON() function is used to calculate Homing Pigeon (Candlestick Pattern: Homing Pigeon).
talib.CDLIDENTICAL3CROWSThe talib.CDLIDENTICAL3CROWS() function is used to calculate Identical Three Crows (Candlestick Pattern: Identical Three Crows).
talib.CDLINNECKThe talib.CDLINNECK() function is used to calculate In-Neck Pattern (Candlestick Chart: In-Neck Pattern).
talib.CDLINVERTEDHAMMERThe talib.CDLINVERTEDHAMMER() function is used to calculate Inverted Hammer (K-Line Pattern: Inverted Hammer).
talib.CDLKICKINGThe talib.CDLKICKING() function is used to calculate Kicking (Candlestick Pattern: Kicking Pattern).
talib.CDLKICKINGBYLENGTHThe talib.CDLKICKINGBYLENGTH() function is used to calculate **Kicking - bull/bear determined by the longer marubozu (K-line pattern: Kicking Bull/Bear...
talib.CDLLADDERBOTTOMThe talib.CDLLADDERBOTTOM() function is used to calculate Ladder Bottom (Candlestick Pattern: Ladder Bottom).
talib.CDLLONGLEGGEDDOJIThe talib.CDLLONGLEGGEDDOJI() function is used to calculate Long Legged Doji (Candlestick Pattern: Long Legged Doji).
talib.CDLLONGLINEThe talib.CDLLONGLINE() function is used to calculate Long Line Candle Pattern (Candlestick Chart: Long Line).
talib.CDLMARUBOZUThe talib.CDLMARUBOZU() function is used to calculate the Marubozu (Candlestick Pattern: Shaven Head and Bottom) pattern.
talib.CDLMATCHINGLOWThe talib.CDLMATCHINGLOW() function is used to calculate Matching Low (Candlestick Pattern: Matching Low).
talib.CDLMATHOLDThe talib.CDLMATHOLD() function is used to calculate Mat Hold (Candlestick Pattern: Mat Hold).
talib.CDLMORNINGDOJISTARThe talib.CDLMORNINGDOJISTAR() function is used to calculate Morning Doji Star (Candlestick Pattern: Morning Doji Star).
talib.CDLMORNINGSTARThe talib.CDLMORNINGSTAR() function is used to calculate Morning Star (Candlestick Pattern: Morning Star).
talib.CDLONNECKThe talib.CDLONNECK() function is used to calculate On-Neck Pattern (Candlestick Chart: On-Neck Pattern).
talib.CDLPIERCINGThe talib.CDLPIERCING() function is used to calculate Piercing Pattern (Candlestick Pattern: Piercing Pattern).
talib.CDLRICKSHAWMANThe talib.CDLRICKSHAWMAN() function is used to calculate Rickshaw Man (Candlestick Pattern: Rickshaw Man).
talib.CDLRISEFALL3METHODSThe talib.CDLRISEFALL3METHODS() function is used to calculate Rising/Falling Three Methods (Candlestick Pattern: Rising/Falling Three Methods).
talib.CDLSEPARATINGLINESThe talib.CDLSEPARATINGLINES() function is used to calculate Separating Lines Pattern (Candlestick Chart: Separating Lines).
talib.CDLSHOOTINGSTARThe talib.CDLSHOOTINGSTAR() function is used to calculate Shooting Star (Candlestick Pattern: Shooting Star).
talib.CDLSHORTLINEThe talib.CDLSHORTLINE() function is used to calculate Short Line Candle Pattern (K-Line: Short Line).
talib.CDLSPINNINGTOPThe talib.CDLSPINNINGTOP() function is used to calculate Spinning Top (Candlestick Pattern: Spinning Top).
talib.CDLSTALLEDPATTERNThe talib.CDLSTALLEDPATTERN() function is used to calculate Stalled Pattern (Candlestick Pattern: Stalled Pattern).
talib.CDLSTICKSANDWICHThe talib.CDLSTICKSANDWICH() function is used to calculate Stick Sandwich (Candlestick Pattern: Stick Sandwich).
talib.CDLTAKURIThe talib.CDLTAKURI() function is used to calculate Takuri (Dragonfly Doji with very long lower shadow) candlestick pattern.
talib.CDLTASUKIGAPThe talib.CDLTASUKIGAP() function is used to calculate Tasuki Gap (Candlestick Pattern: Tasuki Gap).
talib.CDLTHRUSTINGThe talib.CDLTHRUSTING() function is used to calculate Thrusting Pattern (Candlestick Pattern: Thrusting Pattern).
talib.CDLTRISTARThe talib.CDLTRISTAR() function is used to calculate Tristar Pattern (Candlestick Chart: Tristar Pattern).
talib.CDLUNIQUE3RIVERThe talib.CDLUNIQUE3RIVER() function is used to calculate Unique 3 River (Candlestick Pattern: Unique Three River).
talib.CDLUPSIDEGAP2CROWSThe talib.CDLUPSIDEGAP2CROWS() function is used to calculate Upside Gap Two Crows (Candlestick Pattern: Two Crows).
talib.CDLXSIDEGAP3METHODSThe talib.CDLXSIDEGAP3METHODS() function is used to calculate Upside/Downside Gap Three Methods (Candlestick Pattern Recognition).

OS

NameDescription
ListFilesResultFile list object used to record directory listing information.
FileStatFile statistics information object.

OS/os

NameDescription
openOpen a file in the specified mode.
fgetsRead the entire file content at once.
fputsWrite content to a file.
mmapMemory-mapped file, returns the binary data of the file.
getRootDirGet the root directory path for file operations.
listFilesList files and subdirectories in the specified directory.
existsCheck if the specified file or directory exists.
removeDelete the specified file.
mkdirCreate a directory.
rmdirRemove a directory and all its contents.
renameRename a file or move a file.
statGet detailed statistics information of a file.
exitExit the program.

OS/File

NameDescription
closeClose the file and release associated resources.
putsWrite one or more strings to a file.
printfWrite formatted data to file.
flushFlush the file buffer to ensure data is written to disk.
tellGet the current file pointer position.
seekMove the file pointer to a specified position.
eofCheck if the file pointer has reached the end of file.
readRead data from a file.
writeWrite string data to a file.
getlineRead the next line from the file.
toStringGet the string representation of the file object.

Structures

NameDescription
TickerMarket data structure.
DepthMarket depth data structure.
OrderBookOrder structure in market depth.
TradeData structure for market trade records.
RecordData structure for candlestick bars in standard OHLC format, used for charting candlesticks and calculating technical indicators.
MarketData structure for trading symbol market information.
OrderOrder structure.
ConditionConditional order configuration structure, used to set trigger conditions and execution prices for conditional orders.
AccountData structure for account information.
AssetData structure for specific currency asset information.
PositionData structure for contract position information.
FundingData structure for trading instrument funding rate information, only cryptocurrency perpetual contracts support funding rate functionality.

OtherStruct

NameDescription
HttpQuery-optionsThis JSON structure is used to configure various parameters for HTTP requests sent by HttpQuery and HttpQuery_Go functions.
HttpQuery-returnThis JSON structure is the data structure returned by the HttpQuery function in debug mode, when the debug field is set to true in the options paramete...
LogStatus-tableThis JSON structure is used to configure the table content displayed in the strategy status bar.
LogStatus-btnTypeOneThis JSON structure is used to configure button controls in the status bar.
LogStatus-btnTypeTwoThis JSON structure is used to configure button controls in the status bar.
Chart-optionsThis JSON is used to configure chart settings for the custom plotting function Chart().
KLineChart-optionsThis JSON is used to configure the chart settings for the custom drawing function KLineChart.
SetData-dataThis JSON is used to set the data to be loaded by the exchange.SetData() function.
EventLoop-returnThis JSON is the data structure returned by the EventLoop() function.
DBExec-returnThis JSON is the data structure returned by the DBExec() function; this JSON data structure is also returned when executing SQL statements using the ``...
Thread.join-returnThis JSON is the data structure returned by the join() member function of the Thread object, used to store information related to concurrent thre...

Built-in Variables and Constants

EXCHANGE

NameDescription
exchangeexchange is an exchange object, and it is also the first exchange object added in the strategy live trading settings and backtesting settings.
exchangesexchanges is an array of exchange objects that contains all the exchange objects added in the strategy's live trading settings or backtesting settings, where...

ORDER_STATE

NameDescription
ORDER_STATE_PENDINGORDER_STATE_PENDING is the value of the Status property in the Order structure, indicating that the order status is pending.
ORDER_STATE_CLOSEDORDER_STATE_CLOSED is the value of the Status property in the Order structure, indicating that the order status is completed.
ORDER_STATE_CANCELEDORDER_STATE_CANCELED is the value of the Status property in the Order structure, indicating that the order status is canceled.
ORDER_STATE_UNKNOWNORDER_STATE_UNKNOWN is the value of the Status property in the Order structure, indicating that the order status is unknown (other status).

ORDER_TYPE

NameDescription
ORDER_TYPE_BUYORDER_TYPE_BUY is the value of the Type property in the Order structure, representing a buy order type.
ORDER_TYPE_SELLORDER_TYPE_SELL is the Type property value in the Order structure, used to indicate a sell order type.

ORDER_CONDITION_TYPE

NameDescription
ORDER_CONDITION_TYPE_OCOORDER_CONDITION_TYPE_OCO is the value of the ConditionType property in the Condition structure, representing OCO orders (One-Cancels-the-Other).
ORDER_CONDITION_TYPE_TPORDER_CONDITION_TYPE_TP is the ConditionType attribute value in the Condition structure, representing a Take Profit order.
ORDER_CONDITION_TYPE_SLORDER_CONDITION_TYPE_SL is the ConditionType attribute value in the Condition structure, representing a Stop Loss order.
ORDER_CONDITION_TYPE_GENERICORDER_CONDITION_TYPE_GENERIC is the ConditionType property value in the Condition structure, representing a generic conditional order.

POSITION_DIRECTION

NameDescription
PD_LONGPD_LONG is the value of the Type property in the Position structure, representing a long position type.
PD_SHORTPD_SHORT is the value of the Type property in the Position structure, representing a short position type.

ORDER_OFFSET

NameDescription
ORDER_OFFSET_OPENORDER_OFFSET_OPEN is a value for the Offset property in the Order structure, indicating that the order is an opening position operation.
ORDER_OFFSET_CLOSEORDER_OFFSET_CLOSE is a value for the Offset property in the Order structure, indicating that the order is in the close position direction.

PERIOD

NameDescription
PERIOD_M1Constant representing 1-minute candlestick period, with a value of 60.
PERIOD_M3Constant representing the 3-minute candlestick period, with a value of 180.
PERIOD_M5Constant representing the 5-minute candlestick period, with a value of 300.
PERIOD_M15Constant representing the 15-minute candlestick period, with a value of 900.
PERIOD_M30Constant representing the 30-minute candlestick period, with a value of 1800 seconds.
PERIOD_H1Constant representing 1-hour candlestick period, with a value of 3600.
PERIOD_H2Constant representing the 2-hour candlestick period, with a value of 7200.
PERIOD_H4Constant representing the 4-hour candlestick period, with a value of 14400.
PERIOD_H6Constant representing the 6-hour candlestick period, with a value of 21600.
PERIOD_H12Constant representing the 12-hour candlestick period, with a value of 43200.
PERIOD_D1Constant representing 1-day candlestick period, with a value of 86400.
PERIOD_D3Constant representing the 3-day candlestick period, with a value of 259200.
PERIOD_W1Constant representing 1-week candlestick period, with a value of 604800 seconds.

LOG_TYPE

NameDescription
LOG_TYPE_BUYLOG_TYPE_BUY is an optional value for the LogType parameter of the exchange.Log function, used to set the log type printed by the exchange.Log fu...
LOG_TYPE_SELLLOG_TYPE_SELL is an optional value for the LogType parameter of the exchange.Log function, used to set the exchange.Log function to print sell or...
LOG_TYPE_CANCELLOG_TYPE_CANCEL is an optional value for the LogType parameter of the exchange.Log function, used to set the exchange.Log function to print order...