Session Setup State

Perfiltrade · study · 813 行 · 点赞 3 · TradingView 原页

本页源码来自 TradingView 公开发布的开源脚本,版权归原作者所有, 请遵循其原始许可(Pine 脚本常见 CC BY-NC-SA / MPL-2.0 / MIT)。 本项目仅用于研究检索与许可范围内的移植。

Pine Script

//@version=6
indicator("Estado de setups", shorttitle = "Setups", overlay = true, max_lines_count = 100, max_labels_count = 50)
 
// State of the session setups, computed on the data of THIS chart, with what each state did in the past at this
// time of day.
//
// Three readings of the market's own day session:
//   - Gap against the previous session's last price: still open, filled, or ended without filling.
//   - Initial balance (first 60 minutes): unbroken, broken with price beyond the edge, or broken and back inside.
//   - Opening range (first 15 minutes): the same.
// Next to the gap and the unbroken initial balance: the share of past sessions that, being in that state at this time
// of day, ended with the outcome (the gap filled; the initial balance broke before the close), and the rate of all
// cases as the base. A broken range shows its state only: how often a session closed beyond the broken edge would be a
// probable direction, so it is not printed. A state whose outcome is already known carries no percentage.
//
// States: activo = in play; de vuelta dentro = broken and back inside; cumplido = the outcome happened;
// invalidado = the session ended without it.
//
// It is not a signal. Frequencies measured on past sessions of that market, pooled over all weekdays, in sample.
// The table updates inside the bar; the levels it uses are fixed when their window is complete.
 
// --- BEGIN GENERATED CONSTANTS
// Written by scripts/build_tradingview_constants.py. Do not edit by hand.
// 29 markets, statistics through 2026-10-16. Frequencies, counts and session hours only.
string DATA_THROUGH = "2026-10-16"
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_lvSess(string r) =>
    switch r
        "NKD" => "0900-1515"
        => "0930-1600"
f_lvTz(string r) =>
    switch r
        "NKD" => "Asia/Tokyo"
        => "America/New_York"
f_ownSess(string r) =>
    switch r
        "6A" => "0820-1500"
        "6B" => "0820-1500"
        "6C" => "0820-1500"
        "6E" => "0820-1500"
        "6J" => "0820-1500"
        "6M" => "0820-1500"
        "6N" => "0820-1500"
        "6S" => "0820-1500"
        "CL" => "0900-1430"
        "GC" => "0820-1330"
        "HG" => "0810-1300"
        "NG" => "0900-1430"
        "NKD" => "0900-1515"
        "PA" => "0830-1300"
        "PL" => "0820-1305"
        "SI" => "0820-1330"
        "ZB" => "0820-1500"
        "ZC" => "0930-1420"
        "ZF" => "0820-1500"
        "ZN" => "0820-1500"
        "ZS" => "0930-1420"
        "ZT" => "0820-1500"
        "ZW" => "0930-1420"
        => "0930-1600"
f_ownTz(string r) =>
    switch r
        "NKD" => "Asia/Tokyo"
        => "America/New_York"
