FlowscopeDocs

data reference

Subscriptions to market data and their snapshot queries.

data name = subscribe(data.ohlcv) subscribes to the chart’s own bars; exchange, symbol and timeframe arguments pick another market or period. Period sources (ohlcv, oi, cvd, vd, statistics) drive on handlers; data.book and data.volume are snapshots read from another subscription’s handler.

Sources

data.book

Flowscope Script
source data.book -> BookSub

Provides order-book snapshots to read from another subscription’s handler.

  • exchange, symbol, and timeframe choose the market and period. Omit them or use null to inherit the chart’s settings, the window’s settings, or the run settings when there is no chart or window.
  • history requests earlier data as a number of source periods or a duration. Null uses the default. Zero (0 or 0s) asks for live data only: no earlier snapshots are loaded, and reads return snapshots from the period the script started in onward. A negative constant is an error.

Read snapshots from a handler on another subscription. An explicit timeframe sets the snapshot periods independently of the chart. barsAgo counts these source periods. Reads use the latest source boundary at or before the handler’s time. Missing periods return null. Higher-timeframe reads use completed periods; they do not reveal the final contents of a period still in progress.

Each book period uses its latest high-definition snapshot, not an average.

A positive history can raise the default history request but cannot reduce it. Initial snapshot history loads up to 250 source periods, separately from the chart’s replay range, and is also limited by the source’s available history.

ParameterType
exchangestring|string[]?
symbolstring?
timeframetimeframe?
historyint|duration?

data.cvd

Flowscope Script
source data.cvd -> CvdSub

Subscribes to cumulative volume delta bars.

  • exchange, symbol, and timeframe choose the market and period. Omit them or use null to inherit the chart’s settings, the window’s settings, or the run settings when there is no chart or window.
  • history requests earlier data as a number of source periods or a duration. Null uses the default. Zero (0, 0s, or time.seconds(0)) asks for live data only: nothing is loaded before the script goes live, handlers on this subscription run only on live updates, and reads return null until then. A live-only subscription does not make the chart’s history finer. A negative constant is an error; a negative input value also means live data only. During the history replay its isHistory reads true. Once live, a live-only subscription finer than the chart adds its updates to the chart’s live history, so the chart keeps fewer of its own bars after running for a while.
  • bucket selects a size group from 1 to 11, defaulting to 1. Other values are rejected before the script runs.

Completed bars and the current forming bar are available. history can raise the amount of data loaded before the visible range so indicators have enough samples at the left edge. A positive value cannot reduce the default of 750 intraday bars. A longer history can help an EMA settle. Calculations still return null until they have enough samples.

ParameterType
exchangestring|string[]?
symbolstring?
timeframetimeframe?
historyint|duration?
bucketint

data.ohlcv

Flowscope Script
source data.ohlcv -> OhlcvSub

Subscribes to price and volume bars.

  • exchange, symbol, and timeframe choose the market and period. Omit them or use null to inherit the chart’s settings, the window’s settings, or the run settings when there is no chart or window.
  • history requests earlier data as a number of source periods or a duration. Null uses the default. Zero (0, 0s, or time.seconds(0)) asks for live data only: nothing is loaded before the script goes live, handlers on this subscription run only on live updates, and reads return null until then. A live-only subscription does not make the chart’s history finer. A negative constant is an error; a negative input value also means live data only. During the history replay its isHistory reads true. Once live, a live-only subscription finer than the chart adds its updates to the chart’s live history, so the chart keeps fewer of its own bars after running for a while. The chart subscription (no exchange, symbol, or timeframe) cannot be live only. A live-only subscription with the same market and timeframe as one the script needs for a .forming read of a longer timeframe loads history like a normal subscription.

Completed bars and the current forming bar are available. history can raise the amount of data loaded before the visible range so indicators have enough samples at the left edge. A positive value cannot reduce the default of 750 intraday bars. A longer history can help an EMA settle. Calculations still return null until they have enough samples.

ParameterType
exchangestring|string[]?
symbolstring?
timeframetimeframe?
historyint|duration?

data.oi

Flowscope Script
source data.oi -> OiSub

Subscribes to open interest bars.

  • exchange, symbol, and timeframe choose the market and period. Omit them or use null to inherit the chart’s settings, the window’s settings, or the run settings when there is no chart or window.
  • history requests earlier data as a number of source periods or a duration. Null uses the default. Zero (0, 0s, or time.seconds(0)) asks for live data only: nothing is loaded before the script goes live, handlers on this subscription run only on live updates, and reads return null until then. A live-only subscription does not make the chart’s history finer. A negative constant is an error; a negative input value also means live data only. During the history replay its isHistory reads true. Once live, a live-only subscription finer than the chart adds its updates to the chart’s live history, so the chart keeps fewer of its own bars after running for a while.

Completed bars and the current forming bar are available. history can raise the amount of data loaded before the visible range so indicators have enough samples at the left edge. A positive value cannot reduce the default of 750 intraday bars. A longer history can help an EMA settle. Calculations still return null until they have enough samples.

ParameterType
exchangestring|string[]?
symbolstring?
timeframetimeframe?
historyint|duration?

