[{"data":1,"prerenderedAt":4568},["ShallowReactive",2],{"wrun-open-editor-url":3,"indicators:cookbook/liquidation-heat":4},"https://openmarket.xyz/chart/#wrun-open=v1",{"slug":5,"filePath":6,"frontmatter":7,"rawMarkdown":12,"tree":13},"cookbook/liquidation-heat","cookbook/liquidation-heat.md",{"title":8,"description":9,"order":10,"section":11},"Liquidation Heat","Where the leverage opened on recent bars would be liquidated, painted behind the candles as a heatmap. Every bar seeds liquidation prices below its close for…",87,"cookbook","---\ntitle: \"Liquidation Heat\"\ndescription: \"Where the leverage opened on recent bars would be liquidated, painted behind the candles as a heatmap. Every bar seeds liquidation prices below its close for…\"\norder: 87\nsection: \"cookbook\"\n---\n\n\u003C!-- source: docs/indicators/cookbook/liquidation-heat.md; generated by packages/cli/scripts/gen-indicator-docs.ts, do not edit -->\n\n# Liquidation Heat\n\n![Liquidation levels painted behind the candles as a heatmap that follows price](/wrun/images/liquidation-heat.png)\n\nWhere the leverage opened on recent bars would be liquidated, painted behind the candles as a heatmap. Every bar seeds liquidation prices below its close for longs and above it for shorts at four leverage tiers (10x, 25x, 50x and 100x), each weighted by a share of the bar's volume; a level the price trades through is consumed and leaves the map, the rest fade with age until `lookback` bars have passed. The map is 64 rows centred on the close, so it follows price up and down: the brighter a row, the more leverage sits there waiting to be flushed, and a dense band just above or below the price is where a sweep would run.\n\nThe parts are an `out.grid` of 64 rows written cell by cell from `onBar()`, two data-only outputs that place the grid on the price axis, and a `plot.heatmap` declaration over the grid ([Price canvases](../presentation/price-canvases.md)). Every number is computed in the indicator from the chart's own candles ([Data sources](../core-concepts/data-sources.md)). This is also the `liquidation-heat` template: the **Liquidation Heat** card under **Order flow** in the editor's starter list, and it compiles as written.\n\n## The wrun indicator\n\n```typescript sample=liquidation-heat\n// Liquidation Heat: where the leverage opened on recent bars would be liquidated, painted behind the candles as a\n// heatmap. Every bar seeds liquidation prices below its close for longs and above it for shorts at four leverage\n// tiers (10x, 25x, 50x, 100x), weighted by the bar's volume; a level the price trades through is consumed, the rest\n// fade with age. The map is 64 rows centred on the close, so it follows price: the brighter a row, the more leverage\n// sits there waiting to be flushed.\n\nparam.int(\"lookback\", 240, { min: 20, max: 2000, label: \"Lookback in bars\", description: \"Bars a seeded level stays on the map before it has faded out\" });\nparam.number(\"row_pct\", 0.1, { min: 0.01, max: 2, step: 0.01, label: \"Row height in percent\", description: \"Row height as a percent of the close\" });\ninput(\"close\", ohlcv.close); // the primary input: the chart's own candles define the grid and seed the levels\noutput(\"grid_low\", none, overlay, { description: \"The bottom edge of the map's lowest row on this bar\" }); // data-only: the heatmap reads it\noutput(\"row_step\", none, overlay, { description: \"The map's row height in price on this bar\" });\nout.grid(\"heat\", { rows: 64 }); // 64 data-only outputs heat_0..heat_63, one per row of the map, written with out_heat(row, value)\nplot.heatmap({ name: \"liq_heat\", grid: \"heat\", price_low: \"grid_low\", price_step: \"row_step\", palette: [\"theme.bg\", \"#8b5cf640\", \"#8b5cf6\", \"#c026d3\"], scale: \"linear\", min: 0, auto_quantile: 0.98, opacity: 0.8, behind_candles: true, label: \"Liquidation heat\", tooltip: \"{{value:si}} seeded at {{price}}\" }); // violet to magenta, hues no candle theme uses, faint for most cells: the candles stay readable on top\n\nconst ROWS = 64; // rows in the map, the grid's declared count\nconst TIERS = 4; // leverage tiers seeded per bar\nconst MAX_LEVELS = 4096; // seeded levels ride a ring: the oldest is recycled\nconst leverage = new StaticArray\u003Cf64>(TIERS);\nconst levelPrice = new StaticArray\u003Cf64>(MAX_LEVELS); // each seeded level's price, weight and the bar it was seeded on\nconst levelSize = new StaticArray\u003Cf64>(MAX_LEVELS);\nconst levelBar = new StaticArray\u003Ci32>(MAX_LEVELS);\nconst rowHeat = new StaticArray\u003Cf64>(ROWS); // this bar's map, folded from the live levels\nlet head = 0; // the ring position\nlet used = 0; // levels in use\nlet barIndex = 0; // bars seen\nlet lookback = 240; // settings, read in onStart()\nlet rowPct = 0.001;\n\nfunction onStart(): void {\n  lookback = i32(p_lookback());\n  rowPct = p_row_pct() / 100.0;\n  leverage[0] = 10.0;\n  leverage[1] = 25.0;\n  leverage[2] = 50.0;\n  leverage[3] = 100.0;\n}\n\nfunction seed(price: f64, size: f64): void { // one liquidation level into the ring\n  levelPrice[head] = price;\n  levelSize[head] = size;\n  levelBar[head] = barIndex;\n  head = (head + 1) % MAX_LEVELS;\n  if (used \u003C MAX_LEVELS) used += 1;\n}\n\nfunction clearRows(): void { // no map on this bar: every cell empty\n  for (let r = 0; r \u003C ROWS; r += 1) out_heat(r, NaN);\n}\n\n// onBar() runs once per bar: consume the levels the bar traded through, seed this bar's, then fold the live levels\n// onto the 64-row grid around the close and write the grid, its bottom edge and its step.\nfunction onBar(): void {\n  const close = bar.close();\n  const high = bar.high();\n  const low = bar.low();\n  barIndex += 1;\n  if (isNaN(close) || close \u003C= 0.0) {\n    out_grid_low(NaN);\n    out_row_step(NaN);\n    clearRows();\n    return;\n  }\n  for (let k = 0; k \u003C used; k += 1) { // a level inside the bar's range was flushed: it leaves the map\n    if (levelSize[k] > 0.0 && levelPrice[k] >= low && levelPrice[k] \u003C= high) levelSize[k] = 0.0;\n  }\n  const volume = bar.volume();\n  const weight = isNaN(volume) || volume \u003C= 0.0 ? 1.0 : volume; // a market with no volume still seeds, one unit a bar\n  const share = weight / f64(TIERS); // each tier takes an equal share of the bar's volume\n  for (let i = 0; i \u003C TIERS; i += 1) { // longs opened here are liquidated below the close, shorts above it\n    seed(close * (1.0 - 1.0 / leverage[i]), share);\n    seed(close * (1.0 + 1.0 / leverage[i]), share);\n  }\n  const step = close * rowPct;\n  const gridLow = close - step * f64(ROWS / 2); // the middle row holds the close\n  for (let r = 0; r \u003C ROWS; r += 1) rowHeat[r] = 0.0;\n  for (let k = 0; k \u003C used; k += 1) {\n    if (levelSize[k] \u003C= 0.0) continue;\n    const age = barIndex - levelBar[k];\n    if (age > lookback) { // faded out\n      levelSize[k] = 0.0;\n      continue;\n    }\n    const r = i32(Math.floor((levelPrice[k] - gridLow) / step));\n    if (r \u003C 0 || r >= ROWS) continue; // outside the map this bar; it comes back when price moves toward it\n    rowHeat[r] += levelSize[k] * (1.0 - f64(age) / f64(lookback));\n  }\n  out_grid_low(gridLow);\n  out_row_step(step);\n  for (let r = 0; r \u003C ROWS; r += 1) out_heat(r, rowHeat[r] > 0.0 ? rowHeat[r] : NaN); // NaN = an empty cell\n}\n```\n\n## How it works\n\n**A grid the module writes.** `out.grid(\"heat\", { rows: 64 })` declares 64 data-only outputs `heat_0` to `heat_63`, one per row of the map, and the generated writer `out_heat(row, value)` fills them in `onBar()`; a row outside 0 to 63 aborts the run by name, and NaN leaves a cell empty. The two outputs beside it place the grid: `grid_low` is the bottom edge of row 0 on each bar and `row_step` every row's height in price, so the map moves with the close and keeps its shape when the chart's scale changes. `plot.heatmap({ grid: \"heat\", price_low: \"grid_low\", price_step: \"row_step\" })` ties the three together; a heatmap takes `cells` or `grid`, never both.\n\n**The levels.** Each bar seeds eight levels into a ring of 4,096: for every tier, a long opened at the close is liquidated at `close x (1 - 1 / leverage)` and a short at `close x (1 + 1 / leverage)`, each level weighted by a quarter of the bar's volume (one unit on a market without volume). Before seeding, the bar's range is swept: a level between the low and the high was flushed and is zeroed. Then every live level is folded onto the 64 rows around the close with a linear fade, `1 - age / lookback`; a level older than `lookback` is dropped, and one outside the map this bar is kept, since it comes back when price moves toward it.\n\n**The scale.** The palette runs from the chart's background through a faint violet (`#8b5cf640`, violet at a quarter strength, so it reads on a light chart too) and full violet to magenta: hues no candle colour uses, so the amber and orange (or green and red) bars stay readable where they cross the map. `scale: \"linear\"` with `min: 0` keeps most cells faint and lets only the dense rows glow, and `auto_quantile: 0.98` sets the top of the scale at the 98th percentile of every cell in the run. `behind_candles: true` keeps the bars on top. `row_pct` (0.1% of the close) sets the row height: finer rows separate the tiers, coarser rows merge them into bands.\n\n## Where it runs\n\nAny chart: the map is built from the chart's own candles, so it draws on every market and interval. It reads best on perpetual and futures charts, where the leverage it models is traded; on spot or a prediction market the rows still draw, but there is no leverage to be flushed at them.\n\n## When data is missing\n\nA bar whose close is NaN writes an empty map and places nothing. A market without volume seeds one unit a bar, so the map still draws, with every bar weighing the same. The map holds only what the chart has seen: the first `lookback` bars of a run build it up from nothing.\n\n## Customize it\n\n- **A longer memory.** Raise `lookback` to keep levels longer before they fade; lower it for a map of the last session only.\n- **Finer or coarser rows.** `row_pct` sets the row height as a percent of the close; `rows: 64` in `out.grid` sets how many rows the map spans (2 to 128).\n- **Other tiers.** Change the four leverages in `onStart()`; the ring holds eight levels per bar regardless.\n- **A fixed scale.** Set `min` and `max` on the heatmap to compare days on one scale, or `floor` to hide the faintest cells.\n\n## Run it\n\n1. In the editor's Explorer, press the **Templates** icon (\"Browse starter templates\") and pick **Liquidation Heat** under **Order flow**.\n2. Press **Run** on a perpetual chart: the map paints behind the candles, bright where recent leverage would be liquidated, and clears where price has already swept.\n3. Hover a cell for the weight seeded at that price; at the editor's Console prompt, type `row_step` to read the row height in price.\n\n## Concepts used\n\n- [Price canvases](../presentation/price-canvases.md) for `out.grid`, `plot.heatmap` over a grid, `price_low` and `price_step`\n- [Data sources](../core-concepts/data-sources.md) for the chart's own candles as the primary input\n- [Plotting](../presentation/plotting.md) for data-only outputs\n",{"type":14,"children":15,"data":4561,"position":4563},"root",[16,26,29,30,51,52,88,89,283,284,302,303,3311,3312,3328,3329,3557,3558,3666,3667,3818,3819,3835,3836,3850,3851,3867,3868,3902,3903,3918,3919,4204,4205,4221,4222,4382,4383,4398,4399],{"type":17,"value":18,"position":19},"comment"," source: docs/indicators/cookbook/liquidation-heat.md; generated by packages/cli/scripts/gen-indicator-docs.ts, do not edit ",{"start":20,"end":23},{"line":21,"column":21,"offset":22},1,0,{"line":21,"column":24,"offset":25},132,131,{"type":27,"value":28},"text","\n",{"type":27,"value":28},{"type":31,"tagName":32,"properties":33,"children":34,"position":48},"element","p",{},[35],{"type":31,"tagName":36,"properties":37,"children":40,"position":41},"img",{"src":38,"alt":39},"/wrun/images/liquidation-heat.png","Liquidation levels painted behind the candles as a heatmap that follows price",[],{"start":42,"end":45},{"line":43,"column":21,"offset":44},5,153,{"line":43,"column":46,"offset":47},116,268,{"start":49,"end":50},{"line":43,"column":21,"offset":44},{"line":43,"column":46,"offset":47},{"type":27,"value":28},{"type":31,"tagName":32,"properties":53,"children":54,"position":85},{},[55,64,78],{"type":27,"value":56,"position":57},"Where the leverage opened on recent bars would be liquidated, painted behind the candles as a heatmap. Every bar seeds liquidation prices below its close for longs and above it for shorts at four leverage tiers (10x, 25x, 50x and 100x), each weighted by a share of the bar's volume; a level the price trades through is consumed and leaves the map, the rest fade with age until ",{"start":58,"end":61},{"line":59,"column":21,"offset":60},7,270,{"line":59,"column":62,"offset":63},378,647,{"type":31,"tagName":65,"properties":66,"children":67,"position":75},"code",{},[68],{"type":27,"value":69,"position":70},"lookback",{"start":71,"end":72},{"line":59,"column":62,"offset":63},{"line":59,"column":73,"offset":74},388,657,{"start":76,"end":77},{"line":59,"column":62,"offset":63},{"line":59,"column":73,"offset":74},{"type":27,"value":79,"position":80}," bars have passed. The map is 64 rows centred on the close, so it follows price up and down: the brighter a row, the more leverage sits there waiting to be flushed, and a dense band just above or below the price is where a sweep would run.",{"start":81,"end":82},{"line":59,"column":73,"offset":74},{"line":59,"column":83,"offset":84},627,896,{"start":86,"end":87},{"line":59,"column":21,"offset":60},{"line":59,"column":83,"offset":84},{"type":27,"value":28},{"type":31,"tagName":32,"properties":90,"children":91,"position":280},{},[92,101,114,121,134,141,154,161,180,187,205,212,225,232,249,256,273],{"type":27,"value":93,"position":94},"The parts are an ",{"start":95,"end":98},{"line":96,"column":21,"offset":97},9,898,{"line":96,"column":99,"offset":100},18,915,{"type":31,"tagName":65,"properties":102,"children":103,"position":111},{},[104],{"type":27,"value":105,"position":106},"out.grid",{"start":107,"end":108},{"line":96,"column":99,"offset":100},{"line":96,"column":109,"offset":110},28,925,{"start":112,"end":113},{"line":96,"column":99,"offset":100},{"line":96,"column":109,"offset":110},{"type":27,"value":115,"position":116}," of 64 rows written cell by cell from ",{"start":117,"end":118},{"line":96,"column":109,"offset":110},{"line":96,"column":119,"offset":120},66,963,{"type":31,"tagName":65,"properties":122,"children":123,"position":131},{},[124],{"type":27,"value":125,"position":126},"onBar()",{"start":127,"end":128},{"line":96,"column":119,"offset":120},{"line":96,"column":129,"offset":130},75,972,{"start":132,"end":133},{"line":96,"column":119,"offset":120},{"line":96,"column":129,"offset":130},{"type":27,"value":135,"position":136},", two data-only outputs that place the grid on the price axis, and a ",{"start":137,"end":138},{"line":96,"column":129,"offset":130},{"line":96,"column":139,"offset":140},144,1041,{"type":31,"tagName":65,"properties":142,"children":143,"position":151},{},[144],{"type":27,"value":145,"position":146},"plot.heatmap",{"start":147,"end":148},{"line":96,"column":139,"offset":140},{"line":96,"column":149,"offset":150},158,1055,{"start":152,"end":153},{"line":96,"column":139,"offset":140},{"line":96,"column":149,"offset":150},{"type":27,"value":155,"position":156}," declaration over the grid (",{"start":157,"end":158},{"line":96,"column":149,"offset":150},{"line":96,"column":159,"offset":160},186,1083,{"type":31,"tagName":162,"properties":163,"children":165,"position":175},"a",{"href":164},"../presentation/price-canvases.md",[166],{"type":27,"value":167,"position":168},"Price canvases",{"start":169,"end":172},{"line":96,"column":170,"offset":171},187,1084,{"line":96,"column":173,"offset":174},201,1098,{"start":176,"end":177},{"line":96,"column":159,"offset":160},{"line":96,"column":178,"offset":179},237,1134,{"type":27,"value":181,"position":182},"). Every number is computed in the indicator from the chart's own candles (",{"start":183,"end":184},{"line":96,"column":178,"offset":179},{"line":96,"column":185,"offset":186},312,1209,{"type":31,"tagName":162,"properties":188,"children":190,"position":200},{"href":189},"../core-concepts/data-sources.md",[191],{"type":27,"value":192,"position":193},"Data sources",{"start":194,"end":197},{"line":96,"column":195,"offset":196},313,1210,{"line":96,"column":198,"offset":199},325,1222,{"start":201,"end":202},{"line":96,"column":185,"offset":186},{"line":96,"column":203,"offset":204},360,1257,{"type":27,"value":206,"position":207},"). This is also the ",{"start":208,"end":209},{"line":96,"column":203,"offset":204},{"line":96,"column":210,"offset":211},380,1277,{"type":31,"tagName":65,"properties":213,"children":214,"position":222},{},[215],{"type":27,"value":216,"position":217},"liquidation-heat",{"start":218,"end":219},{"line":96,"column":210,"offset":211},{"line":96,"column":220,"offset":221},398,1295,{"start":223,"end":224},{"line":96,"column":210,"offset":211},{"line":96,"column":220,"offset":221},{"type":27,"value":226,"position":227}," template: the ",{"start":228,"end":229},{"line":96,"column":220,"offset":221},{"line":96,"column":230,"offset":231},413,1310,{"type":31,"tagName":233,"properties":234,"children":235,"position":244},"strong",{},[236],{"type":27,"value":8,"position":237},{"start":238,"end":241},{"line":96,"column":239,"offset":240},415,1312,{"line":96,"column":242,"offset":243},431,1328,{"start":245,"end":246},{"line":96,"column":230,"offset":231},{"line":96,"column":247,"offset":248},433,1330,{"type":27,"value":250,"position":251}," card under ",{"start":252,"end":253},{"line":96,"column":247,"offset":248},{"line":96,"column":254,"offset":255},445,1342,{"type":31,"tagName":233,"properties":257,"children":258,"position":268},{},[259],{"type":27,"value":260,"position":261},"Order flow",{"start":262,"end":265},{"line":96,"column":263,"offset":264},447,1344,{"line":96,"column":266,"offset":267},457,1354,{"start":269,"end":270},{"line":96,"column":254,"offset":255},{"line":96,"column":271,"offset":272},459,1356,{"type":27,"value":274,"position":275}," in the editor's starter list, and it compiles as written.",{"start":276,"end":277},{"line":96,"column":271,"offset":272},{"line":96,"column":278,"offset":279},517,1414,{"start":281,"end":282},{"line":96,"column":21,"offset":97},{"line":96,"column":278,"offset":279},{"type":27,"value":28},{"type":31,"tagName":285,"properties":286,"children":287,"position":298},"h2",{},[288],{"type":27,"value":289,"position":290},"The wrun indicator",{"start":291,"end":295},{"line":292,"column":293,"offset":294},11,4,1419,{"line":292,"column":296,"offset":297},22,1437,{"start":299,"end":301},{"line":292,"column":21,"offset":300},1416,{"line":292,"column":296,"offset":297},{"type":27,"value":28},{"type":14,"children":304},[305],{"type":31,"tagName":306,"properties":307,"children":311,"data":-1},"pre",{"class":308,"style":309,"tabindex":310,"data-sample":216},"shiki shiki-themes github-dark github-light","--shiki-dark:#e1e4e8;--shiki-light:#24292e;--shiki-dark-bg:#24292e;--shiki-light-bg:#fff","0",[312],{"type":31,"tagName":65,"properties":313,"children":316},{"class":314},[315],"language-typescript",[317,328,329,337,338,346,347,355,356,364,365,368,369,451,452,531,532,559,560,597,598,627,628,669,670,834,835,838,839,873,874,904,905,935,936,987,988,1039,1040,1084,1085,1130,1131,1181,1182,1214,1215,1244,1245,1274,1275,1305,1306,1332,1333,1336,1337,1370,1371,1402,1403,1439,1440,1470,1471,1500,1501,1529,1530,1558,1559,1567,1568,1571,1572,1643,1644,1661,1662,1679,1680,1697,1698,1743,1744,1783,1784,1791,1792,1795,1796,1829,1830,1908,1909,1916,1917,1920,1921,1929,1930,1938,1939,1967,1968,2000,2001,2030,2031,2060,2061,2081,2082,2128,2129,2149,2150,2170,2171,2183,2184,2196,2197,2205,2206,2266,2267,2339,2340,2347,2348,2377,2378,2446,2447,2493,2494,2556,2557,2603,2604,2644,2645,2652,2653,2682,2683,2747,2748,2816,2817,2868,2869,2901,2902,2932,2933,2959,2960,2980,2981,2993,2994,3002,3003,3056,3057,3111,3112,3167,3168,3175,3176,3189,3190,3203,3204,3303,3304],{"type":31,"tagName":318,"properties":319,"children":321},"span",{"class":320},"line",[322],{"type":31,"tagName":318,"properties":323,"children":325},{"style":324},"--shiki-dark:#6A737D;--shiki-light:#6A737D",[326],{"type":27,"value":327},"// Liquidation Heat: where the leverage opened on recent bars would be liquidated, painted behind the candles as a",{"type":27,"value":28},{"type":31,"tagName":318,"properties":330,"children":331},{"class":320},[332],{"type":31,"tagName":318,"properties":333,"children":334},{"style":324},[335],{"type":27,"value":336},"// heatmap. Every bar seeds liquidation prices below its close for longs and above it for shorts at four leverage",{"type":27,"value":28},{"type":31,"tagName":318,"properties":339,"children":340},{"class":320},[341],{"type":31,"tagName":318,"properties":342,"children":343},{"style":324},[344],{"type":27,"value":345},"// tiers (10x, 25x, 50x, 100x), weighted by the bar's volume; a level the price trades through is consumed, the rest",{"type":27,"value":28},{"type":31,"tagName":318,"properties":348,"children":349},{"class":320},[350],{"type":31,"tagName":318,"properties":351,"children":352},{"style":324},[353],{"type":27,"value":354},"// fade with age. The map is 64 rows centred on the close, so it follows price: the brighter a row, the more leverage",{"type":27,"value":28},{"type":31,"tagName":318,"properties":357,"children":358},{"class":320},[359],{"type":31,"tagName":318,"properties":360,"children":361},{"style":324},[362],{"type":27,"value":363},"// sits there waiting to be flushed.",{"type":27,"value":28},{"type":31,"tagName":318,"properties":366,"children":367},{"class":320},[],{"type":27,"value":28},{"type":31,"tagName":318,"properties":370,"children":371},{"class":320},[372,378,384,389,395,400,406,411,416,421,426,431,436,441,446],{"type":31,"tagName":318,"properties":373,"children":375},{"style":374},"--shiki-dark:#E1E4E8;--shiki-light:#24292E",[376],{"type":27,"value":377},"param.",{"type":31,"tagName":318,"properties":379,"children":381},{"style":380},"--shiki-dark:#B392F0;--shiki-light:#6F42C1",[382],{"type":27,"value":383},"int",{"type":31,"tagName":318,"properties":385,"children":386},{"style":374},[387],{"type":27,"value":388},"(",{"type":31,"tagName":318,"properties":390,"children":392},{"style":391},"--shiki-dark:#9ECBFF;--shiki-light:#032F62",[393],{"type":27,"value":394},"\"lookback\"",{"type":31,"tagName":318,"properties":396,"children":397},{"style":374},[398],{"type":27,"value":399},", ",{"type":31,"tagName":318,"properties":401,"children":403},{"style":402},"--shiki-dark:#79B8FF;--shiki-light:#005CC5",[404],{"type":27,"value":405},"240",{"type":31,"tagName":318,"properties":407,"children":408},{"style":374},[409],{"type":27,"value":410},", { min: ",{"type":31,"tagName":318,"properties":412,"children":413},{"style":402},[414],{"type":27,"value":415},"20",{"type":31,"tagName":318,"properties":417,"children":418},{"style":374},[419],{"type":27,"value":420},", max: ",{"type":31,"tagName":318,"properties":422,"children":423},{"style":402},[424],{"type":27,"value":425},"2000",{"type":31,"tagName":318,"properties":427,"children":428},{"style":374},[429],{"type":27,"value":430},", label: ",{"type":31,"tagName":318,"properties":432,"children":433},{"style":391},[434],{"type":27,"value":435},"\"Lookback in bars\"",{"type":31,"tagName":318,"properties":437,"children":438},{"style":374},[439],{"type":27,"value":440},", description: ",{"type":31,"tagName":318,"properties":442,"children":443},{"style":391},[444],{"type":27,"value":445},"\"Bars a seeded level stays on the map before it has faded out\"",{"type":31,"tagName":318,"properties":447,"children":448},{"style":374},[449],{"type":27,"value":450}," });",{"type":27,"value":28},{"type":31,"tagName":318,"properties":453,"children":454},{"class":320},[455,459,464,468,473,477,482,486,491,495,500,505,509,513,518,522,527],{"type":31,"tagName":318,"properties":456,"children":457},{"style":374},[458],{"type":27,"value":377},{"type":31,"tagName":318,"properties":460,"children":461},{"style":380},[462],{"type":27,"value":463},"number",{"type":31,"tagName":318,"properties":465,"children":466},{"style":374},[467],{"type":27,"value":388},{"type":31,"tagName":318,"properties":469,"children":470},{"style":391},[471],{"type":27,"value":472},"\"row_pct\"",{"type":31,"tagName":318,"properties":474,"children":475},{"style":374},[476],{"type":27,"value":399},{"type":31,"tagName":318,"properties":478,"children":479},{"style":402},[480],{"type":27,"value":481},"0.1",{"type":31,"tagName":318,"properties":483,"children":484},{"style":374},[485],{"type":27,"value":410},{"type":31,"tagName":318,"properties":487,"children":488},{"style":402},[489],{"type":27,"value":490},"0.01",{"type":31,"tagName":318,"properties":492,"children":493},{"style":374},[494],{"type":27,"value":420},{"type":31,"tagName":318,"properties":496,"children":497},{"style":402},[498],{"type":27,"value":499},"2",{"type":31,"tagName":318,"properties":501,"children":502},{"style":374},[503],{"type":27,"value":504},", step: ",{"type":31,"tagName":318,"properties":506,"children":507},{"style":402},[508],{"type":27,"value":490},{"type":31,"tagName":318,"properties":510,"children":511},{"style":374},[512],{"type":27,"value":430},{"type":31,"tagName":318,"properties":514,"children":515},{"style":391},[516],{"type":27,"value":517},"\"Row height in percent\"",{"type":31,"tagName":318,"properties":519,"children":520},{"style":374},[521],{"type":27,"value":440},{"type":31,"tagName":318,"properties":523,"children":524},{"style":391},[525],{"type":27,"value":526},"\"Row height as a percent of the close\"",{"type":31,"tagName":318,"properties":528,"children":529},{"style":374},[530],{"type":27,"value":450},{"type":27,"value":28},{"type":31,"tagName":318,"properties":533,"children":534},{"class":320},[535,540,544,549,554],{"type":31,"tagName":318,"properties":536,"children":537},{"style":380},[538],{"type":27,"value":539},"input",{"type":31,"tagName":318,"properties":541,"children":542},{"style":374},[543],{"type":27,"value":388},{"type":31,"tagName":318,"properties":545,"children":546},{"style":391},[547],{"type":27,"value":548},"\"close\"",{"type":31,"tagName":318,"properties":550,"children":551},{"style":374},[552],{"type":27,"value":553},", ohlcv.close); ",{"type":31,"tagName":318,"properties":555,"children":556},{"style":324},[557],{"type":27,"value":558},"// the primary input: the chart's own candles define the grid and seed the levels",{"type":27,"value":28},{"type":31,"tagName":318,"properties":561,"children":562},{"class":320},[563,568,572,577,582,587,592],{"type":31,"tagName":318,"properties":564,"children":565},{"style":380},[566],{"type":27,"value":567},"output",{"type":31,"tagName":318,"properties":569,"children":570},{"style":374},[571],{"type":27,"value":388},{"type":31,"tagName":318,"properties":573,"children":574},{"style":391},[575],{"type":27,"value":576},"\"grid_low\"",{"type":31,"tagName":318,"properties":578,"children":579},{"style":374},[580],{"type":27,"value":581},", none, overlay, { description: ",{"type":31,"tagName":318,"properties":583,"children":584},{"style":391},[585],{"type":27,"value":586},"\"The bottom edge of the map's lowest row on this bar\"",{"type":31,"tagName":318,"properties":588,"children":589},{"style":374},[590],{"type":27,"value":591}," }); ",{"type":31,"tagName":318,"properties":593,"children":594},{"style":324},[595],{"type":27,"value":596},"// data-only: the heatmap reads it",{"type":27,"value":28},{"type":31,"tagName":318,"properties":599,"children":600},{"class":320},[601,605,609,614,618,623],{"type":31,"tagName":318,"properties":602,"children":603},{"style":380},[604],{"type":27,"value":567},{"type":31,"tagName":318,"properties":606,"children":607},{"style":374},[608],{"type":27,"value":388},{"type":31,"tagName":318,"properties":610,"children":611},{"style":391},[612],{"type":27,"value":613},"\"row_step\"",{"type":31,"tagName":318,"properties":615,"children":616},{"style":374},[617],{"type":27,"value":581},{"type":31,"tagName":318,"properties":619,"children":620},{"style":391},[621],{"type":27,"value":622},"\"The map's row height in price on this bar\"",{"type":31,"tagName":318,"properties":624,"children":625},{"style":374},[626],{"type":27,"value":450},{"type":27,"value":28},{"type":31,"tagName":318,"properties":629,"children":630},{"class":320},[631,636,641,645,650,655,660,664],{"type":31,"tagName":318,"properties":632,"children":633},{"style":374},[634],{"type":27,"value":635},"out.",{"type":31,"tagName":318,"properties":637,"children":638},{"style":380},[639],{"type":27,"value":640},"grid",{"type":31,"tagName":318,"properties":642,"children":643},{"style":374},[644],{"type":27,"value":388},{"type":31,"tagName":318,"properties":646,"children":647},{"style":391},[648],{"type":27,"value":649},"\"heat\"",{"type":31,"tagName":318,"properties":651,"children":652},{"style":374},[653],{"type":27,"value":654},", { rows: ",{"type":31,"tagName":318,"properties":656,"children":657},{"style":402},[658],{"type":27,"value":659},"64",{"type":31,"tagName":318,"properties":661,"children":662},{"style":374},[663],{"type":27,"value":591},{"type":31,"tagName":318,"properties":665,"children":666},{"style":324},[667],{"type":27,"value":668},"// 64 data-only outputs heat_0..heat_63, one per row of the map, written with out_heat(row, value)",{"type":27,"value":28},{"type":31,"tagName":318,"properties":671,"children":672},{"class":320},[673,678,683,688,693,698,702,707,711,716,720,725,730,734,739,743,748,752,757,762,767,772,776,781,786,791,796,801,806,810,815,820,825,829],{"type":31,"tagName":318,"properties":674,"children":675},{"style":374},[676],{"type":27,"value":677},"plot.",{"type":31,"tagName":318,"properties":679,"children":680},{"style":380},[681],{"type":27,"value":682},"heatmap",{"type":31,"tagName":318,"properties":684,"children":685},{"style":374},[686],{"type":27,"value":687},"({ name: ",{"type":31,"tagName":318,"properties":689,"children":690},{"style":391},[691],{"type":27,"value":692},"\"liq_heat\"",{"type":31,"tagName":318,"properties":694,"children":695},{"style":374},[696],{"type":27,"value":697},", grid: ",{"type":31,"tagName":318,"properties":699,"children":700},{"style":391},[701],{"type":27,"value":649},{"type":31,"tagName":318,"properties":703,"children":704},{"style":374},[705],{"type":27,"value":706},", price_low: ",{"type":31,"tagName":318,"properties":708,"children":709},{"style":391},[710],{"type":27,"value":576},{"type":31,"tagName":318,"properties":712,"children":713},{"style":374},[714],{"type":27,"value":715},", price_step: ",{"type":31,"tagName":318,"properties":717,"children":718},{"style":391},[719],{"type":27,"value":613},{"type":31,"tagName":318,"properties":721,"children":722},{"style":374},[723],{"type":27,"value":724},", palette: [",{"type":31,"tagName":318,"properties":726,"children":727},{"style":391},[728],{"type":27,"value":729},"\"theme.bg\"",{"type":31,"tagName":318,"properties":731,"children":732},{"style":374},[733],{"type":27,"value":399},{"type":31,"tagName":318,"properties":735,"children":736},{"style":391},[737],{"type":27,"value":738},"\"#8b5cf640\"",{"type":31,"tagName":318,"properties":740,"children":741},{"style":374},[742],{"type":27,"value":399},{"type":31,"tagName":318,"properties":744,"children":745},{"style":391},[746],{"type":27,"value":747},"\"#8b5cf6\"",{"type":31,"tagName":318,"properties":749,"children":750},{"style":374},[751],{"type":27,"value":399},{"type":31,"tagName":318,"properties":753,"children":754},{"style":391},[755],{"type":27,"value":756},"\"#c026d3\"",{"type":31,"tagName":318,"properties":758,"children":759},{"style":374},[760],{"type":27,"value":761},"], scale: ",{"type":31,"tagName":318,"properties":763,"children":764},{"style":391},[765],{"type":27,"value":766},"\"linear\"",{"type":31,"tagName":318,"properties":768,"children":769},{"style":374},[770],{"type":27,"value":771},", min: ",{"type":31,"tagName":318,"properties":773,"children":774},{"style":402},[775],{"type":27,"value":310},{"type":31,"tagName":318,"properties":777,"children":778},{"style":374},[779],{"type":27,"value":780},", auto_quantile: ",{"type":31,"tagName":318,"properties":782,"children":783},{"style":402},[784],{"type":27,"value":785},"0.98",{"type":31,"tagName":318,"properties":787,"children":788},{"style":374},[789],{"type":27,"value":790},", opacity: ",{"type":31,"tagName":318,"properties":792,"children":793},{"style":402},[794],{"type":27,"value":795},"0.8",{"type":31,"tagName":318,"properties":797,"children":798},{"style":374},[799],{"type":27,"value":800},", behind_candles: ",{"type":31,"tagName":318,"properties":802,"children":803},{"style":402},[804],{"type":27,"value":805},"true",{"type":31,"tagName":318,"properties":807,"children":808},{"style":374},[809],{"type":27,"value":430},{"type":31,"tagName":318,"properties":811,"children":812},{"style":391},[813],{"type":27,"value":814},"\"Liquidation heat\"",{"type":31,"tagName":318,"properties":816,"children":817},{"style":374},[818],{"type":27,"value":819},", tooltip: ",{"type":31,"tagName":318,"properties":821,"children":822},{"style":391},[823],{"type":27,"value":824},"\"{{value:si}} seeded at {{price}}\"",{"type":31,"tagName":318,"properties":826,"children":827},{"style":374},[828],{"type":27,"value":591},{"type":31,"tagName":318,"properties":830,"children":831},{"style":324},[832],{"type":27,"value":833},"// violet to magenta, hues no candle theme uses, faint for most cells: the candles stay readable on top",{"type":27,"value":28},{"type":31,"tagName":318,"properties":836,"children":837},{"class":320},[],{"type":27,"value":28},{"type":31,"tagName":318,"properties":840,"children":841},{"class":320},[842,848,853,858,863,868],{"type":31,"tagName":318,"properties":843,"children":845},{"style":844},"--shiki-dark:#F97583;--shiki-light:#D73A49",[846],{"type":27,"value":847},"const",{"type":31,"tagName":318,"properties":849,"children":850},{"style":402},[851],{"type":27,"value":852}," ROWS",{"type":31,"tagName":318,"properties":854,"children":855},{"style":844},[856],{"type":27,"value":857}," =",{"type":31,"tagName":318,"properties":859,"children":860},{"style":402},[861],{"type":27,"value":862}," 64",{"type":31,"tagName":318,"properties":864,"children":865},{"style":374},[866],{"type":27,"value":867},"; ",{"type":31,"tagName":318,"properties":869,"children":870},{"style":324},[871],{"type":27,"value":872},"// rows in the map, the grid's declared count",{"type":27,"value":28},{"type":31,"tagName":318,"properties":875,"children":876},{"class":320},[877,881,886,890,895,899],{"type":31,"tagName":318,"properties":878,"children":879},{"style":844},[880],{"type":27,"value":847},{"type":31,"tagName":318,"properties":882,"children":883},{"style":402},[884],{"type":27,"value":885}," TIERS",{"type":31,"tagName":318,"properties":887,"children":888},{"style":844},[889],{"type":27,"value":857},{"type":31,"tagName":318,"properties":891,"children":892},{"style":402},[893],{"type":27,"value":894}," 4",{"type":31,"tagName":318,"properties":896,"children":897},{"style":374},[898],{"type":27,"value":867},{"type":31,"tagName":318,"properties":900,"children":901},{"style":324},[902],{"type":27,"value":903},"// leverage tiers seeded per bar",{"type":27,"value":28},{"type":31,"tagName":318,"properties":906,"children":907},{"class":320},[908,912,917,921,926,930],{"type":31,"tagName":318,"properties":909,"children":910},{"style":844},[911],{"type":27,"value":847},{"type":31,"tagName":318,"properties":913,"children":914},{"style":402},[915],{"type":27,"value":916}," MAX_LEVELS",{"type":31,"tagName":318,"properties":918,"children":919},{"style":844},[920],{"type":27,"value":857},{"type":31,"tagName":318,"properties":922,"children":923},{"style":402},[924],{"type":27,"value":925}," 4096",{"type":31,"tagName":318,"properties":927,"children":928},{"style":374},[929],{"type":27,"value":867},{"type":31,"tagName":318,"properties":931,"children":932},{"style":324},[933],{"type":27,"value":934},"// seeded levels ride a ring: the oldest is recycled",{"type":27,"value":28},{"type":31,"tagName":318,"properties":937,"children":938},{"class":320},[939,943,948,952,957,962,967,972,977,982],{"type":31,"tagName":318,"properties":940,"children":941},{"style":844},[942],{"type":27,"value":847},{"type":31,"tagName":318,"properties":944,"children":945},{"style":402},[946],{"type":27,"value":947}," leverage",{"type":31,"tagName":318,"properties":949,"children":950},{"style":844},[951],{"type":27,"value":857},{"type":31,"tagName":318,"properties":953,"children":954},{"style":844},[955],{"type":27,"value":956}," new",{"type":31,"tagName":318,"properties":958,"children":959},{"style":380},[960],{"type":27,"value":961}," StaticArray",{"type":31,"tagName":318,"properties":963,"children":964},{"style":374},[965],{"type":27,"value":966},"\u003C",{"type":31,"tagName":318,"properties":968,"children":969},{"style":380},[970],{"type":27,"value":971},"f64",{"type":31,"tagName":318,"properties":973,"children":974},{"style":374},[975],{"type":27,"value":976},">(",{"type":31,"tagName":318,"properties":978,"children":979},{"style":402},[980],{"type":27,"value":981},"TIERS",{"type":31,"tagName":318,"properties":983,"children":984},{"style":374},[985],{"type":27,"value":986},");",{"type":27,"value":28},{"type":31,"tagName":318,"properties":989,"children":990},{"class":320},[991,995,1000,1004,1008,1012,1016,1020,1024,1029,1034],{"type":31,"tagName":318,"properties":992,"children":993},{"style":844},[994],{"type":27,"value":847},{"type":31,"tagName":318,"properties":996,"children":997},{"style":402},[998],{"type":27,"value":999}," levelPrice",{"type":31,"tagName":318,"properties":1001,"children":1002},{"style":844},[1003],{"type":27,"value":857},{"type":31,"tagName":318,"properties":1005,"children":1006},{"style":844},[1007],{"type":27,"value":956},{"type":31,"tagName":318,"properties":1009,"children":1010},{"style":380},[1011],{"type":27,"value":961},{"type":31,"tagName":318,"properties":1013,"children":1014},{"style":374},[1015],{"type":27,"value":966},{"type":31,"tagName":318,"properties":1017,"children":1018},{"style":380},[1019],{"type":27,"value":971},{"type":31,"tagName":318,"properties":1021,"children":1022},{"style":374},[1023],{"type":27,"value":976},{"type":31,"tagName":318,"properties":1025,"children":1026},{"style":402},[1027],{"type":27,"value":1028},"MAX_LEVELS",{"type":31,"tagName":318,"properties":1030,"children":1031},{"style":374},[1032],{"type":27,"value":1033},"); ",{"type":31,"tagName":318,"properties":1035,"children":1036},{"style":324},[1037],{"type":27,"value":1038},"// each seeded level's price, weight and the bar it was seeded on",{"type":27,"value":28},{"type":31,"tagName":318,"properties":1041,"children":1042},{"class":320},[1043,1047,1052,1056,1060,1064,1068,1072,1076,1080],{"type":31,"tagName":318,"properties":1044,"children":1045},{"style":844},[1046],{"type":27,"value":847},{"type":31,"tagName":318,"properties":1048,"children":1049},{"style":402},[1050],{"type":27,"value":1051}," levelSize",{"type":31,"tagName":318,"properties":1053,"children":1054},{"style":844},[1055],{"type":27,"value":857},{"type":31,"tagName":318,"properties":1057,"children":1058},{"style":844},[1059],{"type":27,"value":956},{"type":31,"tagName":318,"properties":1061,"children":1062},{"style":380},[1063],{"type":27,"value":961},{"type":31,"tagName":318,"properties":1065,"children":1066},{"style":374},[1067],{"type":27,"value":966},{"type":31,"tagName":318,"properties":1069,"children":1070},{"style":380},[1071],{"type":27,"value":971},{"type":31,"tagName":318,"properties":1073,"children":1074},{"style":374},[1075],{"type":27,"value":976},{"type":31,"tagName":318,"properties":1077,"children":1078},{"style":402},[1079],{"type":27,"value":1028},{"type":31,"tagName":318,"properties":1081,"children":1082},{"style":374},[1083],{"type":27,"value":986},{"type":27,"value":28},{"type":31,"tagName":318,"properties":1086,"children":1087},{"class":320},[1088,1092,1097,1101,1105,1109,1113,1118,1122,1126],{"type":31,"tagName":318,"properties":1089,"children":1090},{"style":844},[1091],{"type":27,"value":847},{"type":31,"tagName":318,"properties":1093,"children":1094},{"style":402},[1095],{"type":27,"value":1096}," levelBar",{"type":31,"tagName":318,"properties":1098,"children":1099},{"style":844},[1100],{"type":27,"value":857},{"type":31,"tagName":318,"properties":1102,"children":1103},{"style":844},[1104],{"type":27,"value":956},{"type":31,"tagName":318,"properties":1106,"children":1107},{"style":380},[1108],{"type":27,"value":961},{"type":31,"tagName":318,"properties":1110,"children":1111},{"style":374},[1112],{"type":27,"value":966},{"type":31,"tagName":318,"properties":1114,"children":1115},{"style":380},[1116],{"type":27,"value":1117},"i32",{"type":31,"tagName":318,"properties":1119,"children":1120},{"style":374},[1121],{"type":27,"value":976},{"type":31,"tagName":318,"properties":1123,"children":1124},{"style":402},[1125],{"type":27,"value":1028},{"type":31,"tagName":318,"properties":1127,"children":1128},{"style":374},[1129],{"type":27,"value":986},{"type":27,"value":28},{"type":31,"tagName":318,"properties":1132,"children":1133},{"class":320},[1134,1138,1143,1147,1151,1155,1159,1163,1167,1172,1176],{"type":31,"tagName":318,"properties":1135,"children":1136},{"style":844},[1137],{"type":27,"value":847},{"type":31,"tagName":318,"properties":1139,"children":1140},{"style":402},[1141],{"type":27,"value":1142}," rowHeat",{"type":31,"tagName":318,"properties":1144,"children":1145},{"style":844},[1146],{"type":27,"value":857},{"type":31,"tagName":318,"properties":1148,"children":1149},{"style":844},[1150],{"type":27,"value":956},{"type":31,"tagName":318,"properties":1152,"children":1153},{"style":380},[1154],{"type":27,"value":961},{"type":31,"tagName":318,"properties":1156,"children":1157},{"style":374},[1158],{"type":27,"value":966},{"type":31,"tagName":318,"properties":1160,"children":1161},{"style":380},[1162],{"type":27,"value":971},{"type":31,"tagName":318,"properties":1164,"children":1165},{"style":374},[1166],{"type":27,"value":976},{"type":31,"tagName":318,"properties":1168,"children":1169},{"style":402},[1170],{"type":27,"value":1171},"ROWS",{"type":31,"tagName":318,"properties":1173,"children":1174},{"style":374},[1175],{"type":27,"value":1033},{"type":31,"tagName":318,"properties":1177,"children":1178},{"style":324},[1179],{"type":27,"value":1180},"// this bar's map, folded from the live levels",{"type":27,"value":28},{"type":31,"tagName":318,"properties":1183,"children":1184},{"class":320},[1185,1190,1195,1200,1205,1209],{"type":31,"tagName":318,"properties":1186,"children":1187},{"style":844},[1188],{"type":27,"value":1189},"let",{"type":31,"tagName":318,"properties":1191,"children":1192},{"style":374},[1193],{"type":27,"value":1194}," head ",{"type":31,"tagName":318,"properties":1196,"children":1197},{"style":844},[1198],{"type":27,"value":1199},"=",{"type":31,"tagName":318,"properties":1201,"children":1202},{"style":402},[1203],{"type":27,"value":1204}," 0",{"type":31,"tagName":318,"properties":1206,"children":1207},{"style":374},[1208],{"type":27,"value":867},{"type":31,"tagName":318,"properties":1210,"children":1211},{"style":324},[1212],{"type":27,"value":1213},"// the ring position",{"type":27,"value":28},{"type":31,"tagName":318,"properties":1216,"children":1217},{"class":320},[1218,1222,1227,1231,1235,1239],{"type":31,"tagName":318,"properties":1219,"children":1220},{"style":844},[1221],{"type":27,"value":1189},{"type":31,"tagName":318,"properties":1223,"children":1224},{"style":374},[1225],{"type":27,"value":1226}," used ",{"type":31,"tagName":318,"properties":1228,"children":1229},{"style":844},[1230],{"type":27,"value":1199},{"type":31,"tagName":318,"properties":1232,"children":1233},{"style":402},[1234],{"type":27,"value":1204},{"type":31,"tagName":318,"properties":1236,"children":1237},{"style":374},[1238],{"type":27,"value":867},{"type":31,"tagName":318,"properties":1240,"children":1241},{"style":324},[1242],{"type":27,"value":1243},"// levels in use",{"type":27,"value":28},{"type":31,"tagName":318,"properties":1246,"children":1247},{"class":320},[1248,1252,1257,1261,1265,1269],{"type":31,"tagName":318,"properties":1249,"children":1250},{"style":844},[1251],{"type":27,"value":1189},{"type":31,"tagName":318,"properties":1253,"children":1254},{"style":374},[1255],{"type":27,"value":1256}," barIndex ",{"type":31,"tagName":318,"properties":1258,"children":1259},{"style":844},[1260],{"type":27,"value":1199},{"type":31,"tagName":318,"properties":1262,"children":1263},{"style":402},[1264],{"type":27,"value":1204},{"type":31,"tagName":318,"properties":1266,"children":1267},{"style":374},[1268],{"type":27,"value":867},{"type":31,"tagName":318,"properties":1270,"children":1271},{"style":324},[1272],{"type":27,"value":1273},"// bars seen",{"type":27,"value":28},{"type":31,"tagName":318,"properties":1276,"children":1277},{"class":320},[1278,1282,1287,1291,1296,1300],{"type":31,"tagName":318,"properties":1279,"children":1280},{"style":844},[1281],{"type":27,"value":1189},{"type":31,"tagName":318,"properties":1283,"children":1284},{"style":374},[1285],{"type":27,"value":1286}," lookback ",{"type":31,"tagName":318,"properties":1288,"children":1289},{"style":844},[1290],{"type":27,"value":1199},{"type":31,"tagName":318,"properties":1292,"children":1293},{"style":402},[1294],{"type":27,"value":1295}," 240",{"type":31,"tagName":318,"properties":1297,"children":1298},{"style":374},[1299],{"type":27,"value":867},{"type":31,"tagName":318,"properties":1301,"children":1302},{"style":324},[1303],{"type":27,"value":1304},"// settings, read in onStart()",{"type":27,"value":28},{"type":31,"tagName":318,"properties":1307,"children":1308},{"class":320},[1309,1313,1318,1322,1327],{"type":31,"tagName":318,"properties":1310,"children":1311},{"style":844},[1312],{"type":27,"value":1189},{"type":31,"tagName":318,"properties":1314,"children":1315},{"style":374},[1316],{"type":27,"value":1317}," rowPct ",{"type":31,"tagName":318,"properties":1319,"children":1320},{"style":844},[1321],{"type":27,"value":1199},{"type":31,"tagName":318,"properties":1323,"children":1324},{"style":402},[1325],{"type":27,"value":1326}," 0.001",{"type":31,"tagName":318,"properties":1328,"children":1329},{"style":374},[1330],{"type":27,"value":1331},";",{"type":27,"value":28},{"type":31,"tagName":318,"properties":1334,"children":1335},{"class":320},[],{"type":27,"value":28},{"type":31,"tagName":318,"properties":1338,"children":1339},{"class":320},[1340,1345,1350,1355,1360,1365],{"type":31,"tagName":318,"properties":1341,"children":1342},{"style":844},[1343],{"type":27,"value":1344},"function",{"type":31,"tagName":318,"properties":1346,"children":1347},{"style":380},[1348],{"type":27,"value":1349}," onStart",{"type":31,"tagName":318,"properties":1351,"children":1352},{"style":374},[1353],{"type":27,"value":1354},"()",{"type":31,"tagName":318,"properties":1356,"children":1357},{"style":844},[1358],{"type":27,"value":1359},":",{"type":31,"tagName":318,"properties":1361,"children":1362},{"style":402},[1363],{"type":27,"value":1364}," void",{"type":31,"tagName":318,"properties":1366,"children":1367},{"style":374},[1368],{"type":27,"value":1369}," {",{"type":27,"value":28},{"type":31,"tagName":318,"properties":1372,"children":1373},{"class":320},[1374,1379,1383,1388,1392,1397],{"type":31,"tagName":318,"properties":1375,"children":1376},{"style":374},[1377],{"type":27,"value":1378},"  lookback ",{"type":31,"tagName":318,"properties":1380,"children":1381},{"style":844},[1382],{"type":27,"value":1199},{"type":31,"tagName":318,"properties":1384,"children":1385},{"style":380},[1386],{"type":27,"value":1387}," i32",{"type":31,"tagName":318,"properties":1389,"children":1390},{"style":374},[1391],{"type":27,"value":388},{"type":31,"tagName":318,"properties":1393,"children":1394},{"style":380},[1395],{"type":27,"value":1396},"p_lookback",{"type":31,"tagName":318,"properties":1398,"children":1399},{"style":374},[1400],{"type":27,"value":1401},"());",{"type":27,"value":28},{"type":31,"tagName":318,"properties":1404,"children":1405},{"class":320},[1406,1411,1415,1420,1425,1430,1435],{"type":31,"tagName":318,"properties":1407,"children":1408},{"style":374},[1409],{"type":27,"value":1410},"  rowPct ",{"type":31,"tagName":318,"properties":1412,"children":1413},{"style":844},[1414],{"type":27,"value":1199},{"type":31,"tagName":318,"properties":1416,"children":1417},{"style":380},[1418],{"type":27,"value":1419}," p_row_pct",{"type":31,"tagName":318,"properties":1421,"children":1422},{"style":374},[1423],{"type":27,"value":1424},"() ",{"type":31,"tagName":318,"properties":1426,"children":1427},{"style":844},[1428],{"type":27,"value":1429},"/",{"type":31,"tagName":318,"properties":1431,"children":1432},{"style":402},[1433],{"type":27,"value":1434}," 100.0",{"type":31,"tagName":318,"properties":1436,"children":1437},{"style":374},[1438],{"type":27,"value":1331},{"type":27,"value":28},{"type":31,"tagName":318,"properties":1441,"children":1442},{"class":320},[1443,1448,1452,1457,1461,1466],{"type":31,"tagName":318,"properties":1444,"children":1445},{"style":374},[1446],{"type":27,"value":1447},"  leverage[",{"type":31,"tagName":318,"properties":1449,"children":1450},{"style":402},[1451],{"type":27,"value":310},{"type":31,"tagName":318,"properties":1453,"children":1454},{"style":374},[1455],{"type":27,"value":1456},"] ",{"type":31,"tagName":318,"properties":1458,"children":1459},{"style":844},[1460],{"type":27,"value":1199},{"type":31,"tagName":318,"properties":1462,"children":1463},{"style":402},[1464],{"type":27,"value":1465}," 10.0",{"type":31,"tagName":318,"properties":1467,"children":1468},{"style":374},[1469],{"type":27,"value":1331},{"type":27,"value":28},{"type":31,"tagName":318,"properties":1472,"children":1473},{"class":320},[1474,1478,1483,1487,1491,1496],{"type":31,"tagName":318,"properties":1475,"children":1476},{"style":374},[1477],{"type":27,"value":1447},{"type":31,"tagName":318,"properties":1479,"children":1480},{"style":402},[1481],{"type":27,"value":1482},"1",{"type":31,"tagName":318,"properties":1484,"children":1485},{"style":374},[1486],{"type":27,"value":1456},{"type":31,"tagName":318,"properties":1488,"children":1489},{"style":844},[1490],{"type":27,"value":1199},{"type":31,"tagName":318,"properties":1492,"children":1493},{"style":402},[1494],{"type":27,"value":1495}," 25.0",{"type":31,"tagName":318,"properties":1497,"children":1498},{"style":374},[1499],{"type":27,"value":1331},{"type":27,"value":28},{"type":31,"tagName":318,"properties":1502,"children":1503},{"class":320},[1504,1508,1512,1516,1520,1525],{"type":31,"tagName":318,"properties":1505,"children":1506},{"style":374},[1507],{"type":27,"value":1447},{"type":31,"tagName":318,"properties":1509,"children":1510},{"style":402},[1511],{"type":27,"value":499},{"type":31,"tagName":318,"properties":1513,"children":1514},{"style":374},[1515],{"type":27,"value":1456},{"type":31,"tagName":318,"properties":1517,"children":1518},{"style":844},[1519],{"type":27,"value":1199},{"type":31,"tagName":318,"properties":1521,"children":1522},{"style":402},[1523],{"type":27,"value":1524}," 50.0",{"type":31,"tagName":318,"properties":1526,"children":1527},{"style":374},[1528],{"type":27,"value":1331},{"type":27,"value":28},{"type":31,"tagName":318,"properties":1531,"children":1532},{"class":320},[1533,1537,1542,1546,1550,1554],{"type":31,"tagName":318,"properties":1534,"children":1535},{"style":374},[1536],{"type":27,"value":1447},{"type":31,"tagName":318,"properties":1538,"children":1539},{"style":402},[1540],{"type":27,"value":1541},"3",{"type":31,"tagName":318,"properties":1543,"children":1544},{"style":374},[1545],{"type":27,"value":1456},{"type":31,"tagName":318,"properties":1547,"children":1548},{"style":844},[1549],{"type":27,"value":1199},{"type":31,"tagName":318,"properties":1551,"children":1552},{"style":402},[1553],{"type":27,"value":1434},{"type":31,"tagName":318,"properties":1555,"children":1556},{"style":374},[1557],{"type":27,"value":1331},{"type":27,"value":28},{"type":31,"tagName":318,"properties":1560,"children":1561},{"class":320},[1562],{"type":31,"tagName":318,"properties":1563,"children":1564},{"style":374},[1565],{"type":27,"value":1566},"}",{"type":27,"value":28},{"type":31,"tagName":318,"properties":1569,"children":1570},{"class":320},[],{"type":27,"value":28},{"type":31,"tagName":318,"properties":1573,"children":1574},{"class":320},[1575,1579,1584,1588,1594,1598,1603,1607,1612,1616,1620,1625,1629,1633,1638],{"type":31,"tagName":318,"properties":1576,"children":1577},{"style":844},[1578],{"type":27,"value":1344},{"type":31,"tagName":318,"properties":1580,"children":1581},{"style":380},[1582],{"type":27,"value":1583}," seed",{"type":31,"tagName":318,"properties":1585,"children":1586},{"style":374},[1587],{"type":27,"value":388},{"type":31,"tagName":318,"properties":1589,"children":1591},{"style":1590},"--shiki-dark:#FFAB70;--shiki-light:#E36209",[1592],{"type":27,"value":1593},"price",{"type":31,"tagName":318,"properties":1595,"children":1596},{"style":844},[1597],{"type":27,"value":1359},{"type":31,"tagName":318,"properties":1599,"children":1600},{"style":380},[1601],{"type":27,"value":1602}," f64",{"type":31,"tagName":318,"properties":1604,"children":1605},{"style":374},[1606],{"type":27,"value":399},{"type":31,"tagName":318,"properties":1608,"children":1609},{"style":1590},[1610],{"type":27,"value":1611},"size",{"type":31,"tagName":318,"properties":1613,"children":1614},{"style":844},[1615],{"type":27,"value":1359},{"type":31,"tagName":318,"properties":1617,"children":1618},{"style":380},[1619],{"type":27,"value":1602},{"type":31,"tagName":318,"properties":1621,"children":1622},{"style":374},[1623],{"type":27,"value":1624},")",{"type":31,"tagName":318,"properties":1626,"children":1627},{"style":844},[1628],{"type":27,"value":1359},{"type":31,"tagName":318,"properties":1630,"children":1631},{"style":402},[1632],{"type":27,"value":1364},{"type":31,"tagName":318,"properties":1634,"children":1635},{"style":374},[1636],{"type":27,"value":1637}," { ",{"type":31,"tagName":318,"properties":1639,"children":1640},{"style":324},[1641],{"type":27,"value":1642},"// one liquidation level into the ring",{"type":27,"value":28},{"type":31,"tagName":318,"properties":1645,"children":1646},{"class":320},[1647,1652,1656],{"type":31,"tagName":318,"properties":1648,"children":1649},{"style":374},[1650],{"type":27,"value":1651},"  levelPrice[head] ",{"type":31,"tagName":318,"properties":1653,"children":1654},{"style":844},[1655],{"type":27,"value":1199},{"type":31,"tagName":318,"properties":1657,"children":1658},{"style":374},[1659],{"type":27,"value":1660}," price;",{"type":27,"value":28},{"type":31,"tagName":318,"properties":1663,"children":1664},{"class":320},[1665,1670,1674],{"type":31,"tagName":318,"properties":1666,"children":1667},{"style":374},[1668],{"type":27,"value":1669},"  levelSize[head] ",{"type":31,"tagName":318,"properties":1671,"children":1672},{"style":844},[1673],{"type":27,"value":1199},{"type":31,"tagName":318,"properties":1675,"children":1676},{"style":374},[1677],{"type":27,"value":1678}," size;",{"type":27,"value":28},{"type":31,"tagName":318,"properties":1681,"children":1682},{"class":320},[1683,1688,1692],{"type":31,"tagName":318,"properties":1684,"children":1685},{"style":374},[1686],{"type":27,"value":1687},"  levelBar[head] ",{"type":31,"tagName":318,"properties":1689,"children":1690},{"style":844},[1691],{"type":27,"value":1199},{"type":31,"tagName":318,"properties":1693,"children":1694},{"style":374},[1695],{"type":27,"value":1696}," barIndex;",{"type":27,"value":28},{"type":31,"tagName":318,"properties":1699,"children":1700},{"class":320},[1701,1706,1710,1715,1720,1725,1730,1735,1739],{"type":31,"tagName":318,"properties":1702,"children":1703},{"style":374},[1704],{"type":27,"value":1705},"  head ",{"type":31,"tagName":318,"properties":1707,"children":1708},{"style":844},[1709],{"type":27,"value":1199},{"type":31,"tagName":318,"properties":1711,"children":1712},{"style":374},[1713],{"type":27,"value":1714}," (head ",{"type":31,"tagName":318,"properties":1716,"children":1717},{"style":844},[1718],{"type":27,"value":1719},"+",{"type":31,"tagName":318,"properties":1721,"children":1722},{"style":402},[1723],{"type":27,"value":1724}," 1",{"type":31,"tagName":318,"properties":1726,"children":1727},{"style":374},[1728],{"type":27,"value":1729},") ",{"type":31,"tagName":318,"properties":1731,"children":1732},{"style":844},[1733],{"type":27,"value":1734},"%",{"type":31,"tagName":318,"properties":1736,"children":1737},{"style":402},[1738],{"type":27,"value":916},{"type":31,"tagName":318,"properties":1740,"children":1741},{"style":374},[1742],{"type":27,"value":1331},{"type":27,"value":28},{"type":31,"tagName":318,"properties":1745,"children":1746},{"class":320},[1747,1752,1757,1761,1765,1770,1775,1779],{"type":31,"tagName":318,"properties":1748,"children":1749},{"style":844},[1750],{"type":27,"value":1751},"  if",{"type":31,"tagName":318,"properties":1753,"children":1754},{"style":374},[1755],{"type":27,"value":1756}," (used ",{"type":31,"tagName":318,"properties":1758,"children":1759},{"style":844},[1760],{"type":27,"value":966},{"type":31,"tagName":318,"properties":1762,"children":1763},{"style":402},[1764],{"type":27,"value":916},{"type":31,"tagName":318,"properties":1766,"children":1767},{"style":374},[1768],{"type":27,"value":1769},") used ",{"type":31,"tagName":318,"properties":1771,"children":1772},{"style":844},[1773],{"type":27,"value":1774},"+=",{"type":31,"tagName":318,"properties":1776,"children":1777},{"style":402},[1778],{"type":27,"value":1724},{"type":31,"tagName":318,"properties":1780,"children":1781},{"style":374},[1782],{"type":27,"value":1331},{"type":27,"value":28},{"type":31,"tagName":318,"properties":1785,"children":1786},{"class":320},[1787],{"type":31,"tagName":318,"properties":1788,"children":1789},{"style":374},[1790],{"type":27,"value":1566},{"type":27,"value":28},{"type":31,"tagName":318,"properties":1793,"children":1794},{"class":320},[],{"type":27,"value":28},{"type":31,"tagName":318,"properties":1797,"children":1798},{"class":320},[1799,1803,1808,1812,1816,1820,1824],{"type":31,"tagName":318,"properties":1800,"children":1801},{"style":844},[1802],{"type":27,"value":1344},{"type":31,"tagName":318,"properties":1804,"children":1805},{"style":380},[1806],{"type":27,"value":1807}," clearRows",{"type":31,"tagName":318,"properties":1809,"children":1810},{"style":374},[1811],{"type":27,"value":1354},{"type":31,"tagName":318,"properties":1813,"children":1814},{"style":844},[1815],{"type":27,"value":1359},{"type":31,"tagName":318,"properties":1817,"children":1818},{"style":402},[1819],{"type":27,"value":1364},{"type":31,"tagName":318,"properties":1821,"children":1822},{"style":374},[1823],{"type":27,"value":1637},{"type":31,"tagName":318,"properties":1825,"children":1826},{"style":324},[1827],{"type":27,"value":1828},"// no map on this bar: every cell empty",{"type":27,"value":28},{"type":31,"tagName":318,"properties":1831,"children":1832},{"class":320},[1833,1838,1843,1847,1852,1856,1860,1865,1869,1873,1877,1881,1885,1889,1894,1899,1904],{"type":31,"tagName":318,"properties":1834,"children":1835},{"style":844},[1836],{"type":27,"value":1837},"  for",{"type":31,"tagName":318,"properties":1839,"children":1840},{"style":374},[1841],{"type":27,"value":1842}," (",{"type":31,"tagName":318,"properties":1844,"children":1845},{"style":844},[1846],{"type":27,"value":1189},{"type":31,"tagName":318,"properties":1848,"children":1849},{"style":374},[1850],{"type":27,"value":1851}," r ",{"type":31,"tagName":318,"properties":1853,"children":1854},{"style":844},[1855],{"type":27,"value":1199},{"type":31,"tagName":318,"properties":1857,"children":1858},{"style":402},[1859],{"type":27,"value":1204},{"type":31,"tagName":318,"properties":1861,"children":1862},{"style":374},[1863],{"type":27,"value":1864},"; r ",{"type":31,"tagName":318,"properties":1866,"children":1867},{"style":844},[1868],{"type":27,"value":966},{"type":31,"tagName":318,"properties":1870,"children":1871},{"style":402},[1872],{"type":27,"value":852},{"type":31,"tagName":318,"properties":1874,"children":1875},{"style":374},[1876],{"type":27,"value":1864},{"type":31,"tagName":318,"properties":1878,"children":1879},{"style":844},[1880],{"type":27,"value":1774},{"type":31,"tagName":318,"properties":1882,"children":1883},{"style":402},[1884],{"type":27,"value":1724},{"type":31,"tagName":318,"properties":1886,"children":1887},{"style":374},[1888],{"type":27,"value":1729},{"type":31,"tagName":318,"properties":1890,"children":1891},{"style":380},[1892],{"type":27,"value":1893},"out_heat",{"type":31,"tagName":318,"properties":1895,"children":1896},{"style":374},[1897],{"type":27,"value":1898},"(r, ",{"type":31,"tagName":318,"properties":1900,"children":1901},{"style":402},[1902],{"type":27,"value":1903},"NaN",{"type":31,"tagName":318,"properties":1905,"children":1906},{"style":374},[1907],{"type":27,"value":986},{"type":27,"value":28},{"type":31,"tagName":318,"properties":1910,"children":1911},{"class":320},[1912],{"type":31,"tagName":318,"properties":1913,"children":1914},{"style":374},[1915],{"type":27,"value":1566},{"type":27,"value":28},{"type":31,"tagName":318,"properties":1918,"children":1919},{"class":320},[],{"type":27,"value":28},{"type":31,"tagName":318,"properties":1922,"children":1923},{"class":320},[1924],{"type":31,"tagName":318,"properties":1925,"children":1926},{"style":324},[1927],{"type":27,"value":1928},"// onBar() runs once per bar: consume the levels the bar traded through, seed this bar's, then fold the live levels",{"type":27,"value":28},{"type":31,"tagName":318,"properties":1931,"children":1932},{"class":320},[1933],{"type":31,"tagName":318,"properties":1934,"children":1935},{"style":324},[1936],{"type":27,"value":1937},"// onto the 64-row grid around the close and write the grid, its bottom edge and its step.",{"type":27,"value":28},{"type":31,"tagName":318,"properties":1940,"children":1941},{"class":320},[1942,1946,1951,1955,1959,1963],{"type":31,"tagName":318,"properties":1943,"children":1944},{"style":844},[1945],{"type":27,"value":1344},{"type":31,"tagName":318,"properties":1947,"children":1948},{"style":380},[1949],{"type":27,"value":1950}," onBar",{"type":31,"tagName":318,"properties":1952,"children":1953},{"style":374},[1954],{"type":27,"value":1354},{"type":31,"tagName":318,"properties":1956,"children":1957},{"style":844},[1958],{"type":27,"value":1359},{"type":31,"tagName":318,"properties":1960,"children":1961},{"style":402},[1962],{"type":27,"value":1364},{"type":31,"tagName":318,"properties":1964,"children":1965},{"style":374},[1966],{"type":27,"value":1369},{"type":27,"value":28},{"type":31,"tagName":318,"properties":1969,"children":1970},{"class":320},[1971,1976,1981,1985,1990,1995],{"type":31,"tagName":318,"properties":1972,"children":1973},{"style":844},[1974],{"type":27,"value":1975},"  const",{"type":31,"tagName":318,"properties":1977,"children":1978},{"style":402},[1979],{"type":27,"value":1980}," close",{"type":31,"tagName":318,"properties":1982,"children":1983},{"style":844},[1984],{"type":27,"value":857},{"type":31,"tagName":318,"properties":1986,"children":1987},{"style":374},[1988],{"type":27,"value":1989}," bar.",{"type":31,"tagName":318,"properties":1991,"children":1992},{"style":380},[1993],{"type":27,"value":1994},"close",{"type":31,"tagName":318,"properties":1996,"children":1997},{"style":374},[1998],{"type":27,"value":1999},"();",{"type":27,"value":28},{"type":31,"tagName":318,"properties":2002,"children":2003},{"class":320},[2004,2008,2013,2017,2021,2026],{"type":31,"tagName":318,"properties":2005,"children":2006},{"style":844},[2007],{"type":27,"value":1975},{"type":31,"tagName":318,"properties":2009,"children":2010},{"style":402},[2011],{"type":27,"value":2012}," high",{"type":31,"tagName":318,"properties":2014,"children":2015},{"style":844},[2016],{"type":27,"value":857},{"type":31,"tagName":318,"properties":2018,"children":2019},{"style":374},[2020],{"type":27,"value":1989},{"type":31,"tagName":318,"properties":2022,"children":2023},{"style":380},[2024],{"type":27,"value":2025},"high",{"type":31,"tagName":318,"properties":2027,"children":2028},{"style":374},[2029],{"type":27,"value":1999},{"type":27,"value":28},{"type":31,"tagName":318,"properties":2032,"children":2033},{"class":320},[2034,2038,2043,2047,2051,2056],{"type":31,"tagName":318,"properties":2035,"children":2036},{"style":844},[2037],{"type":27,"value":1975},{"type":31,"tagName":318,"properties":2039,"children":2040},{"style":402},[2041],{"type":27,"value":2042}," low",{"type":31,"tagName":318,"properties":2044,"children":2045},{"style":844},[2046],{"type":27,"value":857},{"type":31,"tagName":318,"properties":2048,"children":2049},{"style":374},[2050],{"type":27,"value":1989},{"type":31,"tagName":318,"properties":2052,"children":2053},{"style":380},[2054],{"type":27,"value":2055},"low",{"type":31,"tagName":318,"properties":2057,"children":2058},{"style":374},[2059],{"type":27,"value":1999},{"type":27,"value":28},{"type":31,"tagName":318,"properties":2062,"children":2063},{"class":320},[2064,2069,2073,2077],{"type":31,"tagName":318,"properties":2065,"children":2066},{"style":374},[2067],{"type":27,"value":2068},"  barIndex ",{"type":31,"tagName":318,"properties":2070,"children":2071},{"style":844},[2072],{"type":27,"value":1774},{"type":31,"tagName":318,"properties":2074,"children":2075},{"style":402},[2076],{"type":27,"value":1724},{"type":31,"tagName":318,"properties":2078,"children":2079},{"style":374},[2080],{"type":27,"value":1331},{"type":27,"value":28},{"type":31,"tagName":318,"properties":2083,"children":2084},{"class":320},[2085,2089,2093,2098,2103,2108,2113,2118,2123],{"type":31,"tagName":318,"properties":2086,"children":2087},{"style":844},[2088],{"type":27,"value":1751},{"type":31,"tagName":318,"properties":2090,"children":2091},{"style":374},[2092],{"type":27,"value":1842},{"type":31,"tagName":318,"properties":2094,"children":2095},{"style":380},[2096],{"type":27,"value":2097},"isNaN",{"type":31,"tagName":318,"properties":2099,"children":2100},{"style":374},[2101],{"type":27,"value":2102},"(close) ",{"type":31,"tagName":318,"properties":2104,"children":2105},{"style":844},[2106],{"type":27,"value":2107},"||",{"type":31,"tagName":318,"properties":2109,"children":2110},{"style":374},[2111],{"type":27,"value":2112}," close ",{"type":31,"tagName":318,"properties":2114,"children":2115},{"style":844},[2116],{"type":27,"value":2117},"\u003C=",{"type":31,"tagName":318,"properties":2119,"children":2120},{"style":402},[2121],{"type":27,"value":2122}," 0.0",{"type":31,"tagName":318,"properties":2124,"children":2125},{"style":374},[2126],{"type":27,"value":2127},") {",{"type":27,"value":28},{"type":31,"tagName":318,"properties":2130,"children":2131},{"class":320},[2132,2137,2141,2145],{"type":31,"tagName":318,"properties":2133,"children":2134},{"style":380},[2135],{"type":27,"value":2136},"    out_grid_low",{"type":31,"tagName":318,"properties":2138,"children":2139},{"style":374},[2140],{"type":27,"value":388},{"type":31,"tagName":318,"properties":2142,"children":2143},{"style":402},[2144],{"type":27,"value":1903},{"type":31,"tagName":318,"properties":2146,"children":2147},{"style":374},[2148],{"type":27,"value":986},{"type":27,"value":28},{"type":31,"tagName":318,"properties":2151,"children":2152},{"class":320},[2153,2158,2162,2166],{"type":31,"tagName":318,"properties":2154,"children":2155},{"style":380},[2156],{"type":27,"value":2157},"    out_row_step",{"type":31,"tagName":318,"properties":2159,"children":2160},{"style":374},[2161],{"type":27,"value":388},{"type":31,"tagName":318,"properties":2163,"children":2164},{"style":402},[2165],{"type":27,"value":1903},{"type":31,"tagName":318,"properties":2167,"children":2168},{"style":374},[2169],{"type":27,"value":986},{"type":27,"value":28},{"type":31,"tagName":318,"properties":2172,"children":2173},{"class":320},[2174,2179],{"type":31,"tagName":318,"properties":2175,"children":2176},{"style":380},[2177],{"type":27,"value":2178},"    clearRows",{"type":31,"tagName":318,"properties":2180,"children":2181},{"style":374},[2182],{"type":27,"value":1999},{"type":27,"value":28},{"type":31,"tagName":318,"properties":2185,"children":2186},{"class":320},[2187,2192],{"type":31,"tagName":318,"properties":2188,"children":2189},{"style":844},[2190],{"type":27,"value":2191},"    return",{"type":31,"tagName":318,"properties":2193,"children":2194},{"style":374},[2195],{"type":27,"value":1331},{"type":27,"value":28},{"type":31,"tagName":318,"properties":2198,"children":2199},{"class":320},[2200],{"type":31,"tagName":318,"properties":2201,"children":2202},{"style":374},[2203],{"type":27,"value":2204},"  }",{"type":27,"value":28},{"type":31,"tagName":318,"properties":2207,"children":2208},{"class":320},[2209,2213,2217,2221,2226,2230,2234,2239,2243,2248,2252,2256,2261],{"type":31,"tagName":318,"properties":2210,"children":2211},{"style":844},[2212],{"type":27,"value":1837},{"type":31,"tagName":318,"properties":2214,"children":2215},{"style":374},[2216],{"type":27,"value":1842},{"type":31,"tagName":318,"properties":2218,"children":2219},{"style":844},[2220],{"type":27,"value":1189},{"type":31,"tagName":318,"properties":2222,"children":2223},{"style":374},[2224],{"type":27,"value":2225}," k ",{"type":31,"tagName":318,"properties":2227,"children":2228},{"style":844},[2229],{"type":27,"value":1199},{"type":31,"tagName":318,"properties":2231,"children":2232},{"style":402},[2233],{"type":27,"value":1204},{"type":31,"tagName":318,"properties":2235,"children":2236},{"style":374},[2237],{"type":27,"value":2238},"; k ",{"type":31,"tagName":318,"properties":2240,"children":2241},{"style":844},[2242],{"type":27,"value":966},{"type":31,"tagName":318,"properties":2244,"children":2245},{"style":374},[2246],{"type":27,"value":2247}," used; k ",{"type":31,"tagName":318,"properties":2249,"children":2250},{"style":844},[2251],{"type":27,"value":1774},{"type":31,"tagName":318,"properties":2253,"children":2254},{"style":402},[2255],{"type":27,"value":1724},{"type":31,"tagName":318,"properties":2257,"children":2258},{"style":374},[2259],{"type":27,"value":2260},") { ",{"type":31,"tagName":318,"properties":2262,"children":2263},{"style":324},[2264],{"type":27,"value":2265},"// a level inside the bar's range was flushed: it leaves the map",{"type":27,"value":28},{"type":31,"tagName":318,"properties":2268,"children":2269},{"class":320},[2270,2275,2280,2285,2289,2294,2299,2304,2309,2314,2318,2322,2327,2331,2335],{"type":31,"tagName":318,"properties":2271,"children":2272},{"style":844},[2273],{"type":27,"value":2274},"    if",{"type":31,"tagName":318,"properties":2276,"children":2277},{"style":374},[2278],{"type":27,"value":2279}," (levelSize[k] ",{"type":31,"tagName":318,"properties":2281,"children":2282},{"style":844},[2283],{"type":27,"value":2284},">",{"type":31,"tagName":318,"properties":2286,"children":2287},{"style":402},[2288],{"type":27,"value":2122},{"type":31,"tagName":318,"properties":2290,"children":2291},{"style":844},[2292],{"type":27,"value":2293}," &&",{"type":31,"tagName":318,"properties":2295,"children":2296},{"style":374},[2297],{"type":27,"value":2298}," levelPrice[k] ",{"type":31,"tagName":318,"properties":2300,"children":2301},{"style":844},[2302],{"type":27,"value":2303},">=",{"type":31,"tagName":318,"properties":2305,"children":2306},{"style":374},[2307],{"type":27,"value":2308}," low ",{"type":31,"tagName":318,"properties":2310,"children":2311},{"style":844},[2312],{"type":27,"value":2313},"&&",{"type":31,"tagName":318,"properties":2315,"children":2316},{"style":374},[2317],{"type":27,"value":2298},{"type":31,"tagName":318,"properties":2319,"children":2320},{"style":844},[2321],{"type":27,"value":2117},{"type":31,"tagName":318,"properties":2323,"children":2324},{"style":374},[2325],{"type":27,"value":2326}," high) levelSize[k] ",{"type":31,"tagName":318,"properties":2328,"children":2329},{"style":844},[2330],{"type":27,"value":1199},{"type":31,"tagName":318,"properties":2332,"children":2333},{"style":402},[2334],{"type":27,"value":2122},{"type":31,"tagName":318,"properties":2336,"children":2337},{"style":374},[2338],{"type":27,"value":1331},{"type":27,"value":28},{"type":31,"tagName":318,"properties":2341,"children":2342},{"class":320},[2343],{"type":31,"tagName":318,"properties":2344,"children":2345},{"style":374},[2346],{"type":27,"value":2204},{"type":27,"value":28},{"type":31,"tagName":318,"properties":2349,"children":2350},{"class":320},[2351,2355,2360,2364,2368,2373],{"type":31,"tagName":318,"properties":2352,"children":2353},{"style":844},[2354],{"type":27,"value":1975},{"type":31,"tagName":318,"properties":2356,"children":2357},{"style":402},[2358],{"type":27,"value":2359}," volume",{"type":31,"tagName":318,"properties":2361,"children":2362},{"style":844},[2363],{"type":27,"value":857},{"type":31,"tagName":318,"properties":2365,"children":2366},{"style":374},[2367],{"type":27,"value":1989},{"type":31,"tagName":318,"properties":2369,"children":2370},{"style":380},[2371],{"type":27,"value":2372},"volume",{"type":31,"tagName":318,"properties":2374,"children":2375},{"style":374},[2376],{"type":27,"value":1999},{"type":27,"value":28},{"type":31,"tagName":318,"properties":2379,"children":2380},{"class":320},[2381,2385,2390,2394,2399,2404,2408,2413,2417,2421,2426,2431,2436,2441],{"type":31,"tagName":318,"properties":2382,"children":2383},{"style":844},[2384],{"type":27,"value":1975},{"type":31,"tagName":318,"properties":2386,"children":2387},{"style":402},[2388],{"type":27,"value":2389}," weight",{"type":31,"tagName":318,"properties":2391,"children":2392},{"style":844},[2393],{"type":27,"value":857},{"type":31,"tagName":318,"properties":2395,"children":2396},{"style":380},[2397],{"type":27,"value":2398}," isNaN",{"type":31,"tagName":318,"properties":2400,"children":2401},{"style":374},[2402],{"type":27,"value":2403},"(volume) ",{"type":31,"tagName":318,"properties":2405,"children":2406},{"style":844},[2407],{"type":27,"value":2107},{"type":31,"tagName":318,"properties":2409,"children":2410},{"style":374},[2411],{"type":27,"value":2412}," volume ",{"type":31,"tagName":318,"properties":2414,"children":2415},{"style":844},[2416],{"type":27,"value":2117},{"type":31,"tagName":318,"properties":2418,"children":2419},{"style":402},[2420],{"type":27,"value":2122},{"type":31,"tagName":318,"properties":2422,"children":2423},{"style":844},[2424],{"type":27,"value":2425}," ?",{"type":31,"tagName":318,"properties":2427,"children":2428},{"style":402},[2429],{"type":27,"value":2430}," 1.0",{"type":31,"tagName":318,"properties":2432,"children":2433},{"style":844},[2434],{"type":27,"value":2435}," :",{"type":31,"tagName":318,"properties":2437,"children":2438},{"style":374},[2439],{"type":27,"value":2440}," volume; ",{"type":31,"tagName":318,"properties":2442,"children":2443},{"style":324},[2444],{"type":27,"value":2445},"// a market with no volume still seeds, one unit a bar",{"type":27,"value":28},{"type":31,"tagName":318,"properties":2448,"children":2449},{"class":320},[2450,2454,2459,2463,2468,2472,2476,2480,2484,2488],{"type":31,"tagName":318,"properties":2451,"children":2452},{"style":844},[2453],{"type":27,"value":1975},{"type":31,"tagName":318,"properties":2455,"children":2456},{"style":402},[2457],{"type":27,"value":2458}," share",{"type":31,"tagName":318,"properties":2460,"children":2461},{"style":844},[2462],{"type":27,"value":857},{"type":31,"tagName":318,"properties":2464,"children":2465},{"style":374},[2466],{"type":27,"value":2467}," weight ",{"type":31,"tagName":318,"properties":2469,"children":2470},{"style":844},[2471],{"type":27,"value":1429},{"type":31,"tagName":318,"properties":2473,"children":2474},{"style":380},[2475],{"type":27,"value":1602},{"type":31,"tagName":318,"properties":2477,"children":2478},{"style":374},[2479],{"type":27,"value":388},{"type":31,"tagName":318,"properties":2481,"children":2482},{"style":402},[2483],{"type":27,"value":981},{"type":31,"tagName":318,"properties":2485,"children":2486},{"style":374},[2487],{"type":27,"value":1033},{"type":31,"tagName":318,"properties":2489,"children":2490},{"style":324},[2491],{"type":27,"value":2492},"// each tier takes an equal share of the bar's volume",{"type":27,"value":28},{"type":31,"tagName":318,"properties":2495,"children":2496},{"class":320},[2497,2501,2505,2509,2514,2518,2522,2527,2531,2535,2539,2543,2547,2551],{"type":31,"tagName":318,"properties":2498,"children":2499},{"style":844},[2500],{"type":27,"value":1837},{"type":31,"tagName":318,"properties":2502,"children":2503},{"style":374},[2504],{"type":27,"value":1842},{"type":31,"tagName":318,"properties":2506,"children":2507},{"style":844},[2508],{"type":27,"value":1189},{"type":31,"tagName":318,"properties":2510,"children":2511},{"style":374},[2512],{"type":27,"value":2513}," i ",{"type":31,"tagName":318,"properties":2515,"children":2516},{"style":844},[2517],{"type":27,"value":1199},{"type":31,"tagName":318,"properties":2519,"children":2520},{"style":402},[2521],{"type":27,"value":1204},{"type":31,"tagName":318,"properties":2523,"children":2524},{"style":374},[2525],{"type":27,"value":2526},"; i ",{"type":31,"tagName":318,"properties":2528,"children":2529},{"style":844},[2530],{"type":27,"value":966},{"type":31,"tagName":318,"properties":2532,"children":2533},{"style":402},[2534],{"type":27,"value":885},{"type":31,"tagName":318,"properties":2536,"children":2537},{"style":374},[2538],{"type":27,"value":2526},{"type":31,"tagName":318,"properties":2540,"children":2541},{"style":844},[2542],{"type":27,"value":1774},{"type":31,"tagName":318,"properties":2544,"children":2545},{"style":402},[2546],{"type":27,"value":1724},{"type":31,"tagName":318,"properties":2548,"children":2549},{"style":374},[2550],{"type":27,"value":2260},{"type":31,"tagName":318,"properties":2552,"children":2553},{"style":324},[2554],{"type":27,"value":2555},"// longs opened here are liquidated below the close, shorts above it",{"type":27,"value":28},{"type":31,"tagName":318,"properties":2558,"children":2559},{"class":320},[2560,2565,2570,2575,2579,2584,2589,2593,2598],{"type":31,"tagName":318,"properties":2561,"children":2562},{"style":380},[2563],{"type":27,"value":2564},"    seed",{"type":31,"tagName":318,"properties":2566,"children":2567},{"style":374},[2568],{"type":27,"value":2569},"(close ",{"type":31,"tagName":318,"properties":2571,"children":2572},{"style":844},[2573],{"type":27,"value":2574},"*",{"type":31,"tagName":318,"properties":2576,"children":2577},{"style":374},[2578],{"type":27,"value":1842},{"type":31,"tagName":318,"properties":2580,"children":2581},{"style":402},[2582],{"type":27,"value":2583},"1.0",{"type":31,"tagName":318,"properties":2585,"children":2586},{"style":844},[2587],{"type":27,"value":2588}," -",{"type":31,"tagName":318,"properties":2590,"children":2591},{"style":402},[2592],{"type":27,"value":2430},{"type":31,"tagName":318,"properties":2594,"children":2595},{"style":844},[2596],{"type":27,"value":2597}," /",{"type":31,"tagName":318,"properties":2599,"children":2600},{"style":374},[2601],{"type":27,"value":2602}," leverage[i]), share);",{"type":27,"value":28},{"type":31,"tagName":318,"properties":2605,"children":2606},{"class":320},[2607,2611,2615,2619,2623,2627,2632,2636,2640],{"type":31,"tagName":318,"properties":2608,"children":2609},{"style":380},[2610],{"type":27,"value":2564},{"type":31,"tagName":318,"properties":2612,"children":2613},{"style":374},[2614],{"type":27,"value":2569},{"type":31,"tagName":318,"properties":2616,"children":2617},{"style":844},[2618],{"type":27,"value":2574},{"type":31,"tagName":318,"properties":2620,"children":2621},{"style":374},[2622],{"type":27,"value":1842},{"type":31,"tagName":318,"properties":2624,"children":2625},{"style":402},[2626],{"type":27,"value":2583},{"type":31,"tagName":318,"properties":2628,"children":2629},{"style":844},[2630],{"type":27,"value":2631}," +",{"type":31,"tagName":318,"properties":2633,"children":2634},{"style":402},[2635],{"type":27,"value":2430},{"type":31,"tagName":318,"properties":2637,"children":2638},{"style":844},[2639],{"type":27,"value":2597},{"type":31,"tagName":318,"properties":2641,"children":2642},{"style":374},[2643],{"type":27,"value":2602},{"type":27,"value":28},{"type":31,"tagName":318,"properties":2646,"children":2647},{"class":320},[2648],{"type":31,"tagName":318,"properties":2649,"children":2650},{"style":374},[2651],{"type":27,"value":2204},{"type":27,"value":28},{"type":31,"tagName":318,"properties":2654,"children":2655},{"class":320},[2656,2660,2665,2669,2673,2677],{"type":31,"tagName":318,"properties":2657,"children":2658},{"style":844},[2659],{"type":27,"value":1975},{"type":31,"tagName":318,"properties":2661,"children":2662},{"style":402},[2663],{"type":27,"value":2664}," step",{"type":31,"tagName":318,"properties":2666,"children":2667},{"style":844},[2668],{"type":27,"value":857},{"type":31,"tagName":318,"properties":2670,"children":2671},{"style":374},[2672],{"type":27,"value":2112},{"type":31,"tagName":318,"properties":2674,"children":2675},{"style":844},[2676],{"type":27,"value":2574},{"type":31,"tagName":318,"properties":2678,"children":2679},{"style":374},[2680],{"type":27,"value":2681}," rowPct;",{"type":27,"value":28},{"type":31,"tagName":318,"properties":2684,"children":2685},{"class":320},[2686,2690,2695,2699,2703,2708,2713,2717,2721,2725,2729,2733,2738,2742],{"type":31,"tagName":318,"properties":2687,"children":2688},{"style":844},[2689],{"type":27,"value":1975},{"type":31,"tagName":318,"properties":2691,"children":2692},{"style":402},[2693],{"type":27,"value":2694}," gridLow",{"type":31,"tagName":318,"properties":2696,"children":2697},{"style":844},[2698],{"type":27,"value":857},{"type":31,"tagName":318,"properties":2700,"children":2701},{"style":374},[2702],{"type":27,"value":2112},{"type":31,"tagName":318,"properties":2704,"children":2705},{"style":844},[2706],{"type":27,"value":2707},"-",{"type":31,"tagName":318,"properties":2709,"children":2710},{"style":374},[2711],{"type":27,"value":2712}," step ",{"type":31,"tagName":318,"properties":2714,"children":2715},{"style":844},[2716],{"type":27,"value":2574},{"type":31,"tagName":318,"properties":2718,"children":2719},{"style":380},[2720],{"type":27,"value":1602},{"type":31,"tagName":318,"properties":2722,"children":2723},{"style":374},[2724],{"type":27,"value":388},{"type":31,"tagName":318,"properties":2726,"children":2727},{"style":402},[2728],{"type":27,"value":1171},{"type":31,"tagName":318,"properties":2730,"children":2731},{"style":844},[2732],{"type":27,"value":2597},{"type":31,"tagName":318,"properties":2734,"children":2735},{"style":402},[2736],{"type":27,"value":2737}," 2",{"type":31,"tagName":318,"properties":2739,"children":2740},{"style":374},[2741],{"type":27,"value":1033},{"type":31,"tagName":318,"properties":2743,"children":2744},{"style":324},[2745],{"type":27,"value":2746},"// the middle row holds the close",{"type":27,"value":28},{"type":31,"tagName":318,"properties":2749,"children":2750},{"class":320},[2751,2755,2759,2763,2767,2771,2775,2779,2783,2787,2791,2795,2799,2804,2808,2812],{"type":31,"tagName":318,"properties":2752,"children":2753},{"style":844},[2754],{"type":27,"value":1837},{"type":31,"tagName":318,"properties":2756,"children":2757},{"style":374},[2758],{"type":27,"value":1842},{"type":31,"tagName":318,"properties":2760,"children":2761},{"style":844},[2762],{"type":27,"value":1189},{"type":31,"tagName":318,"properties":2764,"children":2765},{"style":374},[2766],{"type":27,"value":1851},{"type":31,"tagName":318,"properties":2768,"children":2769},{"style":844},[2770],{"type":27,"value":1199},{"type":31,"tagName":318,"properties":2772,"children":2773},{"style":402},[2774],{"type":27,"value":1204},{"type":31,"tagName":318,"properties":2776,"children":2777},{"style":374},[2778],{"type":27,"value":1864},{"type":31,"tagName":318,"properties":2780,"children":2781},{"style":844},[2782],{"type":27,"value":966},{"type":31,"tagName":318,"properties":2784,"children":2785},{"style":402},[2786],{"type":27,"value":852},{"type":31,"tagName":318,"properties":2788,"children":2789},{"style":374},[2790],{"type":27,"value":1864},{"type":31,"tagName":318,"properties":2792,"children":2793},{"style":844},[2794],{"type":27,"value":1774},{"type":31,"tagName":318,"properties":2796,"children":2797},{"style":402},[2798],{"type":27,"value":1724},{"type":31,"tagName":318,"properties":2800,"children":2801},{"style":374},[2802],{"type":27,"value":2803},") rowHeat[r] ",{"type":31,"tagName":318,"properties":2805,"children":2806},{"style":844},[2807],{"type":27,"value":1199},{"type":31,"tagName":318,"properties":2809,"children":2810},{"style":402},[2811],{"type":27,"value":2122},{"type":31,"tagName":318,"properties":2813,"children":2814},{"style":374},[2815],{"type":27,"value":1331},{"type":27,"value":28},{"type":31,"tagName":318,"properties":2818,"children":2819},{"class":320},[2820,2824,2828,2832,2836,2840,2844,2848,2852,2856,2860,2864],{"type":31,"tagName":318,"properties":2821,"children":2822},{"style":844},[2823],{"type":27,"value":1837},{"type":31,"tagName":318,"properties":2825,"children":2826},{"style":374},[2827],{"type":27,"value":1842},{"type":31,"tagName":318,"properties":2829,"children":2830},{"style":844},[2831],{"type":27,"value":1189},{"type":31,"tagName":318,"properties":2833,"children":2834},{"style":374},[2835],{"type":27,"value":2225},{"type":31,"tagName":318,"properties":2837,"children":2838},{"style":844},[2839],{"type":27,"value":1199},{"type":31,"tagName":318,"properties":2841,"children":2842},{"style":402},[2843],{"type":27,"value":1204},{"type":31,"tagName":318,"properties":2845,"children":2846},{"style":374},[2847],{"type":27,"value":2238},{"type":31,"tagName":318,"properties":2849,"children":2850},{"style":844},[2851],{"type":27,"value":966},{"type":31,"tagName":318,"properties":2853,"children":2854},{"style":374},[2855],{"type":27,"value":2247},{"type":31,"tagName":318,"properties":2857,"children":2858},{"style":844},[2859],{"type":27,"value":1774},{"type":31,"tagName":318,"properties":2861,"children":2862},{"style":402},[2863],{"type":27,"value":1724},{"type":31,"tagName":318,"properties":2865,"children":2866},{"style":374},[2867],{"type":27,"value":2127},{"type":27,"value":28},{"type":31,"tagName":318,"properties":2870,"children":2871},{"class":320},[2872,2876,2880,2884,2888,2892,2897],{"type":31,"tagName":318,"properties":2873,"children":2874},{"style":844},[2875],{"type":27,"value":2274},{"type":31,"tagName":318,"properties":2877,"children":2878},{"style":374},[2879],{"type":27,"value":2279},{"type":31,"tagName":318,"properties":2881,"children":2882},{"style":844},[2883],{"type":27,"value":2117},{"type":31,"tagName":318,"properties":2885,"children":2886},{"style":402},[2887],{"type":27,"value":2122},{"type":31,"tagName":318,"properties":2889,"children":2890},{"style":374},[2891],{"type":27,"value":1729},{"type":31,"tagName":318,"properties":2893,"children":2894},{"style":844},[2895],{"type":27,"value":2896},"continue",{"type":31,"tagName":318,"properties":2898,"children":2899},{"style":374},[2900],{"type":27,"value":1331},{"type":27,"value":28},{"type":31,"tagName":318,"properties":2903,"children":2904},{"class":320},[2905,2910,2915,2919,2923,2927],{"type":31,"tagName":318,"properties":2906,"children":2907},{"style":844},[2908],{"type":27,"value":2909},"    const",{"type":31,"tagName":318,"properties":2911,"children":2912},{"style":402},[2913],{"type":27,"value":2914}," age",{"type":31,"tagName":318,"properties":2916,"children":2917},{"style":844},[2918],{"type":27,"value":857},{"type":31,"tagName":318,"properties":2920,"children":2921},{"style":374},[2922],{"type":27,"value":1256},{"type":31,"tagName":318,"properties":2924,"children":2925},{"style":844},[2926],{"type":27,"value":2707},{"type":31,"tagName":318,"properties":2928,"children":2929},{"style":374},[2930],{"type":27,"value":2931}," levelBar[k];",{"type":27,"value":28},{"type":31,"tagName":318,"properties":2934,"children":2935},{"class":320},[2936,2940,2945,2949,2954],{"type":31,"tagName":318,"properties":2937,"children":2938},{"style":844},[2939],{"type":27,"value":2274},{"type":31,"tagName":318,"properties":2941,"children":2942},{"style":374},[2943],{"type":27,"value":2944}," (age ",{"type":31,"tagName":318,"properties":2946,"children":2947},{"style":844},[2948],{"type":27,"value":2284},{"type":31,"tagName":318,"properties":2950,"children":2951},{"style":374},[2952],{"type":27,"value":2953}," lookback) { ",{"type":31,"tagName":318,"properties":2955,"children":2956},{"style":324},[2957],{"type":27,"value":2958},"// faded out",{"type":27,"value":28},{"type":31,"tagName":318,"properties":2961,"children":2962},{"class":320},[2963,2968,2972,2976],{"type":31,"tagName":318,"properties":2964,"children":2965},{"style":374},[2966],{"type":27,"value":2967},"      levelSize[k] ",{"type":31,"tagName":318,"properties":2969,"children":2970},{"style":844},[2971],{"type":27,"value":1199},{"type":31,"tagName":318,"properties":2973,"children":2974},{"style":402},[2975],{"type":27,"value":2122},{"type":31,"tagName":318,"properties":2977,"children":2978},{"style":374},[2979],{"type":27,"value":1331},{"type":27,"value":28},{"type":31,"tagName":318,"properties":2982,"children":2983},{"class":320},[2984,2989],{"type":31,"tagName":318,"properties":2985,"children":2986},{"style":844},[2987],{"type":27,"value":2988},"      continue",{"type":31,"tagName":318,"properties":2990,"children":2991},{"style":374},[2992],{"type":27,"value":1331},{"type":27,"value":28},{"type":31,"tagName":318,"properties":2995,"children":2996},{"class":320},[2997],{"type":31,"tagName":318,"properties":2998,"children":2999},{"style":374},[3000],{"type":27,"value":3001},"    }",{"type":27,"value":28},{"type":31,"tagName":318,"properties":3004,"children":3005},{"class":320},[3006,3010,3015,3019,3023,3028,3033,3038,3042,3047,3051],{"type":31,"tagName":318,"properties":3007,"children":3008},{"style":844},[3009],{"type":27,"value":2909},{"type":31,"tagName":318,"properties":3011,"children":3012},{"style":402},[3013],{"type":27,"value":3014}," r",{"type":31,"tagName":318,"properties":3016,"children":3017},{"style":844},[3018],{"type":27,"value":857},{"type":31,"tagName":318,"properties":3020,"children":3021},{"style":380},[3022],{"type":27,"value":1387},{"type":31,"tagName":318,"properties":3024,"children":3025},{"style":374},[3026],{"type":27,"value":3027},"(Math.",{"type":31,"tagName":318,"properties":3029,"children":3030},{"style":380},[3031],{"type":27,"value":3032},"floor",{"type":31,"tagName":318,"properties":3034,"children":3035},{"style":374},[3036],{"type":27,"value":3037},"((levelPrice[k] ",{"type":31,"tagName":318,"properties":3039,"children":3040},{"style":844},[3041],{"type":27,"value":2707},{"type":31,"tagName":318,"properties":3043,"children":3044},{"style":374},[3045],{"type":27,"value":3046}," gridLow) ",{"type":31,"tagName":318,"properties":3048,"children":3049},{"style":844},[3050],{"type":27,"value":1429},{"type":31,"tagName":318,"properties":3052,"children":3053},{"style":374},[3054],{"type":27,"value":3055}," step));",{"type":27,"value":28},{"type":31,"tagName":318,"properties":3058,"children":3059},{"class":320},[3060,3064,3069,3073,3077,3082,3086,3090,3094,3098,3102,3106],{"type":31,"tagName":318,"properties":3061,"children":3062},{"style":844},[3063],{"type":27,"value":2274},{"type":31,"tagName":318,"properties":3065,"children":3066},{"style":374},[3067],{"type":27,"value":3068}," (r ",{"type":31,"tagName":318,"properties":3070,"children":3071},{"style":844},[3072],{"type":27,"value":966},{"type":31,"tagName":318,"properties":3074,"children":3075},{"style":402},[3076],{"type":27,"value":1204},{"type":31,"tagName":318,"properties":3078,"children":3079},{"style":844},[3080],{"type":27,"value":3081}," ||",{"type":31,"tagName":318,"properties":3083,"children":3084},{"style":374},[3085],{"type":27,"value":1851},{"type":31,"tagName":318,"properties":3087,"children":3088},{"style":844},[3089],{"type":27,"value":2303},{"type":31,"tagName":318,"properties":3091,"children":3092},{"style":402},[3093],{"type":27,"value":852},{"type":31,"tagName":318,"properties":3095,"children":3096},{"style":374},[3097],{"type":27,"value":1729},{"type":31,"tagName":318,"properties":3099,"children":3100},{"style":844},[3101],{"type":27,"value":2896},{"type":31,"tagName":318,"properties":3103,"children":3104},{"style":374},[3105],{"type":27,"value":867},{"type":31,"tagName":318,"properties":3107,"children":3108},{"style":324},[3109],{"type":27,"value":3110},"// outside the map this bar; it comes back when price moves toward it",{"type":27,"value":28},{"type":31,"tagName":318,"properties":3113,"children":3114},{"class":320},[3115,3120,3124,3129,3133,3137,3141,3145,3149,3154,3158,3162],{"type":31,"tagName":318,"properties":3116,"children":3117},{"style":374},[3118],{"type":27,"value":3119},"    rowHeat[r] ",{"type":31,"tagName":318,"properties":3121,"children":3122},{"style":844},[3123],{"type":27,"value":1774},{"type":31,"tagName":318,"properties":3125,"children":3126},{"style":374},[3127],{"type":27,"value":3128}," levelSize[k] ",{"type":31,"tagName":318,"properties":3130,"children":3131},{"style":844},[3132],{"type":27,"value":2574},{"type":31,"tagName":318,"properties":3134,"children":3135},{"style":374},[3136],{"type":27,"value":1842},{"type":31,"tagName":318,"properties":3138,"children":3139},{"style":402},[3140],{"type":27,"value":2583},{"type":31,"tagName":318,"properties":3142,"children":3143},{"style":844},[3144],{"type":27,"value":2588},{"type":31,"tagName":318,"properties":3146,"children":3147},{"style":380},[3148],{"type":27,"value":1602},{"type":31,"tagName":318,"properties":3150,"children":3151},{"style":374},[3152],{"type":27,"value":3153},"(age) ",{"type":31,"tagName":318,"properties":3155,"children":3156},{"style":844},[3157],{"type":27,"value":1429},{"type":31,"tagName":318,"properties":3159,"children":3160},{"style":380},[3161],{"type":27,"value":1602},{"type":31,"tagName":318,"properties":3163,"children":3164},{"style":374},[3165],{"type":27,"value":3166},"(lookback));",{"type":27,"value":28},{"type":31,"tagName":318,"properties":3169,"children":3170},{"class":320},[3171],{"type":31,"tagName":318,"properties":3172,"children":3173},{"style":374},[3174],{"type":27,"value":2204},{"type":27,"value":28},{"type":31,"tagName":318,"properties":3177,"children":3178},{"class":320},[3179,3184],{"type":31,"tagName":318,"properties":3180,"children":3181},{"style":380},[3182],{"type":27,"value":3183},"  out_grid_low",{"type":31,"tagName":318,"properties":3185,"children":3186},{"style":374},[3187],{"type":27,"value":3188},"(gridLow);",{"type":27,"value":28},{"type":31,"tagName":318,"properties":3191,"children":3192},{"class":320},[3193,3198],{"type":31,"tagName":318,"properties":3194,"children":3195},{"style":380},[3196],{"type":27,"value":3197},"  out_row_step",{"type":31,"tagName":318,"properties":3199,"children":3200},{"style":374},[3201],{"type":27,"value":3202},"(step);",{"type":27,"value":28},{"type":31,"tagName":318,"properties":3205,"children":3206},{"class":320},[3207,3211,3215,3219,3223,3227,3231,3235,3239,3243,3247,3251,3255,3259,3263,3268,3272,3276,3280,3285,3289,3294,3298],{"type":31,"tagName":318,"properties":3208,"children":3209},{"style":844},[3210],{"type":27,"value":1837},{"type":31,"tagName":318,"properties":3212,"children":3213},{"style":374},[3214],{"type":27,"value":1842},{"type":31,"tagName":318,"properties":3216,"children":3217},{"style":844},[3218],{"type":27,"value":1189},{"type":31,"tagName":318,"properties":3220,"children":3221},{"style":374},[3222],{"type":27,"value":1851},{"type":31,"tagName":318,"properties":3224,"children":3225},{"style":844},[3226],{"type":27,"value":1199},{"type":31,"tagName":318,"properties":3228,"children":3229},{"style":402},[3230],{"type":27,"value":1204},{"type":31,"tagName":318,"properties":3232,"children":3233},{"style":374},[3234],{"type":27,"value":1864},{"type":31,"tagName":318,"properties":3236,"children":3237},{"style":844},[3238],{"type":27,"value":966},{"type":31,"tagName":318,"properties":3240,"children":3241},{"style":402},[3242],{"type":27,"value":852},{"type":31,"tagName":318,"properties":3244,"children":3245},{"style":374},[3246],{"type":27,"value":1864},{"type":31,"tagName":318,"properties":3248,"children":3249},{"style":844},[3250],{"type":27,"value":1774},{"type":31,"tagName":318,"properties":3252,"children":3253},{"style":402},[3254],{"type":27,"value":1724},{"type":31,"tagName":318,"properties":3256,"children":3257},{"style":374},[3258],{"type":27,"value":1729},{"type":31,"tagName":318,"properties":3260,"children":3261},{"style":380},[3262],{"type":27,"value":1893},{"type":31,"tagName":318,"properties":3264,"children":3265},{"style":374},[3266],{"type":27,"value":3267},"(r, rowHeat[r] ",{"type":31,"tagName":318,"properties":3269,"children":3270},{"style":844},[3271],{"type":27,"value":2284},{"type":31,"tagName":318,"properties":3273,"children":3274},{"style":402},[3275],{"type":27,"value":2122},{"type":31,"tagName":318,"properties":3277,"children":3278},{"style":844},[3279],{"type":27,"value":2425},{"type":31,"tagName":318,"properties":3281,"children":3282},{"style":374},[3283],{"type":27,"value":3284}," rowHeat[r] ",{"type":31,"tagName":318,"properties":3286,"children":3287},{"style":844},[3288],{"type":27,"value":1359},{"type":31,"tagName":318,"properties":3290,"children":3291},{"style":402},[3292],{"type":27,"value":3293}," NaN",{"type":31,"tagName":318,"properties":3295,"children":3296},{"style":374},[3297],{"type":27,"value":1033},{"type":31,"tagName":318,"properties":3299,"children":3300},{"style":324},[3301],{"type":27,"value":3302},"// NaN = an empty cell",{"type":27,"value":28},{"type":31,"tagName":318,"properties":3305,"children":3306},{"class":320},[3307],{"type":31,"tagName":318,"properties":3308,"children":3309},{"style":374},[3310],{"type":27,"value":1566},{"type":27,"value":28},{"type":31,"tagName":285,"properties":3313,"children":3314,"position":3324},{},[3315],{"type":27,"value":3316,"position":3317},"How it works",{"start":3318,"end":3321},{"line":3319,"column":293,"offset":3320},106,6337,{"line":3319,"column":3322,"offset":3323},16,6349,{"start":3325,"end":3327},{"line":3319,"column":21,"offset":3326},6334,{"line":3319,"column":3322,"offset":3323},{"type":27,"value":28},{"type":31,"tagName":32,"properties":3330,"children":3331,"position":3554},{},[3332,3350,3357,3370,3377,3390,3396,3409,3416,3429,3436,3448,3455,3468,3475,3488,3495,3508,3515,3528,3535,3547],{"type":31,"tagName":233,"properties":3333,"children":3334,"position":3344},{},[3335],{"type":27,"value":3336,"position":3337},"A grid the module writes.",{"start":3338,"end":3342},{"line":3339,"column":3340,"offset":3341},108,3,6353,{"line":3339,"column":109,"offset":3343},6378,{"start":3345,"end":3347},{"line":3339,"column":21,"offset":3346},6351,{"line":3339,"column":3348,"offset":3349},30,6380,{"type":27,"value":3351,"position":3352}," ",{"start":3353,"end":3354},{"line":3339,"column":3348,"offset":3349},{"line":3339,"column":3355,"offset":3356},31,6381,{"type":31,"tagName":65,"properties":3358,"children":3359,"position":3367},{},[3360],{"type":27,"value":3361,"position":3362},"out.grid(\"heat\", { rows: 64 })",{"start":3363,"end":3364},{"line":3339,"column":3355,"offset":3356},{"line":3339,"column":3365,"offset":3366},63,6413,{"start":3368,"end":3369},{"line":3339,"column":3355,"offset":3356},{"line":3339,"column":3365,"offset":3366},{"type":27,"value":3371,"position":3372}," declares 64 data-only outputs ",{"start":3373,"end":3374},{"line":3339,"column":3365,"offset":3366},{"line":3339,"column":3375,"offset":3376},94,6444,{"type":31,"tagName":65,"properties":3378,"children":3379,"position":3387},{},[3380],{"type":27,"value":3381,"position":3382},"heat_0",{"start":3383,"end":3384},{"line":3339,"column":3375,"offset":3376},{"line":3339,"column":3385,"offset":3386},102,6452,{"start":3388,"end":3389},{"line":3339,"column":3375,"offset":3376},{"line":3339,"column":3385,"offset":3386},{"type":27,"value":3391,"position":3392}," to ",{"start":3393,"end":3394},{"line":3339,"column":3385,"offset":3386},{"line":3339,"column":3319,"offset":3395},6456,{"type":31,"tagName":65,"properties":3397,"children":3398,"position":3406},{},[3399],{"type":27,"value":3400,"position":3401},"heat_63",{"start":3402,"end":3403},{"line":3339,"column":3319,"offset":3395},{"line":3339,"column":3404,"offset":3405},115,6465,{"start":3407,"end":3408},{"line":3339,"column":3319,"offset":3395},{"line":3339,"column":3404,"offset":3405},{"type":27,"value":3410,"position":3411},", one per row of the map, and the generated writer ",{"start":3412,"end":3413},{"line":3339,"column":3404,"offset":3405},{"line":3339,"column":3414,"offset":3415},166,6516,{"type":31,"tagName":65,"properties":3417,"children":3418,"position":3426},{},[3419],{"type":27,"value":3420,"position":3421},"out_heat(row, value)",{"start":3422,"end":3423},{"line":3339,"column":3414,"offset":3415},{"line":3339,"column":3424,"offset":3425},188,6538,{"start":3427,"end":3428},{"line":3339,"column":3414,"offset":3415},{"line":3339,"column":3424,"offset":3425},{"type":27,"value":3430,"position":3431}," fills them in ",{"start":3432,"end":3433},{"line":3339,"column":3424,"offset":3425},{"line":3339,"column":3434,"offset":3435},203,6553,{"type":31,"tagName":65,"properties":3437,"children":3438,"position":3445},{},[3439],{"type":27,"value":125,"position":3440},{"start":3441,"end":3442},{"line":3339,"column":3434,"offset":3435},{"line":3339,"column":3443,"offset":3444},212,6562,{"start":3446,"end":3447},{"line":3339,"column":3434,"offset":3435},{"line":3339,"column":3443,"offset":3444},{"type":27,"value":3449,"position":3450},"; a row outside 0 to 63 aborts the run by name, and NaN leaves a cell empty. The two outputs beside it place the grid: ",{"start":3451,"end":3452},{"line":3339,"column":3443,"offset":3444},{"line":3339,"column":3453,"offset":3454},331,6681,{"type":31,"tagName":65,"properties":3456,"children":3457,"position":3465},{},[3458],{"type":27,"value":3459,"position":3460},"grid_low",{"start":3461,"end":3462},{"line":3339,"column":3453,"offset":3454},{"line":3339,"column":3463,"offset":3464},341,6691,{"start":3466,"end":3467},{"line":3339,"column":3453,"offset":3454},{"line":3339,"column":3463,"offset":3464},{"type":27,"value":3469,"position":3470}," is the bottom edge of row 0 on each bar and ",{"start":3471,"end":3472},{"line":3339,"column":3463,"offset":3464},{"line":3339,"column":3473,"offset":3474},386,6736,{"type":31,"tagName":65,"properties":3476,"children":3477,"position":3485},{},[3478],{"type":27,"value":3479,"position":3480},"row_step",{"start":3481,"end":3482},{"line":3339,"column":3473,"offset":3474},{"line":3339,"column":3483,"offset":3484},396,6746,{"start":3486,"end":3487},{"line":3339,"column":3473,"offset":3474},{"line":3339,"column":3483,"offset":3484},{"type":27,"value":3489,"position":3490}," every row's height in price, so the map moves with the close and keeps its shape when the chart's scale changes. ",{"start":3491,"end":3492},{"line":3339,"column":3483,"offset":3484},{"line":3339,"column":3493,"offset":3494},510,6860,{"type":31,"tagName":65,"properties":3496,"children":3497,"position":3505},{},[3498],{"type":27,"value":3499,"position":3500},"plot.heatmap({ grid: \"heat\", price_low: \"grid_low\", price_step: \"row_step\" })",{"start":3501,"end":3502},{"line":3339,"column":3493,"offset":3494},{"line":3339,"column":3503,"offset":3504},589,6939,{"start":3506,"end":3507},{"line":3339,"column":3493,"offset":3494},{"line":3339,"column":3503,"offset":3504},{"type":27,"value":3509,"position":3510}," ties the three together; a heatmap takes ",{"start":3511,"end":3512},{"line":3339,"column":3503,"offset":3504},{"line":3339,"column":3513,"offset":3514},631,6981,{"type":31,"tagName":65,"properties":3516,"children":3517,"position":3525},{},[3518],{"type":27,"value":3519,"position":3520},"cells",{"start":3521,"end":3522},{"line":3339,"column":3513,"offset":3514},{"line":3339,"column":3523,"offset":3524},638,6988,{"start":3526,"end":3527},{"line":3339,"column":3513,"offset":3514},{"line":3339,"column":3523,"offset":3524},{"type":27,"value":3529,"position":3530}," or ",{"start":3531,"end":3532},{"line":3339,"column":3523,"offset":3524},{"line":3339,"column":3533,"offset":3534},642,6992,{"type":31,"tagName":65,"properties":3536,"children":3537,"position":3544},{},[3538],{"type":27,"value":640,"position":3539},{"start":3540,"end":3541},{"line":3339,"column":3533,"offset":3534},{"line":3339,"column":3542,"offset":3543},648,6998,{"start":3545,"end":3546},{"line":3339,"column":3533,"offset":3534},{"line":3339,"column":3542,"offset":3543},{"type":27,"value":3548,"position":3549},", never both.",{"start":3550,"end":3551},{"line":3339,"column":3542,"offset":3543},{"line":3339,"column":3552,"offset":3553},661,7011,{"start":3555,"end":3556},{"line":3339,"column":21,"offset":3346},{"line":3339,"column":3552,"offset":3553},{"type":27,"value":28},{"type":31,"tagName":32,"properties":3559,"children":3560,"position":3663},{},[3561,3578,3585,3598,3605,3618,3625,3638,3645,3657],{"type":31,"tagName":233,"properties":3562,"children":3563,"position":3573},{},[3564],{"type":27,"value":3565,"position":3566},"The levels.",{"start":3567,"end":3570},{"line":3568,"column":3340,"offset":3569},110,7015,{"line":3568,"column":3571,"offset":3572},14,7026,{"start":3574,"end":3576},{"line":3568,"column":21,"offset":3575},7013,{"line":3568,"column":3322,"offset":3577},7028,{"type":27,"value":3579,"position":3580}," Each bar seeds eight levels into a ring of 4,096: for every tier, a long opened at the close is liquidated at ",{"start":3581,"end":3582},{"line":3568,"column":3322,"offset":3577},{"line":3568,"column":3583,"offset":3584},127,7139,{"type":31,"tagName":65,"properties":3586,"children":3587,"position":3595},{},[3588],{"type":27,"value":3589,"position":3590},"close x (1 - 1 / leverage)",{"start":3591,"end":3592},{"line":3568,"column":3583,"offset":3584},{"line":3568,"column":3593,"offset":3594},155,7167,{"start":3596,"end":3597},{"line":3568,"column":3583,"offset":3584},{"line":3568,"column":3593,"offset":3594},{"type":27,"value":3599,"position":3600}," and a short at ",{"start":3601,"end":3602},{"line":3568,"column":3593,"offset":3594},{"line":3568,"column":3603,"offset":3604},171,7183,{"type":31,"tagName":65,"properties":3606,"children":3607,"position":3615},{},[3608],{"type":27,"value":3609,"position":3610},"close x (1 + 1 / leverage)",{"start":3611,"end":3612},{"line":3568,"column":3603,"offset":3604},{"line":3568,"column":3613,"offset":3614},199,7211,{"start":3616,"end":3617},{"line":3568,"column":3603,"offset":3604},{"line":3568,"column":3613,"offset":3614},{"type":27,"value":3619,"position":3620},", each level weighted by a quarter of the bar's volume (one unit on a market without volume). Before seeding, the bar's range is swept: a level between the low and the high was flushed and is zeroed. Then every live level is folded onto the 64 rows around the close with a linear fade, ",{"start":3621,"end":3622},{"line":3568,"column":3613,"offset":3614},{"line":3568,"column":3623,"offset":3624},485,7497,{"type":31,"tagName":65,"properties":3626,"children":3627,"position":3635},{},[3628],{"type":27,"value":3629,"position":3630},"1 - age / lookback",{"start":3631,"end":3632},{"line":3568,"column":3623,"offset":3624},{"line":3568,"column":3633,"offset":3634},505,7517,{"start":3636,"end":3637},{"line":3568,"column":3623,"offset":3624},{"line":3568,"column":3633,"offset":3634},{"type":27,"value":3639,"position":3640},"; a level older than ",{"start":3641,"end":3642},{"line":3568,"column":3633,"offset":3634},{"line":3568,"column":3643,"offset":3644},526,7538,{"type":31,"tagName":65,"properties":3646,"children":3647,"position":3654},{},[3648],{"type":27,"value":69,"position":3649},{"start":3650,"end":3651},{"line":3568,"column":3643,"offset":3644},{"line":3568,"column":3652,"offset":3653},536,7548,{"start":3655,"end":3656},{"line":3568,"column":3643,"offset":3644},{"line":3568,"column":3652,"offset":3653},{"type":27,"value":3658,"position":3659}," is dropped, and one outside the map this bar is kept, since it comes back when price moves toward it.",{"start":3660,"end":3661},{"line":3568,"column":3652,"offset":3653},{"line":3568,"column":3523,"offset":3662},7650,{"start":3664,"end":3665},{"line":3568,"column":21,"offset":3575},{"line":3568,"column":3523,"offset":3662},{"type":27,"value":28},{"type":31,"tagName":32,"properties":3668,"children":3669,"position":3815},{},[3670,3688,3695,3708,3715,3728,3735,3748,3755,3768,3775,3788,3795,3808],{"type":31,"tagName":233,"properties":3671,"children":3672,"position":3682},{},[3673],{"type":27,"value":3674,"position":3675},"The scale.",{"start":3676,"end":3679},{"line":3677,"column":3340,"offset":3678},112,7654,{"line":3677,"column":3680,"offset":3681},13,7664,{"start":3683,"end":3685},{"line":3677,"column":21,"offset":3684},7652,{"line":3677,"column":3686,"offset":3687},15,7666,{"type":27,"value":3689,"position":3690}," The palette runs from the chart's background through a faint violet (",{"start":3691,"end":3692},{"line":3677,"column":3686,"offset":3687},{"line":3677,"column":3693,"offset":3694},85,7736,{"type":31,"tagName":65,"properties":3696,"children":3697,"position":3705},{},[3698],{"type":27,"value":3699,"position":3700},"#8b5cf640",{"start":3701,"end":3702},{"line":3677,"column":3693,"offset":3694},{"line":3677,"column":3703,"offset":3704},96,7747,{"start":3706,"end":3707},{"line":3677,"column":3693,"offset":3694},{"line":3677,"column":3703,"offset":3704},{"type":27,"value":3709,"position":3710},", violet at a quarter strength, so it reads on a light chart too) and full violet to magenta: hues no candle colour uses, so the amber and orange (or green and red) bars stay readable where they cross the map. ",{"start":3711,"end":3712},{"line":3677,"column":3703,"offset":3704},{"line":3677,"column":3713,"offset":3714},306,7957,{"type":31,"tagName":65,"properties":3716,"children":3717,"position":3725},{},[3718],{"type":27,"value":3719,"position":3720},"scale: \"linear\"",{"start":3721,"end":3722},{"line":3677,"column":3713,"offset":3714},{"line":3677,"column":3723,"offset":3724},323,7974,{"start":3726,"end":3727},{"line":3677,"column":3713,"offset":3714},{"line":3677,"column":3723,"offset":3724},{"type":27,"value":3729,"position":3730}," with ",{"start":3731,"end":3732},{"line":3677,"column":3723,"offset":3724},{"line":3677,"column":3733,"offset":3734},329,7980,{"type":31,"tagName":65,"properties":3736,"children":3737,"position":3745},{},[3738],{"type":27,"value":3739,"position":3740},"min: 0",{"start":3741,"end":3742},{"line":3677,"column":3733,"offset":3734},{"line":3677,"column":3743,"offset":3744},337,7988,{"start":3746,"end":3747},{"line":3677,"column":3733,"offset":3734},{"line":3677,"column":3743,"offset":3744},{"type":27,"value":3749,"position":3750}," keeps most cells faint and lets only the dense rows glow, and ",{"start":3751,"end":3752},{"line":3677,"column":3743,"offset":3744},{"line":3677,"column":3753,"offset":3754},400,8051,{"type":31,"tagName":65,"properties":3756,"children":3757,"position":3765},{},[3758],{"type":27,"value":3759,"position":3760},"auto_quantile: 0.98",{"start":3761,"end":3762},{"line":3677,"column":3753,"offset":3754},{"line":3677,"column":3763,"offset":3764},421,8072,{"start":3766,"end":3767},{"line":3677,"column":3753,"offset":3754},{"line":3677,"column":3763,"offset":3764},{"type":27,"value":3769,"position":3770}," sets the top of the scale at the 98th percentile of every cell in the run. ",{"start":3771,"end":3772},{"line":3677,"column":3763,"offset":3764},{"line":3677,"column":3773,"offset":3774},497,8148,{"type":31,"tagName":65,"properties":3776,"children":3777,"position":3785},{},[3778],{"type":27,"value":3779,"position":3780},"behind_candles: true",{"start":3781,"end":3782},{"line":3677,"column":3773,"offset":3774},{"line":3677,"column":3783,"offset":3784},519,8170,{"start":3786,"end":3787},{"line":3677,"column":3773,"offset":3774},{"line":3677,"column":3783,"offset":3784},{"type":27,"value":3789,"position":3790}," keeps the bars on top. ",{"start":3791,"end":3792},{"line":3677,"column":3783,"offset":3784},{"line":3677,"column":3793,"offset":3794},543,8194,{"type":31,"tagName":65,"properties":3796,"children":3797,"position":3805},{},[3798],{"type":27,"value":3799,"position":3800},"row_pct",{"start":3801,"end":3802},{"line":3677,"column":3793,"offset":3794},{"line":3677,"column":3803,"offset":3804},552,8203,{"start":3806,"end":3807},{"line":3677,"column":3793,"offset":3794},{"line":3677,"column":3803,"offset":3804},{"type":27,"value":3809,"position":3810}," (0.1% of the close) sets the row height: finer rows separate the tiers, coarser rows merge them into bands.",{"start":3811,"end":3812},{"line":3677,"column":3803,"offset":3804},{"line":3677,"column":3813,"offset":3814},660,8311,{"start":3816,"end":3817},{"line":3677,"column":21,"offset":3684},{"line":3677,"column":3813,"offset":3814},{"type":27,"value":28},{"type":31,"tagName":285,"properties":3820,"children":3821,"position":3831},{},[3822],{"type":27,"value":3823,"position":3824},"Where it runs",{"start":3825,"end":3828},{"line":3826,"column":293,"offset":3827},114,8316,{"line":3826,"column":3829,"offset":3830},17,8329,{"start":3832,"end":3834},{"line":3826,"column":21,"offset":3833},8313,{"line":3826,"column":3829,"offset":3830},{"type":27,"value":28},{"type":31,"tagName":32,"properties":3837,"children":3838,"position":3847},{},[3839],{"type":27,"value":3840,"position":3841},"Any chart: the map is built from the chart's own candles, so it draws on every market and interval. It reads best on perpetual and futures charts, where the leverage it models is traded; on spot or a prediction market the rows still draw, but there is no leverage to be flushed at them.",{"start":3842,"end":3844},{"line":46,"column":21,"offset":3843},8331,{"line":46,"column":3845,"offset":3846},287,8617,{"start":3848,"end":3849},{"line":46,"column":21,"offset":3843},{"line":46,"column":3845,"offset":3846},{"type":27,"value":28},{"type":31,"tagName":285,"properties":3852,"children":3853,"position":3863},{},[3854],{"type":27,"value":3855,"position":3856},"When data is missing",{"start":3857,"end":3860},{"line":3858,"column":293,"offset":3859},118,8622,{"line":3858,"column":3861,"offset":3862},24,8642,{"start":3864,"end":3866},{"line":3858,"column":21,"offset":3865},8619,{"line":3858,"column":3861,"offset":3862},{"type":27,"value":28},{"type":31,"tagName":32,"properties":3869,"children":3870,"position":3899},{},[3871,3880,3892],{"type":27,"value":3872,"position":3873},"A bar whose close is NaN writes an empty map and places nothing. A market without volume seeds one unit a bar, so the map still draws, with every bar weighing the same. The map holds only what the chart has seen: the first ",{"start":3874,"end":3877},{"line":3875,"column":21,"offset":3876},120,8644,{"line":3875,"column":3878,"offset":3879},224,8867,{"type":31,"tagName":65,"properties":3881,"children":3882,"position":3889},{},[3883],{"type":27,"value":69,"position":3884},{"start":3885,"end":3886},{"line":3875,"column":3878,"offset":3879},{"line":3875,"column":3887,"offset":3888},234,8877,{"start":3890,"end":3891},{"line":3875,"column":3878,"offset":3879},{"line":3875,"column":3887,"offset":3888},{"type":27,"value":3893,"position":3894}," bars of a run build it up from nothing.",{"start":3895,"end":3896},{"line":3875,"column":3887,"offset":3888},{"line":3875,"column":3897,"offset":3898},274,8917,{"start":3900,"end":3901},{"line":3875,"column":21,"offset":3876},{"line":3875,"column":3897,"offset":3898},{"type":27,"value":28},{"type":31,"tagName":285,"properties":3904,"children":3905,"position":3914},{},[3906],{"type":27,"value":3907,"position":3908},"Customize it",{"start":3909,"end":3912},{"line":3910,"column":293,"offset":3911},122,8922,{"line":3910,"column":3322,"offset":3913},8934,{"start":3915,"end":3917},{"line":3910,"column":21,"offset":3916},8919,{"line":3910,"column":3322,"offset":3913},{"type":27,"value":28},{"type":31,"tagName":3920,"properties":3921,"children":3922,"position":4201},"ul",{},[3923,3924,3975,3976,4062,4063,4114,4115,4200],{"type":27,"value":28},{"type":31,"tagName":3925,"properties":3926,"children":3927,"position":3971},"li",{},[3928,3946,3952,3964],{"type":31,"tagName":233,"properties":3929,"children":3930,"position":3940},{},[3931],{"type":27,"value":3932,"position":3933},"A longer memory.",{"start":3934,"end":3937},{"line":3935,"column":43,"offset":3936},124,8940,{"line":3935,"column":3938,"offset":3939},21,8956,{"start":3941,"end":3943},{"line":3935,"column":3340,"offset":3942},8938,{"line":3935,"column":3944,"offset":3945},23,8958,{"type":27,"value":3947,"position":3948}," Raise ",{"start":3949,"end":3950},{"line":3935,"column":3944,"offset":3945},{"line":3935,"column":3348,"offset":3951},8965,{"type":31,"tagName":65,"properties":3953,"children":3954,"position":3961},{},[3955],{"type":27,"value":69,"position":3956},{"start":3957,"end":3958},{"line":3935,"column":3348,"offset":3951},{"line":3935,"column":3959,"offset":3960},40,8975,{"start":3962,"end":3963},{"line":3935,"column":3348,"offset":3951},{"line":3935,"column":3959,"offset":3960},{"type":27,"value":3965,"position":3966}," to keep levels longer before they fade; lower it for a map of the last session only.",{"start":3967,"end":3968},{"line":3935,"column":3959,"offset":3960},{"line":3935,"column":3969,"offset":3970},125,9060,{"start":3972,"end":3974},{"line":3935,"column":21,"offset":3973},8936,{"line":3935,"column":3969,"offset":3970},{"type":27,"value":28},{"type":31,"tagName":3925,"properties":3977,"children":3978,"position":4058},{},[3979,3996,4001,4013,4019,4032,4039,4051],{"type":31,"tagName":233,"properties":3980,"children":3981,"position":3990},{},[3982],{"type":27,"value":3983,"position":3984},"Finer or coarser rows.",{"start":3985,"end":3987},{"line":3969,"column":43,"offset":3986},9065,{"line":3969,"column":3988,"offset":3989},27,9087,{"start":3991,"end":3993},{"line":3969,"column":3340,"offset":3992},9063,{"line":3969,"column":3994,"offset":3995},29,9089,{"type":27,"value":3351,"position":3997},{"start":3998,"end":3999},{"line":3969,"column":3994,"offset":3995},{"line":3969,"column":3348,"offset":4000},9090,{"type":31,"tagName":65,"properties":4002,"children":4003,"position":4010},{},[4004],{"type":27,"value":3799,"position":4005},{"start":4006,"end":4007},{"line":3969,"column":3348,"offset":4000},{"line":3969,"column":4008,"offset":4009},39,9099,{"start":4011,"end":4012},{"line":3969,"column":3348,"offset":4000},{"line":3969,"column":4008,"offset":4009},{"type":27,"value":4014,"position":4015}," sets the row height as a percent of the close; ",{"start":4016,"end":4017},{"line":3969,"column":4008,"offset":4009},{"line":3969,"column":10,"offset":4018},9147,{"type":31,"tagName":65,"properties":4020,"children":4021,"position":4029},{},[4022],{"type":27,"value":4023,"position":4024},"rows: 64",{"start":4025,"end":4026},{"line":3969,"column":10,"offset":4018},{"line":3969,"column":4027,"offset":4028},97,9157,{"start":4030,"end":4031},{"line":3969,"column":10,"offset":4018},{"line":3969,"column":4027,"offset":4028},{"type":27,"value":4033,"position":4034}," in ",{"start":4035,"end":4036},{"line":3969,"column":4027,"offset":4028},{"line":3969,"column":4037,"offset":4038},101,9161,{"type":31,"tagName":65,"properties":4040,"children":4041,"position":4048},{},[4042],{"type":27,"value":105,"position":4043},{"start":4044,"end":4045},{"line":3969,"column":4037,"offset":4038},{"line":3969,"column":4046,"offset":4047},111,9171,{"start":4049,"end":4050},{"line":3969,"column":4037,"offset":4038},{"line":3969,"column":4046,"offset":4047},{"type":27,"value":4052,"position":4053}," sets how many rows the map spans (2 to 128).",{"start":4054,"end":4055},{"line":3969,"column":4046,"offset":4047},{"line":3969,"column":4056,"offset":4057},156,9216,{"start":4059,"end":4061},{"line":3969,"column":21,"offset":4060},9061,{"line":3969,"column":4056,"offset":4057},{"type":27,"value":28},{"type":31,"tagName":3925,"properties":4064,"children":4065,"position":4110},{},[4066,4083,4090,4103],{"type":31,"tagName":233,"properties":4067,"children":4068,"position":4077},{},[4069],{"type":27,"value":4070,"position":4071},"Other tiers.",{"start":4072,"end":4075},{"line":4073,"column":43,"offset":4074},126,9221,{"line":4073,"column":3829,"offset":4076},9233,{"start":4078,"end":4080},{"line":4073,"column":3340,"offset":4079},9219,{"line":4073,"column":4081,"offset":4082},19,9235,{"type":27,"value":4084,"position":4085}," Change the four leverages in ",{"start":4086,"end":4087},{"line":4073,"column":4081,"offset":4082},{"line":4073,"column":4088,"offset":4089},49,9265,{"type":31,"tagName":65,"properties":4091,"children":4092,"position":4100},{},[4093],{"type":27,"value":4094,"position":4095},"onStart()",{"start":4096,"end":4097},{"line":4073,"column":4088,"offset":4089},{"line":4073,"column":4098,"offset":4099},60,9276,{"start":4101,"end":4102},{"line":4073,"column":4088,"offset":4089},{"line":4073,"column":4098,"offset":4099},{"type":27,"value":4104,"position":4105},"; the ring holds eight levels per bar regardless.",{"start":4106,"end":4107},{"line":4073,"column":4098,"offset":4099},{"line":4073,"column":4108,"offset":4109},109,9325,{"start":4111,"end":4113},{"line":4073,"column":21,"offset":4112},9217,{"line":4073,"column":4108,"offset":4109},{"type":27,"value":28},{"type":31,"tagName":3925,"properties":4116,"children":4117,"position":4196},{},[4118,4133,4140,4152,4159,4172,4179,4190],{"type":31,"tagName":233,"properties":4119,"children":4120,"position":4128},{},[4121],{"type":27,"value":4122,"position":4123},"A fixed scale.",{"start":4124,"end":4126},{"line":3583,"column":43,"offset":4125},9330,{"line":3583,"column":4081,"offset":4127},9344,{"start":4129,"end":4131},{"line":3583,"column":3340,"offset":4130},9328,{"line":3583,"column":3938,"offset":4132},9346,{"type":27,"value":4134,"position":4135}," Set ",{"start":4136,"end":4137},{"line":3583,"column":3938,"offset":4132},{"line":3583,"column":4138,"offset":4139},26,9351,{"type":31,"tagName":65,"properties":4141,"children":4142,"position":4149},{},[4143],{"type":27,"value":4144,"position":4145},"min",{"start":4146,"end":4147},{"line":3583,"column":4138,"offset":4139},{"line":3583,"column":3355,"offset":4148},9356,{"start":4150,"end":4151},{"line":3583,"column":4138,"offset":4139},{"line":3583,"column":3355,"offset":4148},{"type":27,"value":4153,"position":4154}," and ",{"start":4155,"end":4156},{"line":3583,"column":3355,"offset":4148},{"line":3583,"column":4157,"offset":4158},36,9361,{"type":31,"tagName":65,"properties":4160,"children":4161,"position":4169},{},[4162],{"type":27,"value":4163,"position":4164},"max",{"start":4165,"end":4166},{"line":3583,"column":4157,"offset":4158},{"line":3583,"column":4167,"offset":4168},41,9366,{"start":4170,"end":4171},{"line":3583,"column":4157,"offset":4158},{"line":3583,"column":4167,"offset":4168},{"type":27,"value":4173,"position":4174}," on the heatmap to compare days on one scale, or ",{"start":4175,"end":4176},{"line":3583,"column":4167,"offset":4168},{"line":3583,"column":4177,"offset":4178},90,9415,{"type":31,"tagName":65,"properties":4180,"children":4181,"position":4187},{},[4182],{"type":27,"value":3032,"position":4183},{"start":4184,"end":4185},{"line":3583,"column":4177,"offset":4178},{"line":3583,"column":4027,"offset":4186},9422,{"start":4188,"end":4189},{"line":3583,"column":4177,"offset":4178},{"line":3583,"column":4027,"offset":4186},{"type":27,"value":4191,"position":4192}," to hide the faintest cells.",{"start":4193,"end":4194},{"line":3583,"column":4027,"offset":4186},{"line":3583,"column":3969,"offset":4195},9450,{"start":4197,"end":4199},{"line":3583,"column":21,"offset":4198},9326,{"line":3583,"column":3969,"offset":4195},{"type":27,"value":28},{"start":4202,"end":4203},{"line":3935,"column":21,"offset":3973},{"line":3583,"column":3969,"offset":4195},{"type":27,"value":28},{"type":31,"tagName":285,"properties":4206,"children":4207,"position":4217},{},[4208],{"type":27,"value":4209,"position":4210},"Run it",{"start":4211,"end":4214},{"line":4212,"column":293,"offset":4213},129,9455,{"line":4212,"column":4215,"offset":4216},10,9461,{"start":4218,"end":4220},{"line":4212,"column":21,"offset":4219},9452,{"line":4212,"column":4215,"offset":4216},{"type":27,"value":28},{"type":31,"tagName":4223,"properties":4224,"children":4225,"position":4379},"ol",{},[4226,4227,4307,4308,4343,4344,4378],{"type":27,"value":28},{"type":31,"tagName":3925,"properties":4228,"children":4229,"position":4303},{},[4230,4237,4254,4260,4275,4281,4296],{"type":27,"value":4231,"position":4232},"In the editor's Explorer, press the ",{"start":4233,"end":4235},{"line":25,"column":293,"offset":4234},9466,{"line":25,"column":3959,"offset":4236},9502,{"type":31,"tagName":233,"properties":4238,"children":4239,"position":4249},{},[4240],{"type":27,"value":4241,"position":4242},"Templates",{"start":4243,"end":4246},{"line":25,"column":4244,"offset":4245},42,9504,{"line":25,"column":4247,"offset":4248},51,9513,{"start":4250,"end":4251},{"line":25,"column":3959,"offset":4236},{"line":25,"column":4252,"offset":4253},53,9515,{"type":27,"value":4255,"position":4256}," icon (\"Browse starter templates\") and pick ",{"start":4257,"end":4258},{"line":25,"column":4252,"offset":4253},{"line":25,"column":4027,"offset":4259},9559,{"type":31,"tagName":233,"properties":4261,"children":4262,"position":4270},{},[4263],{"type":27,"value":8,"position":4264},{"start":4265,"end":4268},{"line":25,"column":4266,"offset":4267},99,9561,{"line":25,"column":3404,"offset":4269},9577,{"start":4271,"end":4272},{"line":25,"column":4027,"offset":4259},{"line":25,"column":4273,"offset":4274},117,9579,{"type":27,"value":4276,"position":4277}," under ",{"start":4278,"end":4279},{"line":25,"column":4273,"offset":4274},{"line":25,"column":3935,"offset":4280},9586,{"type":31,"tagName":233,"properties":4282,"children":4283,"position":4291},{},[4284],{"type":27,"value":260,"position":4285},{"start":4286,"end":4288},{"line":25,"column":4073,"offset":4287},9588,{"line":25,"column":4289,"offset":4290},136,9598,{"start":4292,"end":4293},{"line":25,"column":3935,"offset":4280},{"line":25,"column":4294,"offset":4295},138,9600,{"type":27,"value":4297,"position":4298},".",{"start":4299,"end":4300},{"line":25,"column":4294,"offset":4295},{"line":25,"column":4301,"offset":4302},139,9601,{"start":4304,"end":4306},{"line":25,"column":21,"offset":4305},9463,{"line":25,"column":4301,"offset":4302},{"type":27,"value":28},{"type":31,"tagName":3925,"properties":4309,"children":4310,"position":4339},{},[4311,4318,4333],{"type":27,"value":4312,"position":4313},"Press ",{"start":4314,"end":4316},{"line":24,"column":293,"offset":4315},9605,{"line":24,"column":4215,"offset":4317},9611,{"type":31,"tagName":233,"properties":4319,"children":4320,"position":4329},{},[4321],{"type":27,"value":4322,"position":4323},"Run",{"start":4324,"end":4327},{"line":24,"column":4325,"offset":4326},12,9613,{"line":24,"column":3686,"offset":4328},9616,{"start":4330,"end":4331},{"line":24,"column":4215,"offset":4317},{"line":24,"column":3829,"offset":4332},9618,{"type":27,"value":4334,"position":4335}," on a perpetual chart: the map paints behind the candles, bright where recent leverage would be liquidated, and clears where price has already swept.",{"start":4336,"end":4337},{"line":24,"column":3829,"offset":4332},{"line":24,"column":3414,"offset":4338},9767,{"start":4340,"end":4342},{"line":24,"column":21,"offset":4341},9602,{"line":24,"column":3414,"offset":4338},{"type":27,"value":28},{"type":31,"tagName":3925,"properties":4345,"children":4346,"position":4374},{},[4347,4356,4367],{"type":27,"value":4348,"position":4349},"Hover a cell for the weight seeded at that price; at the editor's Console prompt, type ",{"start":4350,"end":4353},{"line":4351,"column":293,"offset":4352},133,9771,{"line":4351,"column":4354,"offset":4355},91,9858,{"type":31,"tagName":65,"properties":4357,"children":4358,"position":4364},{},[4359],{"type":27,"value":3479,"position":4360},{"start":4361,"end":4362},{"line":4351,"column":4354,"offset":4355},{"line":4351,"column":4037,"offset":4363},9868,{"start":4365,"end":4366},{"line":4351,"column":4354,"offset":4355},{"line":4351,"column":4037,"offset":4363},{"type":27,"value":4368,"position":4369}," to read the row height in price.",{"start":4370,"end":4371},{"line":4351,"column":4037,"offset":4363},{"line":4351,"column":4372,"offset":4373},134,9901,{"start":4375,"end":4377},{"line":4351,"column":21,"offset":4376},9768,{"line":4351,"column":4372,"offset":4373},{"type":27,"value":28},{"start":4380,"end":4381},{"line":25,"column":21,"offset":4305},{"line":4351,"column":4372,"offset":4373},{"type":27,"value":28},{"type":31,"tagName":285,"properties":4384,"children":4385,"position":4394},{},[4386],{"type":27,"value":4387,"position":4388},"Concepts used",{"start":4389,"end":4392},{"line":4390,"column":293,"offset":4391},135,9906,{"line":4390,"column":3829,"offset":4393},9919,{"start":4395,"end":4397},{"line":4390,"column":21,"offset":4396},9903,{"line":4390,"column":3829,"offset":4393},{"type":27,"value":28},{"type":31,"tagName":3920,"properties":4400,"children":4401,"position":4558},{},[4402,4403,4497,4498,4526,4527,4557],{"type":27,"value":28},{"type":31,"tagName":3925,"properties":4404,"children":4405,"position":4493},{},[4406,4422,4429,4441,4447,4458,4464,4476,4481],{"type":31,"tagName":162,"properties":4407,"children":4408,"position":4416},{"href":164},[4409],{"type":27,"value":167,"position":4410},{"start":4411,"end":4414},{"line":4412,"column":293,"offset":4413},137,9924,{"line":4412,"column":99,"offset":4415},9938,{"start":4417,"end":4419},{"line":4412,"column":3340,"offset":4418},9923,{"line":4412,"column":4420,"offset":4421},54,9974,{"type":27,"value":4423,"position":4424}," for ",{"start":4425,"end":4426},{"line":4412,"column":4420,"offset":4421},{"line":4412,"column":4427,"offset":4428},59,9979,{"type":31,"tagName":65,"properties":4430,"children":4431,"position":4438},{},[4432],{"type":27,"value":105,"position":4433},{"start":4434,"end":4435},{"line":4412,"column":4427,"offset":4428},{"line":4412,"column":4436,"offset":4437},69,9989,{"start":4439,"end":4440},{"line":4412,"column":4427,"offset":4428},{"line":4412,"column":4436,"offset":4437},{"type":27,"value":399,"position":4442},{"start":4443,"end":4444},{"line":4412,"column":4436,"offset":4437},{"line":4412,"column":4445,"offset":4446},71,9991,{"type":31,"tagName":65,"properties":4448,"children":4449,"position":4455},{},[4450],{"type":27,"value":145,"position":4451},{"start":4452,"end":4453},{"line":4412,"column":4445,"offset":4446},{"line":4412,"column":3693,"offset":4454},10005,{"start":4456,"end":4457},{"line":4412,"column":4445,"offset":4446},{"line":4412,"column":3693,"offset":4454},{"type":27,"value":4459,"position":4460}," over a grid, ",{"start":4461,"end":4462},{"line":4412,"column":3693,"offset":4454},{"line":4412,"column":4266,"offset":4463},10019,{"type":31,"tagName":65,"properties":4465,"children":4466,"position":4473},{},[4467],{"type":27,"value":4468,"position":4469},"price_low",{"start":4470,"end":4471},{"line":4412,"column":4266,"offset":4463},{"line":4412,"column":3568,"offset":4472},10030,{"start":4474,"end":4475},{"line":4412,"column":4266,"offset":4463},{"line":4412,"column":3568,"offset":4472},{"type":27,"value":4153,"position":4477},{"start":4478,"end":4479},{"line":4412,"column":3568,"offset":4472},{"line":4412,"column":3404,"offset":4480},10035,{"type":31,"tagName":65,"properties":4482,"children":4483,"position":4490},{},[4484],{"type":27,"value":4485,"position":4486},"price_step",{"start":4487,"end":4488},{"line":4412,"column":3404,"offset":4480},{"line":4412,"column":3583,"offset":4489},10047,{"start":4491,"end":4492},{"line":4412,"column":3404,"offset":4480},{"line":4412,"column":3583,"offset":4489},{"start":4494,"end":4496},{"line":4412,"column":21,"offset":4495},9921,{"line":4412,"column":3583,"offset":4489},{"type":27,"value":28},{"type":31,"tagName":3925,"properties":4499,"children":4500,"position":4522},{},[4501,4515],{"type":31,"tagName":162,"properties":4502,"children":4503,"position":4510},{"href":189},[4504],{"type":27,"value":192,"position":4505},{"start":4506,"end":4508},{"line":4294,"column":293,"offset":4507},10051,{"line":4294,"column":3322,"offset":4509},10063,{"start":4511,"end":4513},{"line":4294,"column":3340,"offset":4512},10050,{"line":4294,"column":4247,"offset":4514},10098,{"type":27,"value":4516,"position":4517}," for the chart's own candles as the primary input",{"start":4518,"end":4519},{"line":4294,"column":4247,"offset":4514},{"line":4294,"column":4520,"offset":4521},100,10147,{"start":4523,"end":4525},{"line":4294,"column":21,"offset":4524},10048,{"line":4294,"column":4520,"offset":4521},{"type":27,"value":28},{"type":31,"tagName":3925,"properties":4528,"children":4529,"position":4553},{},[4530,4546],{"type":31,"tagName":162,"properties":4531,"children":4533,"position":4541},{"href":4532},"../presentation/plotting.md",[4534],{"type":27,"value":4535,"position":4536},"Plotting",{"start":4537,"end":4539},{"line":4301,"column":293,"offset":4538},10151,{"line":4301,"column":4325,"offset":4540},10159,{"start":4542,"end":4544},{"line":4301,"column":3340,"offset":4543},10150,{"line":4301,"column":4244,"offset":4545},10189,{"type":27,"value":4547,"position":4548}," for data-only outputs",{"start":4549,"end":4550},{"line":4301,"column":4244,"offset":4545},{"line":4301,"column":4551,"offset":4552},64,10211,{"start":4554,"end":4556},{"line":4301,"column":21,"offset":4555},10148,{"line":4301,"column":4551,"offset":4552},{"type":27,"value":28},{"start":4559,"end":4560},{"line":4412,"column":21,"offset":4495},{"line":4301,"column":4551,"offset":4552},{"quirksMode":4562},false,{"start":4564,"end":4565},{"line":21,"column":21,"offset":22},{"line":4566,"column":21,"offset":4567},140,10212,1791265157052]