f_ssA(string r) =>
    switch r
        "6A" => "SSA|6A|2026-10-16|4185|15,30,45,60,75,90,105,120,135,150,165,180,195,210,225,240,255,270,285,300,315,330,345,360,375,390,395|0.1802,0.2841|2072,882|1827,637,1745,555,1695,505,1643,453,1610,420,1565,375,1501,311,1449,259,1414,224,1387,197,1353,163,1331,141,1316,126,1304,114,1288,98,1275,85,1267,77,1258,68,1246,56,1238,48,1230,40,1224,34,1211,21,1202,12,1195,5,1194,4,1190,0|2003,833|1735,565,1677,507,1627,457,1585,415,1538,368,1498,328,1462,292,1429,259,1390,220,1358,188,1326,156,1307,137,1298,128,1289,119,1274,104,1264,94,1255,85,1249,79,1244,74,1232,62,1223,53,1218,48,1203,33,1193,23,1186,16,1177,7,1174,4|1394,1394|0,0,0,0,0,0,1394,1394,658,658,316,316,141,141,74,74,48,48,30,30,17,17,13,13,13,13,11,11,8,8,5,5,5,5,3,3,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0|1395,1302|0,0,0,0,0,0,1395,1302,851,758,623,530,432,339,339,246,283,190,235,142,199,106,169,76,161,68,146,53,136,43,128,35,124,31,119,26,114,21,113,20,106,13,105,12,103,10,101,8,99,6,95,2,93,0"
        "6B" => "SSA|6B|2026-10-16|4185|15,30,45,60,75,90,105,120,135,150,165,180,195,210,225,240,255,270,285,300,315,330,345,360,375,390,395|0.1623,0.2534|2008,877|1728,597,1644,513,1584,453,1537,406,1497,366,1461,330,1403,272,1366,235,1333,202,1312,181,1272,141,1250,119,1241,110,1232,101,1222,91,1215,84,1201,70,1188,57,1183,52,1178,47,1171,40,1164,33,1151,20,1144,13,1137,6,1133,2,1132,1|2077,964|1768,655,1676,563,1599,486,1542,429,1493,380,1448,335,1401,288,1351,238,1320,207,1285,172,1243,130,1219,106,1204,91,1196,83,1184,71,1174,61,1166,53,1160,47,1154,41,1153,40,1148,35,1139,26,1127,14,1125,12,1119,6,1116,3,1116,3|1395,1395|0,0,0,0,0,0,1395,1395,611,611,324,324,164,164,94,94,61,61,34,34,19,19,14,14,12,12,8,8,6,6,5,5,4,4,3,3,2,2,2,2,1,1,1,1,1,1,1,1,0,0,0,0,0,0|1395,1307|0,0,0,0,0,0,1395,1307,903,815,667,579,488,400,379,291,322,234,261,173,211,123,176,88,162,74,150,62,133,45,125,37,124,36,118,30,112,24,108,20,103,15,103,15,98,10,93,5,92,4,89,1,89,1"
        "6C" => "SSA|6C|2026-10-16|4185|15,30,45,60,75,90,105,120,135,150,165,180,195,210,225,240,255,270,285,300,315,330,345,360,375,390,395|0.1543,0.2558|1958,1111|1556,709,1460,613,1392,545,1343,496,1281,434,1223,376,1135,288,1100,253,1055,208,1025,178,993,146,979,132,955,108,930,83,922,75,918,71,912,65,903,56,894,47,890,43,884,37,876,29,870,23,864,17,857,10,850,3,849,2|2106,1149|1646,689,1527,570,1454,497,1408,451,1375,418,1322,365,1248,291,1206,249,1159,202,1132,175,1100,143,1078,121,1065,108,1051,94,1036,79,1029,72,1017,60,1011,54,1001,44,1001,44,996,39,990,33,977,20,972,15,966,9,961,4,958,1|1395,1392|0,0,0,0,0,0,1395,1392,596,593,290,287,130,127,75,72,46,43,31,28,13,10,9,6,5,2,5,2,4,1,4,1,4,1,3,0,3,0,3,0,3,0,3,0,3,0,3,0,3,0,3,0,3,0|1394,1260|0,0,0,0,0,0,1394,1260,936,802,705,571,529,395,421,287,355,221,309,175,265,131,240,106,216,82,199,65,193,59,183,49,177,43,171,37,164,30,160,26,157,23,154,20,148,14,144,10,139,5,136,2,135,1"
        "6E" => "SSA|6E|2026-10-16|4184|15,30,45,60,75,90,105,120,135,150,165,180,195,210,225,240,255,270,285,300,315,330,345,360,375,390,395|0.1586,0.2567|1961,915|1654,608,1551,505,1475,429,1426,380,1385,339,1352,306,1305,259,1265,219,1237,191,1212,166,1178,132,1162,116,1155,109,1143,97,1125,79,1113,67,1106,60,1101,55,1089,43,1086,40,1080,34,1077,31,1062,16,1060,14,1059,13,1054,8,1049,3|2123,1039|1766,682,1664,580,1595,511,1539,455,1491,407,1443,359,1384,300,1334,250,1309,225,1273,189,1244,160,1219,135,1203,119,1189,105,1174,90,1160,76,1153,69,1143,59,1137,53,1125,41,1121,37,1112,28,1102,18,1096,12,1091,7,1087,3,1087,3|1396,1388|0,0,0,0,0,0,1396,1388,628,620,312,304,150,142,93,85,71,63,50,42,31,23,20,12,17,9,15,7,13,5,11,3,10,2,10,2,10,2,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0|1395,1291|0,0,0,0,0,0,1395,1291,879,775,654,550,459,355,356,252,301,197,252,148,210,106,189,85,178,74,166,62,156,52,148,44,139,35,137,33,131,27,128,24,125,21,120,16,116,12,115,11,110,6,107,3,106,2"
        "6J" => "SSA|6J|2026-10-16|4184|15,30,45,60,75,90,105,120,135,150,165,180,195,210,225,240,255,270,285,300,315,330,345,360,375,390,395|0.1459,0.2504|1942,884|1612,554,1545,487,1484,426,1443,385,1405,347,1360,302,1309,251,1291,233,1261,203,1236,178,1211,153,1200,142,1185,127,1172,114,1160,102,1148,90,1138,80,1127,69,1119,61,1114,56,1107,49,1102,44,1087,29,1082,24,1070,12,1063,5,1062,4|2132,944|1782,594,1704,516,1643,455,1596,408,1561,373,1512,324,1447,259,1409,221,1395,207,1372,184,1350,162,1330,142,1312,124,1295,107,1286,98,1272,84,1263,75,1257,69,1247,59,1238,50,1234,46,1227,39,1212,24,1202,14,1200,12,1193,5,1192,4|1394,1387|0,0,0,0,0,0,1394,1387,702,695,336,329,158,151,117,110,85,78,59,52,29,22,26,19,24,17,21,14,15,8,15,8,13,6,13,6,11,4,9,2,9,2,8,1,8,1,8,1,8,1,7,0,7,0|1395,1246|0,0,0,0,0,0,1395,1246,926,777,724,575,510,361,424,275,371,222,324,175,283,134,252,103,236,87,225,76,217,68,210,61,201,52,193,44,187,38,180,31,176,27,173,24,165,16,160,11,157,8,153,4,150,1"
        "6M" => "SSA|6M|2026-10-16|4185|15,30,45,60,75,90,105,120,135,150,165,180,195,210,225,240,255,270,285,300,315,330,345,360,375,390,395|0.2541,0.3929|2143,1181|1796,834,1683,721,1611,649,1537,575,1473,511,1404,442,1331,369,1267,305,1231,269,1197,235,1162,200,1151,189,1134,172,1113,151,1101,139,1087,125,1067,105,1057,95,1051,89,1036,74,1026,64,1017,55,1005,43,993,31,979,17,971,9,968,6|1871,1096|1489,714,1377,602,1300,525,1249,474,1183,408,1122,347,1080,305,1043,268,1010,235,982,207,958,183,936,161,921,146,906,131,889,114,877,102,860,85,852,77,843,68,834,59,824,49,815,40,800,25,793,18,788,13,780,5,778,3|1393,1386|0,0,0,0,0,0,1393,1386,710,703,375,368,221,214,150,143,103,96,80,73,51,44,42,35,29,22,23,16,22,15,18,11,15,8,13,6,13,6,11,4,10,3,10,3,9,2,8,1,8,1,8,1,7,0|1395,1311|0,0,0,0,0,0,1395,1311,903,819,665,581,511,427,411,327,343,259,286,202,253,169,217,133,197,113,179,95,157,73,152,68,138,54,124,40,119,35,115,31,107,23,103,19,98,14,94,10,91,7,89,5,87,3"
        "6N" => "SSA|6N|2026-10-16|4182|15,30,45,60,75,90,105,120,135,150,165,180,195,210,225,240,255,270,285,300,315,330,345,360,375,390,395|0.1868,0.2964|2037,870|1773,606,1690,523,1628,461,1582,415,1555,388,1508,341,1450,283,1412,245,1387,220,1349,182,1314,147,1296,129,1278,111,1266,99,1254,87,1247,80,1240,73,1231,64,1227,60,1220,53,1217,50,1210,43,1199,32,1189,22,1182,15,1175,8,1172,5|2050,847|1759,556,1690,487,1634,431,1603,400,1558,355,1514,311,1464,261,1431,228,1391,188,1364,161,1336,133,1322,119,1315,112,1304,101,1293,90,1290,87,1281,78,1270,67,1261,58,1256,53,1251,48,1245,42,1229,26,1222,19,1217,14,1205,2,1203,0|1394,1391|0,0,0,0,0,0,1394,1391,637,634,301,298,152,149,90,87,52,49,35,32,17,14,12,9,7,4,5,2,4,1,4,1,4,1,3,0,3,0,3,0,3,0,3,0,3,0,3,0,3,0,3,0,3,0|1394,1302|0,0,0,0,0,0,1394,1302,864,772,655,563,475,383,371,279,311,219,262,170,228,136,203,111,184,92,166,74,156,64,147,55,138,46,132,40,125,33,120,28,114,22,110,18,106,14,99,7,97,5,96,4,94,2"
        "6S" => "SSA|6S|2026-10-16|4185|15,30,45,60,75,90,105,120,135,150,165,180,195,210,225,240,255,270,285,300,315,330,345,360,375,390,395|0.1632,0.2649|1927,913|1611,597,1509,495,1461,447,1421,407,1368,354,1337,323,1277,263,1236,222,1211,197,1185,171,1150,136,1133,119,1121,107,1109,95,1097,83,1085,71,1079,65,1072,58,1056,42,1054,40,1046,32,1041,27,1026,12,1023,9,1018,4,1015,1,1015,1|2142,1052|1812,722,1712,622,1621,531,1566,476,1519,429,1454,364,1379,289,1323,233,1289,199,1258,168,1221,131,1207,117,1187,97,1173,83,1164,74,1151,61,1141,51,1134,44,1125,35,1122,32,1119,29,1113,23,1108,18,1103,13,1100,10,1093,3,1092,2|1396,1394|0,0,0,0,0,0,1396,1394,656,654,347,345,161,159,87,85,57,55,40,38,22,20,17,15,12,10,9,7,6,4,3,1,3,1,3,1,3,1,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0|1396,1288|0,0,0,0,0,0,1396,1288,874,766,648,540,465,357,379,271,308,200,258,150,208,100,191,83,178,70,167,59,156,48,150,42,144,36,141,33,135,27,128,20,123,15,120,12,118,10,117,9,112,4,110,2,109,1"
        "BTC" => "SSA|BTC|2026-10-16|2281|15,30,45,60,75,90,105,120,135,150,165,180,195,210,225,240,255,270,285,300,315,330,345,360,375,385|0.9166,1.5422|1125,457|1012,344,957,289,925,257,892,224,869,201,838,170,813,145,796,128,783,115,770,102,757,89,750,82,745,77,743,75,738,70,729,61,721,53,712,44,707,39,703,35,694,26,691,23,689,21,678,10,673,5,670,2|1035,412|925,302,886,263,847,224,812,189,792,169,775,152,756,133,743,120,733,110,722,99,717,94,706,83,699,76,693,70,685,62,682,59,676,53,669,46,661,38,657,34,648,25,641,18,638,15,635,12,633,10,624,1|761,756|0,0,0,0,0,0,761,756,409,404,258,253,174,169,120,115,92,87,65,60,53,48,44,39,38,33,36,31,32,27,28,23,23,18,17,12,13,8,11,6,8,3,7,2,7,2,6,1,6,1,5,0|761,709|0,0,0,0,0,0,761,709,457,405,359,307,278,226,229,177,199,147,173,121,154,102,141,89,127,75,115,63,109,57,99,47,89,37,85,33,82,30,77,25,70,18,62,10,58,6,57,5,55,3,54,2"
        "CL" => "SSA|CL|2026-10-16|2927|15,30,45,60,75,90,105,120,135,150,165,180,195,210,225,240,255,270,285,300,315,325|0.8546,1.2927|1450,739|1210,499,1140,429,1067,356,1027,316,977,266,945,234,901,190,863,152,831,120,804,93,788,77,780,69,771,60,760,49,752,41,746,35,740,29,732,21,726,15,723,12,717,6,714,3|1319,702|1088,471,1026,409,952,335,917,300,871,254,836,219,800,183,768,151,744,127,724,107,706,89,694,77,682,65,674,57,668,51,664,47,651,34,647,30,641,24,637,20,627,10,621,4|976,974|0,0,0,0,0,0,976,974,397,395,230,228,92,90,50,48,30,28,19,17,14,12,12,10,9,7,6,4,4,2,4,2,4,2,4,2,4,2,4,2,2,0,2,0|976,943|0,0,0,0,0,0,976,943,504,471,379,346,260,227,208,175,168,135,126,93,108,75,88,55,74,41,71,38,67,34,62,29,54,21,50,17,46,13,43,10,38,5,35,2"
        "ES" => "SSA|ES|2026-10-16|4205|15,30,45,60,75,90,105,120,135,150,165,180,195,210,225,240,255,270,285,300,315,330,345,360,375,385|0.3625,0.5936|2273,1325|1715,767,1566,618,1434,486,1364,416,1307,359,1253,305,1218,270,1195,247,1166,218,1146,198,1128,180,1111,163,1103,155,1090,142,1081,133,1068,120,1052,104,1044,96,1032,84,1024,76,1007,59,1000,52,988,40,975,27,959,11,949,1|1822,1115|1338,631,1228,521,1134,427,1074,367,1022,315,988,281,954,247,927,220,897,190,881,174,868,161,852,145,840,133,834,127,824,117,819,112,812,105,809,102,786,79,779,72,759,52,756,49,744,37,732,25,724,17,718,11|1401,1378|0,0,0,0,0,0,1401,1378,716,693,487,464,336,313,257,234,201,178,161,138,138,115,116,93,103,80,90,67,81,58,79,56,74,51,69,46,58,35,46,23,41,18,37,14,34,11,31,8,30,7,26,3|1402,1349|0,0,0,0,0,0,1402,1349,747,694,553,500,440,387,359,306,299,246,255,202,226,173,204,151,180,127,166,113,151,98,139,86,125,72,117,64,102,49,92,39,85,32,77,24,67,14,65,12,60,7,55,2"
        "ETH" => "SSA|ETH|2026-10-16|1472|15,30,45,60,75,90,105,120,135,150,165,180,195,210,225,240,255,270,285,300,315,330,345,360,375,385|1.2128,1.9635|730,301|642,213,603,174,584,155,562,133,542,113,531,102,521,92,510,81,502,73,494,65,490,61,485,56,479,50,474,45,470,41,465,36,460,31,455,26,449,20,445,16,442,13,440,11,436,7,433,4,430,1,429,0|666,270|576,180,548,152,531,135,516,120,501,105,492,96,484,88,478,82,473,77,469,73,463,67,458,62,454,58,448,52,444,48,441,45,437,41,430,34,423,27,419,23,414,18,409,13,406,10,404,8,398,2,397,1|491,489|0,0,0,0,0,0,491,489,255,253,157,155,106,104,73,71,52,50,38,36,33,31,28,26,21,19,18,16,17,15,12,10,8,6,6,4,5,3,3,1,2,0,2,0,2,0,2,0,2,0,2,0|490,449|0,0,0,0,0,0,490,449,284,243,236,195,183,142,150,109,131,90,122,81,107,66,98,57,85,44,80,39,75,34,69,28,59,18,57,16,53,12,52,11,50,9,50,9,49,8,45,4,44,3,41,0"
        "GC" => "SSA|GC|2026-10-16|4180|15,30,45,60,75,90,105,120,135,150,165,180,195,210,225,240,255,270,285,300,305|0.3538,0.5497|2141,1067|1719,645,1615,541,1548,474,1483,409,1431,357,1358,284,1285,211,1246,172,1214,140,1190,116,1167,93,1150,76,1138,64,1127,53,1118,44,1112,38,1102,28,1096,22,1091,17,1083,9,1078,4|1946,969|1544,567,1437,460,1373,396,1316,339,1269,292,1212,235,1170,193,1132,155,1104,127,1088,111,1070,93,1055,78,1037,60,1025,48,1011,34,1005,28,1000,23,993,16,989,12,982,5,979,2|1394,1390|0,0,0,0,0,0,1394,1390,663,659,317,313,155,151,99,95,59,55,43,39,23,19,19,15,14,10,9,5,9,5,8,4,7,3,5,1,4,0,4,0,4,0|1393,1222|0,0,0,0,0,0,1393,1222,915,744,651,480,490,319,408,237,347,176,312,141,274,103,250,79,230,59,222,51,210,39,198,27,195,24,189,18,184,13,176,5,176,5"
        "HG" => "SSA|HG|2026-10-16|4181|15,30,45,60,75,90,105,120,135,150,165,180,195,210,225,240,255,270,285|0.4692,0.6991|2030,869|1762,601,1656,495,1598,437,1519,358,1479,318,1429,268,1390,229,1349,188,1322,161,1289,128,1262,101,1246,85,1233,72,1221,60,1201,40,1190,29,1179,18,1170,9,1162,1|2042,885|1807,650,1693,536,1642,485,1555,398,1504,347,1461,304,1412,255,1375,218,1346,189,1310,153,1280,123,1247,90,1224,67,1207,50,1195,38,1181,24,1176,19,1171,14,1161,4|1395,1388|0,0,0,0,0,0,1395,1388,611,604,314,307,169,162,102,95,62,55,44,37,34,27,28,21,19,12,16,9,16,9,13,6,12,5,11,4,8,1|1394,1287|0,0,0,0,0,0,1394,1287,833,726,631,524,470,363,363,256,292,185,242,135,213,106,192,85,173,66,149,42,136,29,123,16,118,11,113,6,110,3"
        "NG" => "SSA|NG|2026-10-16|2927|15,30,45,60,75,90,105,120,135,150,165,180,195,210,225,240,255,270,285,300,315,325|1.2592,1.9357|1383,685|1154,456,1069,371,1012,314,978,280,940,242,907,209,851,153,829,131,815,117,802,104,791,93,782,84,772,74,766,68,755,57,749,51,736,38,731,33,721,23,715,17,704,6,702,4|1391,676|1128,413,1051,336,1003,288,968,253,945,230,920,205,867,152,846,131,827,112,813,98,798,83,794,79,784,69,774,59,768,53,763,48,754,39,748,33,743,28,729,14,722,7,717,2|976,957|0,0,0,0,0,0,976,957,552,533,359,340,211,192,165,146,131,112,100,81,87,68,77,58,66,47,57,38,53,34,44,25,37,18,31,12,28,9,25,6,23,4,23,4|976,925|0,0,0,0,0,0,976,925,580,529,474,423,331,280,283,232,246,195,217,166,177,126,148,97,128,77,114,63,103,52,93,42,82,31,74,23,68,17,65,14,56,5,52,1"
        "NKD" => "SSA|NKD|2026-10-16|4207|15,30,45,60,75,90,105,120,135,150,165,180,195,210,225,240,255,270,285,300,315,330,345,360,370|0.4185,0.6621|2215,898|1880,563,1769,452,1714,397,1672,355,1626,309,1592,275,1559,242,1536,219,1513,196,1488,171,1482,165,1476,159,1471,154,1462,145,1435,118,1416,99,1406,89,1394,77,1387,70,1377,60,1364,47,1354,37,1346,29,1330,13,1319,2|1870,805|1583,518,1496,431,1440,375,1399,334,1366,301,1329,264,1304,239,1278,213,1261,196,1249,184,1240,175,1233,168,1228,163,1224,159,1186,121,1167,102,1153,88,1145,80,1135,70,1125,60,1110,45,1102,37,1088,23,1079,14,1071,6|1409,1366|0,0,0,0,0,0,1409,1366,861,818,618,575,458,415,361,318,295,252,246,203,228,185,212,169,193,150,177,134,150,107,126,83,112,69,103,60,92,49,86,43,71,28,68,25,58,15,52,9,44,1|1396,1298|0,0,0,0,0,0,1396,1298,839,741,676,578,525,427,445,347,375,277,346,248,323,225,306,208,292,194,283,185,226,128,208,110,196,98,182,84,173,75,161,63,145,47,130,32,123,25,113,15,101,3"
        "NQ" => "SSA|NQ|2026-10-16|4205|15,30,45,60,75,90,105,120,135,150,165,180,195,210,225,240,255,270,285,300,315,330,345,360,375,385|0.5432,0.85|2329,1402|1647,720,1481,554,1358,431,1291,364,1246,319,1185,258,1154,227,1130,203,1109,182,1090,163,1079,152,1067,140,1056,129,1047,120,1035,108,1027,100,1008,81,998,71,988,61,972,45,962,35,954,27,947,20,942,15,937,10,929,2|1793,1148|1211,566,1087,442,995,350,948,303,902,257,860,215,844,199,823,178,806,161,790,145,768,123,762,117,755,110,745,100,734,89,725,80,716,71,711,66,699,54,692,47,682,37,675,30,670,25,666,21,658,13,649,4|1402,1355|0,0,0,0,0,0,1402,1355,758,711,522,475,381,334,308,261,241,194,207,160,178,131,167,120,151,104,131,84,114,67,105,58,99,52,90,43,80,33,69,22,63,16,61,14,57,10,53,6,49,2,49,2|1402,1317|0,0,0,0,0,0,1402,1317,729,644,552,467,439,354,373,288,317,232,282,197,251,166,234,149,215,130,207,122,189,104,178,93,164,79,156,71,149,64,137,52,126,41,116,31,109,24,103,18,94,9,88,3"
        "PA" => "SSA|PA|2026-10-16|4183|15,30,45,60,75,90,105,120,135,150,165,180,195,210,225,240,255,265|0.7511,1.2704|2152,1032|1763,643,1662,542,1544,424,1501,381,1435,315,1389,269,1352,232,1318,198,1285,165,1258,138,1238,118,1215,95,1190,70,1175,55,1160,40,1146,26,1136,16,1131,11|1940,904|1596,560,1516,480,1425,389,1373,337,1320,284,1283,247,1243,207,1211,175,1187,151,1161,125,1138,102,1118,82,1104,68,1089,53,1079,43,1074,38,1061,25,1054,18|1394,1384|0,0,0,0,0,0,1394,1384,654,644,408,398,249,239,167,157,102,92,74,64,50,40,39,29,30,20,24,14,19,9,17,7,14,4,13,3|1395,1234|0,0,0,0,0,0,1395,1234,857,696,683,522,539,378,459,298,390,229,341,180,300,139,274,113,246,85,222,61,207,46,199,38,185,24,177,16"
        "PL" => "SSA|PL|2026-10-16|4183|15,30,45,60,75,90,105,120,135,150,165,180,195,210,225,240,255,270,280|0.5949,0.9545|2080,941|1744,605,1644,505,1548,409,1483,344,1430,291,1380,241,1345,206,1311,172,1276,137,1251,112,1234,95,1218,79,1200,61,1190,51,1178,39,1164,25,1158,19,1151,12,1142,3|2021,921|1664,564,1570,470,1505,405,1457,357,1398,298,1344,244,1304,204,1260,160,1230,130,1211,111,1196,96,1176,76,1161,61,1149,49,1141,41,1133,33,1121,21,1113,13,1107,7|1395,1384|0,0,0,0,0,0,1395,1384,728,717,409,398,261,250,155,144,107,96,76,65,55,44,41,30,34,23,23,12,21,10,19,8,16,5,14,3,14,3|1395,1284|0,0,0,0,0,0,1395,1284,799,688,554,443,422,311,337,226,280,169,239,128,214,103,185,74,171,60,160,49,149,38,139,28,129,18,121,10,118,7"
        "RTY" => "SSA|RTY|2026-10-16|2392|15,30,45,60,75,90,105,120,135,150,165,180,195,210,225,240,255,270,285,300,315,330,345,360,375,385|0.7372,1.0931|1294,816|855,377,766,288,705,227,668,190,637,159,615,137,597,119,580,102,572,94,566,88,556,78,546,68,540,62,536,58,531,53,529,51,524,46,520,42,513,35,511,33,507,29,498,20,492,14,484,6,482,4,479,1|1048,649|696,297,639,240,593,194,563,164,541,142,517,118,506,107,492,93,485,86,474,75,467,68,464,65,453,54,451,52,447,48,444,45,439,40,434,35,423,24,418,19,414,15,412,13,411,12,409,10,403,4,402,3|797,773|0,0,0,0,0,0,797,773,396,372,264,240,202,178,152,128,123,99,102,78,88,64,74,50,63,39,53,29,50,26,45,21,43,19,40,16,39,15,37,13,34,10,30,6,29,5,27,3,27,3,25,1|798,736|0,0,0,0,0,0,798,736,422,360,333,271,291,229,249,187,212,150,188,126,174,112,156,94,147,85,139,77,127,65,112,50,102,40,99,37,98,36,92,30,84,22,82,20,78,16,73,11,70,8,64,2"
        "SI" => "SSA|SI|2026-10-16|4181|15,30,45,60,75,90,105,120,135,150,165,180,195,210,225,240,255,270,285,300,305|0.6692,1.0507|2078,1026|1684,632,1585,533,1506,454,1450,398,1404,352,1356,304,1290,238,1251,199,1220,168,1190,138,1165,113,1142,90,1128,76,1115,63,1107,55,1099,47,1089,37,1083,31,1071,19,1060,8,1056,4|1982,1027|1567,612,1482,527,1404,449,1334,379,1268,313,1218,263,1165,210,1135,180,1104,149,1079,124,1059,104,1041,86,1029,74,1012,57,999,44,993,38,983,28,975,20,973,18,965,10,958,3|1393,1380|0,0,0,0,0,0,1393,1380,652,639,322,309,179,166,122,109,84,71,65,52,47,34,35,22,27,14,24,11,22,9,21,8,20,7,18,5,15,2,13,0,13,0|1394,1226|0,0,0,0,0,0,1394,1226,872,704,608,440,471,303,394,226,339,171,290,122,257,89,230,62,220,52,211,43,201,33,190,22,186,18,182,14,176,8,170,2,169,1"
        "YM" => "SSA|YM|2026-10-16|4209|15,30,45,60,75,90,105,120,135,150,165,180,195,210,225,240,255,270,285,300,315,330,345,360,375,385|0.3819,0.5996|2240,1290|1615,665,1493,543,1383,433,1341,391,1293,343,1242,292,1199,249,1171,221,1150,200,1133,183,1118,168,1097,147,1082,132,1075,125,1061,111,1055,105,1042,92,1033,83,1012,62,1003,53,995,45,990,40,974,24,966,16,957,7,951,1|1879,1167|1308,596,1212,500,1109,397,1059,347,1020,308,984,272,954,242,934,222,917,205,897,185,886,174,871,159,857,145,846,134,837,125,829,117,818,106,811,99,790,78,776,64,769,57,763,51,752,40,742,30,726,14,716,4|1403,1370|0,0,0,0,0,0,1403,1370,774,741,521,488,369,336,289,256,240,207,207,174,183,150,162,129,141,108,126,93,114,81,105,72,98,65,89,56,75,42,69,36,58,25,55,22,52,19,48,15,44,11,39,6|1402,1325|0,0,0,0,0,0,1402,1325,783,706,603,526,489,412,404,327,331,254,296,219,265,188,243,166,222,145,206,129,185,108,173,96,164,87,152,75,140,63,128,51,114,37,106,29,99,22,95,18,87,10,83,6"
        "ZB" => "SSA|ZB|2026-10-16|4202|15,30,45,60,75,90,105,120,135,150,165,180,195,210,225,240,255,270,285,300,315,330,345,360,375,390,395|0.2449,0.3844|2011,1078|1576,643,1475,542,1400,467,1344,411,1303,370,1241,308,1185,252,1163,230,1137,204,1111,178,1088,155,1065,132,1049,116,1037,104,1027,94,1017,84,1012,79,1010,77,999,66,989,56,983,50,975,42,966,33,959,26,948,15,944,11,940,7|2030,1113|1603,686,1493,576,1411,494,1358,441,1317,400,1257,340,1200,283,1169,252,1141,224,1119,202,1095,178,1074,157,1059,142,1043,126,1027,110,1018,101,1002,85,992,75,978,61,970,53,964,47,957,40,950,33,939,22,929,12,923,6,920,3|1401,1391|0,0,0,0,0,0,1401,1391,756,746,426,416,232,222,151,141,108,98,80,70,55,45,43,33,34,24,30,20,25,15,20,10,19,9,16,6,16,6,14,4,14,4,13,3,13,3,11,1,11,1,11,1,11,1|1401,1290|0,0,0,0,0,0,1401,1290,931,820,707,596,535,424,445,334,379,268,330,219,287,176,257,146,234,123,216,105,198,87,190,79,174,63,161,50,148,37,137,26,137,26,131,20,126,15,121,10,118,7,114,3,113,2"
        "ZC" => "SSA|ZC|2026-10-16|3382|15,30,45,60,75,90,105,120,135,150,165,180,195,210,225,240,255,270,285|0.7652,1.0936|1504,923|954,373,884,303,822,241,785,204,758,177,737,156,719,138,703,122,691,110,670,89,643,62,632,51,623,42,617,36,608,27,604,23,600,19,594,13,584,3|1652,1024|1033,405,959,331,914,286,878,250,836,208,811,183,789,161,770,142,756,128,740,112,706,78,698,70,692,64,685,57,675,47,663,35,659,31,654,26,634,6|1129,1077|0,0,0,0,0,0,1129,1077,661,609,463,411,340,288,276,224,227,175,186,134,157,105,138,86,120,68,108,56,97,45,87,35,83,31,68,16,54,2|1127,949|0,0,0,0,0,0,1127,949,705,527,570,392,486,308,441,263,398,220,361,183,320,142,297,119,268,90,252,74,241,63,232,54,222,44,208,30,181,3"
        "ZF" => "SSA|ZF|2026-10-16|4211|15,30,45,60,75,90,105,120,135,150,165,180,195,210,225,240,255,270,285,300,315,330,345,360,375,390,395|0.0718,0.1214|1959,1067|1525,633,1424,532,1352,460,1289,397,1247,355,1185,293,1136,244,1098,206,1076,184,1054,162,1029,137,1017,125,1005,113,988,96,979,87,974,82,972,80,969,77,958,66,949,57,942,50,933,41,917,25,911,19,901,9,896,4,894,2|2087,1161|1603,677,1504,578,1440,514,1382,456,1344,418,1294,368,1227,301,1194,268,1176,250,1144,218,1115,189,1096,170,1078,152,1058,132,1044,118,1026,100,1015,89,1010,84,999,73,990,64,980,54,975,49,959,33,948,22,939,13,931,5,929,3|1402,1387|0,0,0,0,0,0,1402,1387,805,790,461,446,264,249,184,169,129,114,97,82,71,56,53,38,41,26,34,19,28,13,26,11,25,10,24,9,22,7,20,5,19,4,19,4,18,3,17,2,16,1,16,1,15,0|1407,1245|0,0,0,0,0,0,1407,1245,945,783,719,557,566,404,481,319,424,262,376,214,347,185,320,158,306,144,285,123,272,110,255,93,247,85,237,75,221,59,213,51,204,42,193,31,186,24,176,14,171,9,167,5,164,2"
        "ZN" => "SSA|ZN|2026-10-16|4196|15,30,45,60,75,90,105,120,135,150,165,180,195,210,225,240,255,270,285,300,315,330,345,360,375,390,395|0.1213,0.1957|1967,1045|1542,620,1439,517,1363,441,1316,394,1282,360,1220,298,1175,253,1145,223,1119,197,1095,173,1076,154,1054,132,1035,113,1023,101,1012,90,1006,84,1002,80,996,74,987,65,979,57,967,45,962,40,946,24,938,16,930,8,926,4,923,1|2049,1116|1600,667,1494,561,1431,498,1373,440,1332,399,1281,348,1215,282,1186,253,1167,234,1142,209,1119,186,1103,170,1087,154,1063,130,1053,120,1041,108,1027,94,1012,79,999,66,990,57,984,51,979,46,961,28,950,17,944,11,938,5,935,2|1398,1390|0,0,0,0,0,0,1398,1390,786,778,456,448,227,219,152,144,114,106,86,78,58,50,40,32,30,22,25,17,23,15,22,14,20,12,20,12,17,9,15,7,13,5,13,5,10,2,9,1,9,1,9,1,9,1|1399,1247|0,0,0,0,0,0,1399,1247,962,810,739,587,574,422,480,328,434,282,384,232,352,200,333,181,312,160,287,135,269,117,257,105,245,93,235,83,216,64,202,50,191,39,182,30,168,16,162,10,157,5,155,3,154,2"
        "ZS" => "SSA|ZS|2026-10-16|3382|15,30,45,60,75,90,105,120,135,150,165,180,195,210,225,240,255,270,285|0.6377,0.8954|1756,1031|1203,478,1105,380,1047,322,1002,277,961,236,931,206,906,181,877,152,856,131,836,111,797,72,788,63,775,50,768,43,761,36,755,30,748,23,740,15,730,5|1508,867|1039,398,965,324,915,274,869,228,831,190,808,167,789,148,770,129,755,114,737,96,707,66,694,53,683,42,679,38,670,29,667,26,663,22,655,14,642,1|1129,1088|0,0,0,0,0,0,1129,1088,592,551,409,368,302,261,233,192,184,143,145,104,120,79,100,59,87,46,74,33,65,24,61,20,56,15,52,11,41,0|1128,968|0,0,0,0,0,0,1128,968,680,520,566,406,491,331,436,276,384,224,347,187,311,151,284,124,258,98,238,78,221,61,204,44,196,36,181,21,162,2"
        "ZT" => "SSA|ZT|2026-10-16|4215|15,30,45,60,75,90,105,120,135,150,165,180,195,210,225,240,255,270,285,300,315,330,345,360,375,390,395|0.0214,0.0414|1791,1073|1268,550,1181,463,1120,402,1060,342,1031,313,969,251,926,208,896,178,872,154,849,131,836,118,823,105,812,94,799,81,791,73,790,72,781,63,773,55,761,43,755,37,746,28,745,27,738,20,734,16,728,10,722,4,721,3|1930,1122|1388,580,1292,484,1232,424,1192,384,1148,340,1109,301,1044,236,1016,208,999,191,974,166,957,149,939,131,924,116,917,109,906,98,894,86,886,78,881,73,876,68,870,62,863,55,856,48,839,31,825,17,815,7,813,5,811,3|1375,1262|0,0,0,0,0,0,1375,1262,1075,962,823,710,616,503,527,414,442,329,381,268,340,227,294,181,269,156,250,137,229,116,219,106,205,92,196,83,172,59,161,48,152,39,146,33,139,26,134,21,127,14,120,7,118,5|1406,1190|0,0,0,0,0,0,1406,1190,999,783,787,571,618,402,537,321,491,275,441,225,408,192,379,163,365,149,342,126,325,109,309,93,296,80,293,77,282,66,275,59,268,52,259,43,250,34,241,25,231,15,222,6,219,3"
        "ZW" => "SSA|ZW|2026-10-16|3382|15,30,45,60,75,90,105,120,135,150,165,180,195,210,225,240,255,270,285|1.0389,1.471|1614,1002|1029,417,932,320,861,249,819,207,781,169,765,153,736,124,721,109,706,94,699,87,674,62,665,53,657,45,649,37,643,31,638,26,630,18,628,16,615,3|1625,925|1123,423,1028,328,961,261,911,211,878,178,856,156,835,135,811,111,790,90,782,82,765,65,748,48,743,43,737,37,732,32,725,25,719,19,714,14,703,3|1128,1093|0,0,0,0,0,0,1128,1093,579,544,417,382,316,281,225,190,183,148,153,118,112,77,102,67,88,53,77,42,69,34,60,25,57,22,51,16,37,2|1127,947|0,0,0,0,0,0,1127,947,683,503,559,379,481,301,423,243,367,187,337,157,293,113,271,91,257,77,243,63,232,52,227,47,215,35,208,28,183,3"
        => ""