data.stat

Flowscope Script
source data.stat -> StatSub

Subscribes to market statistics bars.

  • exchange, symbol, and timeframe choose the market and period. Omit them or use null to inherit the chart’s settings, the window’s settings, or the run settings when there is no chart or window.
  • history requests earlier data as a number of source periods or a duration. Null uses the default. Zero (0, 0s, or time.seconds(0)) asks for live data only: nothing is loaded before the script goes live, handlers on this subscription run only on live updates, and reads return null until then. A live-only subscription does not make the chart’s history finer. A negative constant is an error; a negative input value also means live data only. During the history replay its isHistory reads true. Once live, a live-only subscription finer than the chart adds its updates to the chart’s live history, so the chart keeps fewer of its own bars after running for a while.

Completed bars and the current forming bar are available. history can raise the amount of data loaded before the visible range so indicators have enough samples at the left edge. A positive value cannot reduce the default of 750 intraday bars. A longer history can help an EMA settle. Calculations still return null until they have enough samples.

ParameterType
exchangestring|string[]?
symbolstring?
timeframetimeframe?
historyint|duration?

data.trades

Flowscope Script
source data.trades -> TradesSub

Delivers individual trades to a trade handler.

  • exchange and symbol choose the market. Null inherits the chart’s market, the window’s market, or the run settings when neither is present.
  • minSize keeps only trades with size >= minSize. Null applies no size filter. A non-positive or non-finite value is rejected before the subscription starts.
  • history requests earlier trades as a duration. Null uses the default; your data plan may cap the requested history. When every trades subscription on the market sets a positive history, only that much is loaded, however long the chart’s range is. Zero (0s or time.seconds(0)) asks for live trades only: no earlier trades are loaded and the trade handler runs only for trades that arrive after the script goes live, not for earlier trades of the current bar. A negative constant is an error.
ParameterType
exchangestring?
symbolstring?
minSizefloat?
historyduration?

data.vd

Flowscope Script
source data.vd -> VdSub

Subscribes to volume delta bars.

  • exchange, symbol, and timeframe choose the market and period. Omit them or use null to inherit the chart’s settings, the window’s settings, or the run settings when there is no chart or window.
  • history requests earlier data as a number of source periods or a duration. Null uses the default. Zero (0, 0s, or time.seconds(0)) asks for live data only: nothing is loaded before the script goes live, handlers on this subscription run only on live updates, and reads return null until then. A live-only subscription does not make the chart’s history finer. A negative constant is an error; a negative input value also means live data only. During the history replay its isHistory reads true. Once live, a live-only subscription finer than the chart adds its updates to the chart’s live history, so the chart keeps fewer of its own bars after running for a while.
  • bucket selects a size group from 1 to 11, defaulting to 1. Other values are rejected before the script runs.

Completed bars and the current forming bar are available. history can raise the amount of data loaded before the visible range so indicators have enough samples at the left edge. A positive value cannot reduce the default of 750 intraday bars. A longer history can help an EMA settle. Calculations still return null until they have enough samples.

ParameterType
exchangestring|string[]?
symbolstring?
timeframetimeframe?
historyint|duration?
bucketint

data.volume

Flowscope Script
source data.volume -> VolumeSub

Provides volume-profile snapshots to read from another subscription’s handler.

  • exchange, symbol, and timeframe choose the market and period. Omit them or use null to inherit the chart’s settings, the window’s settings, or the run settings when there is no chart or window.
  • history requests earlier data as a number of source periods or a duration. Null uses the default. Zero (0 or 0s) asks for live data only: no earlier snapshots are loaded, and reads return snapshots from the period the script started in onward. A negative constant is an error.

Read snapshots from a handler on another subscription. An explicit timeframe sets the snapshot periods independently of the chart. barsAgo counts these source periods. Reads use the latest source boundary at or before the handler’s time. Missing periods return null. Higher-timeframe reads use completed periods; they do not reveal the final contents of a period still in progress.

Higher timeframes may use wider price bins. Read their width with binSize(). There is no forming volume-profile view.

A positive history can raise the default history request but cannot reduce it. Initial snapshot history loads up to 250 source periods, separately from the chart’s replay range, and is also limited by the source’s available history.

ParameterType
exchangestring|string[]?
symbolstring?
timeframetimeframe?
historyint|duration?

Methods

data.book.askRange

Flowscope Script
data.book.askRange(from: float, to: float, barsAgo: int = 0) -> BookSideSummary?

Summarizes ask levels within a price range.

from and to include both ends of the range. Reversed bounds or a range with no levels returns null. Unavailable book data also returns null.

barsAgo counts periods on this subscription, with 0 selecting the current snapshot. An invalid position, a position outside available history, or a missing snapshot returns null.

avgPrice is the quantity-weighted average price of the selected levels.

Your data plan may limit the levels available to read individually. Built-in summary methods use the full book, so their totals may differ from a loop over the levels available on your plan.

ParameterType
fromfloat
tofloat
barsAgoint

Returns BookSideSummary?

Available in Handlers and functions called from handlers.

data.book.asks

