FlowscopeDocs

markets reference

Facts about exchanges and symbols.

Look up exchange categories, listed symbols, base and quote assets, tick and step sizes, and build combined exchange selections.

Functions

markets.agg

Flowscope Script
markets.agg(exchanges: string...) -> string

Builds the combined exchange selection.

Combines exchange names into a value you can pass to subscribe(exchange:). Names are sorted alphabetically and joined with ":": markets.agg("bybit", "binance") returns "binance:bybit". Exchange names are checked when you subscribe.

You can call this during setup. Changing an input used to choose the exchanges restarts the script with the new selection. Pass each exchange name as a separate argument.

ParameterType
exchangesstring

Returns string

markets.exchangeCategory

Flowscope Script
markets.exchangeCategory(exchange: string) -> string

Returns an exchange’s category, such as spot or futures.

exchange selects the exchange. An unknown name returns an empty string. Use markets.hasExchange to check a name before reading its category.

ParameterType
exchangestring

Returns string

Available in Handlers and functions called from handlers.

markets.exchangeNames

Flowscope Script
markets.exchangeNames(category: string? = null) -> string[]

Lists exchange names, optionally filtered by category.

category filters the list, for example to "spot" or "futures". Omit it or use null for all exchanges. Names are sorted alphabetically. An unknown category returns an empty list.

The returned list is read-only. Call this inside a handler.

ParameterType
categorystring?

Returns string[]

Available in Handlers and functions called from handlers.

markets.exchangesForSymbol

Flowscope Script
markets.exchangesForSymbol(symbol: string) -> string[]

Lists the exchanges that offer a symbol.

symbol selects the symbol. Exchange names are sorted alphabetically. An unknown symbol returns an empty list.

The returned list is read-only. Call this inside a handler.

ParameterType
symbolstring

Returns string[]

Available in Handlers and functions called from handlers.

markets.hasExchange

Flowscope Script
markets.hasExchange(exchange: string) -> bool

Reports whether an exchange name is known.

exchange must be one exchange name. A combined selection such as "binancef:bybitf" returns false. The result is never null and does not depend on live market updates.

ParameterType
exchangestring

Returns bool

Available in Handlers and functions called from handlers.

markets.hasSymbol

Flowscope Script
markets.hasSymbol(exchange: string, symbol: string) -> bool

Reports whether a symbol is listed on an exchange.

Checks whether exchange lists symbol. For a combined exchange selection, returns true if any member lists the symbol. If any member exchange is unknown, returns false.

The result is never null and does not depend on the current bar or snapshot.

ParameterType
exchangestring
symbolstring

Returns bool

Available in Handlers and functions called from handlers.

markets.stepSize

Flowscope Script
markets.stepSize(exchange: string, symbol: string) -> float?

Returns the smallest quantity increment for a symbol.

exchange and symbol select the listing. An unknown listing or unavailable increment returns null.

For a combined exchange selection from markets.agg, returns the smallest available increment among exchanges that list the symbol. Exchanges without the symbol are skipped. If any exchange is unknown, none lists the symbol, or no increment is available, returns null.

ParameterType
exchangestring
symbolstring

Returns float?

Available in Handlers and functions called from handlers.

markets.symbolBase

Flowscope Script
markets.symbolBase(exchange: string, symbol: string) -> string

Returns the base asset of a symbol.

exchange and symbol select the listing. An unknown exchange or symbol returns an empty string. The result does not depend on the current bar.

For a combined exchange selection from markets.agg, reads the first exchange in alphabetical order that lists the symbol. If any exchange is unknown, or none lists the symbol, returns an empty string.

ParameterType
exchangestring
symbolstring

Returns string

Available in Handlers and functions called from handlers.

markets.symbolNames

Flowscope Script
markets.symbolNames(exchange: string) -> string[]

Lists the symbols available on an exchange.

exchange selects the exchange. Names are sorted alphabetically. An unknown exchange returns an empty list.

The list is read-only and does not depend on the current bar or snapshot.

ParameterType
exchangestring

Returns string[]

Available in Handlers and functions called from handlers.

markets.symbolQuote

Flowscope Script
markets.symbolQuote(exchange: string, symbol: string) -> string

Returns the quote asset of a symbol.

exchange and symbol select the listing. An unknown exchange or symbol returns an empty string. The result does not depend on the current bar.

For a combined exchange selection from markets.agg, reads the first exchange in alphabetical order that lists the symbol. If any exchange is unknown, or none lists the symbol, returns an empty string.

ParameterType
exchangestring
symbolstring

Returns string

Available in Handlers and functions called from handlers.

markets.tickSize

Flowscope Script
markets.tickSize(exchange: string, symbol: string) -> float?

Returns the smallest price increment for a symbol.

exchange and symbol select the listing. An unknown listing or unavailable increment returns null.

For a combined exchange selection from markets.agg, returns the smallest available increment among exchanges that list the symbol. Exchanges without the symbol are skipped. If any exchange is unknown, none lists the symbol, or no increment is available, returns null.

ParameterType
exchangestring
symbolstring

Returns float?

Available in Handlers and functions called from handlers.