f_ssB(string r) =>
    switch r
        "6A" => "SSB|6A|2833,1430|0,0,0,0,0,0,0,0,459,241,703,411,865,550,1034,686,1103,767,1175,833,1200,873,1227,918,1264,962,1312,1016,1314,1030,1343,1045,1347,1070,1328,1078,1333,1100,1347,1130,1367,1155,1373,1183,1411,1235,1410,1259,1436,1300,1430,1337,1441,1360|0,0,0,0,0,0,0,0,481,216,754,330,958,359,1024,350,1087,340,1137,335,1220,349,1266,341,1266,314,1264,287,1295,291,1288,285,1306,272,1341,272,1354,261,1355,241,1353,225,1356,199,1351,160,1376,147,1364,112,1389,85,1382,64|2829,1404|0,0,0,0,0,0,0,0,482,280,728,456,967,608,1042,678,1146,764,1216,838,1242,889,1281,934,1294,961,1308,997,1343,1038,1331,1062,1359,1089,1361,1114,1356,1135,1368,1149,1370,1158,1360,1168,1398,1223,1389,1253,1415,1292,1397,1327,1401,1342|0,0,0,0,0,0,0,0,514,238,765,305,909,337,1022,354,1039,319,1094,311,1196,319,1214,304,1230,293,1261,283,1259,258,1299,248,1295,229,1312,217,1341,207,1344,199,1361,196,1381,189,1373,147,1396,125,1382,91,1417,66,1422,57"
        "6B" => "SSB|6B|2795,1401|0,0,0,0,0,0,0,0,503,300,744,451,919,579,1020,677,1065,732,1142,811,1225,916,1255,945,1254,977,1274,1006,1285,1037,1285,1056,1302,1073,1324,1101,1353,1145,1346,1152,1342,1166,1365,1197,1380,1232,1400,1261,1403,1284,1398,1323,1399,1342|0,0,0,0,0,0,0,0,471,214,692,287,851,331,984,341,1068,352,1108,338,1168,302,1209,307,1263,296,1280,289,1306,274,1330,269,1343,266,1334,246,1324,211,1345,208,1368,201,1363,176,1373,151,1367,128,1371,108,1387,74,1389,56|2756,1361|0,0,0,0,0,0,0,0,470,256,691,413,899,554,991,640,1066,699,1129,772,1197,855,1239,916,1239,936,1263,958,1281,1004,1306,1028,1305,1059,1307,1077,1350,1111,1338,1142,1361,1171,1353,1172,1352,1191,1347,1214,1360,1238,1345,1272,1359,1305|0,0,0,0,0,0,0,0,501,214,733,284,870,302,981,328,1027,330,1099,327,1167,312,1189,286,1223,282,1239,282,1256,257,1264,244,1284,223,1305,214,1282,195,1311,172,1303,150,1322,154,1355,147,1374,131,1369,110,1398,84,1391,54"
        "6C" => "SSB|6C|2733,1389|0,0,0,0,0,0,0,0,440,258,696,436,863,563,1003,680,1089,752,1135,811,1181,857,1208,906,1230,948,1262,987,1301,1024,1310,1036,1311,1064,1333,1083,1328,1105,1343,1129,1355,1151,1362,1178,1351,1213,1362,1232,1385,1271,1391,1310,1382,1320|0,0,0,0,0,0,0,0,457,207,686,264,881,332,948,321,1004,327,1073,326,1148,340,1168,314,1210,310,1211,286,1201,261,1222,257,1248,241,1246,228,1271,215,1267,198,1269,183,1280,163,1321,148,1329,137,1322,104,1334,75,1346,67|2750,1363|0,0,0,0,0,0,0,0,461,253,708,422,914,588,1024,679,1134,771,1199,847,1196,881,1251,932,1270,961,1293,1008,1274,1029,1307,1052,1322,1082,1345,1101,1358,1123,1361,1141,1370,1169,1347,1171,1355,1194,1381,1233,1388,1261,1380,1295,1374,1308|0,0,0,0,0,0,0,0,511,217,742,314,912,328,1025,340,1049,318,1089,298,1191,317,1202,292,1230,287,1247,258,1289,254,1274,240,1278,220,1283,214,1290,202,1303,189,1305,165,1336,167,1345,152,1340,121,1347,97,1365,66,1374,55"
        "6E" => "SSB|6E|2769,1388|0,0,0,0,0,0,0,0,494,279,713,428,949,610,1031,698,1083,758,1155,838,1149,860,1200,905,1251,968,1271,988,1284,1020,1283,1036,1293,1061,1307,1079,1331,1120,1345,1148,1331,1168,1341,1192,1345,1221,1354,1239,1378,1277,1389,1322,1378,1334|0,0,0,0,0,0,0,0,464,193,697,276,848,290,987,308,1056,309,1095,283,1198,300,1215,297,1231,271,1246,268,1272,258,1305,254,1320,238,1320,224,1320,199,1324,180,1346,166,1349,148,1373,138,1379,128,1372,100,1372,61,1385,51|2771,1371|0,0,0,0,0,0,0,0,428,233,682,413,878,558,989,655,1060,726,1123,776,1162,845,1166,883,1203,921,1210,954,1231,989,1265,1020,1298,1054,1299,1077,1294,1087,1312,1108,1308,1129,1331,1157,1362,1204,1349,1220,1352,1259,1358,1300,1361,1312|0,0,0,0,0,0,0,0,548,229,749,288,919,319,1002,323,1068,319,1121,321,1185,302,1239,300,1243,284,1272,266,1299,252,1297,238,1299,219,1315,203,1346,211,1348,202,1362,184,1349,162,1352,134,1381,126,1395,98,1404,67,1404,56"
        "6J" => "SSB|6J|2638,1257|0,0,0,0,0,0,0,0,445,241,688,397,867,541,960,612,1011,660,1036,701,1081,770,1102,810,1123,834,1163,874,1167,886,1158,899,1156,920,1193,962,1175,976,1195,989,1213,1018,1199,1038,1226,1081,1235,1111,1249,1147,1246,1179,1252,1193|0,0,0,0,0,0,0,0,424,192,668,274,861,299,935,300,1004,293,1094,311,1181,307,1217,297,1228,286,1230,261,1259,261,1292,257,1320,251,1308,221,1343,213,1347,212,1340,189,1371,177,1374,153,1378,132,1373,99,1388,74,1385,63|2715,1475|0,0,0,0,0,0,0,0,426,253,694,432,906,608,952,673,1043,763,1099,817,1174,911,1202,942,1232,993,1255,1020,1262,1040,1295,1079,1308,1110,1335,1128,1322,1150,1357,1168,1364,1205,1393,1240,1408,1270,1431,1314,1456,1346,1468,1393,1489,1419|0,0,0,0,0,0,0,0,490,234,699,329,900,364,1006,389,1036,368,1078,365,1127,338,1155,338,1174,314,1191,308,1212,304,1207,281,1216,264,1210,258,1250,253,1238,248,1250,223,1237,196,1250,175,1244,139,1231,113,1234,74,1218,51"
        "6M" => "SSB|6M|2726,1426|0,0,0,0,0,0,0,0,485,261,708,406,860,531,921,595,996,688,1068,758,1155,836,1160,865,1176,906,1227,949,1251,993,1288,1041,1275,1048,1302,1072,1307,1100,1328,1124,1330,1139,1378,1182,1362,1217,1377,1253,1412,1293,1401,1328,1402,1351|0,0,0,0,0,0,0,0,401,178,615,253,779,309,904,348,979,344,1010,325,1031,306,1105,329,1144,318,1137,292,1167,273,1166,247,1210,256,1213,247,1232,231,1232,220,1259,218,1229,186,1289,176,1291,143,1279,111,1305,85,1311,66|2718,1406|0,0,0,0,0,0,0,0,468,271,730,440,874,552,999,664,1064,737,1156,815,1199,852,1192,873,1235,908,1257,946,1272,985,1274,993,1292,1019,1294,1051,1319,1091,1334,1114,1334,1133,1354,1147,1372,1198,1388,1242,1385,1267,1387,1308,1391,1331|0,0,0,0,0,0,0,0,405,163,621,242,809,314,889,302,944,291,972,281,1015,286,1082,299,1094,291,1116,278,1144,266,1171,272,1194,265,1223,253,1225,229,1233,217,1259,208,1266,204,1269,166,1280,136,1299,119,1314,89,1318,69"
        "6N" => "SSB|6N|2803,1392|0,0,0,0,0,0,0,0,480,257,710,430,881,566,1018,673,1076,759,1150,820,1170,869,1205,894,1224,935,1229,957,1240,989,1266,1018,1269,1037,1272,1054,1302,1083,1303,1111,1333,1139,1330,1151,1346,1188,1372,1223,1393,1256,1387,1305,1391,1316|0,0,0,0,0,0,0,0,483,211,711,272,902,322,990,323,1085,310,1131,316,1220,322,1241,322,1259,298,1303,301,1320,287,1326,273,1353,272,1370,262,1356,240,1366,218,1352,195,1374,191,1383,168,1374,140,1369,115,1398,77,1404,71|2819,1435|0,0,0,0,0,0,0,0,506,288,730,441,947,596,1029,670,1114,746,1187,804,1193,867,1243,916,1295,970,1293,1013,1307,1030,1316,1054,1338,1083,1352,1121,1372,1147,1366,1161,1368,1181,1410,1215,1430,1253,1419,1270,1435,1312,1435,1350,1422,1361|0,0,0,0,0,0,0,0,477,214,722,277,874,323,993,349,1045,345,1092,341,1208,341,1233,332,1226,302,1273,289,1285,285,1309,277,1309,258,1320,239,1324,226,1346,222,1362,211,1333,185,1344,160,1369,148,1366,113,1373,79,1393,71"
        "6S" => "SSB|6S|2773,1371|0,0,0,0,0,0,0,0,502,287,751,457,937,593,1049,690,1132,766,1183,809,1228,880,1243,913,1280,973,1293,985,1317,1003,1315,1028,1342,1061,1342,1072,1336,1095,1350,1119,1347,1152,1350,1159,1343,1189,1361,1218,1356,1250,1340,1273,1373,1308|0,0,0,0,0,0,0,0,439,187,631,251,846,309,971,320,1030,319,1093,319,1168,301,1205,296,1221,260,1247,266,1268,272,1288,253,1285,230,1298,226,1324,211,1327,199,1344,174,1356,174,1388,156,1380,134,1397,110,1420,91,1394,59|2727,1363|0,0,0,0,0,0,0,0,440,245,677,403,863,545,949,612,1024,697,1096,758,1137,826,1166,874,1163,880,1197,926,1223,967,1254,1016,1251,1036,1257,1051,1287,1089,1323,1122,1309,1142,1316,1164,1341,1199,1351,1216,1356,1245,1355,1280,1340,1280|0,0,0,0,0,0,0,0,519,222,756,320,926,368,1033,391,1079,361,1111,358,1204,354,1234,328,1278,339,1284,309,1300,292,1300,265,1327,257,1344,252,1334,226,1311,201,1337,186,1336,166,1337,143,1344,132,1344,105,1359,78,1377,79"
        "BTC" => "SSB|BTC|1426,720|0,0,0,0,0,0,0,0,249,143,359,216,438,289,508,339,526,349,564,385,562,394,599,429,599,441,618,454,640,483,649,498,647,514,666,530,669,544,684,556,696,576,707,590,698,600,715,622,713,649,719,680|0,0,0,0,0,0,0,0,247,95,319,107,400,131,425,137,484,166,504,160,551,171,553,154,594,161,599,162,604,147,617,140,647,145,650,140,661,128,654,120,658,105,670,104,693,100,690,87,702,67,703,40|1444,723|0,0,0,0,0,0,0,0,265,163,379,233,422,277,470,322,512,349,542,375,537,383,559,409,582,439,607,476,607,476,621,497,642,506,650,525,674,544,695,570,682,574,696,590,688,598,701,632,695,653,694,668|0,0,0,0,0,0,0,0,236,99,324,143,424,169,479,174,495,169,521,177,578,190,592,178,607,167,609,141,640,155,655,150,661,150,671,138,672,130,669,114,693,116,689,106,717,104,717,78,739,65,749,55"
        "CL" => "SSB|CL|1947,1024|0,0,0,0,0,0,0,0,414,235,489,300,700,454,731,495,780,555,847,628,873,668,895,701,921,727,936,741,936,757,938,780,959,809,973,831,984,842,1019,885,999,895,1025,946|0,0,0,0,0,0,0,0,386,169,553,243,617,230,709,265,765,261,791,237,821,222,833,209,843,202,857,202,875,193,885,176,890,162,897,154,900,154,883,119,922,116,905,70|1920,934|0,0,0,0,0,0,0,0,374,221,486,298,653,420,712,472,740,504,769,549,811,603,835,640,829,648,857,684,893,719,880,728,899,744,904,763,907,783,923,815,918,827,941,866|0,0,0,0,0,0,0,0,411,159,537,201,645,205,711,202,788,225,850,222,866,200,883,187,913,194,905,172,888,145,918,147,922,140,936,130,947,118,945,95,970,92,962,61"
        "ES" => "SSB|ES|2783,1528|0,0,0,0,0,0,0,0,543,358,737,488,888,606,988,677,1055,744,1101,803,1146,841,1194,879,1227,927,1237,950,1258,985,1289,1027,1327,1061,1350,1073,1380,1116,1398,1133,1454,1192,1474,1235,1465,1257,1504,1307,1518,1362,1506,1413|0,0,0,0,0,0,0,0,539,244,685,300,761,308,810,320,877,332,932,333,955,326,974,327,1004,315,1036,311,1061,300,1071,280,1071,267,1074,268,1124,265,1153,270,1144,233,1157,209,1195,203,1178,167,1203,135,1260,107|2474,1143|0,0,0,0,0,0,0,0,455,242,638,350,714,408,739,457,845,516,856,529,877,563,907,593,916,621,930,643,954,675,965,695,995,746,994,753,1024,802,1022,800,1051,848,1066,866,1118,925,1102,941,1108,991,1124,1047|0,0,0,0,0,0,0,0,473,171,611,210,749,246,857,269,864,261,936,289,990,292,1020,296,1055,285,1086,281,1119,279,1144,280,1154,248,1188,255,1211,228,1256,251,1260,219,1276,213,1256,170,1297,164,1321,130,1330,86"
        "ETH" => "SSB|ETH|894,452|0,0,0,0,0,0,0,0,151,91,220,128,261,170,289,190,304,208,345,232,342,233,365,256,367,259,371,277,389,297,396,302,428,322,432,336,421,342,426,352,440,366,445,377,439,381,448,401,439,408,447,430|0,0,0,0,0,0,0,0,168,65,201,72,260,91,284,99,317,99,302,89,329,103,329,95,359,103,366,91,363,81,370,81,366,75,377,69,410,75,411,68,412,59,415,54,430,53,430,37,445,36,445,21|940,491|0,0,0,0,0,0,0,0,199,118,262,160,303,203,326,223,359,246,382,271,386,279,389,283,401,297,421,319,429,338,440,357,435,356,445,363,461,386,462,390,469,401,474,409,474,426,483,445,487,456,484,467|0,0,0,0,0,0,0,0,158,76,213,87,256,92,301,107,304,104,313,95,339,100,368,113,372,108,373,97,387,91,392,80,413,89,420,91,418,75,429,77,430,71,436,68,445,55,444,40,444,30,451,21"
        "GC" => "SSB|GC|2595,1265|0,0,0,0,0,0,0,0,440,272,693,451,860,583,937,661,1032,736,1086,807,1108,849,1172,920,1186,966,1191,980,1222,1021,1231,1055,1239,1072,1237,1099,1257,1131,1261,1178,1259,1204|0,0,0,0,0,0,0,0,474,197,723,261,899,291,998,296,1050,290,1101,270,1165,268,1162,226,1210,211,1245,215,1253,192,1266,165,1276,155,1297,137,1295,114,1312,78,1317,54|2568,1251|0,0,0,0,0,0,0,0,433,251,714,445,922,596,937,657,1007,732,1052,794,1099,859,1134,906,1169,954,1168,972,1191,1009,1207,1038,1210,1062,1211,1092,1226,1118,1242,1163,1243,1190|0,0,0,0,0,0,0,0,483,202,762,290,912,310,1059,329,1111,308,1148,287,1164,249,1194,236,1209,211,1244,209,1258,186,1269,173,1284,157,1303,135,1309,118,1313,82,1317,56"
        "HG" => "SSB|HG|2710,1382|0,0,0,0,0,0,0,0,516,296,718,443,840,550,970,664,1065,747,1133,840,1180,903,1205,952,1267,1027,1304,1072,1298,1099,1295,1148,1302,1167,1314,1225,1378,1291|0,0,0,0,0,0,0,0,510,213,741,297,925,343,1034,350,1098,354,1141,319,1177,308,1222,295,1226,251,1245,230,1296,226,1337,199,1349,188,1360,141,1318,85|2590,1233|0,0,0,0,0,0,0,0,480,264,695,419,846,518,953,629,1050,719,1108,789,1119,826,1183,878,1207,923,1223,967,1241,1017,1251,1055,1256,1087,1247,1122,1254,1160|0,0,0,0,0,0,0,0,499,186,695,246,864,295,954,288,995,265,1040,250,1105,246,1123,229,1165,216,1207,193,1226,161,1253,142,1281,121,1314,99,1320,66"
        "NG" => "SSB|NG|1762,852|0,0,0,0,0,0,0,0,281,164,385,230,530,332,590,386,644,434,676,466,702,504,723,524,734,551,757,571,744,582,763,615,773,638,796,663,815,695,830,702,813,724,841,774|0,0,0,0,0,0,0,0,294,128,429,167,574,186,629,195,651,188,683,189,722,180,747,183,782,177,794,172,840,180,851,162,870,157,869,149,874,127,881,127,920,116,904,71|1869,988|0,0,0,0,0,0,0,0,306,182,402,245,596,400,673,461,713,500,754,535,766,564,805,588,833,623,863,660,893,695,867,695,914,748,914,769,919,794,935,828,952,859,973,900|0,0,0,0,0,0,0,0,330,143,457,191,595,223,608,205,647,213,681,214,719,211,732,210,758,206,768,195,782,187,832,198,824,166,847,159,859,143,869,124,874,107,876,81"
        "NKD" => "SSB|NKD|2406,1339|0,0,0,0,0,0,0,0,490,301,639,418,767,518,826,567,893,634,937,668,974,709,1012,745,1035,769,1045,796,1100,859,1116,877,1140,916,1150,947,1174,978,1185,995,1208,1029,1251,1074,1269,1123,1285,1170,1314,1254|0,0,0,0,0,0,0,0,312,141,493,199,598,228,682,262,740,268,785,281,807,268,811,259,832,257,859,254,909,247,943,256,956,243,981,234,1003,229,1021,230,1050,227,1035,195,1052,167,1069,135,1076,72|2455,1259|0,0,0,0,0,0,0,0,475,263,626,380,751,477,836,549,907,608,931,642,964,671,983,706,980,704,972,706,1086,807,1113,839,1137,872,1156,898,1153,927,1161,937,1196,981,1207,1011,1239,1051,1245,1105,1236,1169|0,0,0,0,0,0,0,0,362,158,504,183,632,215,718,230,774,231,828,239,846,233,860,217,899,239,950,260,950,223,983,224,1011,222,1038,220,1066,205,1091,213,1100,198,1125,192,1123,168,1155,128,1207,83"
        "NQ" => "SSB|NQ|2650,1479|0,0,0,0,0,0,0,0,544,345,726,478,889,607,981,685,1052,761,1104,810,1136,837,1183,879,1173,912,1232,955,1227,966,1237,999,1271,1037,1278,1046,1310,1081,1335,1111,1376,1165,1394,1214,1401,1231,1425,1274,1451,1327,1452,1382|0,0,0,0,0,0,0,0,523,236,681,300,733,296,791,299,843,297,878,296,916,316,918,302,980,299,952,276,1009,298,1035,283,1034,264,1064,275,1086,270,1093,256,1090,215,1103,187,1127,181,1131,156,1143,120,1179,86|2303,1101|0,0,0,0,0,0,0,0,441,256,617,359,696,439,749,481,809,518,825,559,822,575,866,605,871,639,887,661,900,675,915,693,976,736,967,737,998,782,999,799,1023,838,1034,864,1043,886,1065,933,1058,969,1091,1027|0,0,0,0,0,0,0,0,443,181,551,209,673,230,734,235,772,244,832,239,898,254,904,246,943,240,972,238,1007,248,1031,249,1014,222,1055,234,1072,208,1113,211,1122,189,1141,173,1167,171,1171,137,1202,112,1193,66"
        "PA" => "SSB|PA|2512,1365|0,0,0,0,0,0,0,0,581,360,706,478,882,616,982,717,1053,786,1093,830,1179,915,1200,967,1223,1009,1257,1051,1242,1076,1276,1123,1290,1151,1295,1198|0,0,0,0,0,0,0,0,434,195,654,265,752,279,831,274,913,277,973,285,995,258,1044,245,1074,232,1083,221,1136,211,1134,181,1150,174,1172,145|2454,1251|0,0,0,0,0,0,0,0,502,290,639,393,758,508,903,616,1000,719,1018,760,1095,838,1121,876,1144,916,1162,951,1210,1006,1212,1026,1234,1075,1247,1118|0,0,0,0,0,0,0,0,426,177,641,243,799,273,836,266,893,248,977,256,984,220,1029,225,1074,216,1112,219,1111,181,1138,173,1150,140,1159,111"
        "PL" => "SSB|PL|2499,1309|0,0,0,0,0,0,0,0,477,289,689,432,869,580,973,669,1041,755,1101,816,1129,878,1157,920,1201,984,1208,1009,1216,1040,1243,1084,1279,1129,1272,1159,1285,1192|0,0,0,0,0,0,0,0,438,185,661,260,776,278,873,294,942,282,975,270,1027,251,1067,241,1088,218,1120,216,1152,207,1153,176,1148,148,1179,129,1182,101|2555,1323|0,0,0,0,0,0,0,0,455,281,734,475,898,594,995,691,1091,772,1113,813,1150,859,1202,948,1216,987,1245,1028,1243,1069,1248,1095,1273,1124,1301,1167,1290,1205|0,0,0,0,0,0,0,0,503,209,704,273,832,297,941,310,974,294,1044,301,1088,287,1118,250,1155,235,1181,223,1206,199,1221,183,1220,170,1224,143,1244,109"
        "RTY" => "SSB|RTY|1357,738|0,0,0,0,0,0,0,0,305,181,396,247,447,292,482,334,539,381,544,396,581,417,592,424,601,443,603,461,622,485,632,497,657,514,658,521,663,543,674,557,690,569,704,599,695,611,712,626,712,647,718,680|0,0,0,0,0,0,0,0,266,133,338,160,374,159,426,174,436,161,474,170,473,168,498,181,518,175,541,171,550,165,563,166,554,156,571,155,587,142,593,134,592,131,592,108,617,101,608,91,621,76,629,50|1336,653|0,0,0,0,0,0,0,0,299,171,369,226,406,266,435,281,469,319,475,335,506,357,513,366,542,393,545,399,541,416,559,442,564,453,551,446,587,481,585,481,597,498,586,514,609,535,626,557,639,582,657,612|0,0,0,0,0,0,0,0,275,116,364,145,436,156,482,172,499,162,531,163,533,159,558,160,559,146,583,152,606,148,609,134,627,135,650,146,639,121,658,127,668,121,694,112,682,98,675,80,672,58,671,38"
        "SI" => "SSB|SI|2544,1255|0,0,0,0,0,0,0,0,470,280,720,460,892,604,1003,703,1072,776,1099,813,1126,851,1174,915,1180,945,1196,987,1217,1015,1229,1045,1238,1066,1238,1086,1259,1120,1236,1156,1241,1190|0,0,0,0,0,0,0,0,519,212,771,272,904,274,975,276,1023,253,1091,265,1155,269,1174,242,1210,236,1229,211,1233,198,1242,179,1249,165,1265,147,1267,126,1298,93,1299,62|2530,1227|0,0,0,0,0,0,0,0,421,277,667,447,828,571,920,665,990,731,1034,791,1048,832,1092,880,1136,917,1129,940,1159,970,1182,1006,1191,1030,1184,1047,1217,1100,1248,1152,1236,1175|0,0,0,0,0,0,0,0,511,212,793,292,935,304,1009,292,1062,284,1121,264,1176,257,1191,234,1197,224,1240,217,1252,205,1251,179,1261,160,1287,150,1275,110,1268,71,1290,52"
        "YM" => "SSB|YM|2653,1405|0,0,0,0,0,0,0,0,502,303,679,418,801,519,892,597,958,660,996,715,1040,753,1076,798,1098,827,1120,852,1156,872,1194,905,1228,945,1206,955,1262,997,1287,1021,1329,1065,1328,1101,1351,1131,1353,1165,1405,1220,1399,1286|0,0,0,0,0,0,0,0,468,195,638,262,744,296,809,298,879,312,928,314,956,319,983,306,1022,308,1045,309,1060,313,1061,305,1063,283,1112,286,1114,268,1132,268,1143,245,1172,228,1180,209,1205,187,1186,152,1226,105|2410,1128|0,0,0,0,0,0,0,0,435,221,613,326,699,405,746,439,851,506,852,533,882,552,903,587,917,625,939,653,969,674,975,697,1003,732,988,731,1029,781,1048,810,1046,831,1066,867,1072,891,1069,917,1068,966,1098,1017|0,0,0,0,0,0,0,0,442,175,574,208,717,233,792,256,805,245,876,256,923,267,961,268,996,265,1023,260,1043,260,1076,256,1095,246,1142,260,1155,237,1171,223,1206,216,1214,192,1244,184,1264,167,1295,138,1287,97"
        "ZB" => "SSB|ZB|2717,1396|0,0,0,0,0,0,0,0,414,242,681,426,876,576,969,644,1019,693,1083,748,1115,800,1201,882,1215,909,1244,945,1232,948,1254,981,1273,1009,1284,1029,1310,1074,1311,1094,1345,1141,1359,1173,1371,1196,1362,1219,1375,1251,1391,1296,1386,1310|0,0,0,0,0,0,0,0,440,189,626,269,763,298,869,320,961,343,997,339,1062,333,1062,294,1113,300,1135,283,1189,299,1196,284,1206,273,1224,263,1234,238,1267,233,1260,198,1264,175,1270,161,1305,154,1304,127,1306,91,1319,81|2554,1322|0,0,0,0,0,0,0,0,407,239,617,377,806,526,877,596,933,640,990,708,1027,766,1076,816,1082,833,1100,864,1132,901,1151,932,1169,963,1183,996,1219,1036,1220,1052,1220,1067,1235,1103,1254,1128,1275,1161,1280,1187,1288,1223,1301,1252|0,0,0,0,0,0,0,0,441,190,654,274,803,300,892,315,969,332,1008,317,1066,308,1077,290,1129,304,1149,301,1152,282,1164,265,1170,249,1181,232,1190,213,1214,208,1226,201,1234,177,1238,166,1232,137,1241,120,1249,91,1241,65"
        "ZC" => "SSB|ZC|1762,898|0,0,0,0,0,0,0,0,319,186,418,262,456,310,531,365,564,405,598,440,661,517,685,544,726,592,768,626,818,662,822,676,824,699,868,741,918,854|0,0,0,0,0,0,0,0,332,139,460,188,568,216,593,201,643,201,700,214,758,206,782,201,780,176,791,171,777,157,809,160,826,145,816,120,837,38|1821,937|0,0,0,0,0,0,0,0,346,206,488,308,584,380,647,431,697,473,691,488,782,578,811,615,817,639,857,675,883,704,908,736,901,764,902,788,904,860|0,0,0,0,0,0,0,0,337,135,451,173,528,188,572,196,621,209,700,224,735,205,759,193,811,201,796,175,810,170,810,147,842,130,866,116,909,71"
        "ZF" => "SSB|ZF|2667,1388|0,0,0,0,0,0,0,0,398,239,665,425,854,564,954,657,1013,713,1064,782,1116,815,1160,858,1156,884,1179,888,1195,936,1235,960,1241,991,1246,1004,1268,1045,1290,1074,1317,1132,1336,1158,1364,1201,1380,1232,1370,1251,1387,1303,1389,1327|0,0,0,0,0,0,0,0,421,192,628,266,801,322,911,339,968,336,1011,309,1040,311,1064,299,1116,302,1140,319,1173,291,1169,286,1185,263,1207,271,1220,250,1236,237,1231,190,1233,173,1238,150,1246,132,1269,119,1263,74,1270,56|2492,1289|0,0,0,0,0,0,0,0,395,221,631,389,809,536,862,592,900,627,969,698,1022,759,1072,804,1078,828,1102,864,1134,904,1147,918,1154,935,1171,961,1215,1010,1206,1017,1220,1042,1214,1053,1221,1082,1239,1126,1244,1154,1260,1196,1262,1214|0,0,0,0,0,0,0,0,406,193,593,244,748,271,859,293,952,318,966,296,992,279,1020,279,1064,280,1086,270,1082,241,1092,238,1108,235,1115,223,1117,191,1145,192,1154,178,1175,175,1202,165,1210,138,1219,119,1214,83,1218,69"
        "ZN" => "SSB|ZN|2660,1371|0,0,0,0,0,0,0,0,372,234,648,406,843,547,943,637,1004,703,1068,761,1095,808,1134,835,1140,862,1189,897,1202,931,1222,961,1219,972,1238,984,1265,1039,1289,1083,1315,1107,1331,1145,1356,1193,1341,1202,1340,1227,1361,1280,1356,1292|0,0,0,0,0,0,0,0,402,166,612,258,802,316,902,324,949,313,993,309,1046,305,1080,307,1129,309,1135,296,1156,278,1172,268,1201,265,1206,267,1216,234,1229,208,1233,199,1236,174,1245,144,1278,147,1297,130,1286,82,1296,74|2493,1244|0,0,0,0,0,0,0,0,374,203,581,341,769,490,835,554,906,627,946,664,986,738,1044,794,1032,804,1061,840,1106,868,1126,904,1135,927,1140,934,1193,1006,1189,1018,1197,1029,1205,1053,1215,1081,1235,1110,1235,1135,1236,1175,1237,1187|0,0,0,0,0,0,0,0,438,194,644,276,801,295,902,312,944,300,1001,313,1044,291,1045,262,1104,276,1115,261,1105,250,1110,228,1124,213,1135,212,1129,159,1160,158,1174,158,1180,143,1212,131,1217,112,1236,97,1248,63,1251,55"
        "ZS" => "SSB|ZS|1770,865|0,0,0,0,0,0,0,0,357,195,453,277,522,337,596,383,612,419,657,459,730,528,739,556,778,595,797,628,816,652,842,688,842,696,858,736,871,821|0,0,0,0,0,0,0,0,348,140,457,169,538,181,581,184,660,199,693,193,730,181,776,184,785,172,800,153,816,145,815,122,841,129,858,105,897,43|1876,1001|0,0,0,0,0,0,0,0,373,230,520,351,600,424,631,450,694,497,731,531,832,623,861,660,897,706,917,743,937,783,955,804,955,819,981,850,1003,940|0,0,0,0,0,0,0,0,355,158,455,177,548,194,626,220,670,228,713,233,728,196,741,186,754,177,781,166,795,142,805,140,836,136,844,125,867,57"
        "ZT" => "SSB|ZT|2364,1149|0,0,0,0,0,0,0,0,249,148,439,262,638,415,720,473,761,513,809,559,858,603,895,643,904,658,942,689,950,723,973,751,1008,783,1000,786,1016,821,1027,841,1047,867,1064,893,1087,934,1124,978,1136,1012,1125,1038,1109,1034|0,0,0,0,0,0,0,0,306,126,514,216,674,239,761,270,848,285,893,283,927,279,979,279,1022,283,1042,276,1081,266,1097,256,1095,237,1118,241,1142,226,1155,220,1160,206,1176,201,1191,179,1179,147,1189,123,1221,104,1243,111|2334,1153|0,0,0,0,0,0,0,0,226,129,437,264,581,386,652,448,694,497,750,545,804,591,832,623,872,653,901,692,933,713,952,742,976,770,973,792,1025,852,1056,872,1052,888,1050,890,1067,936,1088,969,1118,1003,1131,1048,1140,1060|0,0,0,0,0,0,0,0,343,149,522,211,698,251,783,271,860,285,916,282,951,280,1000,282,1014,277,1035,263,1050,265,1064,246,1075,238,1093,223,1100,187,1099,183,1131,181,1155,189,1177,170,1181,150,1174,127,1182,93,1182,87"
        "ZW" => "SSB|ZW|1695,861|0,0,0,0,0,0,0,0,379,221,459,306,522,355,605,406,642,445,668,483,708,532,736,554,747,575,776,620,794,640,796,651,812,680,816,705,832,806|0,0,0,0,0,0,0,0,308,130,438,156,512,178,556,191,605,203,647,192,716,189,727,182,752,177,759,155,773,153,790,155,801,139,816,125,860,53|1853,980|0,0,0,0,0,0,0,0,400,234,508,318,620,410,687,475,744,524,760,540,811,601,850,643,878,676,882,698,907,732,923,760,921,771,940,801,976,918|0,0,0,0,0,0,0,0,370,156,482,192,547,193,604,194,643,196,697,217,762,218,781,207,789,193,807,186,811,171,811,152,833,152,836,135,866,56"
        => ""