Flowscope Script
data.book.asks(barsAgo: int = 0) -> BookLevels?

Returns ask levels, starting with the best price.

barsAgo counts periods on this subscription, with 0 selecting the current snapshot. An invalid position, a position outside available history, or a missing snapshot returns null.

Levels are sorted lowest to highest price. A snapshot with no asks returns an empty view with len == 0.

Read the results in a for loop or a local let variable within the handler. They cannot be saved in state, record fields, or collections, passed to another function, or returned from one.

Your data plan may limit the levels available to read individually. Built-in summary methods use the full book, so their totals may differ from a loop over the levels available on your plan.

ParameterType
barsAgoint

Returns BookLevels?

Available in Handlers and functions called from handlers.

data.book.asksTo

Flowscope Script
data.book.asksTo(price: float, barsAgo: int = 0) -> BookSideSummary?

Summarizes ask depth from the best price to a chosen price.

Includes ask levels at or below price. A price beyond the far end of the book includes the whole side. An empty selection or unavailable book data returns null. avgPrice is the quantity-weighted average of the selected prices.

barsAgo counts periods on this subscription, with 0 selecting the current snapshot. An invalid position, a position outside available history, or a missing snapshot returns null.

Your data plan may limit the levels available to read individually. Built-in summary methods use the full book, so their totals may differ from a loop over the levels available on your plan.

ParameterType
pricefloat
barsAgoint

Returns BookSideSummary?

Available in Handlers and functions called from handlers.

data.book.bestAsk

Flowscope Script
data.book.bestAsk(barsAgo: int = 0) -> float?

Returns the lowest ask price.

barsAgo counts periods on this subscription, with 0 selecting the current snapshot. An invalid position, a position outside available history, or a missing snapshot returns null.

A snapshot with no asks returns null.

ParameterType
barsAgoint

Returns float?

Available in Handlers and functions called from handlers.

data.book.bestBid

Flowscope Script
data.book.bestBid(barsAgo: int = 0) -> float?

Returns the highest bid price.

barsAgo counts periods on this subscription, with 0 selecting the current snapshot. An invalid position, a position outside available history, or a missing snapshot returns null.

A snapshot with no bids returns null.

ParameterType
barsAgoint

Returns float?

Available in Handlers and functions called from handlers.

data.book.bidRange

Flowscope Script
data.book.bidRange(from: float, to: float, barsAgo: int = 0) -> BookSideSummary?

Summarizes bid levels within a price range.

from and to include both ends of the range. Reversed bounds or a range with no levels returns null. Unavailable book data also returns null.

barsAgo counts periods on this subscription, with 0 selecting the current snapshot. An invalid position, a position outside available history, or a missing snapshot returns null.

avgPrice is the quantity-weighted average price of the selected levels.

Your data plan may limit the levels available to read individually. Built-in summary methods use the full book, so their totals may differ from a loop over the levels available on your plan.

ParameterType
fromfloat
tofloat
barsAgoint

Returns BookSideSummary?

Available in Handlers and functions called from handlers.

data.book.bids

Flowscope Script
data.book.bids(barsAgo: int = 0) -> BookLevels?

Returns bid levels, starting with the best price.

barsAgo counts periods on this subscription, with 0 selecting the current snapshot. An invalid position, a position outside available history, or a missing snapshot returns null.

Levels are sorted highest to lowest price. A snapshot with no bids returns an empty view with len == 0.

Read the results in a for loop or a local let variable within the handler. They cannot be saved in state, record fields, or collections, passed to another function, or returned from one.

Your data plan may limit the levels available to read individually. Built-in summary methods use the full book, so their totals may differ from a loop over the levels available on your plan.

ParameterType
barsAgoint

Returns BookLevels?

Available in Handlers and functions called from handlers.

data.book.bidsTo

Flowscope Script
data.book.bidsTo(price: float, barsAgo: int = 0) -> BookSideSummary?

Summarizes bid depth from the best price to a chosen price.

Includes bid levels at or above price. A price beyond the far end of the book includes the whole side. An empty selection or unavailable book data returns null. avgPrice is the quantity-weighted average of the selected prices.

barsAgo counts periods on this subscription, with 0 selecting the current snapshot. An invalid position, a position outside available history, or a missing snapshot returns null.

Your data plan may limit the levels available to read individually. Built-in summary methods use the full book, so their totals may differ from a loop over the levels available on your plan.

ParameterType
pricefloat
barsAgoint

Returns BookSideSummary?

Available in Handlers and functions called from handlers.

data.book.binSize

Flowscope Script
data.book.binSize(barsAgo: int = 0) -> float?

Returns the width of each book price bin.

barsAgo counts periods on this subscription, with 0 selecting the current snapshot. An invalid position, a position outside available history, or a missing snapshot returns null.

ParameterType
barsAgoint

Returns float?

Available in Handlers and functions called from handlers.

data.book.depth

Flowscope Script
data.book.depth(outerPct: float, ref: number? = null, innerPct: float? = null, barsAgo: int = 0) -> BookDepth?

