Skip to content
ChartDeck ChartScript docs Account Open the terminal

liq

Measured liquidations (Pro and Elite). ChartDeck data.

#Functions

#liq.eventsfunction

The liquidations the Liquidation candles mark on a bar, by time: exact prints and hourly rows, on the bar the candles place them. Pro and Elite; the last 7 days, 30 on Elite (empty before the data starts, see liq.events_since). Asked again every minute; in replay a liquidation appears once its bar or hour had ended. The chart’s own bars only: inside a request expression it reads empty (CS3124).

liq.events({ back?: int = 0 }): array<liq.event>
ParameterTypeDescription
backintdefault 0How many bars back: 0 = this bar, 1 = the one before.

Returns array<liq.event>.

Example

ChartScriptFragmentOpen in editor
for (const e of liq.events()) {
    if (e.exact && e.usd >= 100000) {
        label.new(e.time, e.price, e.side, xloc.bar_time)
    }
}

Since ChartScript 1

#liq.events_sincefunction

The time (ms) the liquidation data starts (7 days back, 30 on Elite), na without data.

liq.events_since(): int

Returns int.

Example

ChartScriptFragmentOpen in editor
const from = liq.events_since()

Since ChartScript 1

#liq.heatfunction

The liquidation model's heat over this bar (the built-in Liquidation Heatmap's data, hourly columns): a heatmap.column, or na where there is no data. A bar shorter than an hour gets the whole hour's column (span tells how long it is); a longer bar gets the largest value of each row over its hours.

liq.heat(): heatmap.column

Returns heatmap.column.

Example

ChartScriptFragmentOpen in editor
const hm = heatmap.new()
const col = liq.heat()
if (!na(col)) {
    hm.add(col)
}

Since ChartScript 1

#liq.is_modelfunction

true when the liquidation levels are a model estimate, false when they are observed positions of a pinned venue.

liq.is_model(): bool

Returns bool.

Example

ChartScriptFragmentOpen in editor
legend.badge(liq.is_model() ? "Model estimate" : "Observed")

Since ChartScript 1

#liq.levelsfunction

The liquidation model's levels now (the same data as the built-in Liquidation Levels study): an array of liq.level. It is filled on the newest bar only; every other bar gets an empty array.

liq.levels({ side?: simple string = "both" }): array<liq.level>
ParameterTypeDescription
sidesimple stringdefault "both""both", "long" (below the price) or "short" (above).

Returns array<liq.level>.

Example

ChartScriptFragmentOpen in editor
if (barstate.islast) {
    for (const lv of liq.levels()) {
        line.new(time, lv.price, time_close, lv.price, xloc.bar_time, extend.left)
    }
}

Since ChartScript 1

#liq.updatedfunction

When the liquidation data was last updated (ms), na without data.

liq.updated(): int

Returns int.

Example

ChartScriptFragmentOpen in editor
legend.info("updated " + str.format_time(liq.updated(), "HH:mm") + " UTC")

Since ChartScript 1

#liq.venuesfunction

The venues the liquidation data covers, as text, for example "All venues (14)".

liq.venues(): string

Returns string.

Example

ChartScriptFragmentOpen in editor
legend.info(liq.venues())

Since ChartScript 1

#liq.windowfunction

The liquidation model window: "7d" or "30d".

liq.window(): string

Returns string.

Example

ChartScriptFragmentOpen in editor
const w = liq.window()

Since ChartScript 1

#Variables

#liq.long_liq_usdvariable

Longs liquidated in the bar, USD, as the Liquidation candles mark them at the bar’s own timeframe: exact prints where ChartDeck records them (bars under 1 h, the last day), else hourly rows (on bars under 1 h on the bar of the hour whose range holds the price). The last 7 days, 30 on Elite. Pro and Elite. na before the data the chart holds (never 0 there); 0 on a bar inside it with none.

liq.long_liq_usd: float

Type series float.

Example

ChartScriptFragmentOpen in editor
const l = liq.long_liq_usd

Since ChartScript 1

#liq.long_usdvariable

Long liquidations in USD, measured from the venues that publish them (the Liquidations study, as a positive number). Hourly data: on shorter bars the hour’s total sits on the bar that holds the hour’s start (tick / range bars: spread by time). Pro and Elite.

liq.long_usd: float

Type series float.

Example

ChartScriptFragmentOpen in editor
const v = liq.long_usd

Since ChartScript 1

#liq.short_liq_usdvariable

Shorts liquidated in the bar, USD (see liq.long_liq_usd). Pro and Elite. na before the data the chart holds (never 0 there); 0 on a bar inside it with none.

liq.short_liq_usd: float

Type series float.

Example

ChartScriptFragmentOpen in editor
const s = liq.short_liq_usd

Since ChartScript 1

#liq.short_usdvariable

Short liquidations in USD (the Liquidations study). Hourly, as liq.long_usd. Pro and Elite.

liq.short_usd: float

Type series float.

Example

ChartScriptFragmentOpen in editor
const v = liq.short_usd

Since ChartScript 1

#liq.total_usdvariable

Long plus short liquidations in USD; na where neither has a value. Pro and Elite.

liq.total_usd: float

Type series float.

Example

ChartScriptFragmentOpen in editor
const v = liq.total_usd

Since ChartScript 1

#Not available yet

#liq.live_long_usdvariable

Not available yet.

liq.live_long_usd (later version: the live liquidation tape keeps minutes, not a bar history).

Since ChartScript 1

#liq.live_short_usdvariable

Not available yet.

liq.live_short_usd (later version: the live liquidation tape keeps minutes, not a bar history).

Since ChartScript 1

The ChartScript documentation is in English for now; translations will follow.