f_ssC(string r) =>
    switch r
        "6A" => "SSC|6A|3410,1722|0,0,820,447,1031,591,1146,686,1236,777,1333,864,1408,968,1502,1045,1517,1100,1567,1157,1572,1195,1588,1238,1577,1261,1644,1323,1592,1328,1613,1335,1625,1371,1618,1378,1628,1401,1645,1437,1666,1458,1679,1491,1710,1540,1694,1548,1717,1588,1724,1634,1719,1649|0,0,828,349,1088,450,1249,499,1336,510,1419,527,1520,506,1530,487,1577,465,1583,435,1626,425,1648,400,1677,386,1634,337,1703,341,1692,338,1690,307,1704,303,1707,287,1696,255,1682,238,1672,206,1662,165,1690,161,1675,124,1680,84,1686,69|3428,1689|0,0,914,462,1102,626,1272,755,1316,828,1425,924,1501,998,1524,1057,1575,1113,1601,1171,1630,1221,1662,1267,1687,1312,1657,1301,1677,1347,1674,1371,1678,1389,1680,1416,1677,1433,1683,1442,1683,1463,1688,1477,1719,1518,1700,1551,1689,1580,1681,1619,1692,1627|0,0,851,389,1121,456,1203,458,1348,486,1397,469,1475,473,1535,446,1528,409,1571,392,1603,373,1601,344,1592,306,1643,328,1643,294,1656,276,1668,261,1675,240,1687,227,1689,222,1698,204,1698,191,1679,156,1708,127,1723,100,1739,65,1733,60"
        "6B" => "SSC|6B|3385,1710|0,0,860,473,1091,644,1176,733,1310,866,1387,914,1476,1012,1547,1078,1556,1110,1581,1183,1622,1247,1643,1275,1646,1307,1656,1337,1655,1366,1656,1367,1646,1386,1667,1415,1677,1448,1693,1469,1698,1493,1702,1513,1699,1535,1710,1580,1708,1593,1716,1638,1716,1647|0,0,870,407,1123,482,1304,532,1329,481,1400,505,1429,465,1460,443,1513,442,1541,402,1577,369,1592,359,1616,340,1625,322,1640,301,1653,309,1675,297,1658,270,1655,240,1643,219,1648,199,1648,181,1665,165,1658,121,1666,111,1665,69,1666,61|3392,1674|0,0,918,494,1109,644,1295,785,1349,861,1417,945,1486,1008,1539,1078,1543,1114,1571,1153,1593,1220,1628,1276,1640,1304,1662,1337,1651,1349,1651,1366,1648,1388,1646,1400,1672,1427,1660,1457,1668,1477,1693,1494,1679,1516,1694,1539,1684,1556,1665,1588,1671,1612|0,0,867,385,1149,469,1204,454,1337,464,1406,449,1461,442,1488,421,1529,404,1559,394,1602,362,1595,319,1600,299,1597,278,1626,277,1644,265,1656,248,1667,238,1653,220,1673,193,1674,177,1654,162,1683,145,1675,125,1692,110,1719,83,1719,61"
        "6C" => "SSC|6C|3320,1672|0,0,730,397,971,562,1089,656,1135,731,1268,838,1364,958,1451,1034,1493,1096,1527,1159,1534,1181,1547,1221,1549,1267,1562,1292,1613,1329,1600,1334,1615,1354,1638,1388,1646,1411,1641,1415,1653,1437,1649,1458,1652,1492,1656,1509,1681,1559,1677,1597,1677,1612|0,0,817,360,1018,413,1151,438,1306,476,1369,477,1447,458,1451,433,1477,410,1508,376,1568,386,1580,357,1617,336,1628,324,1595,296,1622,295,1624,283,1610,251,1608,231,1618,230,1612,211,1625,192,1637,167,1643,155,1629,108,1640,74,1640,59|3370,1650|0,0,892,462,1128,647,1283,736,1311,814,1378,877,1502,1017,1527,1079,1573,1130,1601,1189,1584,1222,1625,1263,1628,1292,1643,1332,1601,1335,1604,1344,1614,1370,1626,1381,1639,1409,1653,1437,1651,1443,1638,1447,1643,1481,1683,1529,1672,1541,1663,1579,1649,1595|0,0,799,350,1068,417,1153,442,1299,446,1390,476,1432,422,1507,408,1506,382,1530,346,1594,338,1584,309,1604,294,1607,262,1662,268,1670,267,1672,247,1678,243,1677,222,1668,195,1677,191,1694,189,1695,157,1668,114,1688,105,1704,70,1720,55"
        "6E" => "SSC|6E|3420,1699|0,0,910,496,1125,664,1240,766,1321,841,1426,920,1513,1031,1544,1086,1572,1154,1592,1192,1583,1216,1605,1260,1625,1301,1640,1324,1664,1368,1657,1375,1658,1399,1661,1420,1665,1450,1681,1477,1681,1497,1679,1510,1669,1542,1683,1567,1688,1587,1699,1634,1694,1648|0,0,907,406,1160,464,1290,480,1364,487,1405,478,1458,438,1512,424,1544,386,1571,372,1633,371,1653,353,1669,332,1669,316,1664,283,1686,281,1696,260,1696,240,1704,218,1696,195,1697,176,1707,167,1725,140,1719,120,1721,104,1717,62,1724,50|3421,1700|0,0,888,501,1117,661,1261,749,1326,812,1422,936,1492,1026,1516,1066,1558,1135,1595,1175,1628,1244,1585,1248,1606,1284,1601,1306,1647,1346,1660,1370,1672,1395,1683,1415,1669,1434,1669,1453,1652,1464,1659,1488,1691,1534,1693,1568,1692,1596,1681,1622,1693,1641|0,0,935,425,1147,481,1277,521,1383,542,1421,486,1489,451,1534,446,1555,412,1578,398,1593,352,1663,364,1661,340,1681,324,1661,294,1664,279,1667,261,1665,245,1689,234,1700,221,1719,210,1717,189,1703,152,1707,121,1717,98,1735,76,1725,58"
        "6J" => "SSC|6J|3259,1529|0,0,810,441,1021,579,1083,639,1163,729,1283,830,1363,918,1411,963,1438,1004,1450,1043,1489,1104,1482,1142,1489,1159,1520,1185,1525,1206,1521,1211,1513,1234,1523,1269,1496,1270,1486,1280,1524,1316,1524,1342,1545,1375,1532,1390,1530,1417,1524,1454,1516,1462|0,0,805,316,1007,378,1163,430,1278,425,1346,417,1435,406,1462,394,1495,372,1536,359,1562,329,1598,304,1608,295,1599,272,1612,257,1626,256,1651,244,1653,215,1693,218,1716,214,1682,180,1693,160,1686,137,1708,129,1716,103,1731,71,1742,66|3277,1776|0,0,854,514,1085,684,1218,795,1262,846,1335,920,1433,1018,1463,1078,1492,1133,1531,1186,1554,1263,1571,1284,1593,1334,1605,1356,1634,1389,1637,1404,1663,1441,1668,1456,1683,1489,1708,1516,1717,1552,1733,1576,1748,1606,1753,1632,1774,1663,1793,1715,1791,1724|0,0,745,350,965,430,1060,445,1205,495,1315,526,1392,526,1430,504,1461,482,1467,454,1508,408,1520,401,1523,363,1531,350,1514,325,1526,317,1508,283,1515,273,1511,245,1503,227,1505,198,1498,179,1503,154,1509,134,1493,106,1479,58,1482,49"
        "6M" => "SSC|6M|3402,1751|0,0,865,468,1141,691,1257,780,1342,853,1379,917,1485,1013,1510,1062,1531,1118,1554,1155,1602,1207,1578,1223,1581,1268,1614,1295,1659,1341,1674,1360,1664,1380,1685,1403,1684,1430,1701,1467,1678,1480,1710,1518,1721,1564,1711,1579,1714,1608,1738,1659,1737,1682|0,0,760,321,1004,383,1147,442,1254,464,1371,485,1403,465,1450,455,1504,442,1539,435,1538,408,1601,417,1625,389,1618,371,1597,335,1601,326,1625,314,1616,296,1633,277,1621,245,1656,241,1631,207,1640,171,1662,157,1672,133,1654,86,1657,63|3295,1697|0,0,846,459,1030,610,1157,715,1261,797,1351,890,1456,990,1496,1050,1526,1107,1595,1184,1572,1179,1556,1202,1577,1230,1600,1261,1599,1295,1611,1314,1642,1341,1639,1377,1653,1400,1662,1422,1656,1439,1688,1456,1681,1490,1684,1527,1686,1565,1692,1609,1699,1628|0,0,719,311,991,394,1092,420,1185,444,1268,435,1317,424,1371,414,1398,387,1386,342,1450,368,1498,363,1506,350,1510,332,1539,316,1539,303,1531,285,1549,258,1546,244,1549,228,1568,217,1549,205,1570,181,1584,154,1589,120,1595,84,1592,67"
        "6N" => "SSC|6N|3401,1673|0,0,863,464,1087,608,1181,706,1289,774,1385,883,1435,950,1495,1024,1525,1089,1577,1150,1562,1184,1578,1208,1609,1255,1601,1263,1597,1288,1602,1305,1610,1331,1606,1346,1614,1368,1632,1398,1656,1419,1648,1446,1637,1474,1649,1506,1671,1532,1666,1582,1667,1590|0,0,816,343,1053,431,1211,457,1306,498,1384,482,1484,482,1532,463,1565,431,1559,396,1623,392,1639,382,1627,343,1657,349,1678,333,1689,323,1694,303,1709,292,1712,275,1700,248,1685,230,1702,205,1723,182,1718,151,1705,128,1728,87,1730,81|3400,1756|0,0,938,510,1174,693,1304,796,1325,840,1420,930,1529,1023,1567,1083,1598,1136,1616,1182,1629,1249,1665,1284,1682,1317,1686,1359,1687,1383,1706,1407,1697,1401,1701,1438,1722,1474,1706,1471,1705,1503,1743,1532,1733,1564,1744,1587,1749,1618,1736,1658,1735,1672|0,0,813,356,1055,423,1163,450,1314,496,1378,486,1418,484,1460,473,1488,454,1529,433,1578,399,1575,377,1578,356,1596,330,1604,312,1597,293,1621,306,1629,277,1618,248,1642,257,1649,230,1619,204,1644,180,1642,161,1643,134,1659,96,1663,83"
        "6S" => "SSC|6S|3420,1696|0,0,909,496,1120,677,1195,741,1296,828,1427,935,1488,1024,1565,1107,1600,1162,1628,1204,1626,1254,1632,1281,1672,1339,1656,1344,1676,1369,1662,1398,1666,1411,1653,1419,1666,1445,1695,1472,1690,1485,1699,1506,1697,1543,1693,1558,1689,1590,1679,1615,1702,1636|0,0,822,368,1083,421,1257,479,1339,487,1359,463,1451,453,1476,415,1507,397,1544,383,1607,360,1629,346,1614,300,1650,303,1658,293,1684,266,1691,256,1711,250,1708,227,1682,202,1691,191,1686,171,1701,140,1713,130,1721,101,1733,77,1714,58|3403,1677|0,0,908,494,1094,666,1252,767,1312,829,1375,917,1422,990,1476,1051,1487,1080,1509,1130,1559,1198,1570,1241,1593,1265,1602,1298,1617,1329,1632,1367,1631,1376,1640,1387,1645,1418,1647,1437,1648,1461,1655,1482,1674,1523,1674,1537,1678,1565,1665,1595,1659,1600|0,0,826,354,1103,415,1239,456,1362,478,1452,466,1542,471,1564,445,1608,441,1631,415,1648,383,1667,355,1662,338,1671,315,1681,299,1677,266,1692,265,1695,260,1699,233,1705,219,1711,198,1706,178,1702,143,1712,133,1710,107,1729,79,1737,75"
        "BTC" => "SSC|BTC|1827,929|0,0,500,295,614,384,677,439,721,471,767,511,797,568,821,599,839,598,850,623,844,635,868,656,858,665,860,684,868,710,869,716,873,730,890,744,891,759,917,781,916,785,926,799,927,820,929,842,939,869,944,898|0,0,416,168,582,229,670,245,722,266,745,256,782,239,792,224,809,243,825,233,852,232,841,216,866,213,872,199,878,181,886,177,895,173,890,165,895,151,873,130,878,127,881,122,883,101,888,83,882,58,881,31|1862,927|0,0,527,295,667,413,732,475,774,526,791,542,805,585,843,610,843,625,864,640,850,644,862,674,865,689,872,705,879,714,875,731,877,736,891,758,905,766,903,782,908,792,911,807,900,816,901,841,909,864,909,884|0,0,461,180,602,221,683,235,730,231,775,249,808,231,812,222,827,214,825,207,858,212,863,187,873,178,877,167,880,163,899,155,908,155,905,136,905,133,913,122,914,116,916,104,938,99,944,78,947,60,952,43"
        "CL" => "SSC|CL|2377,1261|0,0,557,338,799,503,887,570,938,626,973,665,1055,743,1093,802,1121,857,1142,893,1141,918,1178,958,1177,967,1192,992,1178,1000,1203,1030,1229,1054,1220,1070,1216,1085,1247,1122,1227,1129,1255,1177|0,0,560,264,783,337,882,355,968,370,1018,381,1046,360,1055,334,1074,303,1090,293,1119,281,1095,248,1110,245,1110,226,1136,224,1116,196,1099,179,1114,167,1127,159,1105,128,1132,123,1110,79|2386,1143|0,0,513,292,781,453,872,529,942,590,978,639,1040,706,1072,745,1083,786,1063,806,1109,870,1102,879,1107,900,1105,915,1144,951,1118,950,1132,970,1144,985,1130,998,1154,1037,1150,1047,1167,1078|0,0,584,247,789,310,889,325,964,335,1004,321,1063,311,1075,288,1109,269,1171,268,1156,219,1183,223,1187,208,1197,198,1168,165,1198,168,1198,151,1196,137,1218,129,1201,94,1216,87,1210,63"
        "ES" => "SSC|ES|3410,1837|0,0,964,607,1179,785,1346,890,1442,991,1494,1051,1552,1131,1587,1172,1637,1231,1666,1262,1673,1285,1672,1295,1702,1329,1696,1354,1697,1369,1714,1405,1734,1437,1731,1434,1771,1475,1777,1492,1803,1531,1828,1575,1825,1598,1841,1647,1855,1693,1823,1739|0,0,835,406,1145,494,1189,493,1253,471,1297,461,1324,422,1356,415,1359,392,1378,388,1397,377,1424,383,1427,367,1453,353,1473,349,1478,323,1480,301,1497,311,1497,289,1515,285,1510,252,1503,219,1518,204,1516,166,1520,129,1574,93|3261,1486|0,0,832,460,1095,638,1173,694,1237,767,1312,819,1317,863,1325,897,1346,908,1367,948,1380,974,1369,992,1382,1011,1389,1037,1378,1048,1382,1066,1397,1100,1392,1105,1410,1143,1414,1151,1442,1204,1452,1218,1478,1268,1461,1280,1455,1331,1487,1391|0,0,1007,380,1222,425,1339,453,1406,434,1417,416,1494,411,1543,404,1572,411,1583,385,1596,372,1628,366,1638,357,1653,340,1695,347,1705,337,1709,312,1727,314,1737,289,1749,287,1737,243,1737,233,1727,190,1755,186,1778,142,1762,89"
        "ETH" => "SSC|ETH|1151,572|0,0,293,161,371,227,394,257,446,298,469,316,472,343,491,354,483,361,492,375,491,373,515,397,500,388,508,407,532,433,532,435,548,447,556,459,544,464,544,470,567,495,560,497,554,503,569,521,562,533,566,548|0,0,259,115,371,144,432,160,458,156,477,156,510,150,514,151,541,150,544,142,555,148,541,130,572,143,569,127,554,107,561,108,559,102,556,92,580,92,580,86,562,63,574,65,585,61,574,45,586,38,584,24|1215,627|0,0,347,205,443,269,489,320,523,363,545,384,559,405,584,425,572,425,590,445,595,448,588,456,600,466,597,469,613,489,608,505,608,511,609,510,621,525,612,528,625,542,636,556,633,566,634,588,633,601,625,609|0,0,320,139,397,165,438,155,476,157,491,153,503,146,501,136,526,141,524,129,530,132,551,132,546,128,557,127,550,112,560,99,565,94,569,99,566,90,583,91,573,79,565,66,572,57,572,36,577,24,588,17"
        "GC" => "SSC|GC|3279,1594|0,0,756,417,990,599,1107,706,1156,748,1277,873,1354,974,1413,1048,1475,1126,1501,1176,1527,1226,1554,1273,1565,1312,1557,1324,1587,1366,1576,1382,1597,1407,1585,1432,1598,1462,1587,1503,1582,1525|0,0,867,352,1086,407,1229,428,1365,476,1444,459,1506,425,1526,391,1538,349,1564,323,1587,294,1588,258,1606,235,1634,233,1622,198,1649,187,1639,166,1662,147,1660,124,1684,89,1690,67|3265,1600|0,0,753,432,984,598,1117,701,1238,795,1339,898,1468,1037,1428,1058,1457,1104,1493,1171,1513,1227,1533,1263,1544,1295,1551,1313,1564,1345,1585,1378,1590,1398,1581,1426,1558,1453,1589,1500,1599,1532|0,0,865,369,1089,421,1226,446,1297,442,1394,446,1432,380,1548,398,1575,382,1577,335,1582,295,1600,281,1617,261,1629,250,1635,226,1629,199,1636,185,1655,160,1687,136,1670,96,1661,64"
        "HG" => "SSC|HG|3465,1781|0,0,913,556,1107,677,1356,877,1461,972,1518,1045,1517,1101,1608,1186,1647,1239,1659,1313,1652,1324,1685,1385,1731,1457,1726,1481,1725,1521,1720,1555,1726,1592,1738,1629,1773,1690|0,0,970,428,1152,487,1318,495,1381,484,1445,479,1554,480,1556,442,1569,415,1602,366,1649,382,1642,332,1628,275,1656,258,1680,231,1702,207,1709,176,1709,142,1685,88|3347,1616|0,0,857,484,1069,603,1242,764,1311,843,1378,927,1475,1018,1512,1095,1535,1139,1576,1203,1594,1250,1624,1297,1633,1335,1646,1374,1623,1399,1632,1449,1644,1469,1647,1512,1643,1550|0,0,892,371,1080,433,1304,485,1410,480,1472,471,1500,436,1539,395,1573,377,1574,331,1594,297,1600,265,1615,238,1627,207,1671,192,1678,151,1676,133,1688,99,1696,62"
        "NG" => "SSC|NG|2230,1079|0,0,582,333,744,430,790,497,853,539,874,569,946,647,951,667,980,697,998,728,1023,767,1021,776,1044,810,1064,834,1052,843,1045,871,1050,899,1061,913,1064,934,1072,946,1070,975,1087,1011|0,0,519,211,698,282,809,298,857,299,921,310,982,288,1025,292,1036,280,1044,263,1048,237,1072,237,1069,212,1068,195,1097,195,1117,173,1121,153,1120,147,1132,132,1134,123,1145,99,1134,64|2296,1234|0,0,564,354,758,479,848,568,904,627,901,625,1006,742,1037,777,1060,806,1094,836,1095,858,1104,871,1137,909,1166,946,1170,965,1152,973,1212,1027,1209,1045,1197,1055,1217,1090,1215,1110,1234,1154|0,0,569,274,734,332,820,348,883,344,960,378,988,337,993,316,994,304,1002,297,1020,284,1034,282,1023,256,1013,229,1028,222,1057,218,1018,172,1032,161,1051,154,1045,126,1059,113,1051,76"
        "NKD" => "SSC|NKD|2983,1611|0,0,804,472,1047,654,1132,736,1255,831,1288,888,1328,943,1333,973,1375,1027,1412,1067,1423,1089,1457,1129,1453,1137,1470,1156,1475,1174,1488,1203,1491,1230,1503,1261,1507,1285,1513,1305,1532,1335,1557,1366,1584,1411,1592,1461,1607,1539|0,0,569,250,766,307,891,332,951,340,1045,346,1104,345,1166,359,1178,340,1185,325,1206,319,1194,294,1222,300,1232,297,1275,301,1288,289,1309,279,1317,261,1341,253,1349,242,1367,234,1359,210,1352,175,1361,129,1367,64|3068,1578|0,0,853,520,1039,644,1173,748,1244,820,1296,864,1355,933,1374,990,1395,1018,1427,1063,1442,1075,1430,1087,1428,1092,1442,1113,1507,1156,1516,1196,1524,1229,1522,1236,1524,1270,1507,1277,1533,1325,1540,1354,1575,1391,1574,1436,1580,1512|0,0,647,261,897,349,978,358,1065,364,1118,373,1174,363,1227,344,1265,340,1273,318,1288,321,1318,320,1340,326,1355,319,1343,303,1366,283,1390,269,1412,273,1426,247,1460,251,1464,223,1468,201,1447,172,1464,131,1483,64"
        "NQ" => "SSC|NQ|3272,1806|0,0,996,633,1187,782,1370,925,1450,1004,1467,1045,1529,1117,1577,1165,1593,1192,1634,1250,1636,1260,1646,1282,1671,1322,1687,1347,1695,1371,1697,1392,1709,1421,1680,1410,1709,1445,1723,1467,1748,1514,1767,1555,1763,1571,1792,1628,1800,1662,1790,1705|0,0,840,405,1090,485,1117,455,1168,444,1250,457,1268,432,1287,417,1316,419,1309,380,1338,388,1351,377,1353,353,1349,335,1365,325,1380,311,1392,295,1443,320,1442,299,1445,288,1443,247,1437,216,1451,205,1436,156,1443,129,1473,97|3124,1440|0,0,842,480,1089,649,1154,723,1202,774,1257,836,1279,880,1285,896,1308,925,1307,954,1320,963,1323,985,1352,1025,1344,1036,1353,1055,1359,1073,1385,1099,1373,1091,1377,1135,1397,1154,1395,1184,1381,1195,1415,1226,1414,1265,1415,1300,1426,1359|0,0,908,330,1118,362,1254,389,1328,381,1353,347,1411,344,1452,345,1476,343,1508,332,1517,332,1529,318,1525,295,1548,291,1562,284,1579,275,1576,259,1602,273,1628,243,1631,235,1653,216,1680,208,1659,188,1674,156,1688,128,1689,77"
        "PA" => "SSC|PA|3220,1706|0,0,786,464,1148,751,1247,815,1349,930,1404,995,1487,1085,1531,1157,1544,1199,1570,1254,1626,1321,1629,1351,1631,1376,1644,1417,1632,1441,1641,1476,1638,1501,1662,1558|0,0,665,313,987,404,1123,452,1228,447,1302,449,1327,414,1371,387,1419,374,1440,345,1431,305,1462,293,1484,277,1495,253,1525,235,1536,209,1551,192,1538,144|3255,1636|0,0,863,509,1073,682,1144,753,1287,856,1337,922,1395,1006,1450,1085,1512,1155,1505,1186,1566,1259,1551,1275,1579,1321,1587,1345,1614,1390,1607,1415,1610,1441,1618,1477|0,0,682,276,1083,402,1235,443,1288,431,1372,429,1420,405,1450,375,1463,341,1520,333,1500,280,1550,285,1557,255,1578,250,1577,215,1595,196,1611,178,1615,149"
        "PL" => "SSC|PL|3217,1582|0,0,765,423,939,550,1103,694,1210,774,1269,852,1373,975,1458,1052,1446,1089,1490,1154,1502,1191,1521,1237,1549,1285,1543,1310,1571,1348,1562,1373,1575,1414,1565,1430,1569,1462|0,0,856,351,1156,468,1234,454,1287,441,1393,448,1428,408,1435,378,1516,376,1521,333,1545,313,1556,278,1554,242,1583,230,1577,203,1600,185,1606,154,1626,142,1630,112|3329,1719|0,0,857,504,1192,713,1300,821,1347,899,1460,1034,1513,1105,1551,1167,1580,1214,1606,1251,1606,1295,1655,1364,1656,1401,1690,1446,1693,1481,1687,1497,1698,1524,1710,1571,1715,1600|0,0,818,371,1055,433,1215,461,1345,480,1395,436,1445,421,1492,405,1528,392,1547,377,1579,348,1571,303,1594,277,1589,252,1594,222,1606,207,1605,185,1609,145,1608,118"
        "RTY" => "SSC|RTY|1737,926|0,0,525,326,645,419,718,484,770,541,764,553,793,590,816,612,842,639,839,642,864,668,868,672,865,681,864,696,873,709,875,721,898,745,902,759,892,765,913,786,932,802,943,826,917,816,931,840,924,853,911,879|0,0,445,200,557,230,592,223,618,204,667,215,677,196,690,194,702,184,726,196,714,177,727,182,743,178,756,169,760,167,770,163,754,143,763,133,783,132,775,115,763,103,759,84,794,96,782,72,799,62,819,41|1767,884|0,0,508,313,678,441,711,470,750,511,780,543,813,582,790,584,802,611,788,610,824,634,823,647,835,660,834,675,831,685,829,700,841,710,839,710,847,718,839,735,847,746,840,757,850,776,853,788,859,811,876,840|0,0,530,223,617,219,689,243,727,240,750,236,752,213,812,227,820,209,852,217,824,196,836,186,834,180,847,169,860,165,872,154,869,149,874,150,879,148,892,132,895,126,909,119,902,101,904,91,901,69,887,42"
        "SI" => "SSC|SI|3269,1620|0,0,730,400,1026,619,1164,721,1279,844,1305,896,1433,1030,1507,1135,1533,1185,1532,1208,1549,1249,1564,1293,1567,1319,1572,1349,1600,1391,1598,1401,1622,1431,1628,1455,1623,1489,1601,1511,1612,1548|0,0,862,379,1088,422,1236,464,1323,444,1482,485,1482,410,1495,353,1522,323,1560,319,1582,298,1603,277,1622,264,1634,241,1619,207,1633,203,1615,175,1616,152,1636,127,1662,106,1654,70|3249,1590|0,0,756,403,978,573,1118,684,1229,824,1310,925,1366,1005,1420,1074,1445,1128,1462,1161,1493,1226,1501,1261,1524,1288,1534,1332,1536,1339,1570,1382,1577,1415,1559,1414,1588,1463,1608,1508,1600,1538|0,0,809,362,1077,433,1208,458,1292,423,1415,415,1489,397,1519,363,1558,339,1586,325,1596,283,1620,263,1628,255,1639,221,1654,220,1629,181,1628,150,1660,156,1643,117,1636,80,1649,52"
        "YM" => "SSC|YM|3281,1738|0,0,893,541,1131,726,1250,798,1331,904,1397,977,1454,1034,1489,1066,1498,1100,1534,1142,1558,1175,1569,1214,1593,1243,1595,1256,1614,1281,1624,1295,1642,1327,1638,1338,1678,1389,1702,1409,1711,1433,1731,1477,1728,1494,1755,1543,1762,1580,1731,1626|0,0,762,366,1031,427,1147,464,1216,442,1270,426,1289,414,1321,420,1367,425,1379,415,1387,399,1402,373,1405,359,1425,358,1437,347,1446,345,1451,323,1470,317,1459,277,1458,270,1475,258,1470,224,1485,212,1476,170,1485,141,1533,105|3160,1456|0,0,811,427,1065,622,1131,691,1183,742,1239,786,1262,831,1298,877,1336,914,1336,934,1351,957,1348,979,1365,1011,1379,1033,1384,1045,1391,1068,1392,1095,1410,1104,1397,1130,1413,1150,1407,1168,1414,1197,1435,1225,1414,1251,1415,1290,1450,1355|0,0,915,364,1104,375,1244,395,1316,392,1357,387,1420,386,1431,362,1453,350,1481,346,1507,337,1537,332,1543,318,1554,307,1576,309,1593,300,1617,284,1611,280,1652,271,1655,259,1679,248,1685,224,1678,202,1704,180,1723,153,1700,95"
        "ZB" => "SSC|ZB|3239,1704|0,0,794,468,1001,626,1074,691,1208,795,1328,919,1408,982,1464,1050,1497,1084,1505,1124,1521,1170,1577,1232,1584,1257,1621,1290,1606,1308,1617,1318,1637,1346,1618,1351,1629,1387,1657,1424,1692,1459,1702,1494,1697,1512,1696,1540,1713,1575,1698,1605,1692,1618|0,0,785,373,1030,456,1163,496,1209,488,1233,443,1309,462,1348,432,1376,435,1409,416,1441,391,1435,355,1463,353,1446,329,1485,319,1490,319,1485,300,1517,300,1525,274,1517,245,1490,214,1492,185,1503,171,1521,153,1511,122,1534,97,1543,85|3177,1603|0,0,770,422,975,556,1117,662,1180,746,1253,820,1344,915,1358,956,1376,984,1412,1039,1435,1085,1471,1146,1435,1149,1451,1173,1482,1208,1489,1238,1504,1259,1509,1284,1519,1312,1514,1341,1536,1372,1548,1395,1541,1412,1551,1443,1573,1474,1571,1501,1585,1526|0,0,731,326,966,401,1071,420,1207,436,1297,445,1350,428,1400,422,1448,425,1466,401,1491,382,1480,336,1549,352,1556,343,1545,318,1553,298,1552,287,1560,270,1573,252,1592,229,1574,199,1575,185,1597,176,1596,147,1581,120,1595,98,1584,75"
        "ZC" => "SSC|ZC|2250,1116|0,0,458,262,611,375,693,449,789,524,852,581,853,608,899,648,911,662,940,702,967,770,999,807,1032,854,1039,872,1066,901,1074,914,1074,933,1104,977,1142,1078|0,0,514,210,668,257,778,282,849,291,903,296,972,301,981,283,1015,288,1038,273,1081,247,1076,222,1061,185,1085,183,1083,169,1095,166,1107,152,1100,120,1104,35|2342,1185|0,0,511,313,708,456,800,525,909,605,968,684,1013,730,1045,754,1083,796,1068,808,1117,872,1144,898,1154,926,1169,962,1184,987,1183,1000,1175,1017,1170,1046,1159,1115|0,0,509,211,667,252,764,276,826,279,886,264,918,253,946,262,959,246,1018,255,1049,229,1054,219,1077,208,1073,176,1081,162,1103,158,1124,145,1145,121,1178,67"
        "ZF" => "SSC|ZF|3222,1665|0,0,730,438,942,576,1041,648,1144,761,1283,878,1362,965,1432,1034,1463,1079,1468,1107,1489,1147,1532,1187,1516,1200,1548,1230,1553,1262,1587,1281,1608,1320,1615,1332,1618,1372,1635,1402,1659,1428,1650,1447,1679,1490,1679,1521,1674,1549,1670,1583,1670,1602|0,0,772,362,971,418,1106,465,1184,455,1234,446,1318,445,1358,425,1375,398,1420,388,1448,371,1446,348,1486,349,1481,331,1503,314,1488,304,1484,271,1489,269,1507,243,1508,222,1495,200,1517,188,1508,156,1519,130,1530,105,1542,76,1548,62|3121,1573|0,0,694,411,925,546,1078,687,1138,747,1207,819,1302,927,1324,955,1353,995,1384,1044,1429,1106,1438,1129,1446,1155,1450,1168,1475,1202,1505,1237,1499,1253,1502,1267,1510,1297,1513,1316,1525,1343,1518,1357,1525,1384,1544,1427,1540,1441,1546,1480,1549,1501|0,0,742,318,982,404,1067,391,1198,437,1297,452,1341,411,1402,425,1427,413,1436,386,1428,340,1466,342,1486,328,1506,326,1496,294,1477,266,1494,256,1502,247,1517,225,1526,211,1529,191,1544,182,1555,166,1550,132,1563,123,1562,87,1564,69"
        "ZN" => "SSC|ZN|3220,1649|0,0,724,431,930,585,998,622,1145,749,1272,867,1334,954,1432,1024,1439,1063,1461,1105,1474,1147,1523,1182,1518,1205,1570,1231,1576,1271,1586,1280,1605,1309,1603,1319,1617,1360,1634,1398,1660,1420,1653,1444,1682,1483,1666,1505,1649,1527,1653,1567,1653,1577|0,0,777,358,997,399,1162,476,1190,448,1235,422,1350,427,1356,404,1403,389,1435,376,1472,360,1457,338,1493,332,1471,318,1480,286,1489,286,1486,264,1505,263,1507,232,1507,202,1502,194,1521,179,1509,149,1533,133,1557,115,1560,78,1563,70|3106,1542|0,0,699,401,893,519,1072,662,1117,714,1191,797,1273,883,1304,936,1342,972,1367,1022,1390,1069,1423,1110,1399,1117,1416,1138,1429,1158,1462,1207,1467,1228,1475,1238,1497,1287,1502,1308,1494,1316,1496,1346,1509,1371,1515,1393,1527,1419,1523,1449,1530,1469|0,0,727,308,985,405,1053,387,1200,435,1293,439,1360,423,1400,407,1414,401,1445,380,1467,360,1466,330,1515,335,1527,327,1529,313,1507,271,1515,256,1515,249,1516,208,1529,194,1545,189,1551,164,1563,151,1573,136,1571,118,1580,90,1575,72"
        "ZS" => "SSC|ZS|2294,1113|0,0,505,282,649,377,766,463,844,550,892,607,890,631,940,662,962,700,1006,752,1027,796,1040,828,1058,853,1060,883,1078,906,1080,926,1100,946,1097,972,1108,1057|0,0,559,222,761,286,847,302,918,285,953,276,1017,284,1029,280,1056,271,1049,234,1084,223,1105,210,1112,200,1129,179,1136,167,1152,156,1145,144,1167,129,1185,55|2383,1271|0,0,564,359,747,492,825,554,928,645,996,722,1017,752,1057,785,1090,820,1105,839,1163,920,1173,955,1200,991,1200,1005,1195,1034,1211,1055,1202,1071,1233,1108,1265,1211|0,0,552,242,700,284,800,314,864,309,891,289,960,309,973,300,1000,296,1025,299,1041,252,1053,229,1051,211,1076,210,1099,188,1101,180,1132,174,1123,148,1116,59"
        "ZT" => "SSC|ZT|2930,1401|0,0,461,275,659,395,768,462,868,553,941,619,1072,734,1114,782,1162,820,1188,865,1215,916,1245,934,1249,951,1266,976,1280,1005,1285,1032,1306,1050,1307,1064,1334,1117,1351,1125,1374,1162,1353,1160,1387,1212,1402,1238,1412,1262,1402,1300,1369,1283|0,0,604,258,798,315,941,360,1000,348,1124,388,1212,374,1258,366,1286,358,1315,339,1337,311,1361,315,1392,310,1411,299,1427,285,1447,270,1444,258,1455,249,1460,213,1457,215,1454,187,1497,204,1487,164,1488,146,1494,129,1516,95,1552,114|2917,1439|0,0,507,297,667,389,822,512,886,575,953,647,1064,762,1090,797,1110,836,1158,874,1216,929,1246,965,1263,993,1280,1013,1299,1037,1313,1058,1337,1082,1309,1090,1349,1141,1368,1162,1369,1175,1368,1188,1368,1217,1389,1248,1404,1288,1420,1326,1422,1338|0,0,567,246,841,343,966,374,1093,400,1203,423,1245,389,1291,391,1339,387,1361,378,1352,346,1365,330,1383,316,1394,307,1401,293,1403,277,1404,268,1442,265,1433,225,1434,216,1456,214,1469,206,1497,196,1489,172,1487,137,1481,104,1486,96"
        "ZW" => "SSC|ZW|2241,1098|0,0,536,298,697,431,799,512,864,587,894,637,908,662,945,699,982,738,991,758,1031,814,1045,830,1035,831,1052,874,1070,901,1077,922,1080,946,1097,974,1081,1044|0,0,545,227,700,248,778,256,872,263,933,261,971,262,1007,265,1012,251,1039,244,1065,213,1070,204,1095,208,1098,179,1103,166,1103,147,1114,129,1108,107,1158,53|2361,1268|0,0,564,354,773,507,861,583,964,681,1009,742,1052,790,1102,836,1136,867,1134,879,1164,931,1167,945,1181,969,1183,1001,1203,1038,1223,1060,1223,1074,1233,1101,1268,1214|0,0,545,253,663,279,771,302,854,301,889,280,932,275,941,260,955,256,999,266,1046,255,1070,255,1075,240,1087,219,1079,189,1069,172,1078,163,1085,145,1088,53"
        => ""