Summarizes order-book depth around a price.

  • outerPct sets the distance on either side of ref, as a percentage: from ref * (1 - outerPct/100) to ref * (1 + outerPct/100). Values outside its allowed range stop the script with an error.
  • ref defaults to the mid price. Without both a bid and an ask, the default reference is unavailable and the result is null.
  • innerPct optionally excludes prices strictly inside a smaller band around the reference. Null or zero excludes nothing.

barsAgo counts periods on this subscription, with 0 selecting the current snapshot. An invalid position, a position outside available history, or a missing snapshot returns null. An empty price band or unavailable book data also returns null. Read this from another subscription’s handler; book subscriptions have no handlers.

Your data plan may limit the levels available to read individually. Built-in summary methods use the full book, so their totals may differ from a loop over the levels available on your plan.

ParameterType
outerPctfloat
refnumber?
innerPctfloat?
barsAgoint

Returns BookDepth?

Available in Handlers and functions called from handlers.

data.book.imbalance

Flowscope Script
data.book.imbalance(outerPct: float, unit: BookUnit = 2, ref: number? = null, innerPct: float? = null, barsAgo: int = 0) -> float?

Returns the balance between bids and asks around a price.

  • outerPct sets the price band, as for depth. Values outside its allowed range stop the script with an error.
  • unit chooses quote value (bookunit.quote, the default) or base quantity (bookunit.base).
  • ref defaults to the mid price. innerPct defaults to null.

barsAgo counts periods on this subscription, with 0 selecting the current snapshot. An invalid position, a position outside available history, or a missing snapshot returns null.

Returns (bid - ask) / (bid + ask). Quote units match depth(...).ratioValue; base units match depth(...).ratioQty. A zero total gives NaN. The result is null whenever the corresponding depth call is null.

Your data plan may limit the levels available to read individually. Built-in summary methods use the full book, so their totals may differ from a loop over the levels available on your plan.

ParameterType
outerPctfloat
unitBookUnit
refnumber?
innerPctfloat?
barsAgoint

Returns float?

Available in Handlers and functions called from handlers.

data.book.mid

Flowscope Script
data.book.mid(barsAgo: int = 0) -> float?

Returns the midpoint between the best bid and ask.

barsAgo counts periods on this subscription, with 0 selecting the current snapshot. An invalid position, a position outside available history, or a missing snapshot returns null.

Calculates (bestBid + bestAsk) / 2. Returns null if either side is empty.

ParameterType
barsAgoint

Returns float?

Available in Handlers and functions called from handlers.

data.book.numAsks

Flowscope Script
data.book.numAsks(barsAgo: int = 0) -> int?

Counts the ask levels in a book snapshot.

barsAgo counts periods on this subscription, with 0 selecting the current snapshot. An invalid position, a position outside available history, or a missing snapshot returns null.

A snapshot with no asks returns 0.

Your data plan may limit the levels available to read individually. Built-in summary methods use the full book, so their totals may differ from a loop over the levels available on your plan.

ParameterType
barsAgoint

Returns int?

Available in Handlers and functions called from handlers.

data.book.numBids

Flowscope Script
data.book.numBids(barsAgo: int = 0) -> int?

Counts the bid levels in a book snapshot.

barsAgo counts periods on this subscription, with 0 selecting the current snapshot. An invalid position, a position outside available history, or a missing snapshot returns null.

A snapshot with no bids returns 0.

Your data plan may limit the levels available to read individually. Built-in summary methods use the full book, so their totals may differ from a loop over the levels available on your plan.

ParameterType
barsAgoint

Returns int?

Available in Handlers and functions called from handlers.

data.book.range

Flowscope Script
data.book.range(from: float, to: float, barsAgo: int = 0) -> BookDepth?

Summarizes both bid and ask levels within a price range.

from and to include both ends of the range. Reversed bounds or a range with no levels returns null. Unavailable book data also returns null.

barsAgo counts periods on this subscription, with 0 selecting the current snapshot. An invalid position, a position outside available history, or a missing snapshot returns null.

Your data plan may limit the levels available to read individually. Built-in summary methods use the full book, so their totals may differ from a loop over the levels available on your plan.

ParameterType
fromfloat
tofloat
barsAgoint

Returns BookDepth?

Available in Handlers and functions called from handlers.

data.book.spread

Flowscope Script
data.book.spread(barsAgo: int = 0) -> float?

Returns the gap between the best ask and bid.

barsAgo counts periods on this subscription, with 0 selecting the current snapshot. An invalid position, a position outside available history, or a missing snapshot returns null.

Calculates bestAsk - bestBid. Returns null if either side is empty.

ParameterType
barsAgoint

Returns float?

Available in Handlers and functions called from handlers.

data.book.time

Flowscope Script
data.book.time(barsAgo: int = 0) -> time?

Returns the start time of the book snapshot period.

barsAgo counts periods on this subscription, with 0 selecting the current snapshot. An invalid position, a position outside available history, or a missing snapshot returns null.

ParameterType
barsAgoint

Returns time?

Available in Handlers and functions called from handlers.

data.bookLevels.get

Flowscope Script
data.bookLevels.get(index: int) -> BookLevel?

