本页源码来自 TradingView 公开发布的开源脚本,版权归原作者所有, 请遵循其原始许可(Pine 脚本常见 CC BY-NC-SA / MPL-2.0 / MIT)。 本项目仅用于研究检索与许可范围内的移植。
//@version=6
indicator("Posicionamiento COT", shorttitle = "COT", overlay = false, precision = 1)
// Weekly positioning of the market's large groups, from the CFTC Commitments of Traders report (futures only), read
// through TradingView's official COT library.
//
// Report and groups per market, the same ones as on our COT page:
// - index, rates, currency and crypto futures: Traders in Financial Futures, leveraged funds (main) and asset managers.
// - commodities: Disaggregated, managed money (main) and producers / merchants.
// - Legacy (non-commercials and commercials) only when chosen in the settings.
// Net position = long - short, as % of open interest. Index 0-100 = where the latest net % of open interest sits
// inside the range of the last 156 weekly reports (3 years): 80 or more is the high extreme, 20 or less the low one.
//
// Next to the zone of the main group, what our study measured in this market after readings in that zone, at 4, 13
// and 26 weeks: whether the market's later move was distinguishable from the same readings moved to random dates
// ("igual al azar" or not), with the number of weekly readings (n), the effective sample and the separate episodes.
// The signed return is not printed: this is positioning, not a direction and not a signal.
//
// Weekly data with its own publication lag: positions as of Tuesday, published on Friday. In the chart's history a
// report can appear on the bar of its as-of date, before it was public.
import TradingView/LibraryCOT/6 as cot
// --- metric names of the COT library (checked against the library's source on 2026-10-17)
string TYPE_LEGACY = "Legacy"
string TYPE_DISAGG = "Disaggregated"
string TYPE_FIN = "Financial"
string M_OI = "Open Interest"
string M_LEV = "Leveraged Funds Positions"
string M_AM = "Asset Manager Positions"
string M_MM = "Managed Money Positions"
string M_PM = "Producer Merchant Positions"
string M_NC = "Noncommercial Positions"
string M_C = "Commercial Positions"
string D_LONG = "Long"
string D_SHORT = "Short"
string D_NONE = "No direction"
string T_ALL = "All"
int LOOKBACK = 156
float HIGH = 80.0
float LOW = 20.0
// --- BEGIN GENERATED CONSTANTS
// Written by scripts/build_tradingview_constants.py. Do not edit by hand.
// 30 markets, weekly reports through 2026-10-13. Report, CFTC code, verdicts and counts only.
string DATA_THROUGH = "2026-10-13"
f_parent(string r) =>
switch r
"MES" => "ES"
"MNQ" => "NQ"
"M2K" => "RTY"
"MYM" => "YM"
"MGC" => "GC"
"SIL" => "SI"
"MHG" => "HG"
"MCL" => "CL"
"QM" => "CL"
"MNG" => "NG"
"QG" => "NG"
"MBT" => "BTC"
"MET" => "ETH"
"M6E" => "6E"
"M6A" => "6A"
"M6B" => "6B"
"E7" => "6E"
"J7" => "6J"
"XC" => "ZC"
"XK" => "ZS"
"XW" => "ZW"
"10Y" => "ZN"
"MTN" => "ZN"
"MWN" => "ZB"
=> r
f_cotRep(string r) =>
switch r
"ES" => "T"
"NQ" => "T"
"RTY" => "T"
"YM" => "T"
"NKD" => "T"
"6E" => "T"
"6J" => "T"
"6B" => "T"
"6A" => "T"
"6C" => "T"
"6S" => "T"
"6N" => "T"
"6M" => "T"
"ZT" => "T"
"ZF" => "T"
"ZN" => "T"
"ZB" => "T"
"SR3" => "T"
"GC" => "D"
"SI" => "D"
"HG" => "D"
"PL" => "D"
"PA" => "D"
"CL" => "D"
"NG" => "D"
"ZC" => "D"
"ZS" => "D"
"ZW" => "D"
"BTC" => "T"
"ETH" => "T"
=> ""
f_cotCode(string r) =>
switch r
"ES" => "13874A"
"NQ" => "209742"
"RTY" => "239742"
"YM" => "124603"
"NKD" => "240741"
"6E" => "099741"
"6J" => "097741"
"6B" => "096742"
"6A" => "232741"
"6C" => "090741"
"6S" => "092741"
"6N" => "112741"
"6M" => "095741"
"ZT" => "042601"
"ZF" => "044601"
"ZN" => "043602"
"ZB" => "020601"
"SR3" => "134741"
"GC" => "088691"
"SI" => "084691"
"HG" => "085692"
"PL" => "076651"
"PA" => "075651"
"CL" => "067651"
"NG" => "023651"
"ZC" => "002602"
"ZS" => "005602"
"ZW" => "001602"
"BTC" => "133741"
"ETH" => "146021"
=> ""
f_cot(string r) =>
switch r
"ES" => "COT1|ES|T|leveraged|2026-10-13|2009-12-22|S,60,35,19|S,60,13,19|S,60,10,19|S,134,62,41|S,134,21,41|S,126,34,39|S,656,266,61|S,647,118,61|S,642,64,59"
"NQ" => "COT1|NQ|T|leveraged|2026-10-13|2009-12-22|S,115,43,25|S,115,16,25|S,115,19,25|S,135,73,35|S,130,47,35|S,125,33,32|S,600,275,61|S,596,88,60|S,588,47,58"
"RTY" => "COT1|RTY|T|leveraged|2026-10-13|2009-12-22|S,48,19,9|S,48,36,9|S,48,48,9|S,87,38,17|S,81,22,15|S,81,9,15|S,344,149,26|S,341,80,25|S,328,50,25"
"YM" => "COT1|YM|T|leveraged|2026-10-13|2009-12-22|S,124,53,26|S,124,27,26|S,124,39,26|U,104,47,23|S,104,48,23|S,104,32,23|S,622,305,49|S,613,98,49|S,600,57,49"
"NKD" => "COT1|NKD|T|leveraged|2026-03-03|2009-12-22|S,131,56,30|S,131,39,30|S,131,21,30|S,63,31,14|S,63,20,14|S,63,23,14|S,523,195,44|S,523,106,44|S,523,62,44"
"6E" => "COT1|6E|T|leveraged|2026-10-13|2009-12-22|S,161,73,39|S,161,49,39|S,161,68,39|S,123,48,22|S,117,17,22|S,116,16,21|S,566,255,61|S,563,62,60|S,551,35,60"
"6J" => "COT1|6J|T|leveraged|2026-10-13|2009-12-22|S,110,42,18|S,110,12,18|S,110,9,18|S,207,74,36|S,206,28,35|S,205,23,34|S,533,233,55|S,525,67,54|S,513,49,53"
"6B" => "COT1|6B|T|leveraged|2026-10-13|2009-12-22|S,153,89,30|S,153,25,30|S,153,30,30|S,99,46,15|S,99,16,15|S,99,39,15|S,598,234,45|S,589,78,45|S,576,39,45"
"6A" => "COT1|6A|T|leveraged|2026-10-13|2009-12-22|S,171,62,25|S,169,20,24|S,162,20,21|S,151,68,24|S,151,29,24|S,151,17,24|S,528,238,50|S,521,130,49|S,515,46,45"
"6C" => "COT1|6C|T|leveraged|2026-10-13|2009-12-22|S,63,40,15|S,63,32,15|S,63,15,15|U,180,108,39|S,174,39,38|S,171,31,36|S,607,266,55|S,604,95,54|S,594,58,52"
"6S" => "COT1|6S|T|leveraged|2026-10-13|2009-12-22|S,106,45,24|S,106,23,24|S,106,20,24|S,115,52,29|S,115,30,29|S,115,27,29|S,629,289,52|S,620,97,52|S,607,52,52"
"6N" => "COT1|6N|T|leveraged|2026-10-13|2009-12-22|S,170,110,28|S,170,39,28|S,170,24,28|S,119,54,28|S,112,29,28|S,101,20,26|S,561,233,57|S,559,85,56|S,557,40,54"
"6M" => "COT1|6M|T|leveraged|2026-10-13|2009-12-22|S,116,58,31|S,109,23,29|S,99,25,27|S,127,79,28|S,127,24,28|S,127,19,28|S,607,216,59|S,605,74,57|S,602,46,55"
"ZT" => "COT1|ZT|T|leveraged|2026-10-13|2009-12-22|F,118,75,7|F,109,6,6|F,105,3,3|S,302,120,25|S,302,54,25|S,302,23,25|S,430,177,32|S,430,50,32|S,421,27,29"
"ZF" => "COT1|ZF|T|leveraged|2026-10-13|2009-12-22|S,93,93,16|S,90,11,14|S,89,12,13|S,251,99,16|S,251,43,16|S,251,32,16|S,506,187,32|S,500,57,31|S,488,17,30"
"ZN" => "COT1|ZN|T|leveraged|2026-10-13|2009-12-22|S,162,58,13|S,162,34,13|S,162,9,13|S,317,125,22|S,317,75,22|S,317,19,22|S,371,133,35|S,362,33,35|S,349,25,35"
"ZB" => "COT1|ZB|T|leveraged|2026-10-13|2009-12-22|S,111,52,25|S,110,15,24|S,107,7,24|S,103,35,14|S,103,12,14|S,103,10,14|S,636,231,40|S,628,95,39|S,618,37,38"
"SR3" => "COT1|SR3|T|leveraged|2026-10-13|2021-07-20|||||||||"
"GC" => "COT1|GC|D|managed_money|2026-10-13|2009-12-22|S,172,82,29|S,164,26,28|S,158,11,27|S,144,54,24|S,144,30,24|S,144,31,24|S,534,190,53|S,533,88,52|S,526,35,52"
"SI" => "COT1|SI|D|managed_money|2026-10-13|2009-12-22|S,165,95,28|S,165,22,28|S,165,13,28|S,134,60,21|S,134,41,21|S,134,24,21|S,551,228,50|S,542,124,50|S,529,45,50"
"HG" => "COT1|HG|D|managed_money|2026-10-13|2009-12-22|S,190,97,20|S,181,31,20|S,168,19,19|S,126,74,28|S,126,34,28|S,126,63,28|S,534,238,48|S,534,123,48|S,534,52,48"
"PL" => "COT1|PL|D|managed_money|2026-10-13|2009-12-22|S,99,56,25|U,99,23,25|U,95,15,23|S,172,73,34|S,172,37,34|S,172,53,34|S,579,279,60|S,570,92,60|S,561,59,58"
"PA" => "COT1|PA|D|managed_money|2026-10-13|2009-12-22|S,221,94,19|S,221,23,19|S,221,20,19|S,209,78,24|S,209,24,24|S,209,15,24|S,420,155,43|S,411,50,43|S,398,27,43"
"CL" => "COT1|CL|D|managed_money|2026-10-13|2009-12-22|S,60,20,13|S,60,10,13|S,60,5,13|S,101,41,22|S,101,22,22|S,101,21,22|S,429,170,36|S,420,62,36|S,407,34,36"
"NG" => "COT1|NG|D|managed_money|2026-10-13|2009-12-22|S,94,72,14|S,94,17,14|S,94,13,14|S,95,52,16|S,94,21,15|S,89,32,12|S,401,142,30|S,393,80,29|S,385,31,26"
"ZC" => "COT1|ZC|D|managed_money|2026-10-13|2009-12-22|S,145,42,18|S,141,11,17|S,135,7,16|S,167,70,16|S,167,33,16|S,167,24,16|S,390,125,34|U,385,89,34|S,378,61,32"
"ZS" => "COT1|ZS|D|managed_money|2026-10-13|2009-12-22|S,165,54,22|S,160,19,20|S,153,25,20|S,119,52,18|S,119,31,18|S,119,54,18|S,418,168,40|S,414,75,39|S,408,32,38"
"ZW" => "COT1|ZW|D|managed_money|2026-10-13|2009-12-22|U,87,44,22|S,83,24,20|S,76,14,20|S,172,68,27|S,172,32,27|S,172,95,27|S,443,169,48|S,438,62,47|U,432,22,46"
"BTC" => "COT1|BTC|T|leveraged|2026-10-13|2021-03-30|F,21,21,5|F,17,17,4|F,13,1,2|S,114,52,22|S,114,24,22|S,114,4,22|S,150,79,27|S,145,20,25|S,136,11,24"
"ETH" => "COT1|ETH|T|leveraged|2026-10-13|2024-03-26|F,1,1,1|F,1,1,1|F,1,1,1|F,22,8,8|F,22,8,8|F,22,13,8|S,106,55,10|S,97,49,10|S,84,41,10"
=> ""
// --- END GENERATED CONSTANTS
// ------------------------------------------------------------------------------------------------------------ inputs
string G0 = "General"
string lang = input.string("es", "Idioma / Language / Idioma", options = ["es", "en", "pt"], group = G0)
string marketIn = input.string("Auto", "Mercado / Market", options = ["Auto", "ES", "NQ", "RTY", "YM", "NKD", "GC", "SI", "HG", "PL", "PA", "CL", "NG", "ZN", "ZB", "ZF", "ZT", "SR3", "ZC", "ZS", "ZW", "6E", "6J", "6B", "6A", "6C", "6S", "6N", "6M", "BTC", "ETH"], group = G0, tooltip = "Auto: se toma del símbolo del gráfico (los micros usan el reporte de su contrato grande). / Auto: taken from the chart symbol.")
string repIn = input.string("Auto", "Reporte / Report", options = ["Auto", "Legacy"], group = G0, tooltip = "Auto: el reporte del portal para este mercado (financieros o desagregado). Legacy: no comerciales y comerciales; el estudio no se muestra con Legacy.")
string codeIn = input.string("", "Código CFTC (opcional) / CFTC code", group = G0, tooltip = "Seis caracteres. Solo para un mercado que no está en la lista; con un código propio el estudio no se muestra.")
string mode = input.string("Índice 0-100", "Mostrar / Show", options = ["Índice 0-100", "Neto % del open interest"], group = G0)
bool showSecond = input.bool(true, "Segundo grupo / Second group", group = G0)
bool showTable = input.bool(true, "Tabla / Table", group = G0)
string tablePos = input.string("top_right", "Posición de la tabla", options = ["top_right", "top_left", "bottom_right", "bottom_left", "middle_right"], group = G0)
string G5 = "Colores / Colours"
color cMain = input.color(#58a6ff, "Grupo principal", group = G5)
color cSecond = input.color(#8b98a8, "Segundo grupo", group = G5)
color cHigh = input.color(color.new(#f59e0b, 82), "Zona alta (80 o más)", group = G5)
color cLow = input.color(color.new(#a78bfa, 82), "Zona baja (20 o menos)", group = G5)
color cText = input.color(#c9d1d9, "Texto de la tabla", group = G5)
color cTableBg = input.color(color.new(#0d1117, 15), "Fondo de la tabla", group = G5)
f_t(string es, string en, string pt) =>
lang == "es" ? es : lang == "en" ? en : pt
// ------------------------------------------------------------------------------------------------- report and groups
string root = marketIn == "Auto" ? f_parent(syminfo.root) : marketIn
string embRep = f_cotRep(root)
string embCode = f_cotCode(root)
string code = codeIn != "" ? codeIn : embCode
// "T" = financial futures, "D" = disaggregated, "L" = legacy
string rep = repIn == "Legacy" or embRep == "" ? "L" : embRep
string cotType = rep == "T" ? TYPE_FIN : rep == "D" ? TYPE_DISAGG : TYPE_LEGACY
string mMain = rep == "T" ? M_LEV : rep == "D" ? M_MM : M_NC
string mSecond = rep == "T" ? M_AM : rep == "D" ? M_PM : M_C
string nameMain = rep == "T" ? f_t("Fondos apalancados", "Leveraged funds", "Fundos alavancados") : rep == "D" ? f_t("Fondos gestionados", "Managed money", "Fundos geridos") : f_t("No comerciales", "Non-commercials", "Não comerciais")
string nameSecond = rep == "T" ? f_t("Gestores de activos", "Asset managers", "Gestores de ativos") : rep == "D" ? f_t("Productores y comerciantes", "Producers and merchants", "Produtores e comerciantes") : f_t("Comerciales", "Commercials", "Comerciais")
string repName = rep == "T" ? f_t("financieros (TFF)", "financial futures (TFF)", "financeiros (TFF)") : rep == "D" ? f_t("desagregado", "disaggregated", "desagregado") : "Legacy"
// the study was measured on the embedded report, code and main group only
bool studyOn = rep == embRep and code == embCode and embRep != ""
bool hasCode = str.length(code) == 6
// The library has to be called on every bar (global scope) and raises an error on an empty code, so a market
// without a code requests a valid placeholder and its values are discarded right away.
string reqCode = hasCode ? code : "13874A"
float oiReq = cot.requestCommitmentOfTraders(cotType, reqCode, false, M_OI, D_NONE, T_ALL)
float mainLReq = cot.requestCommitmentOfTraders(cotType, reqCode, false, mMain, D_LONG, T_ALL)
float mainSReq = cot.requestCommitmentOfTraders(cotType, reqCode, false, mMain, D_SHORT, T_ALL)
float secLReq = cot.requestCommitmentOfTraders(cotType, reqCode, false, mSecond, D_LONG, T_ALL)
float secSReq = cot.requestCommitmentOfTraders(cotType, reqCode, false, mSecond, D_SHORT, T_ALL)
float oi = hasCode ? oiReq : na
float mainL = hasCode ? mainLReq : na
float mainS = hasCode ? mainSReq : na
float secL = hasCode ? secLReq : na
float secS = hasCode ? secSReq : na
// ------------------------------------------------------------------------------------------------- weekly readings
// A new report is a bar where the open interest or the main group's positions change.
f_index(array<float> a, int lb) =>
float v = na
int n = a.size()
if n >= lb
array<float> w = a.slice(n - lb, n)
float lo = w.min()
float hi = w.max()
if hi > lo
v := 100.0 * (a.get(n - 1) - lo) / (hi - lo)
v
f_last(array<float> a, int back) =>
float v = na
int n = a.size()
if n > back
v := a.get(n - 1 - back)
v
var array<float> netMain = array.new<float>()
var array<float> netSec = array.new<float>()
var int lastRepTime = na
var float idxMain = na
var float idxSec = na
bool valid = not na(oi) and oi > 0 and not na(mainL) and not na(mainS)
bool newRep = valid and (na(oi[1]) or oi != oi[1] or mainL != mainL[1] or mainS != mainS[1])
if newRep
netMain.push(100.0 * (mainL - mainS) / oi)
netSec.push(na(secL) or na(secS) ? na : 100.0 * (secL - secS) / oi)
if netMain.size() > LOOKBACK + 1
netMain.shift()
netSec.shift()
lastRepTime := time
idxMain := f_index(netMain, LOOKBACK)
idxSec := f_index(netSec, LOOKBACK)
bool showIdx = mode == "Índice 0-100"
float pMain = showIdx ? idxMain : f_last(netMain, 0)
float pSec = showIdx ? idxSec : f_last(netSec, 0)
plot(pMain, "Grupo principal", color = cMain, linewidth = 2, style = plot.style_stepline)
plot(showSecond ? pSec : na, "Segundo grupo", color = cSecond, linewidth = 1, style = plot.style_stepline)
plot(showIdx ? HIGH : na, "80", color = color.new(cText, 70), style = plot.style_line, display = display.pane)
plot(showIdx ? LOW : na, "20", color = color.new(cText, 70), style = plot.style_line, display = display.pane)
plot(showIdx ? na : 0.0, "0", color = color.new(cText, 70), style = plot.style_line, display = display.pane)
bgcolor(idxMain >= HIGH ? cHigh : idxMain <= LOW ? cLow : na, title = "Zona del grupo principal")
// ------------------------------------------------------------------------------------------------------- statistics
// COT1|root|report|main group|last report|first index reading|nine cells "verdict,n,effective n,episodes":
// high 4/13/26 weeks, low 4/13/26, middle 4/13/26. Verdicts: S igual al azar, D distinto del azar (confirmed from
// 2022 on), U distinto del azar over the whole period but not confirmed from 2022 on, F too few cases.
var array<string> fs = str.split(f_cot(root), "|")
var bool statsOk = fs.size() >= 15 and fs.get(0) == "COT1"
f_cellOf(int zone, int h) =>
string s = ""
int i = 6 + zone * 3 + h
if statsOk and i < fs.size()
s := fs.get(i)
s
f_verdict(string v) =>
v == "S" ? f_t("igual al azar", "same as chance", "igual ao acaso") : v == "D" ? f_t("distinto del azar", "different from chance", "diferente do acaso") : v == "U" ? f_t("distinto del azar, sin confirmar desde 2022", "different from chance, not confirmed since 2022", "diferente do acaso, sem confirmar desde 2022") : v == "F" ? f_t("muy pocos casos", "too few cases", "poucos casos") : "—"
f_num(float v, string fmt) =>
string s = na(v) ? "—" : str.tostring(v, fmt)
lang == "en" ? s : str.replace_all(s, ".", ",")
// ------------------------------------------------------------------------------------------------------------- table
f_pos(string p) =>
p == "top_left" ? position.top_left : p == "bottom_right" ? position.bottom_right : p == "bottom_left" ? position.bottom_left : p == "middle_right" ? position.middle_right : position.top_right
f_cell(table t, int col, int row, string txt, color tc, string al) =>
table.cell(t, col, row, txt, text_color = tc, text_size = size.small, text_halign = al)
true
f_zone(float x) =>
na(x) ? f_t("sin 156 reportes", "no 156 reports", "sem 156 relatórios") : x >= HIGH ? f_t("extremo alto", "high extreme", "extremo alto") : x <= LOW ? f_t("extremo bajo", "low extreme", "extremo baixo") : f_t("medio", "middle", "meio")
f_groupRow(table t, int row, string name, array<float> nets, float x) =>
float now = f_last(nets, 0)
float prev = f_last(nets, 1)
f_cell(t, 0, row, name, cText, text.align_left)
f_cell(t, 1, row, f_num(now, "0.0") + "%", cText, text.align_right)
f_cell(t, 2, row, na(now) or na(prev) ? "—" : (now - prev >= 0 ? "+" : "") + f_num(now - prev, "0.0"), cText, text.align_right)
f_cell(t, 3, row, f_num(x, "0"), cText, text.align_right)
f_cell(t, 4, row, f_zone(x), cText, text.align_left)
true
var table info = na
if barstate.islast and showTable
// a fresh table on every update: merged cells are defined once per table
if not na(info)
table.delete(info)
info := table.new(f_pos(tablePos), 5, 12, bgcolor = cTableBg, border_width = 0)
color dim = color.new(cText, 35)
if not hasCode
f_cell(info, 0, 0, f_t("Sin código CFTC para ", "No CFTC code for ", "Sem código CFTC para ") + root + f_t(": escríbelo en los ajustes.", ": type it in the settings.", ": escreva-o nos ajustes."), cText, text.align_left)
else if netMain.size() == 0
f_cell(info, 0, 0, f_t("Sin datos del reporte para ", "No report data for ", "Sem dados do relatório para ") + root + " (" + code + ")", cText, text.align_left)
else
string head = f_t("Posicionamiento COT · ", "COT positioning · ", "Posicionamento COT · ") + root + " · " + repName + " · " + f_t("reporte del ", "report of ", "relatório de ") + str.format_time(lastRepTime, "yyyy-MM-dd", "America/New_York")
f_cell(info, 0, 0, head, cText, text.align_left)
table.merge_cells(info, 0, 0, 4, 0)
f_cell(info, 0, 1, f_t("grupo", "group", "grupo"), dim, text.align_left)
f_cell(info, 1, 1, f_t("neto % OI", "net % OI", "líquido % OI"), dim, text.align_right)
f_cell(info, 2, 1, f_t("cambio semanal", "weekly change", "variação semanal"), dim, text.align_right)
f_cell(info, 3, 1, f_t("índice", "index", "índice"), dim, text.align_right)
f_cell(info, 4, 1, f_t("zona", "zone", "zona"), dim, text.align_left)
f_groupRow(info, 2, nameMain, netMain, idxMain)
f_groupRow(info, 3, nameSecond, netSec, idxSec)
int zone = na(idxMain) ? -1 : idxMain >= HIGH ? 0 : idxMain <= LOW ? 1 : 2
if not studyOn or not statsOk
f_cell(info, 0, 4, f_t("Sin estudio para este reporte o mercado.", "No study for this report or market.", "Sem estudo para este relatório ou mercado."), dim, text.align_left)
table.merge_cells(info, 0, 4, 4, 4)
else if zone < 0
f_cell(info, 0, 4, f_t("Faltan reportes para el índice de 156 semanas: usa un gráfico diario o semanal.", "Not enough reports for the 156-week index: use a daily or weekly chart.", "Faltam relatórios para o índice de 156 semanas: use um gráfico diário ou semanal."), dim, text.align_left)
table.merge_cells(info, 0, 4, 4, 4)
else
f_cell(info, 0, 4, f_t("Nuestro estudio, tras lecturas de ", "Our study, after readings of ", "Nosso estudo, após leituras de ") + nameMain + f_t(" en zona ", " in the zone ", " na zona ") + f_zone(idxMain) + f_t(": ¿el movimiento posterior difirió del azar?", ": did the later move differ from chance?", ": o movimento posterior diferiu do acaso?"), cText, text.align_left)
table.merge_cells(info, 0, 4, 4, 4)
f_cell(info, 0, 5, f_t("horizonte", "horizon", "horizonte"), dim, text.align_left)
f_cell(info, 1, 5, f_t("resultado", "result", "resultado"), dim, text.align_left)
f_cell(info, 2, 5, "n", dim, text.align_right)
f_cell(info, 3, 5, f_t("n efectivo", "effective n", "n efetivo"), dim, text.align_right)
f_cell(info, 4, 5, f_t("episodios", "episodes", "episódios"), dim, text.align_right)
array<string> hz = array.from("4", "13", "26")
for h = 0 to 2
array<string> c = str.split(f_cellOf(zone, h), ",")
bool okc = c.size() >= 4
f_cell(info, 0, 6 + h, hz.get(h) + f_t(" semanas", " weeks", " semanas"), cText, text.align_left)
f_cell(info, 1, 6 + h, okc ? f_verdict(c.get(0)) : "—", cText, text.align_left)
f_cell(info, 2, 6 + h, okc ? c.get(1) : "—", cText, text.align_right)
f_cell(info, 3, 6 + h, okc ? c.get(2) : "—", cText, text.align_right)
f_cell(info, 4, 6 + h, okc ? c.get(3) : "—", cText, text.align_right)
string how = f_t("Comparado con las mismas lecturas movidas a fechas al azar (1.000 veces); 9 pruebas por mercado: una de cada veinte sale distinta por azar. Reportes desde ", "Compared with the same readings moved to random dates (1,000 times); 9 tests per market: one in twenty comes out different by chance. Reports from ", "Comparado com as mesmas leituras movidas para datas ao acaso (1.000 vezes); 9 testes por mercado: um em cada vinte sai diferente por acaso. Relatórios desde ") + fs.get(5) + f_t(" al ", " to ", " até ") + fs.get(4) + "."
f_cell(info, 0, 9, how, dim, text.align_left)
table.merge_cells(info, 0, 9, 4, 9)
string foot = f_t("Datos semanales de la CFTC, solo futuros: posiciones del martes publicadas el viernes. Posicionamiento, no es una señal.", "Weekly CFTC data, futures only: Tuesday positions published on Friday. Positioning, not a signal.", "Dados semanais da CFTC, só futuros: posições de terça publicadas na sexta. Posicionamento, não é um sinal.")
f_cell(info, 0, 10, foot, dim, text.align_left)
table.merge_cells(info, 0, 10, 4, 10)