// --- END GENERATED CONSTANTS
 
// --- BEGIN SHARED CORE
// One session state machine, fed bar by bar. The same code runs (a) inside a fixed-timeframe request, where the chart
// keeps enough sessions for the 20-session average range and the row size, and (b) on the chart bars (or on their
// intrabars when the chart timeframe does not line up with the session), for what happens inside today's session.
type Sess
    int startMin = 570
    int endMin = 960
    string tz = "America/New_York"
    int ibMin = 60
    int orMin = 15
    int rowTicks = 0
    bool active = false
    int count = 0
    int finished = 0
    int dayKey = 0
    int startTime = 0
    int elapsed = 0
    int lastDow = 0
    int lastMonth = 0
    float o = na
    float h = na
    float l = na
    float c = na
    float orH = na
    float orL = na
    bool orDone = false
    float ibH = na
    float ibL = na
    bool ibDone = false
    bool brkOrUp = false
    bool brkOrDn = false
    bool brkIbUp = false
    bool brkIbDn = false
    bool gapFilled = false
    float step = na
    float nextStep = na
    array<float> perH
    array<float> perL
    float pO = na
    float pH = na
    float pL = na
    float pC = na
    float pVAH = na
    float pVAL = na
    float pPOC = na
    float pStep = na
    int pDayKey = 0
    int pDow = 0
    int pStart = 0
    array<float> pPerH
    array<float> pPerL
    array<float> ranges
    array<float> trs
    float atr = na
    float wO = na
    float wH = na
    float wL = na
    float pwH = na
    float pwL = na
    bool wPartial = true
    float mO = na
    float mH = na
    float mL = na
    float pmH = na
    float pmL = na
    bool mPartial = true
 