Reads an order-book level by index.

index counts from 0, starting with the best price. A negative index or one at or beyond len returns null. view[i] is equivalent to view.get(i). The level’s value equals price * qty.

ParameterType
indexint

Returns BookLevel?

Available in Handlers and functions called from handlers.

data.cvd.change

Flowscope Script
data.cvd.change() -> float?

Returns the change from open to close on the confirmed bar.

Calculates close - open for this subscription’s current confirmed bar. Returns null if the bar or either field is unavailable.

Returns float?

Available in Handlers and functions called from handlers.

data.cvd.range

Flowscope Script
data.cvd.range() -> float?

Returns the high-to-low range of the confirmed bar.

Calculates high - low for this subscription’s current confirmed bar. Returns null if the bar or either field is unavailable.

Returns float?

Available in Handlers and functions called from handlers.

data.ohlcv.change

Flowscope Script
data.ohlcv.change() -> float?

Returns the change from open to close on the confirmed bar.

Calculates close - open for this subscription’s current confirmed bar. Returns null if the bar or either field is unavailable.

Returns float?

Available in Handlers and functions called from handlers.

data.ohlcv.delta

Flowscope Script
data.ohlcv.delta() -> float?

Returns the current OHLCV buy-sell volume delta.

Calculates buyVolume - sellVolume for this subscription’s current confirmed bar. Returns null if the bar or either field is unavailable.

Returns float?

Available in Handlers and functions called from handlers.

data.ohlcv.range

Flowscope Script
data.ohlcv.range() -> float?

Returns the high-to-low range of the confirmed bar.

Calculates high - low for this subscription’s current confirmed bar. Returns null if the bar or either field is unavailable.

Returns float?

Available in Handlers and functions called from handlers.

data.ohlcv.tradeDelta

Flowscope Script
data.ohlcv.tradeDelta() -> int?

Returns the current OHLCV buy-sell trade-count delta.

Calculates buyCount - sellCount for this subscription’s current confirmed bar. Returns null if the bar or either field is unavailable.

Returns int?

Available in Handlers and functions called from handlers.

data.oi.change

Flowscope Script
data.oi.change() -> float?

Returns the change from open to close on the confirmed bar.

Calculates close - open for this subscription’s current confirmed bar. Returns null if the bar or either field is unavailable.

Returns float?

Available in Handlers and functions called from handlers.

data.oi.range

Flowscope Script
data.oi.range() -> float?

Returns the high-to-low range of the confirmed bar.

Calculates high - low for this subscription’s current confirmed bar. Returns null if the bar or either field is unavailable.

Returns float?

Available in Handlers and functions called from handlers.

data.profile.buckets

Flowscope Script
data.profile.buckets(count: int, from: number? = null, to: number? = null) -> VolumeBuckets?

Groups volume into equal-width price buckets.

count chooses the number of buckets. They span from the lowest selected price through one binSize above the highest. Each level goes into the bucket containing its price, so bucket totals add up to the selected range’s totals. A count below 1 or above 4096 returns null.

from and to select the price range first, including both ends. Null leaves that end unrestricted. An empty range or reversed bounds returns null. A window with no snapshots returns null. The profile combines volume at each price before grouping it.

Read the values you need before calling buckets or bucketsByLevels again during the same calculation step. A later call replaces the data read through earlier bucket views, even on another snapshot or profile. Request the buckets again when you need a fresh view.

ParameterType
countint
fromnumber?
tonumber?

Returns VolumeBuckets?

Available in Handlers and functions called from handlers.

data.profile.bucketsByLevels

Flowscope Script
data.profile.bucketsByLevels(levelsPerBucket: int, from: number? = null, to: number? = null) -> VolumeBuckets?

Groups consecutive price levels into volume buckets.

levelsPerBucket chooses how many levels to put in each bucket. The last bucket can contain fewer levels. Each bucket starts at its first level’s price and ends one binSize above its last level. A value below 1 returns null. The result cannot exceed 4096 buckets; exceeding that limit returns null.

from and to select the price range first, including both ends. Null leaves that end unrestricted. An empty range or reversed bounds returns null. A window with no snapshots returns null. The profile combines volume at each price before grouping it.

Read the values you need before calling buckets or bucketsByLevels again during the same calculation step. A later call replaces the data read through earlier bucket views, even on another snapshot or profile. Request the buckets again when you need a fresh view.

ParameterType
levelsPerBucketint
fromnumber?
tonumber?

Returns VolumeBuckets?

Available in Handlers and functions called from handlers.

data.profile.delta

Flowscope Script
data.profile.delta() -> float?

Returns the rolling window’s volume delta (buy - sell).

Calculates buy - sell across the rolling profile. This matches summary().delta when the summary is non-null. A window with no snapshots returns null.

Returns float?

Available in Handlers and functions called from handlers.

data.profile.poc

Flowscope Script
data.profile.poc(basis: VolBasis = 0, from: number? = null, to: number? = null) -> VolumeLevel?

Returns the point of control: the level with the largest selected volume.

basis chooses which volume to compare, defaulting to volbasis.total. from and to optionally limit the price range, including both ends; null leaves that end unrestricted. Ties use the lowest price.

