[{"data":1,"prerenderedAt":3865},["ShallowReactive",2],{"indicators:strategies/examples-perps":3},{"slug":4,"filePath":5,"frontmatter":6,"rawMarkdown":11,"tree":12},"strategies/examples-perps","strategies/examples-perps.md",{"title":7,"description":8,"order":9,"section":10},"Examples: The Five Perps Scenarios","The five canonical perps scripts behind the kScript (legacy) engine's acceptance battery, ported as Indicator files: liquidation on both sides, fee…",87,"strategies","---\ntitle: \"Examples: The Five Perps Scenarios\"\ndescription: \"The five canonical perps scripts behind the kScript (legacy) engine's acceptance battery, ported as Indicator files: liquidation on both sides, fee…\"\norder: 87\nsection: \"strategies\"\n---\n\n\u003C!-- source: docs/indicators/strategies/examples-perps.md; generated by packages/cli/scripts/gen-indicator-docs.ts, do not edit -->\n\n# Examples: The Five Perps Scenarios\n\nThe five canonical perps scripts behind the kScript (legacy) engine's acceptance battery, ported as Indicator files: liquidation on both sides, fee classification, funding erosion and bankruptcy accounting. They are reproduction scripts: each re-derives its pinned number on the fixture bars committed beside the engine's probe (prices near 100), which is what makes it verifiable; on a live chart they simply enter at that chart's prices. The [perps and leverage](perps-and-leverage.md) page has the formulas and the numbers each must land on. kScript's `barIndex == 0` gate becomes a row counter the file keeps itself.\n\n## 1. Long liquidation\n\nA 10x long entered at 100 with 0.5% maintenance margin must liquidate at exactly `(100 - 10) / 0.995 = 90.45226130653266`.\n\n```typescript\n// Scenario 1, long liquidation: a 10x long at 100 with 0.5% maintenance margin must liquidate at (100 - 10) / 0.995.\nimport { input, line, ohlcv, output, overlay } from \"./sdk/declare\";\nimport { in_close } from \"./gen/inputs\";\nimport { emitRow, out_close } from \"./gen/outputs\";\nimport { strategy } from \"./gen/strategy\";\n\nstrategy({ initialCapital: 10000, instrument: \"perps\", leverage: 10, maintenanceMarginPercent: 0.5, qtyType: \"fixed\", qtyValue: 1, slippageBps: 0, makerFeePercent: 0, takerFeePercent: 0, funding: \"off\" });\ninput(\"close\", ohlcv.close);\noutput(\"close\", line, overlay, { description: \"Close price\" });\n\nlet bars: i32 = 0;\nlet close: f64 = NaN;\n\nexport function init(): void {}\n\nexport function state(): i32 {\n  close = in_close();\n  bars += 1;\n  return 1;\n}\n\nexport function finalize(): void {\n  if (bars == 1) strategy.long(\"L\").send();\n  out_close(close);\n  emitRow();\n}\n\nexport function reset(): void {\n  bars = 0;\n  close = NaN;\n}\n```\n\n## 2. Short liquidation with taker fees\n\nThe short side of the same formula, `(100 + 10) / 1.005 = 109.45273631840797`, with a market entry so both the entry fill and the liquidation fill pay `takerFeePercent`.\n\n```typescript\n// Scenario 2, short liquidation with taker fees: the short formula (100 + 10) / 1.005, both fills paying the taker rate.\nimport { input, line, ohlcv, output, overlay } from \"./sdk/declare\";\nimport { in_close } from \"./gen/inputs\";\nimport { emitRow, out_close } from \"./gen/outputs\";\nimport { strategy } from \"./gen/strategy\";\n\nstrategy({ initialCapital: 10000, qtyType: \"fixed\", qtyValue: 1, instrument: \"perps\", leverage: 10, maintenanceMarginPercent: 0.5, takerFeePercent: 0.05, funding: \"off\" });\ninput(\"close\", ohlcv.close);\noutput(\"close\", line, overlay, { description: \"Close price\" });\n\nlet close: f64 = NaN;\n\nexport function init(): void {}\n\nexport function state(): i32 {\n  close = in_close();\n  return 1;\n}\n\nexport function finalize(): void {\n  if (strategy.positionSize() == 0 && close \u003C 100.5) strategy.short(\"S\").send();\n  out_close(close);\n  emitRow();\n}\n\nexport function reset(): void {\n  close = NaN;\n}\n```\n\n## 3. Maker and taker split\n\nTwo trades, four fills, four fee classifications: a limit entry and its take-profit limit pay maker; a market entry and its protective stop pay taker. Also a guard-design lesson: the file runs at the bar's close, after fills, so entry zones stay disjoint from exit prices or the flat-position guard re-arms on the very bar an exit filled.\n\n```typescript\n// Scenario 3, maker and taker split: a limit entry and its take-profit pay maker, a market entry and its stop pay taker.\nimport { input, line, ohlcv, output, overlay } from \"./sdk/declare\";\nimport { in_close } from \"./gen/inputs\";\nimport { emitRow, out_close } from \"./gen/outputs\";\nimport { strategy } from \"./gen/strategy\";\n\nstrategy({ initialCapital: 10000, qtyType: \"fixed\", qtyValue: 1, instrument: \"perps\", leverage: 5, makerFeePercent: 0.01, takerFeePercent: 0.05, funding: \"off\" });\ninput(\"close\", ohlcv.close);\noutput(\"close\", line, overlay, { description: \"Close price\" });\n\nlet close: f64 = NaN;\nlet held: f64 = 0;\n\nexport function init(): void {}\n\nexport function state(): i32 {\n  close = in_close();\n  held = strategy.positionSize();\n  return 1;\n}\n\nexport function finalize(): void {\n  if (held == 0 && close > 100.5 && close \u003C 103.0) strategy.long(\"LimitIn\").limit(95.0).send();\n  if (held == 0 && close > 110.5) strategy.long(\"MarketIn\").send();\n  if (held > 0) {\n    strategy.exit(\"TP\").from(\"LimitIn\").limit(105.0).send();\n    strategy.exit(\"SL\").from(\"MarketIn\").stop(92.0).send();\n  }\n  out_close(close);\n  emitRow();\n}\n\nexport function reset(): void {\n  close = NaN;\n  held = 0;\n}\n```\n\n## 4. Funding erosion\n\nFunding settles against the isolated margin: each settlement debits cash and committed margin together, the liquidation price tightens as margin erodes, and a settlement that depletes margin liquidates the position at that bar's open with zero price PnL. This release attaches no funding provider, so the port counts every unsettled open bar in `fundingUnavailableCount` and charges nothing; the numbers reproduce once a provider lands.\n\n```typescript\n// Scenario 4, funding erosion: settlements debit cash and committed margin together, and a depleting settlement liquidates at that bar's open.\nimport { input, line, ohlcv, output, overlay } from \"./sdk/declare\";\nimport { in_close } from \"./gen/inputs\";\nimport { emitRow, out_close } from \"./gen/outputs\";\nimport { strategy } from \"./gen/strategy\";\n\nstrategy({ initialCapital: 10000, qtyType: \"fixed\", qtyValue: 1, instrument: \"perps\", leverage: 10, maintenanceMarginPercent: 0.5, funding: \"data\" });\ninput(\"close\", ohlcv.close);\noutput(\"close\", line, overlay, { description: \"Close price\" });\n\nlet close: f64 = NaN;\n\nexport function init(): void {}\n\nexport function state(): i32 {\n  close = in_close();\n  return 1;\n}\n\nexport function finalize(): void {\n  if (strategy.positionSize() == 0 && close > 99.5) strategy.long(\"L\").send();\n  out_close(close);\n  emitRow();\n}\n\nexport function reset(): void {\n  close = NaN;\n}\n```\n\n## 5. Bankruptcy gap\n\nPrice gaps straight through the liquidation level: the fill is the bar price because it is worse, the loss beyond committed margin is recorded as `bankruptcyDeficit`, and equity floors at exactly zero.\n\n```typescript\n// Scenario 5, bankruptcy gap: a gap through the liquidation level fills at the worse bar price, the loss past the margin is the bankruptcy deficit, and equity floors at zero.\nimport { input, line, lower, ohlcv, output } from \"./sdk/declare\";\nimport { in_close } from \"./gen/inputs\";\nimport { emitRow, out_equity } from \"./gen/outputs\";\nimport { strategy } from \"./gen/strategy\";\n\nstrategy({ initialCapital: 10, instrument: \"perps\", leverage: 10, maintenanceMarginPercent: 0.5, qtyType: \"fixed\", qtyValue: 1, slippageBps: 0, makerFeePercent: 0, takerFeePercent: 0, funding: \"off\" });\ninput(\"close\", ohlcv.close);\noutput(\"equity\", line, lower, { description: \"Strategy equity\" });\n\nlet bars: i32 = 0;\n\nexport function init(): void {}\n\nexport function state(): i32 {\n  bars += 1;\n  return 1;\n}\n\nexport function finalize(): void {\n  if (bars == 1) strategy.long(\"L\").send();\n  out_equity(strategy.equity());\n  emitRow();\n}\n\nexport function reset(): void {\n  bars = 0;\n}\n```\n",{"type":13,"children":14,"data":3858,"position":3860},"root",[15,25,28,29,93,94,113,114,149,150,898,899,916,917,971,972,1578,1579,1596,1597,1611,1612,2554,2555,2571,2572,2607,2608,3198,3199,3216,3217,3252,3253],{"type":16,"value":17,"position":18},"comment"," source: docs/indicators/strategies/examples-perps.md; generated by packages/cli/scripts/gen-indicator-docs.ts, do not edit ",{"start":19,"end":22},{"line":20,"column":20,"offset":21},1,0,{"line":20,"column":23,"offset":24},132,131,{"type":26,"value":27},"text","\n",{"type":26,"value":27},{"type":30,"tagName":31,"properties":32,"children":33,"position":90},"element","p",{},[34,43,62,69,83],{"type":26,"value":35,"position":36},"The five canonical perps scripts behind the kScript (legacy) engine's acceptance battery, ported as Indicator files: liquidation on both sides, fee classification, funding erosion and bankruptcy accounting. They are reproduction scripts: each re-derives its pinned number on the fixture bars committed beside the engine's probe (prices near 100), which is what makes it verifiable; on a live chart they simply enter at that chart's prices. The ",{"start":37,"end":40},{"line":38,"column":20,"offset":39},5,171,{"line":38,"column":41,"offset":42},445,615,{"type":30,"tagName":44,"properties":45,"children":47,"position":57},"a",{"href":46},"perps-and-leverage.md",[48],{"type":26,"value":49,"position":50},"perps and leverage",{"start":51,"end":54},{"line":38,"column":52,"offset":53},446,616,{"line":38,"column":55,"offset":56},464,634,{"start":58,"end":59},{"line":38,"column":41,"offset":42},{"line":38,"column":60,"offset":61},488,658,{"type":26,"value":63,"position":64}," page has the formulas and the numbers each must land on. kScript's ",{"start":65,"end":66},{"line":38,"column":60,"offset":61},{"line":38,"column":67,"offset":68},556,726,{"type":30,"tagName":70,"properties":71,"children":72,"position":80},"code",{},[73],{"type":26,"value":74,"position":75},"barIndex == 0",{"start":76,"end":77},{"line":38,"column":67,"offset":68},{"line":38,"column":78,"offset":79},571,741,{"start":81,"end":82},{"line":38,"column":67,"offset":68},{"line":38,"column":78,"offset":79},{"type":26,"value":84,"position":85}," gate becomes a row counter the file keeps itself.",{"start":86,"end":87},{"line":38,"column":78,"offset":79},{"line":38,"column":88,"offset":89},621,791,{"start":91,"end":92},{"line":38,"column":20,"offset":39},{"line":38,"column":88,"offset":89},{"type":26,"value":27},{"type":30,"tagName":95,"properties":96,"children":98,"position":109},"h2",{"id":97},"1.-long-liquidation",[99],{"type":26,"value":100,"position":101},"1. Long liquidation",{"start":102,"end":106},{"line":103,"column":104,"offset":105},7,4,796,{"line":103,"column":107,"offset":108},23,815,{"start":110,"end":112},{"line":103,"column":20,"offset":111},793,{"line":103,"column":107,"offset":108},{"type":26,"value":27},{"type":30,"tagName":31,"properties":115,"children":116,"position":146},{},[117,126,139],{"type":26,"value":118,"position":119},"A 10x long entered at 100 with 0.5% maintenance margin must liquidate at exactly ",{"start":120,"end":123},{"line":121,"column":20,"offset":122},9,817,{"line":121,"column":124,"offset":125},82,898,{"type":30,"tagName":70,"properties":127,"children":128,"position":136},{},[129],{"type":26,"value":130,"position":131},"(100 - 10) / 0.995 = 90.45226130653266",{"start":132,"end":133},{"line":121,"column":124,"offset":125},{"line":121,"column":134,"offset":135},122,938,{"start":137,"end":138},{"line":121,"column":124,"offset":125},{"line":121,"column":134,"offset":135},{"type":26,"value":140,"position":141},".",{"start":142,"end":143},{"line":121,"column":134,"offset":135},{"line":121,"column":144,"offset":145},123,939,{"start":147,"end":148},{"line":121,"column":20,"offset":122},{"line":121,"column":144,"offset":145},{"type":26,"value":27},{"type":13,"children":151},[152],{"type":30,"tagName":153,"properties":154,"children":158,"data":-1},"pre",{"class":155,"style":156,"tabindex":157},"shiki shiki-themes github-dark github-light","--shiki-dark:#e1e4e8;--shiki-light:#24292e;--shiki-dark-bg:#24292e;--shiki-light-bg:#fff","0",[159],{"type":30,"tagName":70,"properties":160,"children":161},{},[162,173,174,205,206,231,232,257,258,283,284,287,288,400,401,424,425,455,456,459,460,497,498,532,533,536,537,574,575,578,579,612,613,636,637,659,660,676,677,685,686,689,690,722,723,778,779,792,793,805,806,813,814,817,818,850,851,870,871,890,891],{"type":30,"tagName":163,"properties":164,"children":166},"span",{"class":165},"line",[167],{"type":30,"tagName":163,"properties":168,"children":170},{"style":169},"--shiki-dark:#6A737D;--shiki-light:#6A737D",[171],{"type":26,"value":172},"// Scenario 1, long liquidation: a 10x long at 100 with 0.5% maintenance margin must liquidate at (100 - 10) / 0.995.",{"type":26,"value":27},{"type":30,"tagName":163,"properties":175,"children":176},{"class":165},[177,183,189,194,200],{"type":30,"tagName":163,"properties":178,"children":180},{"style":179},"--shiki-dark:#F97583;--shiki-light:#D73A49",[181],{"type":26,"value":182},"import",{"type":30,"tagName":163,"properties":184,"children":186},{"style":185},"--shiki-dark:#E1E4E8;--shiki-light:#24292E",[187],{"type":26,"value":188}," { input, line, ohlcv, output, overlay } ",{"type":30,"tagName":163,"properties":190,"children":191},{"style":179},[192],{"type":26,"value":193},"from",{"type":30,"tagName":163,"properties":195,"children":197},{"style":196},"--shiki-dark:#9ECBFF;--shiki-light:#032F62",[198],{"type":26,"value":199}," \"./sdk/declare\"",{"type":30,"tagName":163,"properties":201,"children":202},{"style":185},[203],{"type":26,"value":204},";",{"type":26,"value":27},{"type":30,"tagName":163,"properties":207,"children":208},{"class":165},[209,213,218,222,227],{"type":30,"tagName":163,"properties":210,"children":211},{"style":179},[212],{"type":26,"value":182},{"type":30,"tagName":163,"properties":214,"children":215},{"style":185},[216],{"type":26,"value":217}," { in_close } ",{"type":30,"tagName":163,"properties":219,"children":220},{"style":179},[221],{"type":26,"value":193},{"type":30,"tagName":163,"properties":223,"children":224},{"style":196},[225],{"type":26,"value":226}," \"./gen/inputs\"",{"type":30,"tagName":163,"properties":228,"children":229},{"style":185},[230],{"type":26,"value":204},{"type":26,"value":27},{"type":30,"tagName":163,"properties":233,"children":234},{"class":165},[235,239,244,248,253],{"type":30,"tagName":163,"properties":236,"children":237},{"style":179},[238],{"type":26,"value":182},{"type":30,"tagName":163,"properties":240,"children":241},{"style":185},[242],{"type":26,"value":243}," { emitRow, out_close } ",{"type":30,"tagName":163,"properties":245,"children":246},{"style":179},[247],{"type":26,"value":193},{"type":30,"tagName":163,"properties":249,"children":250},{"style":196},[251],{"type":26,"value":252}," \"./gen/outputs\"",{"type":30,"tagName":163,"properties":254,"children":255},{"style":185},[256],{"type":26,"value":204},{"type":26,"value":27},{"type":30,"tagName":163,"properties":259,"children":260},{"class":165},[261,265,270,274,279],{"type":30,"tagName":163,"properties":262,"children":263},{"style":179},[264],{"type":26,"value":182},{"type":30,"tagName":163,"properties":266,"children":267},{"style":185},[268],{"type":26,"value":269}," { strategy } ",{"type":30,"tagName":163,"properties":271,"children":272},{"style":179},[273],{"type":26,"value":193},{"type":30,"tagName":163,"properties":275,"children":276},{"style":196},[277],{"type":26,"value":278}," \"./gen/strategy\"",{"type":30,"tagName":163,"properties":280,"children":281},{"style":185},[282],{"type":26,"value":204},{"type":26,"value":27},{"type":30,"tagName":163,"properties":285,"children":286},{"class":165},[],{"type":26,"value":27},{"type":30,"tagName":163,"properties":289,"children":290},{"class":165},[291,297,302,308,313,318,323,328,333,338,343,348,353,358,363,367,372,376,381,385,390,395],{"type":30,"tagName":163,"properties":292,"children":294},{"style":293},"--shiki-dark:#B392F0;--shiki-light:#6F42C1",[295],{"type":26,"value":296},"strategy",{"type":30,"tagName":163,"properties":298,"children":299},{"style":185},[300],{"type":26,"value":301},"({ initialCapital: ",{"type":30,"tagName":163,"properties":303,"children":305},{"style":304},"--shiki-dark:#79B8FF;--shiki-light:#005CC5",[306],{"type":26,"value":307},"10000",{"type":30,"tagName":163,"properties":309,"children":310},{"style":185},[311],{"type":26,"value":312},", instrument: ",{"type":30,"tagName":163,"properties":314,"children":315},{"style":196},[316],{"type":26,"value":317},"\"perps\"",{"type":30,"tagName":163,"properties":319,"children":320},{"style":185},[321],{"type":26,"value":322},", leverage: ",{"type":30,"tagName":163,"properties":324,"children":325},{"style":304},[326],{"type":26,"value":327},"10",{"type":30,"tagName":163,"properties":329,"children":330},{"style":185},[331],{"type":26,"value":332},", maintenanceMarginPercent: ",{"type":30,"tagName":163,"properties":334,"children":335},{"style":304},[336],{"type":26,"value":337},"0.5",{"type":30,"tagName":163,"properties":339,"children":340},{"style":185},[341],{"type":26,"value":342},", qtyType: ",{"type":30,"tagName":163,"properties":344,"children":345},{"style":196},[346],{"type":26,"value":347},"\"fixed\"",{"type":30,"tagName":163,"properties":349,"children":350},{"style":185},[351],{"type":26,"value":352},", qtyValue: ",{"type":30,"tagName":163,"properties":354,"children":355},{"style":304},[356],{"type":26,"value":357},"1",{"type":30,"tagName":163,"properties":359,"children":360},{"style":185},[361],{"type":26,"value":362},", slippageBps: ",{"type":30,"tagName":163,"properties":364,"children":365},{"style":304},[366],{"type":26,"value":157},{"type":30,"tagName":163,"properties":368,"children":369},{"style":185},[370],{"type":26,"value":371},", makerFeePercent: ",{"type":30,"tagName":163,"properties":373,"children":374},{"style":304},[375],{"type":26,"value":157},{"type":30,"tagName":163,"properties":377,"children":378},{"style":185},[379],{"type":26,"value":380},", takerFeePercent: ",{"type":30,"tagName":163,"properties":382,"children":383},{"style":304},[384],{"type":26,"value":157},{"type":30,"tagName":163,"properties":386,"children":387},{"style":185},[388],{"type":26,"value":389},", funding: ",{"type":30,"tagName":163,"properties":391,"children":392},{"style":196},[393],{"type":26,"value":394},"\"off\"",{"type":30,"tagName":163,"properties":396,"children":397},{"style":185},[398],{"type":26,"value":399}," });",{"type":26,"value":27},{"type":30,"tagName":163,"properties":402,"children":403},{"class":165},[404,409,414,419],{"type":30,"tagName":163,"properties":405,"children":406},{"style":293},[407],{"type":26,"value":408},"input",{"type":30,"tagName":163,"properties":410,"children":411},{"style":185},[412],{"type":26,"value":413},"(",{"type":30,"tagName":163,"properties":415,"children":416},{"style":196},[417],{"type":26,"value":418},"\"close\"",{"type":30,"tagName":163,"properties":420,"children":421},{"style":185},[422],{"type":26,"value":423},", ohlcv.close);",{"type":26,"value":27},{"type":30,"tagName":163,"properties":426,"children":427},{"class":165},[428,433,437,441,446,451],{"type":30,"tagName":163,"properties":429,"children":430},{"style":293},[431],{"type":26,"value":432},"output",{"type":30,"tagName":163,"properties":434,"children":435},{"style":185},[436],{"type":26,"value":413},{"type":30,"tagName":163,"properties":438,"children":439},{"style":196},[440],{"type":26,"value":418},{"type":30,"tagName":163,"properties":442,"children":443},{"style":185},[444],{"type":26,"value":445},", line, overlay, { description: ",{"type":30,"tagName":163,"properties":447,"children":448},{"style":196},[449],{"type":26,"value":450},"\"Close price\"",{"type":30,"tagName":163,"properties":452,"children":453},{"style":185},[454],{"type":26,"value":399},{"type":26,"value":27},{"type":30,"tagName":163,"properties":457,"children":458},{"class":165},[],{"type":26,"value":27},{"type":30,"tagName":163,"properties":461,"children":462},{"class":165},[463,468,473,478,483,488,493],{"type":30,"tagName":163,"properties":464,"children":465},{"style":179},[466],{"type":26,"value":467},"let",{"type":30,"tagName":163,"properties":469,"children":470},{"style":185},[471],{"type":26,"value":472}," bars",{"type":30,"tagName":163,"properties":474,"children":475},{"style":179},[476],{"type":26,"value":477},":",{"type":30,"tagName":163,"properties":479,"children":480},{"style":293},[481],{"type":26,"value":482}," i32",{"type":30,"tagName":163,"properties":484,"children":485},{"style":179},[486],{"type":26,"value":487}," =",{"type":30,"tagName":163,"properties":489,"children":490},{"style":304},[491],{"type":26,"value":492}," 0",{"type":30,"tagName":163,"properties":494,"children":495},{"style":185},[496],{"type":26,"value":204},{"type":26,"value":27},{"type":30,"tagName":163,"properties":499,"children":500},{"class":165},[501,505,510,514,519,523,528],{"type":30,"tagName":163,"properties":502,"children":503},{"style":179},[504],{"type":26,"value":467},{"type":30,"tagName":163,"properties":506,"children":507},{"style":185},[508],{"type":26,"value":509}," close",{"type":30,"tagName":163,"properties":511,"children":512},{"style":179},[513],{"type":26,"value":477},{"type":30,"tagName":163,"properties":515,"children":516},{"style":293},[517],{"type":26,"value":518}," f64",{"type":30,"tagName":163,"properties":520,"children":521},{"style":179},[522],{"type":26,"value":487},{"type":30,"tagName":163,"properties":524,"children":525},{"style":304},[526],{"type":26,"value":527}," NaN",{"type":30,"tagName":163,"properties":529,"children":530},{"style":185},[531],{"type":26,"value":204},{"type":26,"value":27},{"type":30,"tagName":163,"properties":534,"children":535},{"class":165},[],{"type":26,"value":27},{"type":30,"tagName":163,"properties":538,"children":539},{"class":165},[540,545,550,555,560,564,569],{"type":30,"tagName":163,"properties":541,"children":542},{"style":179},[543],{"type":26,"value":544},"export",{"type":30,"tagName":163,"properties":546,"children":547},{"style":179},[548],{"type":26,"value":549}," function",{"type":30,"tagName":163,"properties":551,"children":552},{"style":293},[553],{"type":26,"value":554}," init",{"type":30,"tagName":163,"properties":556,"children":557},{"style":185},[558],{"type":26,"value":559},"()",{"type":30,"tagName":163,"properties":561,"children":562},{"style":179},[563],{"type":26,"value":477},{"type":30,"tagName":163,"properties":565,"children":566},{"style":304},[567],{"type":26,"value":568}," void",{"type":30,"tagName":163,"properties":570,"children":571},{"style":185},[572],{"type":26,"value":573}," {}",{"type":26,"value":27},{"type":30,"tagName":163,"properties":576,"children":577},{"class":165},[],{"type":26,"value":27},{"type":30,"tagName":163,"properties":580,"children":581},{"class":165},[582,586,590,595,599,603,607],{"type":30,"tagName":163,"properties":583,"children":584},{"style":179},[585],{"type":26,"value":544},{"type":30,"tagName":163,"properties":587,"children":588},{"style":179},[589],{"type":26,"value":549},{"type":30,"tagName":163,"properties":591,"children":592},{"style":293},[593],{"type":26,"value":594}," state",{"type":30,"tagName":163,"properties":596,"children":597},{"style":185},[598],{"type":26,"value":559},{"type":30,"tagName":163,"properties":600,"children":601},{"style":179},[602],{"type":26,"value":477},{"type":30,"tagName":163,"properties":604,"children":605},{"style":293},[606],{"type":26,"value":482},{"type":30,"tagName":163,"properties":608,"children":609},{"style":185},[610],{"type":26,"value":611}," {",{"type":26,"value":27},{"type":30,"tagName":163,"properties":614,"children":615},{"class":165},[616,621,626,631],{"type":30,"tagName":163,"properties":617,"children":618},{"style":185},[619],{"type":26,"value":620},"  close ",{"type":30,"tagName":163,"properties":622,"children":623},{"style":179},[624],{"type":26,"value":625},"=",{"type":30,"tagName":163,"properties":627,"children":628},{"style":293},[629],{"type":26,"value":630}," in_close",{"type":30,"tagName":163,"properties":632,"children":633},{"style":185},[634],{"type":26,"value":635},"();",{"type":26,"value":27},{"type":30,"tagName":163,"properties":638,"children":639},{"class":165},[640,645,650,655],{"type":30,"tagName":163,"properties":641,"children":642},{"style":185},[643],{"type":26,"value":644},"  bars ",{"type":30,"tagName":163,"properties":646,"children":647},{"style":179},[648],{"type":26,"value":649},"+=",{"type":30,"tagName":163,"properties":651,"children":652},{"style":304},[653],{"type":26,"value":654}," 1",{"type":30,"tagName":163,"properties":656,"children":657},{"style":185},[658],{"type":26,"value":204},{"type":26,"value":27},{"type":30,"tagName":163,"properties":661,"children":662},{"class":165},[663,668,672],{"type":30,"tagName":163,"properties":664,"children":665},{"style":179},[666],{"type":26,"value":667},"  return",{"type":30,"tagName":163,"properties":669,"children":670},{"style":304},[671],{"type":26,"value":654},{"type":30,"tagName":163,"properties":673,"children":674},{"style":185},[675],{"type":26,"value":204},{"type":26,"value":27},{"type":30,"tagName":163,"properties":678,"children":679},{"class":165},[680],{"type":30,"tagName":163,"properties":681,"children":682},{"style":185},[683],{"type":26,"value":684},"}",{"type":26,"value":27},{"type":30,"tagName":163,"properties":687,"children":688},{"class":165},[],{"type":26,"value":27},{"type":30,"tagName":163,"properties":691,"children":692},{"class":165},[693,697,701,706,710,714,718],{"type":30,"tagName":163,"properties":694,"children":695},{"style":179},[696],{"type":26,"value":544},{"type":30,"tagName":163,"properties":698,"children":699},{"style":179},[700],{"type":26,"value":549},{"type":30,"tagName":163,"properties":702,"children":703},{"style":293},[704],{"type":26,"value":705}," finalize",{"type":30,"tagName":163,"properties":707,"children":708},{"style":185},[709],{"type":26,"value":559},{"type":30,"tagName":163,"properties":711,"children":712},{"style":179},[713],{"type":26,"value":477},{"type":30,"tagName":163,"properties":715,"children":716},{"style":304},[717],{"type":26,"value":568},{"type":30,"tagName":163,"properties":719,"children":720},{"style":185},[721],{"type":26,"value":611},{"type":26,"value":27},{"type":30,"tagName":163,"properties":724,"children":725},{"class":165},[726,731,736,741,745,750,755,759,764,769,774],{"type":30,"tagName":163,"properties":727,"children":728},{"style":179},[729],{"type":26,"value":730},"  if",{"type":30,"tagName":163,"properties":732,"children":733},{"style":185},[734],{"type":26,"value":735}," (bars ",{"type":30,"tagName":163,"properties":737,"children":738},{"style":179},[739],{"type":26,"value":740},"==",{"type":30,"tagName":163,"properties":742,"children":743},{"style":304},[744],{"type":26,"value":654},{"type":30,"tagName":163,"properties":746,"children":747},{"style":185},[748],{"type":26,"value":749},") strategy.",{"type":30,"tagName":163,"properties":751,"children":752},{"style":293},[753],{"type":26,"value":754},"long",{"type":30,"tagName":163,"properties":756,"children":757},{"style":185},[758],{"type":26,"value":413},{"type":30,"tagName":163,"properties":760,"children":761},{"style":196},[762],{"type":26,"value":763},"\"L\"",{"type":30,"tagName":163,"properties":765,"children":766},{"style":185},[767],{"type":26,"value":768},").",{"type":30,"tagName":163,"properties":770,"children":771},{"style":293},[772],{"type":26,"value":773},"send",{"type":30,"tagName":163,"properties":775,"children":776},{"style":185},[777],{"type":26,"value":635},{"type":26,"value":27},{"type":30,"tagName":163,"properties":780,"children":781},{"class":165},[782,787],{"type":30,"tagName":163,"properties":783,"children":784},{"style":293},[785],{"type":26,"value":786},"  out_close",{"type":30,"tagName":163,"properties":788,"children":789},{"style":185},[790],{"type":26,"value":791},"(close);",{"type":26,"value":27},{"type":30,"tagName":163,"properties":794,"children":795},{"class":165},[796,801],{"type":30,"tagName":163,"properties":797,"children":798},{"style":293},[799],{"type":26,"value":800},"  emitRow",{"type":30,"tagName":163,"properties":802,"children":803},{"style":185},[804],{"type":26,"value":635},{"type":26,"value":27},{"type":30,"tagName":163,"properties":807,"children":808},{"class":165},[809],{"type":30,"tagName":163,"properties":810,"children":811},{"style":185},[812],{"type":26,"value":684},{"type":26,"value":27},{"type":30,"tagName":163,"properties":815,"children":816},{"class":165},[],{"type":26,"value":27},{"type":30,"tagName":163,"properties":819,"children":820},{"class":165},[821,825,829,834,838,842,846],{"type":30,"tagName":163,"properties":822,"children":823},{"style":179},[824],{"type":26,"value":544},{"type":30,"tagName":163,"properties":826,"children":827},{"style":179},[828],{"type":26,"value":549},{"type":30,"tagName":163,"properties":830,"children":831},{"style":293},[832],{"type":26,"value":833}," reset",{"type":30,"tagName":163,"properties":835,"children":836},{"style":185},[837],{"type":26,"value":559},{"type":30,"tagName":163,"properties":839,"children":840},{"style":179},[841],{"type":26,"value":477},{"type":30,"tagName":163,"properties":843,"children":844},{"style":304},[845],{"type":26,"value":568},{"type":30,"tagName":163,"properties":847,"children":848},{"style":185},[849],{"type":26,"value":611},{"type":26,"value":27},{"type":30,"tagName":163,"properties":852,"children":853},{"class":165},[854,858,862,866],{"type":30,"tagName":163,"properties":855,"children":856},{"style":185},[857],{"type":26,"value":644},{"type":30,"tagName":163,"properties":859,"children":860},{"style":179},[861],{"type":26,"value":625},{"type":30,"tagName":163,"properties":863,"children":864},{"style":304},[865],{"type":26,"value":492},{"type":30,"tagName":163,"properties":867,"children":868},{"style":185},[869],{"type":26,"value":204},{"type":26,"value":27},{"type":30,"tagName":163,"properties":872,"children":873},{"class":165},[874,878,882,886],{"type":30,"tagName":163,"properties":875,"children":876},{"style":185},[877],{"type":26,"value":620},{"type":30,"tagName":163,"properties":879,"children":880},{"style":179},[881],{"type":26,"value":625},{"type":30,"tagName":163,"properties":883,"children":884},{"style":304},[885],{"type":26,"value":527},{"type":30,"tagName":163,"properties":887,"children":888},{"style":185},[889],{"type":26,"value":204},{"type":26,"value":27},{"type":30,"tagName":163,"properties":892,"children":893},{"class":165},[894],{"type":30,"tagName":163,"properties":895,"children":896},{"style":185},[897],{"type":26,"value":684},{"type":26,"value":27},{"type":30,"tagName":95,"properties":900,"children":902,"position":912},{"id":901},"2.-short-liquidation-with-taker-fees",[903],{"type":26,"value":904,"position":905},"2. Short liquidation with taker fees",{"start":906,"end":909},{"line":907,"column":104,"offset":908},45,1919,{"line":907,"column":910,"offset":911},40,1955,{"start":913,"end":915},{"line":907,"column":20,"offset":914},1916,{"line":907,"column":910,"offset":911},{"type":26,"value":27},{"type":30,"tagName":31,"properties":918,"children":919,"position":968},{},[920,929,942,949,962],{"type":26,"value":921,"position":922},"The short side of the same formula, ",{"start":923,"end":926},{"line":924,"column":20,"offset":925},47,1957,{"line":924,"column":927,"offset":928},37,1993,{"type":30,"tagName":70,"properties":930,"children":931,"position":939},{},[932],{"type":26,"value":933,"position":934},"(100 + 10) / 1.005 = 109.45273631840797",{"start":935,"end":936},{"line":924,"column":927,"offset":928},{"line":924,"column":937,"offset":938},78,2034,{"start":940,"end":941},{"line":924,"column":927,"offset":928},{"line":924,"column":937,"offset":938},{"type":26,"value":943,"position":944},", with a market entry so both the entry fill and the liquidation fill pay ",{"start":945,"end":946},{"line":924,"column":937,"offset":938},{"line":924,"column":947,"offset":948},152,2108,{"type":30,"tagName":70,"properties":950,"children":951,"position":959},{},[952],{"type":26,"value":953,"position":954},"takerFeePercent",{"start":955,"end":956},{"line":924,"column":947,"offset":948},{"line":924,"column":957,"offset":958},169,2125,{"start":960,"end":961},{"line":924,"column":947,"offset":948},{"line":924,"column":957,"offset":958},{"type":26,"value":140,"position":963},{"start":964,"end":965},{"line":924,"column":957,"offset":958},{"line":924,"column":966,"offset":967},170,2126,{"start":969,"end":970},{"line":924,"column":20,"offset":925},{"line":924,"column":966,"offset":967},{"type":26,"value":27},{"type":13,"children":973},[974],{"type":30,"tagName":153,"properties":975,"children":976,"data":-1},{"class":155,"style":156,"tabindex":157},[977],{"type":30,"tagName":70,"properties":978,"children":979},{},[980,988,989,1012,1013,1036,1037,1060,1061,1084,1085,1088,1089,1165,1166,1185,1186,1213,1214,1217,1218,1249,1250,1253,1254,1285,1286,1289,1290,1321,1322,1341,1342,1357,1358,1365,1366,1369,1370,1401,1402,1482,1483,1494,1495,1506,1507,1514,1515,1518,1519,1550,1551,1570,1571],{"type":30,"tagName":163,"properties":981,"children":982},{"class":165},[983],{"type":30,"tagName":163,"properties":984,"children":985},{"style":169},[986],{"type":26,"value":987},"// Scenario 2, short liquidation with taker fees: the short formula (100 + 10) / 1.005, both fills paying the taker rate.",{"type":26,"value":27},{"type":30,"tagName":163,"properties":990,"children":991},{"class":165},[992,996,1000,1004,1008],{"type":30,"tagName":163,"properties":993,"children":994},{"style":179},[995],{"type":26,"value":182},{"type":30,"tagName":163,"properties":997,"children":998},{"style":185},[999],{"type":26,"value":188},{"type":30,"tagName":163,"properties":1001,"children":1002},{"style":179},[1003],{"type":26,"value":193},{"type":30,"tagName":163,"properties":1005,"children":1006},{"style":196},[1007],{"type":26,"value":199},{"type":30,"tagName":163,"properties":1009,"children":1010},{"style":185},[1011],{"type":26,"value":204},{"type":26,"value":27},{"type":30,"tagName":163,"properties":1014,"children":1015},{"class":165},[1016,1020,1024,1028,1032],{"type":30,"tagName":163,"properties":1017,"children":1018},{"style":179},[1019],{"type":26,"value":182},{"type":30,"tagName":163,"properties":1021,"children":1022},{"style":185},[1023],{"type":26,"value":217},{"type":30,"tagName":163,"properties":1025,"children":1026},{"style":179},[1027],{"type":26,"value":193},{"type":30,"tagName":163,"properties":1029,"children":1030},{"style":196},[1031],{"type":26,"value":226},{"type":30,"tagName":163,"properties":1033,"children":1034},{"style":185},[1035],{"type":26,"value":204},{"type":26,"value":27},{"type":30,"tagName":163,"properties":1038,"children":1039},{"class":165},[1040,1044,1048,1052,1056],{"type":30,"tagName":163,"properties":1041,"children":1042},{"style":179},[1043],{"type":26,"value":182},{"type":30,"tagName":163,"properties":1045,"children":1046},{"style":185},[1047],{"type":26,"value":243},{"type":30,"tagName":163,"properties":1049,"children":1050},{"style":179},[1051],{"type":26,"value":193},{"type":30,"tagName":163,"properties":1053,"children":1054},{"style":196},[1055],{"type":26,"value":252},{"type":30,"tagName":163,"properties":1057,"children":1058},{"style":185},[1059],{"type":26,"value":204},{"type":26,"value":27},{"type":30,"tagName":163,"properties":1062,"children":1063},{"class":165},[1064,1068,1072,1076,1080],{"type":30,"tagName":163,"properties":1065,"children":1066},{"style":179},[1067],{"type":26,"value":182},{"type":30,"tagName":163,"properties":1069,"children":1070},{"style":185},[1071],{"type":26,"value":269},{"type":30,"tagName":163,"properties":1073,"children":1074},{"style":179},[1075],{"type":26,"value":193},{"type":30,"tagName":163,"properties":1077,"children":1078},{"style":196},[1079],{"type":26,"value":278},{"type":30,"tagName":163,"properties":1081,"children":1082},{"style":185},[1083],{"type":26,"value":204},{"type":26,"value":27},{"type":30,"tagName":163,"properties":1086,"children":1087},{"class":165},[],{"type":26,"value":27},{"type":30,"tagName":163,"properties":1090,"children":1091},{"class":165},[1092,1096,1100,1104,1108,1112,1116,1120,1124,1128,1132,1136,1140,1144,1148,1153,1157,1161],{"type":30,"tagName":163,"properties":1093,"children":1094},{"style":293},[1095],{"type":26,"value":296},{"type":30,"tagName":163,"properties":1097,"children":1098},{"style":185},[1099],{"type":26,"value":301},{"type":30,"tagName":163,"properties":1101,"children":1102},{"style":304},[1103],{"type":26,"value":307},{"type":30,"tagName":163,"properties":1105,"children":1106},{"style":185},[1107],{"type":26,"value":342},{"type":30,"tagName":163,"properties":1109,"children":1110},{"style":196},[1111],{"type":26,"value":347},{"type":30,"tagName":163,"properties":1113,"children":1114},{"style":185},[1115],{"type":26,"value":352},{"type":30,"tagName":163,"properties":1117,"children":1118},{"style":304},[1119],{"type":26,"value":357},{"type":30,"tagName":163,"properties":1121,"children":1122},{"style":185},[1123],{"type":26,"value":312},{"type":30,"tagName":163,"properties":1125,"children":1126},{"style":196},[1127],{"type":26,"value":317},{"type":30,"tagName":163,"properties":1129,"children":1130},{"style":185},[1131],{"type":26,"value":322},{"type":30,"tagName":163,"properties":1133,"children":1134},{"style":304},[1135],{"type":26,"value":327},{"type":30,"tagName":163,"properties":1137,"children":1138},{"style":185},[1139],{"type":26,"value":332},{"type":30,"tagName":163,"properties":1141,"children":1142},{"style":304},[1143],{"type":26,"value":337},{"type":30,"tagName":163,"properties":1145,"children":1146},{"style":185},[1147],{"type":26,"value":380},{"type":30,"tagName":163,"properties":1149,"children":1150},{"style":304},[1151],{"type":26,"value":1152},"0.05",{"type":30,"tagName":163,"properties":1154,"children":1155},{"style":185},[1156],{"type":26,"value":389},{"type":30,"tagName":163,"properties":1158,"children":1159},{"style":196},[1160],{"type":26,"value":394},{"type":30,"tagName":163,"properties":1162,"children":1163},{"style":185},[1164],{"type":26,"value":399},{"type":26,"value":27},{"type":30,"tagName":163,"properties":1167,"children":1168},{"class":165},[1169,1173,1177,1181],{"type":30,"tagName":163,"properties":1170,"children":1171},{"style":293},[1172],{"type":26,"value":408},{"type":30,"tagName":163,"properties":1174,"children":1175},{"style":185},[1176],{"type":26,"value":413},{"type":30,"tagName":163,"properties":1178,"children":1179},{"style":196},[1180],{"type":26,"value":418},{"type":30,"tagName":163,"properties":1182,"children":1183},{"style":185},[1184],{"type":26,"value":423},{"type":26,"value":27},{"type":30,"tagName":163,"properties":1187,"children":1188},{"class":165},[1189,1193,1197,1201,1205,1209],{"type":30,"tagName":163,"properties":1190,"children":1191},{"style":293},[1192],{"type":26,"value":432},{"type":30,"tagName":163,"properties":1194,"children":1195},{"style":185},[1196],{"type":26,"value":413},{"type":30,"tagName":163,"properties":1198,"children":1199},{"style":196},[1200],{"type":26,"value":418},{"type":30,"tagName":163,"properties":1202,"children":1203},{"style":185},[1204],{"type":26,"value":445},{"type":30,"tagName":163,"properties":1206,"children":1207},{"style":196},[1208],{"type":26,"value":450},{"type":30,"tagName":163,"properties":1210,"children":1211},{"style":185},[1212],{"type":26,"value":399},{"type":26,"value":27},{"type":30,"tagName":163,"properties":1215,"children":1216},{"class":165},[],{"type":26,"value":27},{"type":30,"tagName":163,"properties":1219,"children":1220},{"class":165},[1221,1225,1229,1233,1237,1241,1245],{"type":30,"tagName":163,"properties":1222,"children":1223},{"style":179},[1224],{"type":26,"value":467},{"type":30,"tagName":163,"properties":1226,"children":1227},{"style":185},[1228],{"type":26,"value":509},{"type":30,"tagName":163,"properties":1230,"children":1231},{"style":179},[1232],{"type":26,"value":477},{"type":30,"tagName":163,"properties":1234,"children":1235},{"style":293},[1236],{"type":26,"value":518},{"type":30,"tagName":163,"properties":1238,"children":1239},{"style":179},[1240],{"type":26,"value":487},{"type":30,"tagName":163,"properties":1242,"children":1243},{"style":304},[1244],{"type":26,"value":527},{"type":30,"tagName":163,"properties":1246,"children":1247},{"style":185},[1248],{"type":26,"value":204},{"type":26,"value":27},{"type":30,"tagName":163,"properties":1251,"children":1252},{"class":165},[],{"type":26,"value":27},{"type":30,"tagName":163,"properties":1255,"children":1256},{"class":165},[1257,1261,1265,1269,1273,1277,1281],{"type":30,"tagName":163,"properties":1258,"children":1259},{"style":179},[1260],{"type":26,"value":544},{"type":30,"tagName":163,"properties":1262,"children":1263},{"style":179},[1264],{"type":26,"value":549},{"type":30,"tagName":163,"properties":1266,"children":1267},{"style":293},[1268],{"type":26,"value":554},{"type":30,"tagName":163,"properties":1270,"children":1271},{"style":185},[1272],{"type":26,"value":559},{"type":30,"tagName":163,"properties":1274,"children":1275},{"style":179},[1276],{"type":26,"value":477},{"type":30,"tagName":163,"properties":1278,"children":1279},{"style":304},[1280],{"type":26,"value":568},{"type":30,"tagName":163,"properties":1282,"children":1283},{"style":185},[1284],{"type":26,"value":573},{"type":26,"value":27},{"type":30,"tagName":163,"properties":1287,"children":1288},{"class":165},[],{"type":26,"value":27},{"type":30,"tagName":163,"properties":1291,"children":1292},{"class":165},[1293,1297,1301,1305,1309,1313,1317],{"type":30,"tagName":163,"properties":1294,"children":1295},{"style":179},[1296],{"type":26,"value":544},{"type":30,"tagName":163,"properties":1298,"children":1299},{"style":179},[1300],{"type":26,"value":549},{"type":30,"tagName":163,"properties":1302,"children":1303},{"style":293},[1304],{"type":26,"value":594},{"type":30,"tagName":163,"properties":1306,"children":1307},{"style":185},[1308],{"type":26,"value":559},{"type":30,"tagName":163,"properties":1310,"children":1311},{"style":179},[1312],{"type":26,"value":477},{"type":30,"tagName":163,"properties":1314,"children":1315},{"style":293},[1316],{"type":26,"value":482},{"type":30,"tagName":163,"properties":1318,"children":1319},{"style":185},[1320],{"type":26,"value":611},{"type":26,"value":27},{"type":30,"tagName":163,"properties":1323,"children":1324},{"class":165},[1325,1329,1333,1337],{"type":30,"tagName":163,"properties":1326,"children":1327},{"style":185},[1328],{"type":26,"value":620},{"type":30,"tagName":163,"properties":1330,"children":1331},{"style":179},[1332],{"type":26,"value":625},{"type":30,"tagName":163,"properties":1334,"children":1335},{"style":293},[1336],{"type":26,"value":630},{"type":30,"tagName":163,"properties":1338,"children":1339},{"style":185},[1340],{"type":26,"value":635},{"type":26,"value":27},{"type":30,"tagName":163,"properties":1343,"children":1344},{"class":165},[1345,1349,1353],{"type":30,"tagName":163,"properties":1346,"children":1347},{"style":179},[1348],{"type":26,"value":667},{"type":30,"tagName":163,"properties":1350,"children":1351},{"style":304},[1352],{"type":26,"value":654},{"type":30,"tagName":163,"properties":1354,"children":1355},{"style":185},[1356],{"type":26,"value":204},{"type":26,"value":27},{"type":30,"tagName":163,"properties":1359,"children":1360},{"class":165},[1361],{"type":30,"tagName":163,"properties":1362,"children":1363},{"style":185},[1364],{"type":26,"value":684},{"type":26,"value":27},{"type":30,"tagName":163,"properties":1367,"children":1368},{"class":165},[],{"type":26,"value":27},{"type":30,"tagName":163,"properties":1371,"children":1372},{"class":165},[1373,1377,1381,1385,1389,1393,1397],{"type":30,"tagName":163,"properties":1374,"children":1375},{"style":179},[1376],{"type":26,"value":544},{"type":30,"tagName":163,"properties":1378,"children":1379},{"style":179},[1380],{"type":26,"value":549},{"type":30,"tagName":163,"properties":1382,"children":1383},{"style":293},[1384],{"type":26,"value":705},{"type":30,"tagName":163,"properties":1386,"children":1387},{"style":185},[1388],{"type":26,"value":559},{"type":30,"tagName":163,"properties":1390,"children":1391},{"style":179},[1392],{"type":26,"value":477},{"type":30,"tagName":163,"properties":1394,"children":1395},{"style":304},[1396],{"type":26,"value":568},{"type":30,"tagName":163,"properties":1398,"children":1399},{"style":185},[1400],{"type":26,"value":611},{"type":26,"value":27},{"type":30,"tagName":163,"properties":1403,"children":1404},{"class":165},[1405,1409,1414,1419,1424,1428,1432,1437,1442,1447,1452,1456,1461,1465,1470,1474,1478],{"type":30,"tagName":163,"properties":1406,"children":1407},{"style":179},[1408],{"type":26,"value":730},{"type":30,"tagName":163,"properties":1410,"children":1411},{"style":185},[1412],{"type":26,"value":1413}," (strategy.",{"type":30,"tagName":163,"properties":1415,"children":1416},{"style":293},[1417],{"type":26,"value":1418},"positionSize",{"type":30,"tagName":163,"properties":1420,"children":1421},{"style":185},[1422],{"type":26,"value":1423},"() ",{"type":30,"tagName":163,"properties":1425,"children":1426},{"style":179},[1427],{"type":26,"value":740},{"type":30,"tagName":163,"properties":1429,"children":1430},{"style":304},[1431],{"type":26,"value":492},{"type":30,"tagName":163,"properties":1433,"children":1434},{"style":179},[1435],{"type":26,"value":1436}," &&",{"type":30,"tagName":163,"properties":1438,"children":1439},{"style":185},[1440],{"type":26,"value":1441}," close ",{"type":30,"tagName":163,"properties":1443,"children":1444},{"style":179},[1445],{"type":26,"value":1446},"\u003C",{"type":30,"tagName":163,"properties":1448,"children":1449},{"style":304},[1450],{"type":26,"value":1451}," 100.5",{"type":30,"tagName":163,"properties":1453,"children":1454},{"style":185},[1455],{"type":26,"value":749},{"type":30,"tagName":163,"properties":1457,"children":1458},{"style":293},[1459],{"type":26,"value":1460},"short",{"type":30,"tagName":163,"properties":1462,"children":1463},{"style":185},[1464],{"type":26,"value":413},{"type":30,"tagName":163,"properties":1466,"children":1467},{"style":196},[1468],{"type":26,"value":1469},"\"S\"",{"type":30,"tagName":163,"properties":1471,"children":1472},{"style":185},[1473],{"type":26,"value":768},{"type":30,"tagName":163,"properties":1475,"children":1476},{"style":293},[1477],{"type":26,"value":773},{"type":30,"tagName":163,"properties":1479,"children":1480},{"style":185},[1481],{"type":26,"value":635},{"type":26,"value":27},{"type":30,"tagName":163,"properties":1484,"children":1485},{"class":165},[1486,1490],{"type":30,"tagName":163,"properties":1487,"children":1488},{"style":293},[1489],{"type":26,"value":786},{"type":30,"tagName":163,"properties":1491,"children":1492},{"style":185},[1493],{"type":26,"value":791},{"type":26,"value":27},{"type":30,"tagName":163,"properties":1496,"children":1497},{"class":165},[1498,1502],{"type":30,"tagName":163,"properties":1499,"children":1500},{"style":293},[1501],{"type":26,"value":800},{"type":30,"tagName":163,"properties":1503,"children":1504},{"style":185},[1505],{"type":26,"value":635},{"type":26,"value":27},{"type":30,"tagName":163,"properties":1508,"children":1509},{"class":165},[1510],{"type":30,"tagName":163,"properties":1511,"children":1512},{"style":185},[1513],{"type":26,"value":684},{"type":26,"value":27},{"type":30,"tagName":163,"properties":1516,"children":1517},{"class":165},[],{"type":26,"value":27},{"type":30,"tagName":163,"properties":1520,"children":1521},{"class":165},[1522,1526,1530,1534,1538,1542,1546],{"type":30,"tagName":163,"properties":1523,"children":1524},{"style":179},[1525],{"type":26,"value":544},{"type":30,"tagName":163,"properties":1527,"children":1528},{"style":179},[1529],{"type":26,"value":549},{"type":30,"tagName":163,"properties":1531,"children":1532},{"style":293},[1533],{"type":26,"value":833},{"type":30,"tagName":163,"properties":1535,"children":1536},{"style":185},[1537],{"type":26,"value":559},{"type":30,"tagName":163,"properties":1539,"children":1540},{"style":179},[1541],{"type":26,"value":477},{"type":30,"tagName":163,"properties":1543,"children":1544},{"style":304},[1545],{"type":26,"value":568},{"type":30,"tagName":163,"properties":1547,"children":1548},{"style":185},[1549],{"type":26,"value":611},{"type":26,"value":27},{"type":30,"tagName":163,"properties":1552,"children":1553},{"class":165},[1554,1558,1562,1566],{"type":30,"tagName":163,"properties":1555,"children":1556},{"style":185},[1557],{"type":26,"value":620},{"type":30,"tagName":163,"properties":1559,"children":1560},{"style":179},[1561],{"type":26,"value":625},{"type":30,"tagName":163,"properties":1563,"children":1564},{"style":304},[1565],{"type":26,"value":527},{"type":30,"tagName":163,"properties":1567,"children":1568},{"style":185},[1569],{"type":26,"value":204},{"type":26,"value":27},{"type":30,"tagName":163,"properties":1572,"children":1573},{"class":165},[1574],{"type":30,"tagName":163,"properties":1575,"children":1576},{"style":185},[1577],{"type":26,"value":684},{"type":26,"value":27},{"type":30,"tagName":95,"properties":1580,"children":1582,"position":1592},{"id":1581},"3.-maker-and-taker-split",[1583],{"type":26,"value":1584,"position":1585},"3. Maker and taker split",{"start":1586,"end":1589},{"line":1587,"column":104,"offset":1588},80,3070,{"line":1587,"column":1590,"offset":1591},28,3094,{"start":1593,"end":1595},{"line":1587,"column":20,"offset":1594},3067,{"line":1587,"column":1590,"offset":1591},{"type":26,"value":27},{"type":30,"tagName":31,"properties":1598,"children":1599,"position":1608},{},[1600],{"type":26,"value":1601,"position":1602},"Two trades, four fills, four fee classifications: a limit entry and its take-profit limit pay maker; a market entry and its protective stop pay taker. Also a guard-design lesson: the file runs at the bar's close, after fills, so entry zones stay disjoint from exit prices or the flat-position guard re-arms on the very bar an exit filled.",{"start":1603,"end":1605},{"line":124,"column":20,"offset":1604},3096,{"line":124,"column":1606,"offset":1607},339,3434,{"start":1609,"end":1610},{"line":124,"column":20,"offset":1604},{"line":124,"column":1606,"offset":1607},{"type":26,"value":27},{"type":13,"children":1613},[1614],{"type":30,"tagName":153,"properties":1615,"children":1616,"data":-1},{"class":155,"style":156,"tabindex":157},[1617],{"type":30,"tagName":70,"properties":1618,"children":1619},{},[1620,1628,1629,1652,1653,1676,1677,1700,1701,1724,1725,1728,1729,1806,1807,1826,1827,1854,1855,1858,1859,1890,1891,1923,1924,1927,1928,1959,1960,1963,1964,1995,1996,2015,2016,2041,2042,2057,2058,2065,2066,2069,2070,2101,2102,2203,2204,2269,2270,2294,2295,2362,2363,2429,2430,2438,2439,2450,2451,2462,2463,2470,2471,2474,2475,2506,2507,2526,2527,2546,2547],{"type":30,"tagName":163,"properties":1621,"children":1622},{"class":165},[1623],{"type":30,"tagName":163,"properties":1624,"children":1625},{"style":169},[1626],{"type":26,"value":1627},"// Scenario 3, maker and taker split: a limit entry and its take-profit pay maker, a market entry and its stop pay taker.",{"type":26,"value":27},{"type":30,"tagName":163,"properties":1630,"children":1631},{"class":165},[1632,1636,1640,1644,1648],{"type":30,"tagName":163,"properties":1633,"children":1634},{"style":179},[1635],{"type":26,"value":182},{"type":30,"tagName":163,"properties":1637,"children":1638},{"style":185},[1639],{"type":26,"value":188},{"type":30,"tagName":163,"properties":1641,"children":1642},{"style":179},[1643],{"type":26,"value":193},{"type":30,"tagName":163,"properties":1645,"children":1646},{"style":196},[1647],{"type":26,"value":199},{"type":30,"tagName":163,"properties":1649,"children":1650},{"style":185},[1651],{"type":26,"value":204},{"type":26,"value":27},{"type":30,"tagName":163,"properties":1654,"children":1655},{"class":165},[1656,1660,1664,1668,1672],{"type":30,"tagName":163,"properties":1657,"children":1658},{"style":179},[1659],{"type":26,"value":182},{"type":30,"tagName":163,"properties":1661,"children":1662},{"style":185},[1663],{"type":26,"value":217},{"type":30,"tagName":163,"properties":1665,"children":1666},{"style":179},[1667],{"type":26,"value":193},{"type":30,"tagName":163,"properties":1669,"children":1670},{"style":196},[1671],{"type":26,"value":226},{"type":30,"tagName":163,"properties":1673,"children":1674},{"style":185},[1675],{"type":26,"value":204},{"type":26,"value":27},{"type":30,"tagName":163,"properties":1678,"children":1679},{"class":165},[1680,1684,1688,1692,1696],{"type":30,"tagName":163,"properties":1681,"children":1682},{"style":179},[1683],{"type":26,"value":182},{"type":30,"tagName":163,"properties":1685,"children":1686},{"style":185},[1687],{"type":26,"value":243},{"type":30,"tagName":163,"properties":1689,"children":1690},{"style":179},[1691],{"type":26,"value":193},{"type":30,"tagName":163,"properties":1693,"children":1694},{"style":196},[1695],{"type":26,"value":252},{"type":30,"tagName":163,"properties":1697,"children":1698},{"style":185},[1699],{"type":26,"value":204},{"type":26,"value":27},{"type":30,"tagName":163,"properties":1702,"children":1703},{"class":165},[1704,1708,1712,1716,1720],{"type":30,"tagName":163,"properties":1705,"children":1706},{"style":179},[1707],{"type":26,"value":182},{"type":30,"tagName":163,"properties":1709,"children":1710},{"style":185},[1711],{"type":26,"value":269},{"type":30,"tagName":163,"properties":1713,"children":1714},{"style":179},[1715],{"type":26,"value":193},{"type":30,"tagName":163,"properties":1717,"children":1718},{"style":196},[1719],{"type":26,"value":278},{"type":30,"tagName":163,"properties":1721,"children":1722},{"style":185},[1723],{"type":26,"value":204},{"type":26,"value":27},{"type":30,"tagName":163,"properties":1726,"children":1727},{"class":165},[],{"type":26,"value":27},{"type":30,"tagName":163,"properties":1730,"children":1731},{"class":165},[1732,1736,1740,1744,1748,1752,1756,1760,1764,1768,1772,1777,1781,1786,1790,1794,1798,1802],{"type":30,"tagName":163,"properties":1733,"children":1734},{"style":293},[1735],{"type":26,"value":296},{"type":30,"tagName":163,"properties":1737,"children":1738},{"style":185},[1739],{"type":26,"value":301},{"type":30,"tagName":163,"properties":1741,"children":1742},{"style":304},[1743],{"type":26,"value":307},{"type":30,"tagName":163,"properties":1745,"children":1746},{"style":185},[1747],{"type":26,"value":342},{"type":30,"tagName":163,"properties":1749,"children":1750},{"style":196},[1751],{"type":26,"value":347},{"type":30,"tagName":163,"properties":1753,"children":1754},{"style":185},[1755],{"type":26,"value":352},{"type":30,"tagName":163,"properties":1757,"children":1758},{"style":304},[1759],{"type":26,"value":357},{"type":30,"tagName":163,"properties":1761,"children":1762},{"style":185},[1763],{"type":26,"value":312},{"type":30,"tagName":163,"properties":1765,"children":1766},{"style":196},[1767],{"type":26,"value":317},{"type":30,"tagName":163,"properties":1769,"children":1770},{"style":185},[1771],{"type":26,"value":322},{"type":30,"tagName":163,"properties":1773,"children":1774},{"style":304},[1775],{"type":26,"value":1776},"5",{"type":30,"tagName":163,"properties":1778,"children":1779},{"style":185},[1780],{"type":26,"value":371},{"type":30,"tagName":163,"properties":1782,"children":1783},{"style":304},[1784],{"type":26,"value":1785},"0.01",{"type":30,"tagName":163,"properties":1787,"children":1788},{"style":185},[1789],{"type":26,"value":380},{"type":30,"tagName":163,"properties":1791,"children":1792},{"style":304},[1793],{"type":26,"value":1152},{"type":30,"tagName":163,"properties":1795,"children":1796},{"style":185},[1797],{"type":26,"value":389},{"type":30,"tagName":163,"properties":1799,"children":1800},{"style":196},[1801],{"type":26,"value":394},{"type":30,"tagName":163,"properties":1803,"children":1804},{"style":185},[1805],{"type":26,"value":399},{"type":26,"value":27},{"type":30,"tagName":163,"properties":1808,"children":1809},{"class":165},[1810,1814,1818,1822],{"type":30,"tagName":163,"properties":1811,"children":1812},{"style":293},[1813],{"type":26,"value":408},{"type":30,"tagName":163,"properties":1815,"children":1816},{"style":185},[1817],{"type":26,"value":413},{"type":30,"tagName":163,"properties":1819,"children":1820},{"style":196},[1821],{"type":26,"value":418},{"type":30,"tagName":163,"properties":1823,"children":1824},{"style":185},[1825],{"type":26,"value":423},{"type":26,"value":27},{"type":30,"tagName":163,"properties":1828,"children":1829},{"class":165},[1830,1834,1838,1842,1846,1850],{"type":30,"tagName":163,"properties":1831,"children":1832},{"style":293},[1833],{"type":26,"value":432},{"type":30,"tagName":163,"properties":1835,"children":1836},{"style":185},[1837],{"type":26,"value":413},{"type":30,"tagName":163,"properties":1839,"children":1840},{"style":196},[1841],{"type":26,"value":418},{"type":30,"tagName":163,"properties":1843,"children":1844},{"style":185},[1845],{"type":26,"value":445},{"type":30,"tagName":163,"properties":1847,"children":1848},{"style":196},[1849],{"type":26,"value":450},{"type":30,"tagName":163,"properties":1851,"children":1852},{"style":185},[1853],{"type":26,"value":399},{"type":26,"value":27},{"type":30,"tagName":163,"properties":1856,"children":1857},{"class":165},[],{"type":26,"value":27},{"type":30,"tagName":163,"properties":1860,"children":1861},{"class":165},[1862,1866,1870,1874,1878,1882,1886],{"type":30,"tagName":163,"properties":1863,"children":1864},{"style":179},[1865],{"type":26,"value":467},{"type":30,"tagName":163,"properties":1867,"children":1868},{"style":185},[1869],{"type":26,"value":509},{"type":30,"tagName":163,"properties":1871,"children":1872},{"style":179},[1873],{"type":26,"value":477},{"type":30,"tagName":163,"properties":1875,"children":1876},{"style":293},[1877],{"type":26,"value":518},{"type":30,"tagName":163,"properties":1879,"children":1880},{"style":179},[1881],{"type":26,"value":487},{"type":30,"tagName":163,"properties":1883,"children":1884},{"style":304},[1885],{"type":26,"value":527},{"type":30,"tagName":163,"properties":1887,"children":1888},{"style":185},[1889],{"type":26,"value":204},{"type":26,"value":27},{"type":30,"tagName":163,"properties":1892,"children":1893},{"class":165},[1894,1898,1903,1907,1911,1915,1919],{"type":30,"tagName":163,"properties":1895,"children":1896},{"style":179},[1897],{"type":26,"value":467},{"type":30,"tagName":163,"properties":1899,"children":1900},{"style":185},[1901],{"type":26,"value":1902}," held",{"type":30,"tagName":163,"properties":1904,"children":1905},{"style":179},[1906],{"type":26,"value":477},{"type":30,"tagName":163,"properties":1908,"children":1909},{"style":293},[1910],{"type":26,"value":518},{"type":30,"tagName":163,"properties":1912,"children":1913},{"style":179},[1914],{"type":26,"value":487},{"type":30,"tagName":163,"properties":1916,"children":1917},{"style":304},[1918],{"type":26,"value":492},{"type":30,"tagName":163,"properties":1920,"children":1921},{"style":185},[1922],{"type":26,"value":204},{"type":26,"value":27},{"type":30,"tagName":163,"properties":1925,"children":1926},{"class":165},[],{"type":26,"value":27},{"type":30,"tagName":163,"properties":1929,"children":1930},{"class":165},[1931,1935,1939,1943,1947,1951,1955],{"type":30,"tagName":163,"properties":1932,"children":1933},{"style":179},[1934],{"type":26,"value":544},{"type":30,"tagName":163,"properties":1936,"children":1937},{"style":179},[1938],{"type":26,"value":549},{"type":30,"tagName":163,"properties":1940,"children":1941},{"style":293},[1942],{"type":26,"value":554},{"type":30,"tagName":163,"properties":1944,"children":1945},{"style":185},[1946],{"type":26,"value":559},{"type":30,"tagName":163,"properties":1948,"children":1949},{"style":179},[1950],{"type":26,"value":477},{"type":30,"tagName":163,"properties":1952,"children":1953},{"style":304},[1954],{"type":26,"value":568},{"type":30,"tagName":163,"properties":1956,"children":1957},{"style":185},[1958],{"type":26,"value":573},{"type":26,"value":27},{"type":30,"tagName":163,"properties":1961,"children":1962},{"class":165},[],{"type":26,"value":27},{"type":30,"tagName":163,"properties":1965,"children":1966},{"class":165},[1967,1971,1975,1979,1983,1987,1991],{"type":30,"tagName":163,"properties":1968,"children":1969},{"style":179},[1970],{"type":26,"value":544},{"type":30,"tagName":163,"properties":1972,"children":1973},{"style":179},[1974],{"type":26,"value":549},{"type":30,"tagName":163,"properties":1976,"children":1977},{"style":293},[1978],{"type":26,"value":594},{"type":30,"tagName":163,"properties":1980,"children":1981},{"style":185},[1982],{"type":26,"value":559},{"type":30,"tagName":163,"properties":1984,"children":1985},{"style":179},[1986],{"type":26,"value":477},{"type":30,"tagName":163,"properties":1988,"children":1989},{"style":293},[1990],{"type":26,"value":482},{"type":30,"tagName":163,"properties":1992,"children":1993},{"style":185},[1994],{"type":26,"value":611},{"type":26,"value":27},{"type":30,"tagName":163,"properties":1997,"children":1998},{"class":165},[1999,2003,2007,2011],{"type":30,"tagName":163,"properties":2000,"children":2001},{"style":185},[2002],{"type":26,"value":620},{"type":30,"tagName":163,"properties":2004,"children":2005},{"style":179},[2006],{"type":26,"value":625},{"type":30,"tagName":163,"properties":2008,"children":2009},{"style":293},[2010],{"type":26,"value":630},{"type":30,"tagName":163,"properties":2012,"children":2013},{"style":185},[2014],{"type":26,"value":635},{"type":26,"value":27},{"type":30,"tagName":163,"properties":2017,"children":2018},{"class":165},[2019,2024,2028,2033,2037],{"type":30,"tagName":163,"properties":2020,"children":2021},{"style":185},[2022],{"type":26,"value":2023},"  held ",{"type":30,"tagName":163,"properties":2025,"children":2026},{"style":179},[2027],{"type":26,"value":625},{"type":30,"tagName":163,"properties":2029,"children":2030},{"style":185},[2031],{"type":26,"value":2032}," strategy.",{"type":30,"tagName":163,"properties":2034,"children":2035},{"style":293},[2036],{"type":26,"value":1418},{"type":30,"tagName":163,"properties":2038,"children":2039},{"style":185},[2040],{"type":26,"value":635},{"type":26,"value":27},{"type":30,"tagName":163,"properties":2043,"children":2044},{"class":165},[2045,2049,2053],{"type":30,"tagName":163,"properties":2046,"children":2047},{"style":179},[2048],{"type":26,"value":667},{"type":30,"tagName":163,"properties":2050,"children":2051},{"style":304},[2052],{"type":26,"value":654},{"type":30,"tagName":163,"properties":2054,"children":2055},{"style":185},[2056],{"type":26,"value":204},{"type":26,"value":27},{"type":30,"tagName":163,"properties":2059,"children":2060},{"class":165},[2061],{"type":30,"tagName":163,"properties":2062,"children":2063},{"style":185},[2064],{"type":26,"value":684},{"type":26,"value":27},{"type":30,"tagName":163,"properties":2067,"children":2068},{"class":165},[],{"type":26,"value":27},{"type":30,"tagName":163,"properties":2071,"children":2072},{"class":165},[2073,2077,2081,2085,2089,2093,2097],{"type":30,"tagName":163,"properties":2074,"children":2075},{"style":179},[2076],{"type":26,"value":544},{"type":30,"tagName":163,"properties":2078,"children":2079},{"style":179},[2080],{"type":26,"value":549},{"type":30,"tagName":163,"properties":2082,"children":2083},{"style":293},[2084],{"type":26,"value":705},{"type":30,"tagName":163,"properties":2086,"children":2087},{"style":185},[2088],{"type":26,"value":559},{"type":30,"tagName":163,"properties":2090,"children":2091},{"style":179},[2092],{"type":26,"value":477},{"type":30,"tagName":163,"properties":2094,"children":2095},{"style":304},[2096],{"type":26,"value":568},{"type":30,"tagName":163,"properties":2098,"children":2099},{"style":185},[2100],{"type":26,"value":611},{"type":26,"value":27},{"type":30,"tagName":163,"properties":2103,"children":2104},{"class":165},[2105,2109,2114,2118,2122,2126,2130,2135,2139,2143,2147,2151,2156,2160,2164,2168,2173,2177,2182,2186,2191,2195,2199],{"type":30,"tagName":163,"properties":2106,"children":2107},{"style":179},[2108],{"type":26,"value":730},{"type":30,"tagName":163,"properties":2110,"children":2111},{"style":185},[2112],{"type":26,"value":2113}," (held ",{"type":30,"tagName":163,"properties":2115,"children":2116},{"style":179},[2117],{"type":26,"value":740},{"type":30,"tagName":163,"properties":2119,"children":2120},{"style":304},[2121],{"type":26,"value":492},{"type":30,"tagName":163,"properties":2123,"children":2124},{"style":179},[2125],{"type":26,"value":1436},{"type":30,"tagName":163,"properties":2127,"children":2128},{"style":185},[2129],{"type":26,"value":1441},{"type":30,"tagName":163,"properties":2131,"children":2132},{"style":179},[2133],{"type":26,"value":2134},">",{"type":30,"tagName":163,"properties":2136,"children":2137},{"style":304},[2138],{"type":26,"value":1451},{"type":30,"tagName":163,"properties":2140,"children":2141},{"style":179},[2142],{"type":26,"value":1436},{"type":30,"tagName":163,"properties":2144,"children":2145},{"style":185},[2146],{"type":26,"value":1441},{"type":30,"tagName":163,"properties":2148,"children":2149},{"style":179},[2150],{"type":26,"value":1446},{"type":30,"tagName":163,"properties":2152,"children":2153},{"style":304},[2154],{"type":26,"value":2155}," 103.0",{"type":30,"tagName":163,"properties":2157,"children":2158},{"style":185},[2159],{"type":26,"value":749},{"type":30,"tagName":163,"properties":2161,"children":2162},{"style":293},[2163],{"type":26,"value":754},{"type":30,"tagName":163,"properties":2165,"children":2166},{"style":185},[2167],{"type":26,"value":413},{"type":30,"tagName":163,"properties":2169,"children":2170},{"style":196},[2171],{"type":26,"value":2172},"\"LimitIn\"",{"type":30,"tagName":163,"properties":2174,"children":2175},{"style":185},[2176],{"type":26,"value":768},{"type":30,"tagName":163,"properties":2178,"children":2179},{"style":293},[2180],{"type":26,"value":2181},"limit",{"type":30,"tagName":163,"properties":2183,"children":2184},{"style":185},[2185],{"type":26,"value":413},{"type":30,"tagName":163,"properties":2187,"children":2188},{"style":304},[2189],{"type":26,"value":2190},"95.0",{"type":30,"tagName":163,"properties":2192,"children":2193},{"style":185},[2194],{"type":26,"value":768},{"type":30,"tagName":163,"properties":2196,"children":2197},{"style":293},[2198],{"type":26,"value":773},{"type":30,"tagName":163,"properties":2200,"children":2201},{"style":185},[2202],{"type":26,"value":635},{"type":26,"value":27},{"type":30,"tagName":163,"properties":2205,"children":2206},{"class":165},[2207,2211,2215,2219,2223,2227,2231,2235,2240,2244,2248,2252,2257,2261,2265],{"type":30,"tagName":163,"properties":2208,"children":2209},{"style":179},[2210],{"type":26,"value":730},{"type":30,"tagName":163,"properties":2212,"children":2213},{"style":185},[2214],{"type":26,"value":2113},{"type":30,"tagName":163,"properties":2216,"children":2217},{"style":179},[2218],{"type":26,"value":740},{"type":30,"tagName":163,"properties":2220,"children":2221},{"style":304},[2222],{"type":26,"value":492},{"type":30,"tagName":163,"properties":2224,"children":2225},{"style":179},[2226],{"type":26,"value":1436},{"type":30,"tagName":163,"properties":2228,"children":2229},{"style":185},[2230],{"type":26,"value":1441},{"type":30,"tagName":163,"properties":2232,"children":2233},{"style":179},[2234],{"type":26,"value":2134},{"type":30,"tagName":163,"properties":2236,"children":2237},{"style":304},[2238],{"type":26,"value":2239}," 110.5",{"type":30,"tagName":163,"properties":2241,"children":2242},{"style":185},[2243],{"type":26,"value":749},{"type":30,"tagName":163,"properties":2245,"children":2246},{"style":293},[2247],{"type":26,"value":754},{"type":30,"tagName":163,"properties":2249,"children":2250},{"style":185},[2251],{"type":26,"value":413},{"type":30,"tagName":163,"properties":2253,"children":2254},{"style":196},[2255],{"type":26,"value":2256},"\"MarketIn\"",{"type":30,"tagName":163,"properties":2258,"children":2259},{"style":185},[2260],{"type":26,"value":768},{"type":30,"tagName":163,"properties":2262,"children":2263},{"style":293},[2264],{"type":26,"value":773},{"type":30,"tagName":163,"properties":2266,"children":2267},{"style":185},[2268],{"type":26,"value":635},{"type":26,"value":27},{"type":30,"tagName":163,"properties":2271,"children":2272},{"class":165},[2273,2277,2281,2285,2289],{"type":30,"tagName":163,"properties":2274,"children":2275},{"style":179},[2276],{"type":26,"value":730},{"type":30,"tagName":163,"properties":2278,"children":2279},{"style":185},[2280],{"type":26,"value":2113},{"type":30,"tagName":163,"properties":2282,"children":2283},{"style":179},[2284],{"type":26,"value":2134},{"type":30,"tagName":163,"properties":2286,"children":2287},{"style":304},[2288],{"type":26,"value":492},{"type":30,"tagName":163,"properties":2290,"children":2291},{"style":185},[2292],{"type":26,"value":2293},") {",{"type":26,"value":27},{"type":30,"tagName":163,"properties":2296,"children":2297},{"class":165},[2298,2303,2308,2312,2317,2321,2325,2329,2333,2337,2341,2345,2350,2354,2358],{"type":30,"tagName":163,"properties":2299,"children":2300},{"style":185},[2301],{"type":26,"value":2302},"    strategy.",{"type":30,"tagName":163,"properties":2304,"children":2305},{"style":293},[2306],{"type":26,"value":2307},"exit",{"type":30,"tagName":163,"properties":2309,"children":2310},{"style":185},[2311],{"type":26,"value":413},{"type":30,"tagName":163,"properties":2313,"children":2314},{"style":196},[2315],{"type":26,"value":2316},"\"TP\"",{"type":30,"tagName":163,"properties":2318,"children":2319},{"style":185},[2320],{"type":26,"value":768},{"type":30,"tagName":163,"properties":2322,"children":2323},{"style":293},[2324],{"type":26,"value":193},{"type":30,"tagName":163,"properties":2326,"children":2327},{"style":185},[2328],{"type":26,"value":413},{"type":30,"tagName":163,"properties":2330,"children":2331},{"style":196},[2332],{"type":26,"value":2172},{"type":30,"tagName":163,"properties":2334,"children":2335},{"style":185},[2336],{"type":26,"value":768},{"type":30,"tagName":163,"properties":2338,"children":2339},{"style":293},[2340],{"type":26,"value":2181},{"type":30,"tagName":163,"properties":2342,"children":2343},{"style":185},[2344],{"type":26,"value":413},{"type":30,"tagName":163,"properties":2346,"children":2347},{"style":304},[2348],{"type":26,"value":2349},"105.0",{"type":30,"tagName":163,"properties":2351,"children":2352},{"style":185},[2353],{"type":26,"value":768},{"type":30,"tagName":163,"properties":2355,"children":2356},{"style":293},[2357],{"type":26,"value":773},{"type":30,"tagName":163,"properties":2359,"children":2360},{"style":185},[2361],{"type":26,"value":635},{"type":26,"value":27},{"type":30,"tagName":163,"properties":2364,"children":2365},{"class":165},[2366,2370,2374,2378,2383,2387,2391,2395,2399,2403,2408,2412,2417,2421,2425],{"type":30,"tagName":163,"properties":2367,"children":2368},{"style":185},[2369],{"type":26,"value":2302},{"type":30,"tagName":163,"properties":2371,"children":2372},{"style":293},[2373],{"type":26,"value":2307},{"type":30,"tagName":163,"properties":2375,"children":2376},{"style":185},[2377],{"type":26,"value":413},{"type":30,"tagName":163,"properties":2379,"children":2380},{"style":196},[2381],{"type":26,"value":2382},"\"SL\"",{"type":30,"tagName":163,"properties":2384,"children":2385},{"style":185},[2386],{"type":26,"value":768},{"type":30,"tagName":163,"properties":2388,"children":2389},{"style":293},[2390],{"type":26,"value":193},{"type":30,"tagName":163,"properties":2392,"children":2393},{"style":185},[2394],{"type":26,"value":413},{"type":30,"tagName":163,"properties":2396,"children":2397},{"style":196},[2398],{"type":26,"value":2256},{"type":30,"tagName":163,"properties":2400,"children":2401},{"style":185},[2402],{"type":26,"value":768},{"type":30,"tagName":163,"properties":2404,"children":2405},{"style":293},[2406],{"type":26,"value":2407},"stop",{"type":30,"tagName":163,"properties":2409,"children":2410},{"style":185},[2411],{"type":26,"value":413},{"type":30,"tagName":163,"properties":2413,"children":2414},{"style":304},[2415],{"type":26,"value":2416},"92.0",{"type":30,"tagName":163,"properties":2418,"children":2419},{"style":185},[2420],{"type":26,"value":768},{"type":30,"tagName":163,"properties":2422,"children":2423},{"style":293},[2424],{"type":26,"value":773},{"type":30,"tagName":163,"properties":2426,"children":2427},{"style":185},[2428],{"type":26,"value":635},{"type":26,"value":27},{"type":30,"tagName":163,"properties":2431,"children":2432},{"class":165},[2433],{"type":30,"tagName":163,"properties":2434,"children":2435},{"style":185},[2436],{"type":26,"value":2437},"  }",{"type":26,"value":27},{"type":30,"tagName":163,"properties":2440,"children":2441},{"class":165},[2442,2446],{"type":30,"tagName":163,"properties":2443,"children":2444},{"style":293},[2445],{"type":26,"value":786},{"type":30,"tagName":163,"properties":2447,"children":2448},{"style":185},[2449],{"type":26,"value":791},{"type":26,"value":27},{"type":30,"tagName":163,"properties":2452,"children":2453},{"class":165},[2454,2458],{"type":30,"tagName":163,"properties":2455,"children":2456},{"style":293},[2457],{"type":26,"value":800},{"type":30,"tagName":163,"properties":2459,"children":2460},{"style":185},[2461],{"type":26,"value":635},{"type":26,"value":27},{"type":30,"tagName":163,"properties":2464,"children":2465},{"class":165},[2466],{"type":30,"tagName":163,"properties":2467,"children":2468},{"style":185},[2469],{"type":26,"value":684},{"type":26,"value":27},{"type":30,"tagName":163,"properties":2472,"children":2473},{"class":165},[],{"type":26,"value":27},{"type":30,"tagName":163,"properties":2476,"children":2477},{"class":165},[2478,2482,2486,2490,2494,2498,2502],{"type":30,"tagName":163,"properties":2479,"children":2480},{"style":179},[2481],{"type":26,"value":544},{"type":30,"tagName":163,"properties":2483,"children":2484},{"style":179},[2485],{"type":26,"value":549},{"type":30,"tagName":163,"properties":2487,"children":2488},{"style":293},[2489],{"type":26,"value":833},{"type":30,"tagName":163,"properties":2491,"children":2492},{"style":185},[2493],{"type":26,"value":559},{"type":30,"tagName":163,"properties":2495,"children":2496},{"style":179},[2497],{"type":26,"value":477},{"type":30,"tagName":163,"properties":2499,"children":2500},{"style":304},[2501],{"type":26,"value":568},{"type":30,"tagName":163,"properties":2503,"children":2504},{"style":185},[2505],{"type":26,"value":611},{"type":26,"value":27},{"type":30,"tagName":163,"properties":2508,"children":2509},{"class":165},[2510,2514,2518,2522],{"type":30,"tagName":163,"properties":2511,"children":2512},{"style":185},[2513],{"type":26,"value":620},{"type":30,"tagName":163,"properties":2515,"children":2516},{"style":179},[2517],{"type":26,"value":625},{"type":30,"tagName":163,"properties":2519,"children":2520},{"style":304},[2521],{"type":26,"value":527},{"type":30,"tagName":163,"properties":2523,"children":2524},{"style":185},[2525],{"type":26,"value":204},{"type":26,"value":27},{"type":30,"tagName":163,"properties":2528,"children":2529},{"class":165},[2530,2534,2538,2542],{"type":30,"tagName":163,"properties":2531,"children":2532},{"style":185},[2533],{"type":26,"value":2023},{"type":30,"tagName":163,"properties":2535,"children":2536},{"style":179},[2537],{"type":26,"value":625},{"type":30,"tagName":163,"properties":2539,"children":2540},{"style":304},[2541],{"type":26,"value":492},{"type":30,"tagName":163,"properties":2543,"children":2544},{"style":185},[2545],{"type":26,"value":204},{"type":26,"value":27},{"type":30,"tagName":163,"properties":2548,"children":2549},{"class":165},[2550],{"type":30,"tagName":163,"properties":2551,"children":2552},{"style":185},[2553],{"type":26,"value":684},{"type":26,"value":27},{"type":30,"tagName":95,"properties":2556,"children":2558,"position":2567},{"id":2557},"4.-funding-erosion",[2559],{"type":26,"value":2560,"position":2561},"4. Funding erosion",{"start":2562,"end":2564},{"line":144,"column":104,"offset":2563},4660,{"line":144,"column":2565,"offset":2566},22,4678,{"start":2568,"end":2570},{"line":144,"column":20,"offset":2569},4657,{"line":144,"column":2565,"offset":2566},{"type":26,"value":27},{"type":30,"tagName":31,"properties":2573,"children":2574,"position":2604},{},[2575,2584,2597],{"type":26,"value":2576,"position":2577},"Funding settles against the isolated margin: each settlement debits cash and committed margin together, the liquidation price tightens as margin erodes, and a settlement that depletes margin liquidates the position at that bar's open with zero price PnL. This release attaches no funding provider, so the port counts every unsettled open bar in ",{"start":2578,"end":2581},{"line":2579,"column":20,"offset":2580},125,4680,{"line":2579,"column":2582,"offset":2583},346,5025,{"type":30,"tagName":70,"properties":2585,"children":2586,"position":2594},{},[2587],{"type":26,"value":2588,"position":2589},"fundingUnavailableCount",{"start":2590,"end":2591},{"line":2579,"column":2582,"offset":2583},{"line":2579,"column":2592,"offset":2593},371,5050,{"start":2595,"end":2596},{"line":2579,"column":2582,"offset":2583},{"line":2579,"column":2592,"offset":2593},{"type":26,"value":2598,"position":2599}," and charges nothing; the numbers reproduce once a provider lands.",{"start":2600,"end":2601},{"line":2579,"column":2592,"offset":2593},{"line":2579,"column":2602,"offset":2603},437,5116,{"start":2605,"end":2606},{"line":2579,"column":20,"offset":2580},{"line":2579,"column":2602,"offset":2603},{"type":26,"value":27},{"type":13,"children":2609},[2610],{"type":30,"tagName":153,"properties":2611,"children":2612,"data":-1},{"class":155,"style":156,"tabindex":157},[2613],{"type":30,"tagName":70,"properties":2614,"children":2615},{},[2616,2624,2625,2648,2649,2672,2673,2696,2697,2720,2721,2724,2725,2793,2794,2813,2814,2841,2842,2845,2846,2877,2878,2881,2882,2913,2914,2917,2918,2949,2950,2969,2970,2985,2986,2993,2994,2997,2998,3029,3030,3102,3103,3114,3115,3126,3127,3134,3135,3138,3139,3170,3171,3190,3191],{"type":30,"tagName":163,"properties":2617,"children":2618},{"class":165},[2619],{"type":30,"tagName":163,"properties":2620,"children":2621},{"style":169},[2622],{"type":26,"value":2623},"// Scenario 4, funding erosion: settlements debit cash and committed margin together, and a depleting settlement liquidates at that bar's open.",{"type":26,"value":27},{"type":30,"tagName":163,"properties":2626,"children":2627},{"class":165},[2628,2632,2636,2640,2644],{"type":30,"tagName":163,"properties":2629,"children":2630},{"style":179},[2631],{"type":26,"value":182},{"type":30,"tagName":163,"properties":2633,"children":2634},{"style":185},[2635],{"type":26,"value":188},{"type":30,"tagName":163,"properties":2637,"children":2638},{"style":179},[2639],{"type":26,"value":193},{"type":30,"tagName":163,"properties":2641,"children":2642},{"style":196},[2643],{"type":26,"value":199},{"type":30,"tagName":163,"properties":2645,"children":2646},{"style":185},[2647],{"type":26,"value":204},{"type":26,"value":27},{"type":30,"tagName":163,"properties":2650,"children":2651},{"class":165},[2652,2656,2660,2664,2668],{"type":30,"tagName":163,"properties":2653,"children":2654},{"style":179},[2655],{"type":26,"value":182},{"type":30,"tagName":163,"properties":2657,"children":2658},{"style":185},[2659],{"type":26,"value":217},{"type":30,"tagName":163,"properties":2661,"children":2662},{"style":179},[2663],{"type":26,"value":193},{"type":30,"tagName":163,"properties":2665,"children":2666},{"style":196},[2667],{"type":26,"value":226},{"type":30,"tagName":163,"properties":2669,"children":2670},{"style":185},[2671],{"type":26,"value":204},{"type":26,"value":27},{"type":30,"tagName":163,"properties":2674,"children":2675},{"class":165},[2676,2680,2684,2688,2692],{"type":30,"tagName":163,"properties":2677,"children":2678},{"style":179},[2679],{"type":26,"value":182},{"type":30,"tagName":163,"properties":2681,"children":2682},{"style":185},[2683],{"type":26,"value":243},{"type":30,"tagName":163,"properties":2685,"children":2686},{"style":179},[2687],{"type":26,"value":193},{"type":30,"tagName":163,"properties":2689,"children":2690},{"style":196},[2691],{"type":26,"value":252},{"type":30,"tagName":163,"properties":2693,"children":2694},{"style":185},[2695],{"type":26,"value":204},{"type":26,"value":27},{"type":30,"tagName":163,"properties":2698,"children":2699},{"class":165},[2700,2704,2708,2712,2716],{"type":30,"tagName":163,"properties":2701,"children":2702},{"style":179},[2703],{"type":26,"value":182},{"type":30,"tagName":163,"properties":2705,"children":2706},{"style":185},[2707],{"type":26,"value":269},{"type":30,"tagName":163,"properties":2709,"children":2710},{"style":179},[2711],{"type":26,"value":193},{"type":30,"tagName":163,"properties":2713,"children":2714},{"style":196},[2715],{"type":26,"value":278},{"type":30,"tagName":163,"properties":2717,"children":2718},{"style":185},[2719],{"type":26,"value":204},{"type":26,"value":27},{"type":30,"tagName":163,"properties":2722,"children":2723},{"class":165},[],{"type":26,"value":27},{"type":30,"tagName":163,"properties":2726,"children":2727},{"class":165},[2728,2732,2736,2740,2744,2748,2752,2756,2760,2764,2768,2772,2776,2780,2784,2789],{"type":30,"tagName":163,"properties":2729,"children":2730},{"style":293},[2731],{"type":26,"value":296},{"type":30,"tagName":163,"properties":2733,"children":2734},{"style":185},[2735],{"type":26,"value":301},{"type":30,"tagName":163,"properties":2737,"children":2738},{"style":304},[2739],{"type":26,"value":307},{"type":30,"tagName":163,"properties":2741,"children":2742},{"style":185},[2743],{"type":26,"value":342},{"type":30,"tagName":163,"properties":2745,"children":2746},{"style":196},[2747],{"type":26,"value":347},{"type":30,"tagName":163,"properties":2749,"children":2750},{"style":185},[2751],{"type":26,"value":352},{"type":30,"tagName":163,"properties":2753,"children":2754},{"style":304},[2755],{"type":26,"value":357},{"type":30,"tagName":163,"properties":2757,"children":2758},{"style":185},[2759],{"type":26,"value":312},{"type":30,"tagName":163,"properties":2761,"children":2762},{"style":196},[2763],{"type":26,"value":317},{"type":30,"tagName":163,"properties":2765,"children":2766},{"style":185},[2767],{"type":26,"value":322},{"type":30,"tagName":163,"properties":2769,"children":2770},{"style":304},[2771],{"type":26,"value":327},{"type":30,"tagName":163,"properties":2773,"children":2774},{"style":185},[2775],{"type":26,"value":332},{"type":30,"tagName":163,"properties":2777,"children":2778},{"style":304},[2779],{"type":26,"value":337},{"type":30,"tagName":163,"properties":2781,"children":2782},{"style":185},[2783],{"type":26,"value":389},{"type":30,"tagName":163,"properties":2785,"children":2786},{"style":196},[2787],{"type":26,"value":2788},"\"data\"",{"type":30,"tagName":163,"properties":2790,"children":2791},{"style":185},[2792],{"type":26,"value":399},{"type":26,"value":27},{"type":30,"tagName":163,"properties":2795,"children":2796},{"class":165},[2797,2801,2805,2809],{"type":30,"tagName":163,"properties":2798,"children":2799},{"style":293},[2800],{"type":26,"value":408},{"type":30,"tagName":163,"properties":2802,"children":2803},{"style":185},[2804],{"type":26,"value":413},{"type":30,"tagName":163,"properties":2806,"children":2807},{"style":196},[2808],{"type":26,"value":418},{"type":30,"tagName":163,"properties":2810,"children":2811},{"style":185},[2812],{"type":26,"value":423},{"type":26,"value":27},{"type":30,"tagName":163,"properties":2815,"children":2816},{"class":165},[2817,2821,2825,2829,2833,2837],{"type":30,"tagName":163,"properties":2818,"children":2819},{"style":293},[2820],{"type":26,"value":432},{"type":30,"tagName":163,"properties":2822,"children":2823},{"style":185},[2824],{"type":26,"value":413},{"type":30,"tagName":163,"properties":2826,"children":2827},{"style":196},[2828],{"type":26,"value":418},{"type":30,"tagName":163,"properties":2830,"children":2831},{"style":185},[2832],{"type":26,"value":445},{"type":30,"tagName":163,"properties":2834,"children":2835},{"style":196},[2836],{"type":26,"value":450},{"type":30,"tagName":163,"properties":2838,"children":2839},{"style":185},[2840],{"type":26,"value":399},{"type":26,"value":27},{"type":30,"tagName":163,"properties":2843,"children":2844},{"class":165},[],{"type":26,"value":27},{"type":30,"tagName":163,"properties":2847,"children":2848},{"class":165},[2849,2853,2857,2861,2865,2869,2873],{"type":30,"tagName":163,"properties":2850,"children":2851},{"style":179},[2852],{"type":26,"value":467},{"type":30,"tagName":163,"properties":2854,"children":2855},{"style":185},[2856],{"type":26,"value":509},{"type":30,"tagName":163,"properties":2858,"children":2859},{"style":179},[2860],{"type":26,"value":477},{"type":30,"tagName":163,"properties":2862,"children":2863},{"style":293},[2864],{"type":26,"value":518},{"type":30,"tagName":163,"properties":2866,"children":2867},{"style":179},[2868],{"type":26,"value":487},{"type":30,"tagName":163,"properties":2870,"children":2871},{"style":304},[2872],{"type":26,"value":527},{"type":30,"tagName":163,"properties":2874,"children":2875},{"style":185},[2876],{"type":26,"value":204},{"type":26,"value":27},{"type":30,"tagName":163,"properties":2879,"children":2880},{"class":165},[],{"type":26,"value":27},{"type":30,"tagName":163,"properties":2883,"children":2884},{"class":165},[2885,2889,2893,2897,2901,2905,2909],{"type":30,"tagName":163,"properties":2886,"children":2887},{"style":179},[2888],{"type":26,"value":544},{"type":30,"tagName":163,"properties":2890,"children":2891},{"style":179},[2892],{"type":26,"value":549},{"type":30,"tagName":163,"properties":2894,"children":2895},{"style":293},[2896],{"type":26,"value":554},{"type":30,"tagName":163,"properties":2898,"children":2899},{"style":185},[2900],{"type":26,"value":559},{"type":30,"tagName":163,"properties":2902,"children":2903},{"style":179},[2904],{"type":26,"value":477},{"type":30,"tagName":163,"properties":2906,"children":2907},{"style":304},[2908],{"type":26,"value":568},{"type":30,"tagName":163,"properties":2910,"children":2911},{"style":185},[2912],{"type":26,"value":573},{"type":26,"value":27},{"type":30,"tagName":163,"properties":2915,"children":2916},{"class":165},[],{"type":26,"value":27},{"type":30,"tagName":163,"properties":2919,"children":2920},{"class":165},[2921,2925,2929,2933,2937,2941,2945],{"type":30,"tagName":163,"properties":2922,"children":2923},{"style":179},[2924],{"type":26,"value":544},{"type":30,"tagName":163,"properties":2926,"children":2927},{"style":179},[2928],{"type":26,"value":549},{"type":30,"tagName":163,"properties":2930,"children":2931},{"style":293},[2932],{"type":26,"value":594},{"type":30,"tagName":163,"properties":2934,"children":2935},{"style":185},[2936],{"type":26,"value":559},{"type":30,"tagName":163,"properties":2938,"children":2939},{"style":179},[2940],{"type":26,"value":477},{"type":30,"tagName":163,"properties":2942,"children":2943},{"style":293},[2944],{"type":26,"value":482},{"type":30,"tagName":163,"properties":2946,"children":2947},{"style":185},[2948],{"type":26,"value":611},{"type":26,"value":27},{"type":30,"tagName":163,"properties":2951,"children":2952},{"class":165},[2953,2957,2961,2965],{"type":30,"tagName":163,"properties":2954,"children":2955},{"style":185},[2956],{"type":26,"value":620},{"type":30,"tagName":163,"properties":2958,"children":2959},{"style":179},[2960],{"type":26,"value":625},{"type":30,"tagName":163,"properties":2962,"children":2963},{"style":293},[2964],{"type":26,"value":630},{"type":30,"tagName":163,"properties":2966,"children":2967},{"style":185},[2968],{"type":26,"value":635},{"type":26,"value":27},{"type":30,"tagName":163,"properties":2971,"children":2972},{"class":165},[2973,2977,2981],{"type":30,"tagName":163,"properties":2974,"children":2975},{"style":179},[2976],{"type":26,"value":667},{"type":30,"tagName":163,"properties":2978,"children":2979},{"style":304},[2980],{"type":26,"value":654},{"type":30,"tagName":163,"properties":2982,"children":2983},{"style":185},[2984],{"type":26,"value":204},{"type":26,"value":27},{"type":30,"tagName":163,"properties":2987,"children":2988},{"class":165},[2989],{"type":30,"tagName":163,"properties":2990,"children":2991},{"style":185},[2992],{"type":26,"value":684},{"type":26,"value":27},{"type":30,"tagName":163,"properties":2995,"children":2996},{"class":165},[],{"type":26,"value":27},{"type":30,"tagName":163,"properties":2999,"children":3000},{"class":165},[3001,3005,3009,3013,3017,3021,3025],{"type":30,"tagName":163,"properties":3002,"children":3003},{"style":179},[3004],{"type":26,"value":544},{"type":30,"tagName":163,"properties":3006,"children":3007},{"style":179},[3008],{"type":26,"value":549},{"type":30,"tagName":163,"properties":3010,"children":3011},{"style":293},[3012],{"type":26,"value":705},{"type":30,"tagName":163,"properties":3014,"children":3015},{"style":185},[3016],{"type":26,"value":559},{"type":30,"tagName":163,"properties":3018,"children":3019},{"style":179},[3020],{"type":26,"value":477},{"type":30,"tagName":163,"properties":3022,"children":3023},{"style":304},[3024],{"type":26,"value":568},{"type":30,"tagName":163,"properties":3026,"children":3027},{"style":185},[3028],{"type":26,"value":611},{"type":26,"value":27},{"type":30,"tagName":163,"properties":3031,"children":3032},{"class":165},[3033,3037,3041,3045,3049,3053,3057,3061,3065,3069,3074,3078,3082,3086,3090,3094,3098],{"type":30,"tagName":163,"properties":3034,"children":3035},{"style":179},[3036],{"type":26,"value":730},{"type":30,"tagName":163,"properties":3038,"children":3039},{"style":185},[3040],{"type":26,"value":1413},{"type":30,"tagName":163,"properties":3042,"children":3043},{"style":293},[3044],{"type":26,"value":1418},{"type":30,"tagName":163,"properties":3046,"children":3047},{"style":185},[3048],{"type":26,"value":1423},{"type":30,"tagName":163,"properties":3050,"children":3051},{"style":179},[3052],{"type":26,"value":740},{"type":30,"tagName":163,"properties":3054,"children":3055},{"style":304},[3056],{"type":26,"value":492},{"type":30,"tagName":163,"properties":3058,"children":3059},{"style":179},[3060],{"type":26,"value":1436},{"type":30,"tagName":163,"properties":3062,"children":3063},{"style":185},[3064],{"type":26,"value":1441},{"type":30,"tagName":163,"properties":3066,"children":3067},{"style":179},[3068],{"type":26,"value":2134},{"type":30,"tagName":163,"properties":3070,"children":3071},{"style":304},[3072],{"type":26,"value":3073}," 99.5",{"type":30,"tagName":163,"properties":3075,"children":3076},{"style":185},[3077],{"type":26,"value":749},{"type":30,"tagName":163,"properties":3079,"children":3080},{"style":293},[3081],{"type":26,"value":754},{"type":30,"tagName":163,"properties":3083,"children":3084},{"style":185},[3085],{"type":26,"value":413},{"type":30,"tagName":163,"properties":3087,"children":3088},{"style":196},[3089],{"type":26,"value":763},{"type":30,"tagName":163,"properties":3091,"children":3092},{"style":185},[3093],{"type":26,"value":768},{"type":30,"tagName":163,"properties":3095,"children":3096},{"style":293},[3097],{"type":26,"value":773},{"type":30,"tagName":163,"properties":3099,"children":3100},{"style":185},[3101],{"type":26,"value":635},{"type":26,"value":27},{"type":30,"tagName":163,"properties":3104,"children":3105},{"class":165},[3106,3110],{"type":30,"tagName":163,"properties":3107,"children":3108},{"style":293},[3109],{"type":26,"value":786},{"type":30,"tagName":163,"properties":3111,"children":3112},{"style":185},[3113],{"type":26,"value":791},{"type":26,"value":27},{"type":30,"tagName":163,"properties":3116,"children":3117},{"class":165},[3118,3122],{"type":30,"tagName":163,"properties":3119,"children":3120},{"style":293},[3121],{"type":26,"value":800},{"type":30,"tagName":163,"properties":3123,"children":3124},{"style":185},[3125],{"type":26,"value":635},{"type":26,"value":27},{"type":30,"tagName":163,"properties":3128,"children":3129},{"class":165},[3130],{"type":30,"tagName":163,"properties":3131,"children":3132},{"style":185},[3133],{"type":26,"value":684},{"type":26,"value":27},{"type":30,"tagName":163,"properties":3136,"children":3137},{"class":165},[],{"type":26,"value":27},{"type":30,"tagName":163,"properties":3140,"children":3141},{"class":165},[3142,3146,3150,3154,3158,3162,3166],{"type":30,"tagName":163,"properties":3143,"children":3144},{"style":179},[3145],{"type":26,"value":544},{"type":30,"tagName":163,"properties":3147,"children":3148},{"style":179},[3149],{"type":26,"value":549},{"type":30,"tagName":163,"properties":3151,"children":3152},{"style":293},[3153],{"type":26,"value":833},{"type":30,"tagName":163,"properties":3155,"children":3156},{"style":185},[3157],{"type":26,"value":559},{"type":30,"tagName":163,"properties":3159,"children":3160},{"style":179},[3161],{"type":26,"value":477},{"type":30,"tagName":163,"properties":3163,"children":3164},{"style":304},[3165],{"type":26,"value":568},{"type":30,"tagName":163,"properties":3167,"children":3168},{"style":185},[3169],{"type":26,"value":611},{"type":26,"value":27},{"type":30,"tagName":163,"properties":3172,"children":3173},{"class":165},[3174,3178,3182,3186],{"type":30,"tagName":163,"properties":3175,"children":3176},{"style":185},[3177],{"type":26,"value":620},{"type":30,"tagName":163,"properties":3179,"children":3180},{"style":179},[3181],{"type":26,"value":625},{"type":30,"tagName":163,"properties":3183,"children":3184},{"style":304},[3185],{"type":26,"value":527},{"type":30,"tagName":163,"properties":3187,"children":3188},{"style":185},[3189],{"type":26,"value":204},{"type":26,"value":27},{"type":30,"tagName":163,"properties":3192,"children":3193},{"class":165},[3194],{"type":30,"tagName":163,"properties":3195,"children":3196},{"style":185},[3197],{"type":26,"value":684},{"type":26,"value":27},{"type":30,"tagName":95,"properties":3200,"children":3202,"position":3212},{"id":3201},"5.-bankruptcy-gap",[3203],{"type":26,"value":3204,"position":3205},"5. Bankruptcy gap",{"start":3206,"end":3209},{"line":3207,"column":104,"offset":3208},158,6058,{"line":3207,"column":3210,"offset":3211},21,6075,{"start":3213,"end":3215},{"line":3207,"column":20,"offset":3214},6055,{"line":3207,"column":3210,"offset":3211},{"type":26,"value":27},{"type":30,"tagName":31,"properties":3218,"children":3219,"position":3249},{},[3220,3229,3242],{"type":26,"value":3221,"position":3222},"Price gaps straight through the liquidation level: the fill is the bar price because it is worse, the loss beyond committed margin is recorded as ",{"start":3223,"end":3226},{"line":3224,"column":20,"offset":3225},160,6077,{"line":3224,"column":3227,"offset":3228},147,6223,{"type":30,"tagName":70,"properties":3230,"children":3231,"position":3239},{},[3232],{"type":26,"value":3233,"position":3234},"bankruptcyDeficit",{"start":3235,"end":3236},{"line":3224,"column":3227,"offset":3228},{"line":3224,"column":3237,"offset":3238},166,6242,{"start":3240,"end":3241},{"line":3224,"column":3227,"offset":3228},{"line":3224,"column":3237,"offset":3238},{"type":26,"value":3243,"position":3244},", and equity floors at exactly zero.",{"start":3245,"end":3246},{"line":3224,"column":3237,"offset":3238},{"line":3224,"column":3247,"offset":3248},202,6278,{"start":3250,"end":3251},{"line":3224,"column":20,"offset":3225},{"line":3224,"column":3247,"offset":3248},{"type":26,"value":27},{"type":13,"children":3254},[3255],{"type":30,"tagName":153,"properties":3256,"children":3257,"data":-1},{"class":155,"style":156,"tabindex":157},[3258],{"type":30,"tagName":70,"properties":3259,"children":3260},{},[3261,3269,3270,3294,3295,3318,3319,3343,3344,3367,3368,3371,3372,3463,3464,3483,3484,3514,3515,3518,3519,3550,3551,3554,3555,3586,3587,3590,3591,3622,3623,3642,3643,3658,3659,3666,3667,3670,3671,3702,3703,3750,3751,3774,3775,3786,3787,3794,3795,3798,3799,3830,3831,3850,3851],{"type":30,"tagName":163,"properties":3262,"children":3263},{"class":165},[3264],{"type":30,"tagName":163,"properties":3265,"children":3266},{"style":169},[3267],{"type":26,"value":3268},"// Scenario 5, bankruptcy gap: a gap through the liquidation level fills at the worse bar price, the loss past the margin is the bankruptcy deficit, and equity floors at zero.",{"type":26,"value":27},{"type":30,"tagName":163,"properties":3271,"children":3272},{"class":165},[3273,3277,3282,3286,3290],{"type":30,"tagName":163,"properties":3274,"children":3275},{"style":179},[3276],{"type":26,"value":182},{"type":30,"tagName":163,"properties":3278,"children":3279},{"style":185},[3280],{"type":26,"value":3281}," { input, line, lower, ohlcv, output } ",{"type":30,"tagName":163,"properties":3283,"children":3284},{"style":179},[3285],{"type":26,"value":193},{"type":30,"tagName":163,"properties":3287,"children":3288},{"style":196},[3289],{"type":26,"value":199},{"type":30,"tagName":163,"properties":3291,"children":3292},{"style":185},[3293],{"type":26,"value":204},{"type":26,"value":27},{"type":30,"tagName":163,"properties":3296,"children":3297},{"class":165},[3298,3302,3306,3310,3314],{"type":30,"tagName":163,"properties":3299,"children":3300},{"style":179},[3301],{"type":26,"value":182},{"type":30,"tagName":163,"properties":3303,"children":3304},{"style":185},[3305],{"type":26,"value":217},{"type":30,"tagName":163,"properties":3307,"children":3308},{"style":179},[3309],{"type":26,"value":193},{"type":30,"tagName":163,"properties":3311,"children":3312},{"style":196},[3313],{"type":26,"value":226},{"type":30,"tagName":163,"properties":3315,"children":3316},{"style":185},[3317],{"type":26,"value":204},{"type":26,"value":27},{"type":30,"tagName":163,"properties":3320,"children":3321},{"class":165},[3322,3326,3331,3335,3339],{"type":30,"tagName":163,"properties":3323,"children":3324},{"style":179},[3325],{"type":26,"value":182},{"type":30,"tagName":163,"properties":3327,"children":3328},{"style":185},[3329],{"type":26,"value":3330}," { emitRow, out_equity } ",{"type":30,"tagName":163,"properties":3332,"children":3333},{"style":179},[3334],{"type":26,"value":193},{"type":30,"tagName":163,"properties":3336,"children":3337},{"style":196},[3338],{"type":26,"value":252},{"type":30,"tagName":163,"properties":3340,"children":3341},{"style":185},[3342],{"type":26,"value":204},{"type":26,"value":27},{"type":30,"tagName":163,"properties":3345,"children":3346},{"class":165},[3347,3351,3355,3359,3363],{"type":30,"tagName":163,"properties":3348,"children":3349},{"style":179},[3350],{"type":26,"value":182},{"type":30,"tagName":163,"properties":3352,"children":3353},{"style":185},[3354],{"type":26,"value":269},{"type":30,"tagName":163,"properties":3356,"children":3357},{"style":179},[3358],{"type":26,"value":193},{"type":30,"tagName":163,"properties":3360,"children":3361},{"style":196},[3362],{"type":26,"value":278},{"type":30,"tagName":163,"properties":3364,"children":3365},{"style":185},[3366],{"type":26,"value":204},{"type":26,"value":27},{"type":30,"tagName":163,"properties":3369,"children":3370},{"class":165},[],{"type":26,"value":27},{"type":30,"tagName":163,"properties":3373,"children":3374},{"class":165},[3375,3379,3383,3387,3391,3395,3399,3403,3407,3411,3415,3419,3423,3427,3431,3435,3439,3443,3447,3451,3455,3459],{"type":30,"tagName":163,"properties":3376,"children":3377},{"style":293},[3378],{"type":26,"value":296},{"type":30,"tagName":163,"properties":3380,"children":3381},{"style":185},[3382],{"type":26,"value":301},{"type":30,"tagName":163,"properties":3384,"children":3385},{"style":304},[3386],{"type":26,"value":327},{"type":30,"tagName":163,"properties":3388,"children":3389},{"style":185},[3390],{"type":26,"value":312},{"type":30,"tagName":163,"properties":3392,"children":3393},{"style":196},[3394],{"type":26,"value":317},{"type":30,"tagName":163,"properties":3396,"children":3397},{"style":185},[3398],{"type":26,"value":322},{"type":30,"tagName":163,"properties":3400,"children":3401},{"style":304},[3402],{"type":26,"value":327},{"type":30,"tagName":163,"properties":3404,"children":3405},{"style":185},[3406],{"type":26,"value":332},{"type":30,"tagName":163,"properties":3408,"children":3409},{"style":304},[3410],{"type":26,"value":337},{"type":30,"tagName":163,"properties":3412,"children":3413},{"style":185},[3414],{"type":26,"value":342},{"type":30,"tagName":163,"properties":3416,"children":3417},{"style":196},[3418],{"type":26,"value":347},{"type":30,"tagName":163,"properties":3420,"children":3421},{"style":185},[3422],{"type":26,"value":352},{"type":30,"tagName":163,"properties":3424,"children":3425},{"style":304},[3426],{"type":26,"value":357},{"type":30,"tagName":163,"properties":3428,"children":3429},{"style":185},[3430],{"type":26,"value":362},{"type":30,"tagName":163,"properties":3432,"children":3433},{"style":304},[3434],{"type":26,"value":157},{"type":30,"tagName":163,"properties":3436,"children":3437},{"style":185},[3438],{"type":26,"value":371},{"type":30,"tagName":163,"properties":3440,"children":3441},{"style":304},[3442],{"type":26,"value":157},{"type":30,"tagName":163,"properties":3444,"children":3445},{"style":185},[3446],{"type":26,"value":380},{"type":30,"tagName":163,"properties":3448,"children":3449},{"style":304},[3450],{"type":26,"value":157},{"type":30,"tagName":163,"properties":3452,"children":3453},{"style":185},[3454],{"type":26,"value":389},{"type":30,"tagName":163,"properties":3456,"children":3457},{"style":196},[3458],{"type":26,"value":394},{"type":30,"tagName":163,"properties":3460,"children":3461},{"style":185},[3462],{"type":26,"value":399},{"type":26,"value":27},{"type":30,"tagName":163,"properties":3465,"children":3466},{"class":165},[3467,3471,3475,3479],{"type":30,"tagName":163,"properties":3468,"children":3469},{"style":293},[3470],{"type":26,"value":408},{"type":30,"tagName":163,"properties":3472,"children":3473},{"style":185},[3474],{"type":26,"value":413},{"type":30,"tagName":163,"properties":3476,"children":3477},{"style":196},[3478],{"type":26,"value":418},{"type":30,"tagName":163,"properties":3480,"children":3481},{"style":185},[3482],{"type":26,"value":423},{"type":26,"value":27},{"type":30,"tagName":163,"properties":3485,"children":3486},{"class":165},[3487,3491,3495,3500,3505,3510],{"type":30,"tagName":163,"properties":3488,"children":3489},{"style":293},[3490],{"type":26,"value":432},{"type":30,"tagName":163,"properties":3492,"children":3493},{"style":185},[3494],{"type":26,"value":413},{"type":30,"tagName":163,"properties":3496,"children":3497},{"style":196},[3498],{"type":26,"value":3499},"\"equity\"",{"type":30,"tagName":163,"properties":3501,"children":3502},{"style":185},[3503],{"type":26,"value":3504},", line, lower, { description: ",{"type":30,"tagName":163,"properties":3506,"children":3507},{"style":196},[3508],{"type":26,"value":3509},"\"Strategy equity\"",{"type":30,"tagName":163,"properties":3511,"children":3512},{"style":185},[3513],{"type":26,"value":399},{"type":26,"value":27},{"type":30,"tagName":163,"properties":3516,"children":3517},{"class":165},[],{"type":26,"value":27},{"type":30,"tagName":163,"properties":3520,"children":3521},{"class":165},[3522,3526,3530,3534,3538,3542,3546],{"type":30,"tagName":163,"properties":3523,"children":3524},{"style":179},[3525],{"type":26,"value":467},{"type":30,"tagName":163,"properties":3527,"children":3528},{"style":185},[3529],{"type":26,"value":472},{"type":30,"tagName":163,"properties":3531,"children":3532},{"style":179},[3533],{"type":26,"value":477},{"type":30,"tagName":163,"properties":3535,"children":3536},{"style":293},[3537],{"type":26,"value":482},{"type":30,"tagName":163,"properties":3539,"children":3540},{"style":179},[3541],{"type":26,"value":487},{"type":30,"tagName":163,"properties":3543,"children":3544},{"style":304},[3545],{"type":26,"value":492},{"type":30,"tagName":163,"properties":3547,"children":3548},{"style":185},[3549],{"type":26,"value":204},{"type":26,"value":27},{"type":30,"tagName":163,"properties":3552,"children":3553},{"class":165},[],{"type":26,"value":27},{"type":30,"tagName":163,"properties":3556,"children":3557},{"class":165},[3558,3562,3566,3570,3574,3578,3582],{"type":30,"tagName":163,"properties":3559,"children":3560},{"style":179},[3561],{"type":26,"value":544},{"type":30,"tagName":163,"properties":3563,"children":3564},{"style":179},[3565],{"type":26,"value":549},{"type":30,"tagName":163,"properties":3567,"children":3568},{"style":293},[3569],{"type":26,"value":554},{"type":30,"tagName":163,"properties":3571,"children":3572},{"style":185},[3573],{"type":26,"value":559},{"type":30,"tagName":163,"properties":3575,"children":3576},{"style":179},[3577],{"type":26,"value":477},{"type":30,"tagName":163,"properties":3579,"children":3580},{"style":304},[3581],{"type":26,"value":568},{"type":30,"tagName":163,"properties":3583,"children":3584},{"style":185},[3585],{"type":26,"value":573},{"type":26,"value":27},{"type":30,"tagName":163,"properties":3588,"children":3589},{"class":165},[],{"type":26,"value":27},{"type":30,"tagName":163,"properties":3592,"children":3593},{"class":165},[3594,3598,3602,3606,3610,3614,3618],{"type":30,"tagName":163,"properties":3595,"children":3596},{"style":179},[3597],{"type":26,"value":544},{"type":30,"tagName":163,"properties":3599,"children":3600},{"style":179},[3601],{"type":26,"value":549},{"type":30,"tagName":163,"properties":3603,"children":3604},{"style":293},[3605],{"type":26,"value":594},{"type":30,"tagName":163,"properties":3607,"children":3608},{"style":185},[3609],{"type":26,"value":559},{"type":30,"tagName":163,"properties":3611,"children":3612},{"style":179},[3613],{"type":26,"value":477},{"type":30,"tagName":163,"properties":3615,"children":3616},{"style":293},[3617],{"type":26,"value":482},{"type":30,"tagName":163,"properties":3619,"children":3620},{"style":185},[3621],{"type":26,"value":611},{"type":26,"value":27},{"type":30,"tagName":163,"properties":3624,"children":3625},{"class":165},[3626,3630,3634,3638],{"type":30,"tagName":163,"properties":3627,"children":3628},{"style":185},[3629],{"type":26,"value":644},{"type":30,"tagName":163,"properties":3631,"children":3632},{"style":179},[3633],{"type":26,"value":649},{"type":30,"tagName":163,"properties":3635,"children":3636},{"style":304},[3637],{"type":26,"value":654},{"type":30,"tagName":163,"properties":3639,"children":3640},{"style":185},[3641],{"type":26,"value":204},{"type":26,"value":27},{"type":30,"tagName":163,"properties":3644,"children":3645},{"class":165},[3646,3650,3654],{"type":30,"tagName":163,"properties":3647,"children":3648},{"style":179},[3649],{"type":26,"value":667},{"type":30,"tagName":163,"properties":3651,"children":3652},{"style":304},[3653],{"type":26,"value":654},{"type":30,"tagName":163,"properties":3655,"children":3656},{"style":185},[3657],{"type":26,"value":204},{"type":26,"value":27},{"type":30,"tagName":163,"properties":3660,"children":3661},{"class":165},[3662],{"type":30,"tagName":163,"properties":3663,"children":3664},{"style":185},[3665],{"type":26,"value":684},{"type":26,"value":27},{"type":30,"tagName":163,"properties":3668,"children":3669},{"class":165},[],{"type":26,"value":27},{"type":30,"tagName":163,"properties":3672,"children":3673},{"class":165},[3674,3678,3682,3686,3690,3694,3698],{"type":30,"tagName":163,"properties":3675,"children":3676},{"style":179},[3677],{"type":26,"value":544},{"type":30,"tagName":163,"properties":3679,"children":3680},{"style":179},[3681],{"type":26,"value":549},{"type":30,"tagName":163,"properties":3683,"children":3684},{"style":293},[3685],{"type":26,"value":705},{"type":30,"tagName":163,"properties":3687,"children":3688},{"style":185},[3689],{"type":26,"value":559},{"type":30,"tagName":163,"properties":3691,"children":3692},{"style":179},[3693],{"type":26,"value":477},{"type":30,"tagName":163,"properties":3695,"children":3696},{"style":304},[3697],{"type":26,"value":568},{"type":30,"tagName":163,"properties":3699,"children":3700},{"style":185},[3701],{"type":26,"value":611},{"type":26,"value":27},{"type":30,"tagName":163,"properties":3704,"children":3705},{"class":165},[3706,3710,3714,3718,3722,3726,3730,3734,3738,3742,3746],{"type":30,"tagName":163,"properties":3707,"children":3708},{"style":179},[3709],{"type":26,"value":730},{"type":30,"tagName":163,"properties":3711,"children":3712},{"style":185},[3713],{"type":26,"value":735},{"type":30,"tagName":163,"properties":3715,"children":3716},{"style":179},[3717],{"type":26,"value":740},{"type":30,"tagName":163,"properties":3719,"children":3720},{"style":304},[3721],{"type":26,"value":654},{"type":30,"tagName":163,"properties":3723,"children":3724},{"style":185},[3725],{"type":26,"value":749},{"type":30,"tagName":163,"properties":3727,"children":3728},{"style":293},[3729],{"type":26,"value":754},{"type":30,"tagName":163,"properties":3731,"children":3732},{"style":185},[3733],{"type":26,"value":413},{"type":30,"tagName":163,"properties":3735,"children":3736},{"style":196},[3737],{"type":26,"value":763},{"type":30,"tagName":163,"properties":3739,"children":3740},{"style":185},[3741],{"type":26,"value":768},{"type":30,"tagName":163,"properties":3743,"children":3744},{"style":293},[3745],{"type":26,"value":773},{"type":30,"tagName":163,"properties":3747,"children":3748},{"style":185},[3749],{"type":26,"value":635},{"type":26,"value":27},{"type":30,"tagName":163,"properties":3752,"children":3753},{"class":165},[3754,3759,3764,3769],{"type":30,"tagName":163,"properties":3755,"children":3756},{"style":293},[3757],{"type":26,"value":3758},"  out_equity",{"type":30,"tagName":163,"properties":3760,"children":3761},{"style":185},[3762],{"type":26,"value":3763},"(strategy.",{"type":30,"tagName":163,"properties":3765,"children":3766},{"style":293},[3767],{"type":26,"value":3768},"equity",{"type":30,"tagName":163,"properties":3770,"children":3771},{"style":185},[3772],{"type":26,"value":3773},"());",{"type":26,"value":27},{"type":30,"tagName":163,"properties":3776,"children":3777},{"class":165},[3778,3782],{"type":30,"tagName":163,"properties":3779,"children":3780},{"style":293},[3781],{"type":26,"value":800},{"type":30,"tagName":163,"properties":3783,"children":3784},{"style":185},[3785],{"type":26,"value":635},{"type":26,"value":27},{"type":30,"tagName":163,"properties":3788,"children":3789},{"class":165},[3790],{"type":30,"tagName":163,"properties":3791,"children":3792},{"style":185},[3793],{"type":26,"value":684},{"type":26,"value":27},{"type":30,"tagName":163,"properties":3796,"children":3797},{"class":165},[],{"type":26,"value":27},{"type":30,"tagName":163,"properties":3800,"children":3801},{"class":165},[3802,3806,3810,3814,3818,3822,3826],{"type":30,"tagName":163,"properties":3803,"children":3804},{"style":179},[3805],{"type":26,"value":544},{"type":30,"tagName":163,"properties":3807,"children":3808},{"style":179},[3809],{"type":26,"value":549},{"type":30,"tagName":163,"properties":3811,"children":3812},{"style":293},[3813],{"type":26,"value":833},{"type":30,"tagName":163,"properties":3815,"children":3816},{"style":185},[3817],{"type":26,"value":559},{"type":30,"tagName":163,"properties":3819,"children":3820},{"style":179},[3821],{"type":26,"value":477},{"type":30,"tagName":163,"properties":3823,"children":3824},{"style":304},[3825],{"type":26,"value":568},{"type":30,"tagName":163,"properties":3827,"children":3828},{"style":185},[3829],{"type":26,"value":611},{"type":26,"value":27},{"type":30,"tagName":163,"properties":3832,"children":3833},{"class":165},[3834,3838,3842,3846],{"type":30,"tagName":163,"properties":3835,"children":3836},{"style":185},[3837],{"type":26,"value":644},{"type":30,"tagName":163,"properties":3839,"children":3840},{"style":179},[3841],{"type":26,"value":625},{"type":30,"tagName":163,"properties":3843,"children":3844},{"style":304},[3845],{"type":26,"value":492},{"type":30,"tagName":163,"properties":3847,"children":3848},{"style":185},[3849],{"type":26,"value":204},{"type":26,"value":27},{"type":30,"tagName":163,"properties":3852,"children":3853},{"class":165},[3854],{"type":30,"tagName":163,"properties":3855,"children":3856},{"style":185},[3857],{"type":26,"value":684},{"quirksMode":3859},false,{"start":3861,"end":3862},{"line":20,"column":20,"offset":21},{"line":3863,"column":20,"offset":3864},192,7265,1790157177300]