f_newSess(int startMin, int endMin, string tz, int ibMin, int orMin, int rowTicks) =>
    Sess.new(startMin = startMin, endMin = endMin, tz = tz, ibMin = ibMin, orMin = orMin, rowTicks = rowTicks, perH = array.new<float>(), perL = array.new<float>(), pPerH = array.new<float>(), pPerL = array.new<float>(), ranges = array.new<float>(), trs = array.new<float>())
 
// "HHMM-HHMM" -> minutes of the day
f_sessStart(string s) =>
    int(str.tonumber(str.substring(s, 0, 2)) * 60 + str.tonumber(str.substring(s, 2, 4)))
f_sessEnd(string s) =>
    int(str.tonumber(str.substring(s, 5, 7)) * 60 + str.tonumber(str.substring(s, 7, 9)))
 
// Row size of the profile: a round number of ticks that gives about 45 rows for a typical session
// (the median range of up to 60 sessions before the one being read). rowTicks > 0 overrides it.
f_autoStep(array<float> ranges, int rowTicks, float fallbackRange) =>
    float typical = fallbackRange
    int n = ranges.size()
    if n > 0
        array<float> srt = ranges.copy()
        srt.sort(order.ascending)
        typical := srt.get(int(math.floor(n / 2)))
    int k = int(math.max(1, math.ceil(nz(typical, syminfo.mintick * 45) / 45 / syminfo.mintick)))
    int ticks = k
    array<int> nice = array.from(1, 2, 4, 5, 8, 10, 20, 25, 40, 50, 100, 200, 250, 500, 1000)
    bool found = false
    for v in nice
        if not found and v >= k
            ticks := v
            found := true
    if rowTicks > 0
        ticks := rowTicks
    ticks * syminfo.mintick
 