Returns the combined level’s price, buy, sell, total, delta, and ratio. Its index is -1 because it does not belong to one snapshot. An empty range or a window with no snapshots returns null.

ParameterType
basisVolBasis
fromnumber?
tonumber?

Returns VolumeLevel?

Available in Handlers and functions called from handlers.

data.profile.ratio

Flowscope Script
data.profile.ratio() -> float?

Returns the rolling window’s volume-delta ratio (delta / total).

Calculates delta / total across the rolling profile. This matches summary().ratio when the summary is non-null. A window with no snapshots returns null. A zero total volume gives NaN.

Returns float?

Available in Handlers and functions called from handlers.

data.profile.summary

Flowscope Script
data.profile.summary(from: number? = null, to: number? = null) -> VolumeSummary?

Summarizes a rolling profile, optionally within a price range.

from and to select prices, including both ends. Null leaves that end unrestricted. An empty range, reversed bounds, or a window with no snapshots returns null.

time is the start time of the newest snapshot period. binSize is the finest price-bin size in the window. levels counts distinct combined price levels within the selected range.

ParameterType
fromnumber?
tonumber?

Returns VolumeSummary?

Available in Handlers and functions called from handlers.

data.profile.total

Flowscope Script
data.profile.total() -> float?

Returns the rolling window’s total (buy + sell) volume.

Calculates buy + sell across the rolling profile. This matches summary().total when the summary is non-null. A window with no snapshots returns null. With one snapshot, profile(bars: 1).total() equals vol.total(). Unavailable profile data also returns null.

Returns float?

Available in Handlers and functions called from handlers.

data.profile.valueArea

Flowscope Script
data.profile.valueArea(percent: float, basis: VolBasis = 0, from: number? = null, to: number? = null) -> VolumeArea?

Returns the low and high prices of a volume value area.

percent sets how much of the selected volume the area should cover. basis chooses the volume to use, defaulting to volbasis.total. from and to optionally limit the price range; null leaves that end unrestricted.

Starts at the point of control, then adds the neighboring level with more selected volume until the target percentage is reached. Ties at the point of control or during expansion choose the lower price. At percent: 100.0, the area covers the whole range.

lowPrice and highPrice describe the area. The other fields (buy, sell, total, delta, ratio, and levels) summarize the entire queried price range.

An empty range or a window with no snapshots returns null.

ParameterType
percentfloat
basisVolBasis
fromnumber?
tonumber?

Returns VolumeArea?

Available in Handlers and functions called from handlers.

data.stat.liqDelta

Flowscope Script
data.stat.liqDelta() -> float?

Returns the current buy-sell liquidation delta.

Calculates buyLiq - sellLiq for this subscription’s current confirmed bar. Returns null if the bar or either field is unavailable.

Returns float?

Available in Handlers and functions called from handlers.

data.stat.liqTotal

Flowscope Script
data.stat.liqTotal() -> float?

Returns the current total liquidation value.

Calculates buyLiq + sellLiq for this subscription’s current confirmed bar. Returns null if the bar or either field is unavailable.

Returns float?

Available in Handlers and functions called from handlers.

data.vd.change

Flowscope Script
data.vd.change() -> float?

Returns the change from open to close on the confirmed bar.

Calculates close - open for this subscription’s current confirmed bar. Returns null if the bar or either field is unavailable.

Returns float?

Available in Handlers and functions called from handlers.

data.vd.range

Flowscope Script
data.vd.range() -> float?

Returns the high-to-low range of the confirmed bar.

Calculates high - low for this subscription’s current confirmed bar. Returns null if the bar or either field is unavailable.

Returns float?

Available in Handlers and functions called from handlers.

data.volume.binSize

Flowscope Script
data.volume.binSize(barsAgo: int = 0) -> float?

Returns the width of each price bin.

barsAgo counts periods on this subscription, with 0 selecting the current snapshot. An invalid position, a position outside available history, or a missing snapshot returns null.

ParameterType
barsAgoint

Returns float?

Available in Handlers and functions called from handlers.

data.volume.buckets

Flowscope Script
data.volume.buckets(count: int, from: number? = null, to: number? = null, barsAgo: int = 0) -> VolumeBuckets?

Groups volume into equal-width price buckets.

count chooses the number of buckets. They span from the lowest selected price through one binSize above the highest. Each level goes into the bucket containing its price, so bucket totals add up to the selected range’s totals. A count below 1 or above 4096 returns null.

from and to select the price range first, including both ends. Null leaves that end unrestricted. An empty range or reversed bounds returns null. barsAgo chooses the snapshot; a missing snapshot returns null.

Read the values you need before calling buckets or bucketsByLevels again during the same calculation step. A later call replaces the data read through earlier bucket views, even on another snapshot or profile. Request the buckets again when you need a fresh view.

ParameterType
countint
fromnumber?
tonumber?
barsAgoint

Returns VolumeBuckets?

Available in Handlers and functions called from handlers.

data.volume.bucketsByLevels

Flowscope Script
data.volume.bucketsByLevels(levelsPerBucket: int, from: number? = null, to: number? = null, barsAgo: int = 0) -> VolumeBuckets?

Groups consecutive price levels into volume buckets.

levelsPerBucket chooses how many levels to put in each bucket. The last bucket can contain fewer levels. Each bucket starts at its first level’s price and ends one binSize above its last level. A value below 1 returns null.

from and to select the price range first, including both ends. Null leaves that end unrestricted. An empty range or reversed bounds returns null. barsAgo chooses the snapshot; a missing snapshot returns null.

Read the values you need before calling buckets or bucketsByLevels again during the same calculation step. A later call replaces the data read through earlier bucket views, even on another snapshot or profile. Request the buckets again when you need a fresh view.

ParameterType
levelsPerBucketint
fromnumber?
tonumber?
barsAgoint

Returns VolumeBuckets?

Available in Handlers and functions called from handlers.

data.volume.bucketsByStep

Flowscope Script
data.volume.bucketsByStep(step: float, from: number? = null, to: number? = null, barsAgo: int = 0) -> VolumeBuckets?

Groups volume into price buckets of a fixed size on a shared price grid.

step is the height of every bucket. Buckets start at whole multiples of step, so a price falls in the same bucket on every snapshot: rows line up across bars. The first bucket holds the lowest selected price, the last the highest, and empty buckets between them are included with zero volume. A step that is zero, negative or not finite returns null, as does a range that needs more than 4096 buckets.

from and to select the price range first, including both ends. Null leaves that end open. An empty range or reversed bounds return null. barsAgo chooses the snapshot; a missing snapshot returns null.

The view’s time is the start of the snapshot’s period: the time to pass when drawing the buckets as cells on that period’s bar.

ParameterType
stepfloat
fromnumber?
tonumber?
barsAgoint

Returns VolumeBuckets?

Available in Handlers and functions called from handlers.

data.volume.delta

Flowscope Script
data.volume.delta(barsAgo: int = 0) -> float?

Returns the buy volume minus sell volume.

barsAgo counts periods on this subscription, with 0 selecting the current snapshot. An invalid position, a position outside available history, or a missing snapshot returns null.

An empty snapshot returns 0.0. This matches summary(barsAgo).delta when the summary is non-null.

ParameterType
barsAgoint

Returns float?

Available in Handlers and functions called from handlers.

data.volume.level

Flowscope Script
data.volume.level(index: int, barsAgo: int = 0) -> VolumeLevel?

Reads a volume-profile level by index.

index counts traded price levels from 0, starting with the lowest price. barsAgo chooses the snapshot. Adjacent levels can be more than one binSize apart because prices with no stored trades are skipped.

An index beyond the level count, unavailable history, or a missing snapshot returns null. Read the count with summary(barsAgo).levels.

ParameterType
indexint
barsAgoint

Returns VolumeLevel?

Available in Handlers and functions called from handlers.

data.volume.levels

Flowscope Script
data.volume.levels(barsAgo: int = 0) -> VolumeLevels?

Returns volume-profile levels from lowest to highest price.

barsAgo counts periods on this subscription, with 0 selecting the current snapshot. An invalid position, a position outside available history, or a missing snapshot returns null.

Contains the traded levels, matching level(index, barsAgo:) one by one. A snapshot with no levels returns an empty view with len == 0. These results include all profile levels; the order-book depth limit does not apply.

Read the results in a for loop or a local let variable within the handler. They cannot be saved in state, record fields, or collections, passed to another function, or returned from one.

ParameterType
barsAgoint

Returns VolumeLevels?

Available in Handlers and functions called from handlers.

data.volume.numLevels

Flowscope Script
data.volume.numLevels(barsAgo: int = 0) -> int?

Returns the number of traded price levels.

barsAgo counts periods on this subscription, with 0 selecting the current snapshot. An invalid position, a position outside available history, or a missing snapshot returns null.

An empty snapshot returns 0. This matches summary(barsAgo).levels when the summary is non-null.

ParameterType
barsAgoint

Returns int?

Available in Handlers and functions called from handlers.

data.volume.poc

Flowscope Script
data.volume.poc(basis: VolBasis = 0, from: number? = null, to: number? = null, barsAgo: int = 0) -> VolumeLevel?

Returns the point of control: the level with the largest selected volume.

basis chooses which volume to compare, defaulting to volbasis.total. from and to optionally limit the price range, including both ends; null leaves that end unrestricted. Ties use the lowest price.

barsAgo chooses the snapshot. An empty range, reversed bounds, or a missing snapshot returns null.

ParameterType
basisVolBasis
fromnumber?
tonumber?
barsAgoint

Returns VolumeLevel?

Available in Handlers and functions called from handlers.

data.volume.profile

Flowscope Script
data.volume.profile(bars: int) -> Profile

Creates a rolling volume profile over the last bars confirmed snapshots.

Returns a Profile combining the last bars completed volume snapshots available at the time the handler runs. The profile itself is never null, but its query results can be null. It has no barsAgo: parameter.

Keep the profile in a let variable or call its methods directly. It cannot be saved in state, record fields, or collections, passed to a function, or returned from one.