f_row(float price, float step) =>
    int(math.floor(price / step + 1e-9))
 
// Point of control and 70% value area from the highs and lows of the 30-minute periods of one session.
// POC = the row with the most periods; ties go to the row closest to the middle of the range, then the higher one.
// Value area = grown from the POC one row at a time toward the side with more periods (ties up) until 70%.
// A row is named by its lower price, like the profile page of the portal.
f_profile(array<float> perH, array<float> perL, float step) =>
    float poc = na
    float vah = na
    float val = na
    int bot = na
    int top = na
    int np = perH.size()
    if np > 0 and not na(step) and step > 0
        for i = 0 to np - 1
            float ph = perH.get(i)
            float pl = perL.get(i)
            if not na(ph) and not na(pl)
                int rl = f_row(pl, step)
                int rh = f_row(ph, step)
                bot := na(bot) ? rl : math.min(bot, rl)
                top := na(top) ? rh : math.max(top, rh)
    if not na(bot) and top - bot < 5000
        int nrows = top - bot + 1
        array<int> counts = array.new<int>(nrows, 0)
        for i = 0 to np - 1
            float ph = perH.get(i)
            float pl = perL.get(i)
            if not na(ph) and not na(pl)
                int rl = f_row(pl, step) - bot
                int rh = f_row(ph, step) - bot
                for r = rl to rh
                    counts.set(r, counts.get(r) + 1)
        int mx = counts.max()
        float mid = (nrows - 1) / 2.0
        int pr = -1
        float best = na
        for r = 0 to nrows - 1
            if counts.get(r) == mx
                float d = math.abs(r - mid)
                if pr < 0 or d <= best
                    pr := r
                    best := d
        int total = counts.sum()
        int loR = pr
        int hiR = pr
        float acc = counts.get(pr)
        while acc < 0.70 * total and (loR > 0 or hiR < nrows - 1)
            int up = hiR < nrows - 1 ? counts.get(hiR + 1) : -1
            int dn = loR > 0 ? counts.get(loR - 1) : -1
            if up >= dn
                hiR += 1
                acc += up
            else
                loR -= 1
                acc += dn
        poc := math.round_to_mintick((bot + pr) * step)
        vah := math.round_to_mintick((bot + hiR) * step)
        val := math.round_to_mintick((bot + loR) * step)
    [poc, vah, val]
 
// Closes the running session: its levels become the "prior session" ones.
method finish(Sess s) =>
    if s.active
        s.active := false
        s.finished := s.finished + 1
        float rng = s.h - s.l
        [poc, vah, val] = f_profile(s.perH, s.perL, s.step)
        float tr = na(s.pC) ? rng : math.max(rng, math.max(math.abs(s.h - s.pC), math.abs(s.l - s.pC)))
        s.trs.push(tr)
        if s.trs.size() > 20
            s.trs.shift()
        s.ranges.push(rng)
        if s.ranges.size() > 60
            s.ranges.shift()
        s.atr := s.trs.size() >= 5 ? s.trs.avg() : na
        s.nextStep := f_autoStep(s.ranges, s.rowTicks, rng)
        s.pO := s.o
        s.pH := s.h
        s.pL := s.l
        s.pC := s.c
        s.pPOC := poc
        s.pVAH := vah
        s.pVAL := val
        s.pStep := s.step
        s.pDayKey := s.dayKey
        s.pDow := s.lastDow
        s.pStart := s.startTime
        s.pPerH := s.perH.copy()
        s.pPerL := s.perL.copy()
        s.wH := na(s.wH) ? s.h : math.max(s.wH, s.h)
        s.wL := na(s.wL) ? s.l : math.min(s.wL, s.l)
        s.mH := na(s.mH) ? s.h : math.max(s.mH, s.h)
        s.mL := na(s.mL) ? s.l : math.min(s.mL, s.l)
    s.finished
 
// Opens a new session at the bar that starts at time t (off = minutes after the nominal session open).
method begin(Sess s, int t, int off, int key, int dow, float o) =>
    bool first = s.lastDow == 0
    bool newWeek = first or dow <= s.lastDow or t - s.startTime > 6 * 86400000
    if newWeek
        s.pwH := s.wPartial ? na : s.wH
        s.pwL := s.wPartial ? na : s.wL
        s.wPartial := first and dow != dayofweek.monday
        s.wH := na
        s.wL := na
        s.wO := o
    int mon = month(t, s.tz)
    if mon != s.lastMonth
        s.pmH := s.mPartial ? na : s.mH
        s.pmL := s.mPartial ? na : s.mL
        s.mPartial := first
        s.mH := na
        s.mL := na
        s.mO := o
    s.lastDow := dow
    s.lastMonth := mon
    s.dayKey := key
    s.startTime := t - off * 60000
    s.active := true
    s.count := s.count + 1
    s.o := o
    s.h := na
    s.l := na
    s.c := na
    s.orH := na
    s.orL := na
    s.orDone := false
    s.ibH := na
    s.ibL := na
    s.ibDone := false
    s.brkOrUp := false
    s.brkOrDn := false
    s.brkIbUp := false
    s.brkIbDn := false
    s.gapFilled := false
    s.elapsed := 0
    s.step := f_autoStep(s.ranges, s.rowTicks, na)
    s.perH := array.new<float>()
    s.perL := array.new<float>()
    s.count
 
// One bar (or intrabar) that starts at time t and lasts dur minutes; done = the bar is complete.
method feed(Sess s, int t, int dur, bool done, float o, float h, float l, float c) =>
    int mins = hour(t, s.tz) * 60 + minute(t, s.tz)
    int dow = dayofweek(t, s.tz)
    bool inWin = mins >= s.startMin and mins < s.endMin and dow != dayofweek.saturday and dow != dayofweek.sunday and not na(h) and not na(l)
    int key = year(t, s.tz) * 10000 + month(t, s.tz) * 100 + dayofmonth(t, s.tz)
    if s.active and (not inWin or key != s.dayKey)
        s.finish()
    if inWin
        int off = mins - s.startMin
        if key != s.dayKey
            s.begin(t, off, key, dow, o)
        s.h := na(s.h) ? h : math.max(s.h, h)
        s.l := na(s.l) ? l : math.min(s.l, l)
        s.c := c
        s.elapsed := off + dur
        // opening range: bars that start inside the window build it; the first bar after it fixes it
        if off < s.orMin
            s.orH := na(s.orH) ? h : math.max(s.orH, h)
            s.orL := na(s.orL) ? l : math.min(s.orL, l)
        else
            s.orDone := true
            if h > s.orH
                s.brkOrUp := true
            if l < s.orL
                s.brkOrDn := true
        if off < s.ibMin
            s.ibH := na(s.ibH) ? h : math.max(s.ibH, h)
            s.ibL := na(s.ibL) ? l : math.min(s.ibL, l)
        else
            s.ibDone := true
            if h > s.ibH
                s.brkIbUp := true
            if l < s.ibL
                s.brkIbDn := true
        // gap against the previous session's last price: filled when price trades back at it
        if not na(s.pC) and not s.gapFilled
            if (s.o > s.pC and l <= s.pC) or (s.o < s.pC and h >= s.pC)
                s.gapFilled := true
        // highs and lows of the 30-minute periods (A = first 30 minutes)
        int k = int(math.floor(off / 30))
        while s.perH.size() <= k
            s.perH.push(na)
            s.perL.push(na)
        float ph = s.perH.get(k)
        float pl = s.perL.get(k)
        s.perH.set(k, na(ph) ? h : math.max(ph, h))
        s.perL.set(k, na(pl) ? l : math.min(pl, l))
        // the bar that ends the window closes the session (once that bar is complete)
        if done and s.elapsed >= s.endMin - s.startMin
            s.finish()
    s.count
 
// The deep-history context: prior-session levels, 20-session average true range of the regular session, row size,
// week and month references. Evaluated on a fixed timeframe so that a 1-minute chart has the same history as a
// 60-minute one. Everything it returns is final when the session it describes has ended.
f_ctx(int startMin, int endMin, string tz, int rowTicks, int dur) =>
    var Sess s = f_newSess(startMin, endMin, tz, 60, 15, rowTicks)
    s.feed(time, dur, barstate.isconfirmed, open, high, low, close)
    [s.finished, s.pDayKey, s.pDow, s.lastMonth, s.pStart, s.pO, s.pH, s.pL, s.pC, s.pVAH, s.pVAL, s.pPOC, s.atr, s.trs.size(), s.pStep, s.nextStep, s.wO, s.wH, s.wL, s.pwH, s.pwL, s.wPartial, s.mO, s.mH, s.mL, s.pmH, s.pmL, s.mPartial]
 
// Timeframe of the deep-history context and of the intrabars: the coarsest of 15 / 5 / 1 minutes the session lines up with.
f_gridTf(int a, int b, int cap) =>
    a % 15 == 0 and b % 15 == 0 and cap >= 15 ? 15 : a % 5 == 0 and b % 5 == 0 and cap >= 5 ? 5 : 1
// --- END SHARED CORE
 