bars must be known before the script runs: use a literal, input, or setup value. Invalid bars values are rejected before the script runs. Each profile supports up to 65,536 distinct price levels and is also subject to the script’s resource limits. If either limit is exceeded, its queries return null without stopping the script. Later queries can remain null even if the window becomes smaller. Refreshing the data or restarting the script allows another attempt; reduce bars if the limit keeps being reached.

If fewer than bars completed snapshots are available, the profile uses those that exist. With no snapshots, all query methods return null.

ParameterType
barsint

Returns Profile

Available in Handlers and functions called from handlers.

data.volume.ratio

Flowscope Script
data.volume.ratio(barsAgo: int = 0) -> float?

Returns the volume delta divided by total volume.

barsAgo counts periods on this subscription, with 0 selecting the current snapshot. An invalid position, a position outside available history, or a missing snapshot returns null.

Returns NaN if total volume is zero. This matches summary(barsAgo).ratio when the summary is non-null.

ParameterType
barsAgoint

Returns float?

Available in Handlers and functions called from handlers.

data.volume.summary

Flowscope Script
data.volume.summary(barsAgo: int = 0, from: number? = null, to: number? = null) -> VolumeSummary?

Summarizes a volume profile, optionally within a price range.

barsAgo counts periods on this subscription, with 0 selecting the current snapshot. An invalid position, a position outside available history, or a missing snapshot returns null.

from and to select prices, including both ends. Null leaves that end unrestricted, so summary(0) reads the whole current profile. Reversed bounds or a range with no levels returns null.

Read this from another subscription’s handler. Volume profiles have no forming view.

ParameterType
barsAgoint
fromnumber?
tonumber?

Returns VolumeSummary?

Available in Handlers and functions called from handlers.

data.volume.time

Flowscope Script
data.volume.time(barsAgo: int = 0) -> time?

Returns the start time of the snapshot period.

barsAgo counts periods on this subscription, with 0 selecting the current snapshot. An invalid position, a position outside available history, or a missing snapshot returns null.

ParameterType
barsAgoint

Returns time?

Available in Handlers and functions called from handlers.

data.volume.total

Flowscope Script
data.volume.total(barsAgo: int = 0) -> float?

Returns the total buy and sell volume.

barsAgo counts periods on this subscription, with 0 selecting the current snapshot. An invalid position, a position outside available history, or a missing snapshot returns null.

An empty snapshot returns 0.0. This matches summary(barsAgo).total when the summary is non-null.

ParameterType
barsAgoint

Returns float?

Available in Handlers and functions called from handlers.

data.volume.valueArea

Flowscope Script
data.volume.valueArea(percent: float, basis: VolBasis = 0, from: number? = null, to: number? = null, barsAgo: int = 0) -> VolumeArea?

Returns the low and high prices of a volume value area.

percent sets how much of the selected volume the area should cover. basis chooses the volume to use, defaulting to volbasis.total. from and to optionally limit the price range; null leaves that end unrestricted.

Starts at the point of control, then adds the neighboring level with more selected volume until the target percentage is reached. Ties at the point of control or during expansion choose the lower price. At percent: 100.0, the area covers the whole range.

lowPrice and highPrice describe the area. The other fields (buy, sell, total, delta, ratio, and levels) summarize the entire queried price range.

barsAgo chooses the snapshot. An empty range, reversed bounds, or a missing snapshot returns null.

ParameterType
percentfloat
basisVolBasis
fromnumber?
tonumber?
barsAgoint

Returns VolumeArea?

Available in Handlers and functions called from handlers.

data.volumeBuckets.get

Flowscope Script
data.volumeBuckets.get(index: int) -> FootprintBucket?

Reads a volume bucket by index.

index counts from 0, starting with the lowest price range. A negative index or one at or beyond len returns null. view[i] is equivalent to view.get(i). total is buy + sell; delta is buy - sell.

A later buckets or bucketsByLevels call during the same calculation step replaces the data read through this view, even if it uses another snapshot or profile.

ParameterType
indexint

Returns FootprintBucket?

Available in Handlers and functions called from handlers.

data.volumeLevels.get

Flowscope Script
data.volumeLevels.get(index: int) -> VolumeLevel?

Reads a volume-profile level by index.

index counts from 0, starting with the lowest price. A negative index or one at or beyond len returns null. view[i] is equivalent to view.get(i). The fields match level(index, barsAgo:) for the same snapshot. The level’s ratio is NaN when its total volume is zero.

ParameterType
indexint

Returns VolumeLevel?

Available in Handlers and functions called from handlers.

Constants

ConstantTypeValueDescription
bookunit.baseBookUnit1Selects base quantity for book imbalance calculations.
bookunit.quoteBookUnit2Selects quote value for book imbalance calculations.
volbasis.buyVolBasis1Ranks profile levels by buy volume.
volbasis.deltaAbsVolBasis3Ranks profile levels by |buy - sell| (absolute per-level delta).
volbasis.sellVolBasis2Ranks profile levels by sell volume.
volbasis.totalVolBasis0Ranks profile levels by total (buy + sell) volume.