// ------------------------------------------------------------------------------------------------------------ inputs
string G0 = "General"
string lang = input.string("es", "Idioma / Language / Idioma", options = ["es", "en", "pt"], group = G0)
string marketIn = input.string("Auto", "Mercado de las estadísticas / Market", options = ["Auto", "ES", "NQ", "RTY", "YM", "NKD", "GC", "SI", "HG", "PL", "PA", "CL", "NG", "ZN", "ZB", "ZF", "ZT", "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 las estadísticas de su contrato grande). / Auto: taken from the chart symbol.")
string srcMode = input.string("Auto", "Datos para la sesión de hoy", options = ["Auto", "Velas del gráfico", "Intrabarras"], group = G0, tooltip = "Auto: usa las velas del gráfico cuando su temporalidad encaja con la apertura de la sesión; si no encaja, usa intrabarras de 5 o de 1 minuto.")
bool showLines = input.bool(true, "Dibujar cierre anterior, rango de apertura y balance inicial", group = G0)
bool showTable = input.bool(true, "Tabla", group = G0)
string tablePos = input.string("bottom_right", "Posición de la tabla", options = ["top_right", "top_left", "bottom_right", "bottom_left", "middle_right"], group = G0)
string G5 = "Colores / Colours"
color cClose = input.color(#8b98a8, "Cierre anterior", group = G5)
color cOR = input.color(#fbbf24, "Rango de apertura", group = G5)
color cIB = input.color(#f59e0b, "Balance inicial", group = G5)
color cActive = input.color(#26a69a, "Estado: activo", group = G5)
color cBack = input.color(#fbbf24, "Estado: de vuelta dentro", group = G5)
color cDone = input.color(#8b98a8, "Estado: cumplido / invalidado", 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
 
string root = marketIn == "Auto" ? f_parent(syminfo.root) : marketIn
string ownSpec = f_ownSess(root)
string ownTz = f_ownTz(root)
int ownStart = f_sessStart(ownSpec)
int ownEnd = f_sessEnd(ownSpec)
int total = ownEnd - ownStart
 
bool okTf = timeframe.isminutes and timeframe.multiplier <= 60
int mult = timeframe.multiplier
bool aligned = ownStart % mult == 0 and ownEnd % mult == 0 and 15 % mult == 0
bool useLtf = okTf and mult > 1 and (srcMode == "Intrabarras" or (srcMode == "Auto" and not aligned))
int ltfDur = f_gridTf(ownStart, ownEnd, math.min(mult - 1, 5))
string ltfTf = str.tostring(ltfDur)
 
// -------------------------------------------------------------------------------------------------------- statistics
// n and k per checkpoint of the session (minutes since the open), per setup and state. Three lines per market:
// SSA|root|data through|sessions|checkpoints|IB size cuts|gap up base|gap up activo|gap down base|gap down activo|IB narrow base|IB narrow pendiente|IB wide base|IB wide pendiente
// SSB|root|IB up base|IB up activo|IB up de vuelta|IB down base|IB down activo|IB down de vuelta
// SSC|root|opening range, same six fields as SSB
f_nums(string s) =>
    array<float> out = array.new<float>()
    if s != ""
        array<string> parts = str.split(s, ",")
        for p in parts
            out.push(str.tonumber(p))
    out
 
f_field(array<string> f, int i) =>
    array<float> out = array.new<float>()
    if i < f.size()
        out := f_nums(f.get(i))
    out
 
f_str(array<string> f, int i) =>
    string v = ""
    if i < f.size()
        v := f.get(i)
    v
 
f_at(array<float> a, int i) =>
    float v = na
    if i >= 0 and i < a.size()
        v := a.get(i)
    v
 
var array<string> fa = str.split(f_ssA(root), "|")
var array<string> fb = str.split(f_ssB(root), "|")
var array<string> fc = str.split(f_ssC(root), "|")
var bool statsOn = fa.size() >= 14 and fb.size() >= 8 and fc.size() >= 8 and fa.get(0) == "SSA"
var string through = f_str(fa, 2)
var string nSess = f_str(fa, 3)
var array<float> marks = f_field(fa, 4)
var array<float> cuts = f_field(fa, 5)
var array<float> gapUpBase = f_field(fa, 6)
var array<float> gapUpAct = f_field(fa, 7)
var array<float> gapDnBase = f_field(fa, 8)
var array<float> gapDnAct = f_field(fa, 9)
var array<float> narrowBase = f_field(fa, 10)
var array<float> narrowPend = f_field(fa, 11)
var array<float> wideBase = f_field(fa, 12)
var array<float> widePend = f_field(fa, 13)
var array<float> ibUpBase = f_field(fb, 2)
var array<float> ibUpAct = f_field(fb, 3)
var array<float> ibUpBack = f_field(fb, 4)
var array<float> ibDnBase = f_field(fb, 5)
var array<float> ibDnAct = f_field(fb, 6)
var array<float> ibDnBack = f_field(fb, 7)
var array<float> orUpBase = f_field(fc, 2)
var array<float> orUpAct = f_field(fc, 3)
var array<float> orUpBack = f_field(fc, 4)
var array<float> orDnBase = f_field(fc, 5)
var array<float> orDnAct = f_field(fc, 6)
var array<float> orDnBack = f_field(fc, 7)
 
// Rate of a state at a minute of the session: the checkpoint already passed, moved linearly toward the next one.
// Returns [rate, n]; the rate is na before the first checkpoint, after the close and with fewer than 10 cases.
f_rate(array<float> rows, int atMin) =>
    float pct = na
    float n = na
    int nm = marks.size()
    if nm > 0 and rows.size() >= 2 * nm and atMin < total
        if atMin >= marks.get(0)
            int lo = 0
            for j = 0 to nm - 1
                if marks.get(j) <= atMin
                    lo := j
            n := rows.get(2 * lo)
            float k = rows.get(2 * lo + 1)
            if n >= 10
                pct := 100.0 * k / n
                if lo + 1 < nm and atMin > marks.get(lo)
                    float n2 = rows.get(2 * lo + 2)
                    float k2 = rows.get(2 * lo + 3)
                    if n2 >= 10
                        float f = (atMin - marks.get(lo)) / (marks.get(lo + 1) - marks.get(lo))
                        pct += f * (100.0 * k2 / n2 - pct)
    [pct, n]
 
f_pct(float v) =>
    na(v) ? "—" : str.tostring(v, "0.0") + "%"
f_px(float v) =>
    na(v) ? "—" : str.tostring(v, format.mintick)
f_n(float v) =>
    na(v) ? "" : " (n = " + str.tostring(v, "0") + ")"
f_base(array<float> b) =>
    float n = f_at(b, 0)
    float k = f_at(b, 1)
    na(n) or n < 10 ? "—" : f_pct(100.0 * k / n) + f_n(n)
 
// ------------------------------------------------------------------------------------------------------ today's bars
var Sess own = f_newSess(ownStart, ownEnd, ownTz, 60, 15, 0)
int count0 = own.count
bool or0 = own.orDone
bool ib0 = own.ibDone
if okTf
    if useLtf
        [lt, lo, lh, ll, lc] = request.security_lower_tf(syminfo.tickerid, ltfTf, [time, open, high, low, close])
        int nl = lt.size()
        if nl > 0
            for i = 0 to nl - 1
                bool done = i < nl - 1 or barstate.isconfirmed
                own.feed(lt.get(i), ltfDur, done, lo.get(i), lh.get(i), ll.get(i), lc.get(i))
    else
        own.feed(time, mult, barstate.isconfirmed, open, high, low, close)
 
bool evOpen = own.count != count0
bool evOr = own.orDone and not or0
bool evIb = own.ibDone and not ib0
 
// levels of the session in progress (fixed once known)
var float kPC = na
var float kORH = na
var float kORL = na
var float kIBH = na
var float kIBL = na
int xEnd = own.startTime + total * 60000
if evOpen
    kPC := own.pC
    kORH := na
    kORL := na
    kIBH := na
    kIBL := na
    if showLines and not na(kPC)
        line.new(own.startTime, kPC, xEnd, kPC, xloc = xloc.bar_time, color = cClose, style = line.style_dashed, width = 1)
if evOr
    kORH := own.orH
    kORL := own.orL
    if showLines and not na(kORH)
        line.new(own.startTime, kORH, xEnd, kORH, xloc = xloc.bar_time, color = cOR, width = 1)
        line.new(own.startTime, kORL, xEnd, kORL, xloc = xloc.bar_time, color = cOR, width = 1)
if evIb
    kIBH := own.ibH
    kIBL := own.ibL
    if showLines and not na(kIBH)
        line.new(own.startTime, kIBH, xEnd, kIBH, xloc = xloc.bar_time, color = cIB, width = 2)
        line.new(own.startTime, kIBL, xEnd, kIBL, xloc = xloc.bar_time, color = cIB, width = 2)
 
// ------------------------------------------------------------------------------------------------------------- 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
 
var table info = na
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
 
string S_ACTIVE = f_t("activo", "active", "ativo")
string S_BACK = f_t("de vuelta dentro", "back inside", "de volta dentro")
string S_DONE = f_t("cumplido", "done", "cumprido")
string S_VOID = f_t("invalidado", "void", "invalidado")
string S_PEND = f_t("pendiente", "pending", "pendente")
 
// One row of a break card: state from the last price against the edge, rate of closing beyond it.
f_breakRow(table t, int row, string name, bool up, float level, bool over, float px, int atMin, array<float> base, array<float> act, array<float> back) =>
    bool beyond = up ? px > level : px < level
    string st = over ? (beyond ? S_DONE : S_VOID) : (beyond ? S_ACTIVE : S_BACK)
    color sc = over ? cDone : (beyond ? cActive : cBack)
    array<float> rows = back
    if beyond
        rows := act
    // a break shows its state only: the share of sessions that closed beyond the edge would be a probable direction
    string rt = "—"
    f_cell(t, 0, row, name + " " + f_px(level), cText, text.align_left)
    f_cell(t, 1, row, st, sc, text.align_left)
    f_cell(t, 2, row, rt, cText, text.align_right)
    f_cell(t, 3, row, "—", color.new(cText, 35), text.align_right)
    true
 
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), 4, 10, bgcolor = cTableBg, border_width = 0)
    color dim = color.new(cText, 35)
    if not okTf
        f_cell(info, 0, 0, f_t("Usa un gráfico de 1 a 60 minutos.", "Use a chart of 1 to 60 minutes.", "Use um gráfico de 1 a 60 minutos."), cText, text.align_left)
    else if own.count == 0
        f_cell(info, 0, 0, f_t("Aún no hay una sesión completa en el gráfico.", "No session on the chart yet.", "Ainda não há uma sessão no gráfico."), cText, text.align_left)
    else
        int elapsedMin = own.elapsed
        bool over = not own.active or elapsedMin >= total
        float px = own.c
        string head = f_t("Estado de setups · ", "Setup state · ", "Estado dos setups · ") + root + " · " + (over ? f_t("sesión terminada", "session over", "sessão encerrada") : f_t("minuto ", "minute ", "minuto ") + str.tostring(elapsedMin) + f_t(" de ", " of ", " de ") + str.tostring(total))
        f_cell(info, 0, 0, head, cText, text.align_left)
        table.merge_cells(info, 0, 0, 3, 0)
        f_cell(info, 0, 1, "Setup", dim, text.align_left)
        f_cell(info, 1, 1, f_t("estado", "state", "estado"), dim, text.align_left)
        f_cell(info, 2, 1, f_t("en este estado y hora", "in this state at this time", "neste estado e hora"), dim, text.align_right)
        f_cell(info, 3, 1, f_t("todos los casos", "all cases", "todos os casos"), dim, text.align_right)
        int row = 2
        // --- gap against the previous session's last price
        if na(kPC) or own.o == kPC
            f_cell(info, 0, row, f_t("Gap de apertura", "Opening gap", "Gap de abertura"), cText, text.align_left)
            f_cell(info, 1, row, f_t("sin gap", "no gap", "sem gap"), dim, text.align_left)
        else
            bool gUp = own.o > kPC
            float gPct = (own.o - kPC) / kPC * 100
            string gName = (gUp ? f_t("Gap al alza ", "Gap up ", "Gap de alta ") : f_t("Gap a la baja ", "Gap down ", "Gap de baixa ")) + str.tostring(gPct, "0.00") + "% → " + f_px(kPC)
            array<float> gRows = gapDnAct
            array<float> gBase = gapDnBase
            if gUp
                gRows := gapUpAct
                gBase := gapUpBase
            [gp, gn] = f_rate(gRows, elapsedMin)
            string gSt = own.gapFilled ? S_DONE : over ? S_VOID : S_ACTIVE
            string gRt = own.gapFilled or over or not statsOn ? "—" : na(gp) ? (na(gn) ? "—" : f_t("menos de 10 casos", "fewer than 10 cases", "menos de 10 casos")) : f_pct(gp) + f_n(gn)
            f_cell(info, 0, row, gName, cText, text.align_left)
            f_cell(info, 1, row, gSt, own.gapFilled or over ? cDone : cActive, text.align_left)
            f_cell(info, 2, row, gRt, cText, text.align_right)
            f_cell(info, 3, row, statsOn ? f_base(gBase) : "—", dim, text.align_right)
        row += 1
        // --- initial balance
        if not own.ibDone
            f_cell(info, 0, row, f_t("Balance inicial", "Initial balance", "Balanço inicial"), cText, text.align_left)
            f_cell(info, 1, row, f_t("formándose", "forming", "em formação"), dim, text.align_left)
            row += 1
        else
            if own.brkIbUp
                f_breakRow(info, row, f_t("IB roto arriba", "IB broken up", "IB rompido acima"), true, own.ibH, over, px, elapsedMin, ibUpBase, ibUpAct, ibUpBack)
                row += 1
            if own.brkIbDn
                f_breakRow(info, row, f_t("IB roto abajo", "IB broken down", "IB rompido abaixo"), false, own.ibL, over, px, elapsedMin, ibDnBase, ibDnAct, ibDnBack)
                row += 1
            if not own.brkIbUp and not own.brkIbDn
                // unbroken: how often an IB of this size (thirds of the market's own history) broke before the close
                float sizePct = own.ibL > 0 ? (own.ibH - own.ibL) / own.ibL * 100 : na
                float c0 = f_at(cuts, 0)
                float c1 = f_at(cuts, 1)
                bool narrow = not na(c0) and sizePct <= c0
                bool wide = not na(c1) and sizePct > c1
                string szName = narrow ? f_t("IB estrecho sin romper", "Narrow IB, unbroken", "IB estreito sem romper") : wide ? f_t("IB ancho sin romper", "Wide IB, unbroken", "IB largo sem romper") : f_t("IB medio sin romper", "Mid-size IB, unbroken", "IB médio sem romper")
                array<float> sRows = widePend
                array<float> sBase = wideBase
                if narrow
                    sRows := narrowPend
                    sBase := narrowBase
                [sp, sn] = f_rate(sRows, elapsedMin)
                bool sized = narrow or wide
                string sRt = over or not statsOn or not sized ? "—" : na(sp) ? (na(sn) ? "—" : f_t("menos de 10 casos", "fewer than 10 cases", "menos de 10 casos")) : f_pct(sp) + f_n(sn)
                f_cell(info, 0, row, szName + " (" + str.tostring(sizePct, "0.00") + "%)", cText, text.align_left)
                f_cell(info, 1, row, over ? S_VOID : S_PEND, over ? cDone : cBack, text.align_left)
                f_cell(info, 2, row, sRt, cText, text.align_right)
                f_cell(info, 3, row, statsOn and sized ? f_base(sBase) : "—", dim, text.align_right)
                row += 1
        // --- opening range (15 minutes)
        if not own.orDone
            f_cell(info, 0, row, f_t("Rango de apertura", "Opening range", "Range de abertura"), cText, text.align_left)
            f_cell(info, 1, row, f_t("formándose", "forming", "em formação"), dim, text.align_left)
            row += 1
        else
            if own.brkOrUp
                f_breakRow(info, row, f_t("RA roto arriba", "OR broken up", "RA rompido acima"), true, own.orH, over, px, elapsedMin, orUpBase, orUpAct, orUpBack)
                row += 1
            if own.brkOrDn
                f_breakRow(info, row, f_t("RA roto abajo", "OR broken down", "RA rompido abaixo"), false, own.orL, over, px, elapsedMin, orDnBase, orDnAct, orDnBack)
                row += 1
            if not own.brkOrUp and not own.brkOrDn
                f_cell(info, 0, row, f_t("Rango de apertura", "Opening range", "Range de abertura"), cText, text.align_left)
                f_cell(info, 1, row, f_t("sin romper", "unbroken", "sem romper"), dim, text.align_left)
                row += 1
        string what = f_t("Gap: se rellena antes del cierre. IB sin romper: se rompe antes del cierre. Roturas: solo el estado, sin tasa.", "Gap: it fills before the close. Unbroken IB: it breaks before the close. Breaks: state only, no rate.", "Gap: fecha antes do fechamento. IB sem romper: rompe antes do fechamento. Rompimentos: só o estado, sem taxa.")
        f_cell(info, 0, 8, what, dim, text.align_left)
        table.merge_cells(info, 0, 8, 3, 8)
        string foot = f_t("Sesión ", "Session ", "Sessão ") + ownSpec + " (" + ownTz + ")" + (statsOn ? f_t(" · datos al ", " · data through ", " · dados até ") + through + " · " + nSess + f_t(" sesiones", " sessions", " sessões") : f_t(" · sin frecuencias para este mercado", " · no frequencies for this market", " · sem frequências para este mercado")) + f_t(". Frecuencia pasada; no es una señal.", ". Past frequency; not a signal.", ". Frequência passada; não é um sinal.")
        f_cell(info, 0, 9, foot, dim, text.align_left)
        table.merge_cells(info, 0, 9, 3, 9)
 
// ------------------------------------------------------------------------------------------------------------ alerts
bool aGap = own.gapFilled
bool aIbUp = own.brkIbUp
bool aIbDn = own.brkIbDn
bool aOrUp = own.brkOrUp
bool aOrDn = own.brkOrDn
alertcondition(aGap and not aGap[1], "Gap filled", "El gap de apertura se rellenó / the opening gap filled")
alertcondition(aIbUp and not aIbUp[1], "Initial balance broken up", "Balance inicial roto por arriba / initial balance broken up")
alertcondition(aIbDn and not aIbDn[1], "Initial balance broken down", "Balance inicial roto por abajo / initial balance broken down")
alertcondition(aOrUp and not aOrUp[1], "Opening range broken up", "Rango de apertura roto por arriba / opening range broken up")
alertcondition(aOrDn and not aOrDn[1], "Opening range broken down", "Rango de apertura roto por abajo / opening range broken down")

← 返回列表