"Vibe-Trading: Your Personal Trading Agent"
Python ai-agentalgorithmic-tradingbacktestingfintechllmmcpmulti-agentpythonquantitative-financetrading
fix(backtest): Hong Kong RMB and USD counters stay out of the HKD pool, decided by the code
Haozhe Wu1f6e05d3ba14
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex de1a7ae1a..4241d6aaf 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -217,19 +217,26 @@ This project adheres to [Semantic Versioning](https://semver.org/).### Fixed-- **A dollar-quoted BYMA or TSX line no longer enters a peso or Canadian-dollar- backtest** (#1576, after #1543). Both venues list USD lines beside their- home-currency ones. On 2026-09-24 Yahoo declared USD for GGALD.BA (4.20),- SPYD.BA and AAPLD.BA, and for DLR-U.TO and XUS-U.TO. `ar_equity` and- `ca_equity` are each one static-currency pool, so such a line was priced as- pesos or Canadian dollars. As on the LSE, the loaders now read the declared- currency. They admit a `.BA` line only in ARS and a `.TO` / `.V` line only- in CAD. A trailing `D` does not decide it: YPFD.BA is a peso line. Every- other declared quote currency is recorded in market-data provenance, and the- grounding gate asks an answer to name that currency rather than the one the- suffix implies. Hong Kong RMB counters are unchanged (80700.HK is declared- CNY), because the Hong Kong chain starts with sources that declare no- currency.+- **A dollar-quoted BYMA or TSX line, or a Hong Kong RMB or USD counter, no+ longer enters a single-currency backtest** (#1576, after #1543). Both venues+ list USD lines beside their home-currency ones. On 2026-09-24 Yahoo declared+ USD for GGALD.BA (4.20), SPYD.BA and AAPLD.BA, and for DLR-U.TO and+ XUS-U.TO. `ar_equity` and `ca_equity` are each one static-currency pool, so+ such a line was priced as pesos or Canadian dollars. As on the LSE, the+ loaders now read the declared currency. They admit a `.BA` line only in ARS+ and a `.TO` / `.V` line only in CAD. A trailing `D` does not decide it:+ YPFD.BA is a peso line. Every other declared quote currency is recorded in+ market-data provenance, and the grounding gate asks an answer to name that+ currency rather than the one the suffix implies. Hong Kong is decided by the+ code, because the Hong Kong chain starts with sources that declare no+ currency: HKEX's Stock Code Allocation Plan assigns 80000-89999 to products+ traded in renminbi and several 09xxx ranges (plus 10900-10999 and+ 41500-41599) to products traded in USD. So an RMB counter (80700.HK, 375.40+ CNY on 2026-09-24) or a USD ETF (9834.HK) is refused in a Hong Kong or+ cross-market backtest, is counted in its own currency by the mixed-currency+ guard, and is quoted in that currency by the grounding gate, whichever+ source served it. The table matched the currency Yahoo declared for all 24+ codes probed across the ranges.- **Grounding identity and symbol search know every market the data layerroutes** (#1565, #1575). `.BA`, `.L` and `.VN` symbols had nocanonical-symbol scan, venue or currency in grounding. Symbol searchdiff --git a/README.md b/README.mdindex ba480ec21..e1c3459c9 100644--- a/README.md+++ b/README.md@@ -52,7 +52,7 @@> ⚠️ **Security warning:** The X account `VibeTrading_HKU`, Virtuals project `101845`, and token contract `0x640BDBF77b6447E8b7DB7894cED84BD1c40571f4` are not official Vibe-Trading assets. We have never launched or endorsed any token or memecoin. Do not buy, connect a wallet, or sign anything. [Details](SECURITY.md#official-channels--impersonation).-- **2026-09-24** 💱 **A dollar line priced as pesos, Email and WebSocket in the Web UI, and a CI break from an SDK update**: BYMA and the TSX list US-dollar lines beside their home-currency ones (GGALD.BA, DLR-U.TO), and an Argentine or Canadian backtest priced them in its single peso or Canadian-dollar pool. The loaders now admit a line only in its market's currency, as LSE lines already were, and every other declared quote currency travels with the data, so an answer names the right one ([#1576](https://github.com/HKUDS/Vibe-Trading/pull/1576)). Stock profiles carry the listing's own venue and currency beside the issuer's fundamentals ([#1577](https://github.com/HKUDS/Vibe-Trading/pull/1577)), grounding and symbol search know every market the data layer routes ([#1575](https://github.com/HKUDS/Vibe-Trading/pull/1575)), and `technical_indicators` reports volume with the unit its source declares — board lots or shares, 100× apart ([#1571](https://github.com/HKUDS/Vibe-Trading/pull/1571)). Email and WebSocket join the guided channel setup, with mail-server certificates now verified and settings writes closed to cross-site pages ([#1544](https://github.com/HKUDS/Vibe-Trading/pull/1544)). **Fixed:** an explicit provider header lost to an ambient twin under openai 3.19.2, which had turned every PR's CI red ([#1568](https://github.com/HKUDS/Vibe-Trading/pull/1568)); a backtest from a microsecond-resolution source was dated 1970 ([#1560](https://github.com/HKUDS/Vibe-Trading/pull/1560)); a research goal that is plainly an order is refused again ([#1562](https://github.com/HKUDS/Vibe-Trading/pull/1562)); a strict-bench OOS split could leave one side empty ([#1559](https://github.com/HKUDS/Vibe-Trading/pull/1559)); HRP label alignment, cross-validation label order and non-finite quant inputs ([#1555](https://github.com/HKUDS/Vibe-Trading/pull/1555), [#1556](https://github.com/HKUDS/Vibe-Trading/pull/1556), [#1557](https://github.com/HKUDS/Vibe-Trading/pull/1557), [#1558](https://github.com/HKUDS/Vibe-Trading/pull/1558)); the shadow-account overtrading window ([#1563](https://github.com/HKUDS/Vibe-Trading/pull/1563)); and asset growth was read day over day ([#1564](https://github.com/HKUDS/Vibe-Trading/pull/1564)). Thanks [@Shizoqua](https://github.com/Shizoqua), [@zeus229](https://github.com/zeus229) and [@shadowinlife](https://github.com/shadowinlife)!+- **2026-09-24** 💱 **A dollar line priced as pesos, Email and WebSocket in the Web UI, and a CI break from an SDK update**: BYMA and the TSX list US-dollar lines beside their home-currency ones (GGALD.BA, DLR-U.TO), and an Argentine or Canadian backtest priced them in its single peso or Canadian-dollar pool. The loaders now admit a line only in its market's currency, as LSE lines already were, and every other declared quote currency travels with the data, so an answer names the right one ([#1576](https://github.com/HKUDS/Vibe-Trading/pull/1576)). Hong Kong's RMB and USD counters (80700.HK, 9834.HK), which HKEX numbers in their own code ranges, are refused in a Hong Kong backtest for the same reason and quoted in their own currency. Stock profiles carry the listing's own venue and currency beside the issuer's fundamentals ([#1577](https://github.com/HKUDS/Vibe-Trading/pull/1577)), grounding and symbol search know every market the data layer routes ([#1575](https://github.com/HKUDS/Vibe-Trading/pull/1575)), and `technical_indicators` reports volume with the unit its source declares — board lots or shares, 100× apart ([#1571](https://github.com/HKUDS/Vibe-Trading/pull/1571)). Email and WebSocket join the guided channel setup, with mail-server certificates now verified and settings writes closed to cross-site pages, and a plain IMAP login is upgraded with STARTTLS before the password goes out ([#1544](https://github.com/HKUDS/Vibe-Trading/pull/1544)). **Fixed:** an explicit provider header lost to an ambient twin under openai 3.19.2, which had turned every PR's CI red ([#1568](https://github.com/HKUDS/Vibe-Trading/pull/1568)); a backtest from a microsecond-resolution source was dated 1970 ([#1560](https://github.com/HKUDS/Vibe-Trading/pull/1560)); a research goal that is plainly an order is refused again ([#1562](https://github.com/HKUDS/Vibe-Trading/pull/1562)); a strict-bench OOS split could leave one side empty ([#1559](https://github.com/HKUDS/Vibe-Trading/pull/1559)); HRP label alignment, cross-validation label order and non-finite quant inputs ([#1555](https://github.com/HKUDS/Vibe-Trading/pull/1555), [#1556](https://github.com/HKUDS/Vibe-Trading/pull/1556), [#1557](https://github.com/HKUDS/Vibe-Trading/pull/1557), [#1558](https://github.com/HKUDS/Vibe-Trading/pull/1558)); the shadow-account overtrading window ([#1563](https://github.com/HKUDS/Vibe-Trading/pull/1563)); and asset growth was read day over day ([#1564](https://github.com/HKUDS/Vibe-Trading/pull/1564)). Thanks [@Shizoqua](https://github.com/Shizoqua), [@zeus229](https://github.com/zeus229) and [@shadowinlife](https://github.com/shadowinlife)!- **2026-09-23** 🇦🇷 **Argentine listings, a short book sized upside down, and the last half of the tail-risk gate**: `.BA` symbols — BYMA equities and CEDEARs — route to Yahoo as their own ARS market, and the Web UI groups and labels them like any other; an Argentine backtest still fails closed until BYMA execution rules are modelled ([#1543](https://github.com/HKUDS/Vibe-Trading/pull/1543)). The mean-variance and turnover-aware optimizers scored every position as if it were held long, so the strongest shorts got the least capital. Both now size on position returns, where a long and a short of two correlated names hedge each other instead of reading as correlated — on a +0.92 correlated pair the old objective put the whole book on the long, the new one splits it 0.51 / -0.49 ([#1548](https://github.com/HKUDS/Vibe-Trading/pull/1548)). And a tail-risk figure now has to name its own field once a session holds more than one measure or confidence level, so an ES 95% can no longer quote the VaR 95% value under a call id ([#1425](https://github.com/HKUDS/Vibe-Trading/issues/1425)). **Fixed:** Monte-Carlo validation annualises at the venue's bars per year instead of a hardcoded 252, so its Sharpe agrees with the rest of the same report ([#1546](https://github.com/HKUDS/Vibe-Trading/pull/1546)); a futures order on a negative-price bar is no longer rejected outright ([#1547](https://github.com/HKUDS/Vibe-Trading/pull/1547)); a factor's IC ratio is left unset for a negative baseline instead of reading real decay as healthy improvement ([#1549](https://github.com/HKUDS/Vibe-Trading/pull/1549)); and two memories sharing a title under different types keep their own index rows and link targets ([#1545](https://github.com/HKUDS/Vibe-Trading/pull/1545)). Thanks [@zeus229](https://github.com/zeus229), [@Shizoqua](https://github.com/Shizoqua) and [@he-yufeng](https://github.com/he-yufeng)!diff --git a/README_ar.md b/README_ar.mdindex 94e035229..8c45dbdd7 100644--- a/README_ar.md+++ b/README_ar.md@@ -52,7 +52,7 @@> ⚠️ **تحذير أمني:** حساب X باسم `VibeTrading_HKU`، ومشروع Virtuals رقم `101845`، وعقد التوكن `0x640BDBF77b6447E8b7DB7894cED84BD1c40571f4` كلّها غير رسمية ولا تتبع Vibe-Trading. لم نُطلق أو نؤيد مطلقًا أي توكن أو عملة ميم. لا تشترِ هذا التوكن، ولا تربط محفظتك، ولا توقّع أي شيء. [التفاصيل](SECURITY.md#official-channels--impersonation).-- **2026-09-24** 💱 **أوراق مسعّرة بالدولار حُسبت بالبيزو، وEmail وWebSocket في واجهة الويب، وعطل في CI سببه تحديث SDK**: تُدرج BYMA وبورصة تورنتو أوراقًا مسعّرة بالدولار الأمريكي إلى جانب أوراقها بالعملة المحلية (GGALD.BA وDLR-U.TO)، وكان الاختبار الرجعي الأرجنتيني أو الكندي يسعّرها في مجمّعه الوحيد بالبيزو أو بالدولار الكندي. صارت أدوات التحميل تقبل الورقة فقط إذا كانت مسعّرة بعملة سوقها، كما هو الحال مع أوراق LSE، وتنتقل عملة التسعير المعلنة لغيرها مع البيانات فيذكر الجواب العملة الصحيحة ([#1576](https://github.com/HKUDS/Vibe-Trading/pull/1576)). ملفات الأسهم تحمل بورصة الإدراج وعملته إلى جانب البيانات الأساسية للمُصدر ([#1577](https://github.com/HKUDS/Vibe-Trading/pull/1577))، ويعرف التحقق من الأرقام والبحث عن الرموز كل سوق تدعمه طبقة البيانات ([#1575](https://github.com/HKUDS/Vibe-Trading/pull/1575))، وتعيد `technical_indicators` حجم التداول مع الوحدة التي يعلنها المصدر — لوت أو سهم، والفرق 100 ضعف ([#1571](https://github.com/HKUDS/Vibe-Trading/pull/1571)). وينضم Email وWebSocket إلى الإعداد الموجَّه للقنوات، مع التحقق من شهادات خادم البريد ورفض كتابة الإعدادات من صفحات عابرة للمواقع ([#1544](https://github.com/HKUDS/Vibe-Trading/pull/1544)). **إصلاحات:** ترويسة المزوّد الصريحة كانت تُستبدل بترويسة بيئية بالاسم نفسه في openai 3.19.2، ما جعل CI يفشل لكل PR ([#1568](https://github.com/HKUDS/Vibe-Trading/pull/1568))؛ واختبار رجعي من مصدر بدقة الميكروثانية كان مؤرخًا بعام 1970 ([#1560](https://github.com/HKUDS/Vibe-Trading/pull/1560))؛ وهدف بحثي هو أمر تداول صريح يُرفض مجددًا ([#1562](https://github.com/HKUDS/Vibe-Trading/pull/1562))؛ وتقسيم OOS في strict bench كان قد يترك أحد الجانبين فارغًا ([#1559](https://github.com/HKUDS/Vibe-Trading/pull/1559))؛ ومحاذاة تسميات HRP وترتيب تسميات التحقق المتقاطع والمدخلات غير المنتهية ([#1555](https://github.com/HKUDS/Vibe-Trading/pull/1555) و[#1556](https://github.com/HKUDS/Vibe-Trading/pull/1556) و[#1557](https://github.com/HKUDS/Vibe-Trading/pull/1557) و[#1558](https://github.com/HKUDS/Vibe-Trading/pull/1558))؛ ونافذة الإفراط في التداول في الحساب الظلي ([#1563](https://github.com/HKUDS/Vibe-Trading/pull/1563))؛ ونمو الأصول الذي كان يُحسب يومًا بيوم ([#1564](https://github.com/HKUDS/Vibe-Trading/pull/1564)). شكرًا [@Shizoqua](https://github.com/Shizoqua) و[@zeus229](https://github.com/zeus229) و[@shadowinlife](https://github.com/shadowinlife)!+- **2026-09-24** 💱 **أوراق مسعّرة بالدولار حُسبت بالبيزو، وEmail وWebSocket في واجهة الويب، وعطل في CI سببه تحديث SDK**: تُدرج BYMA وبورصة تورنتو أوراقًا مسعّرة بالدولار الأمريكي إلى جانب أوراقها بالعملة المحلية (GGALD.BA وDLR-U.TO)، وكان الاختبار الرجعي الأرجنتيني أو الكندي يسعّرها في مجمّعه الوحيد بالبيزو أو بالدولار الكندي. صارت أدوات التحميل تقبل الورقة فقط إذا كانت مسعّرة بعملة سوقها، كما هو الحال مع أوراق LSE، وتنتقل عملة التسعير المعلنة لغيرها مع البيانات فيذكر الجواب العملة الصحيحة ([#1576](https://github.com/HKUDS/Vibe-Trading/pull/1576)). كما تُرفض في الاختبار الرجعي لهونغ كونغ، للسبب نفسه، الخطوط المتداولة باليوان والدولار (80700.HK و9834.HK) التي ترقّمها HKEX في نطاقات رموز خاصة بها، وتُعرض بعملتها. ملفات الأسهم تحمل بورصة الإدراج وعملته إلى جانب البيانات الأساسية للمُصدر ([#1577](https://github.com/HKUDS/Vibe-Trading/pull/1577))، ويعرف التحقق من الأرقام والبحث عن الرموز كل سوق تدعمه طبقة البيانات ([#1575](https://github.com/HKUDS/Vibe-Trading/pull/1575))، وتعيد `technical_indicators` حجم التداول مع الوحدة التي يعلنها المصدر — لوت أو سهم، والفرق 100 ضعف ([#1571](https://github.com/HKUDS/Vibe-Trading/pull/1571)). وينضم Email وWebSocket إلى الإعداد الموجَّه للقنوات، مع التحقق من شهادات خادم البريد ورفض كتابة الإعدادات من صفحات عابرة للمواقع، وترقية تسجيل دخول IMAP غير المشفّر عبر STARTTLS قبل إرسال كلمة المرور ([#1544](https://github.com/HKUDS/Vibe-Trading/pull/1544)). **إصلاحات:** ترويسة المزوّد الصريحة كانت تُستبدل بترويسة بيئية بالاسم نفسه في openai 3.19.2، ما جعل CI يفشل لكل PR ([#1568](https://github.com/HKUDS/Vibe-Trading/pull/1568))؛ واختبار رجعي من مصدر بدقة الميكروثانية كان مؤرخًا بعام 1970 ([#1560](https://github.com/HKUDS/Vibe-Trading/pull/1560))؛ وهدف بحثي هو أمر تداول صريح يُرفض مجددًا ([#1562](https://github.com/HKUDS/Vibe-Trading/pull/1562))؛ وتقسيم OOS في strict bench كان قد يترك أحد الجانبين فارغًا ([#1559](https://github.com/HKUDS/Vibe-Trading/pull/1559))؛ ومحاذاة تسميات HRP وترتيب تسميات التحقق المتقاطع والمدخلات غير المنتهية ([#1555](https://github.com/HKUDS/Vibe-Trading/pull/1555) و[#1556](https://github.com/HKUDS/Vibe-Trading/pull/1556) و[#1557](https://github.com/HKUDS/Vibe-Trading/pull/1557) و[#1558](https://github.com/HKUDS/Vibe-Trading/pull/1558))؛ ونافذة الإفراط في التداول في الحساب الظلي ([#1563](https://github.com/HKUDS/Vibe-Trading/pull/1563))؛ ونمو الأصول الذي كان يُحسب يومًا بيوم ([#1564](https://github.com/HKUDS/Vibe-Trading/pull/1564)). شكرًا [@Shizoqua](https://github.com/Shizoqua) و[@zeus229](https://github.com/zeus229) و[@shadowinlife](https://github.com/shadowinlife)!- **2026-09-23** 🇦🇷 **أسهم أرجنتينية، ومحفظة بيع على المكشوف كان حجمها مقلوبًا، والنصف الأخير من بوابة مخاطر الذيل**: رموز `.BA` (أسهم BYMA وشهادات CEDEAR) تُوجَّه إلى Yahoo كسوق بعملة ARS خاصة بها، وواجهة الويب تجمعها وتسمّيها مثل أي سوق آخر؛ ويظل الاختبار الرجعي للأرجنتين يفشل صراحةً حتى تُنمذَج قواعد التنفيذ في BYMA ([#1543](https://github.com/HKUDS/Vibe-Trading/pull/1543)). كان مُحسِّنا المتوسط-التباين ومراعاة الدوران يقيّمان كل مركز كأنه شراء، فحصلت أقوى مراكز البيع على أقل رأس مال. الاثنان الآن يحدّدان الحجم على عوائد المركز، حيث يتحوّط شراء وبيع لورقتين مترابطتين بدل أن يُقرآ كمترابطتين — على زوج بترابط +0.92 كان الهدف القديم يضع المحفظة كلها في الشراء، والجديد يقسمها 0.51 / -0.49 ([#1548](https://github.com/HKUDS/Vibe-Trading/pull/1548)). وصار رقم مخاطر الذيل مُلزَمًا بتسمية حقله بعد أن تحتفظ الجلسة بأكثر من مقياس أو مستوى ثقة، فلا يمكن لـ ES 95% أن يقتبس قيمة VaR 95% تحت معرّف نداء ([#1425](https://github.com/HKUDS/Vibe-Trading/issues/1425)). **إصلاحات:** تحقّق مونت كارلو يحوّل إلى أساس سنوي بعدد أشرطة المنصة لا بالرقم الثابت 252، فيتوافق شارب مع بقية التقرير نفسه ([#1546](https://github.com/HKUDS/Vibe-Trading/pull/1546)); أمر العقود المستقبلية على شريط بسعر سالب لم يعد يُرفض كليًا ([#1547](https://github.com/HKUDS/Vibe-Trading/pull/1547)); ونسبة IC للعامل تُترك غير محددة عندما يكون الأساس سالبًا بدل قراءة التدهور الحقيقي كتحسّن سليم ([#1549](https://github.com/HKUDS/Vibe-Trading/pull/1549)); وذاكرتان تتشاركان العنوان تحت نوعين مختلفين تحتفظان بسطري فهرس ووصلات مستقلة ([#1545](https://github.com/HKUDS/Vibe-Trading/pull/1545)). شكرًا [@zeus229](https://github.com/zeus229) و[@Shizoqua](https://github.com/Shizoqua) و[@he-yufeng](https://github.com/he-yufeng)!diff --git a/README_es.md b/README_es.mdindex 2b8ca0b57..e8277702c 100644--- a/README_es.md+++ b/README_es.md@@ -52,7 +52,7 @@> ⚠️ **Advertencia de seguridad:** la cuenta de X `VibeTrading_HKU`, el proyecto de Virtuals `101845` y el contrato de token `0x640BDBF77b6447E8b7DB7894cED84BD1c40571f4` no son activos oficiales de Vibe-Trading. Nunca hemos lanzado ni respaldado ningún token o memecoin. No compres, conectes una wallet ni firmes nada. [Detalles](SECURITY.md#official-channels--impersonation).-- **2026-09-24** 💱 **Una línea en dólares valuada en pesos, Email y WebSocket en la Web UI, y una rotura de CI por una actualización del SDK**: BYMA y la TSX listan líneas en dólares junto a las de su moneda local (GGALD.BA, DLR-U.TO), y un backtest argentino o canadiense las valuaba en su único pool en pesos o en dólares canadienses. Los loaders ahora admiten una línea solo en la moneda de su mercado, como ya ocurría con las líneas de la LSE, y cualquier otra moneda de cotización declarada viaja con los datos, de modo que la respuesta nombra la correcta ([#1576](https://github.com/HKUDS/Vibe-Trading/pull/1576)). Los perfiles de acciones incluyen el mercado y la moneda del propio listado junto a los fundamentales del emisor ([#1577](https://github.com/HKUDS/Vibe-Trading/pull/1577)), el grounding y la búsqueda de símbolos conocen todos los mercados que enruta la capa de datos ([#1575](https://github.com/HKUDS/Vibe-Trading/pull/1575)) y `technical_indicators` informa el volumen con la unidad que declara su fuente — lotes o acciones, a 100× de distancia ([#1571](https://github.com/HKUDS/Vibe-Trading/pull/1571)). Email y WebSocket se suman a la configuración guiada de canales, con verificación de certificados del servidor de correo y escrituras de configuración cerradas a páginas de otros sitios ([#1544](https://github.com/HKUDS/Vibe-Trading/pull/1544)). **Corregido:** una cabecera explícita del proveedor que perdía frente a su gemela del entorno con openai 3.19.2 y había puesto en rojo el CI de todos los PR ([#1568](https://github.com/HKUDS/Vibe-Trading/pull/1568)); un backtest de una fuente con resolución de microsegundos fechado en 1970 ([#1560](https://github.com/HKUDS/Vibe-Trading/pull/1560)); un objetivo de investigación que es claramente una orden vuelve a rechazarse ([#1562](https://github.com/HKUDS/Vibe-Trading/pull/1562)); una división OOS del strict bench que podía dejar un lado vacío ([#1559](https://github.com/HKUDS/Vibe-Trading/pull/1559)); alineación de etiquetas en HRP, orden de etiquetas en la validación cruzada y entradas no finitas ([#1555](https://github.com/HKUDS/Vibe-Trading/pull/1555), [#1556](https://github.com/HKUDS/Vibe-Trading/pull/1556), [#1557](https://github.com/HKUDS/Vibe-Trading/pull/1557), [#1558](https://github.com/HKUDS/Vibe-Trading/pull/1558)); la ventana de sobreoperación de la cuenta sombra ([#1563](https://github.com/HKUDS/Vibe-Trading/pull/1563)); y el crecimiento de activos, que se medía día contra día ([#1564](https://github.com/HKUDS/Vibe-Trading/pull/1564)). ¡Gracias [@Shizoqua](https://github.com/Shizoqua), [@zeus229](https://github.com/zeus229) y [@shadowinlife](https://github.com/shadowinlife)!+- **2026-09-24** 💱 **Una línea en dólares valuada en pesos, Email y WebSocket en la Web UI, y una rotura de CI por una actualización del SDK**: BYMA y la TSX listan líneas en dólares junto a las de su moneda local (GGALD.BA, DLR-U.TO), y un backtest argentino o canadiense las valuaba en su único pool en pesos o en dólares canadienses. Los loaders ahora admiten una línea solo en la moneda de su mercado, como ya ocurría con las líneas de la LSE, y cualquier otra moneda de cotización declarada viaja con los datos, de modo que la respuesta nombra la correcta ([#1576](https://github.com/HKUDS/Vibe-Trading/pull/1576)). Las líneas de Hong Kong en renminbi y en dólares (80700.HK, 9834.HK), que HKEX numera en sus propios rangos de códigos, se rechazan en un backtest de Hong Kong por la misma razón y se cotizan en su propia moneda. Los perfiles de acciones incluyen el mercado y la moneda del propio listado junto a los fundamentales del emisor ([#1577](https://github.com/HKUDS/Vibe-Trading/pull/1577)), el grounding y la búsqueda de símbolos conocen todos los mercados que enruta la capa de datos ([#1575](https://github.com/HKUDS/Vibe-Trading/pull/1575)) y `technical_indicators` informa el volumen con la unidad que declara su fuente — lotes o acciones, a 100× de distancia ([#1571](https://github.com/HKUDS/Vibe-Trading/pull/1571)). Email y WebSocket se suman a la configuración guiada de canales, con verificación de certificados del servidor de correo y escrituras de configuración cerradas a páginas de otros sitios, y un inicio de sesión IMAP sin SSL que ahora se cifra con STARTTLS antes de enviar la contraseña ([#1544](https://github.com/HKUDS/Vibe-Trading/pull/1544)). **Corregido:** una cabecera explícita del proveedor que perdía frente a su gemela del entorno con openai 3.19.2 y había puesto en rojo el CI de todos los PR ([#1568](https://github.com/HKUDS/Vibe-Trading/pull/1568)); un backtest de una fuente con resolución de microsegundos fechado en 1970 ([#1560](https://github.com/HKUDS/Vibe-Trading/pull/1560)); un objetivo de investigación que es claramente una orden vuelve a rechazarse ([#1562](https://github.com/HKUDS/Vibe-Trading/pull/1562)); una división OOS del strict bench que podía dejar un lado vacío ([#1559](https://github.com/HKUDS/Vibe-Trading/pull/1559)); alineación de etiquetas en HRP, orden de etiquetas en la validación cruzada y entradas no finitas ([#1555](https://github.com/HKUDS/Vibe-Trading/pull/1555), [#1556](https://github.com/HKUDS/Vibe-Trading/pull/1556), [#1557](https://github.com/HKUDS/Vibe-Trading/pull/1557), [#1558](https://github.com/HKUDS/Vibe-Trading/pull/1558)); la ventana de sobreoperación de la cuenta sombra ([#1563](https://github.com/HKUDS/Vibe-Trading/pull/1563)); y el crecimiento de activos, que se medía día contra día ([#1564](https://github.com/HKUDS/Vibe-Trading/pull/1564)). ¡Gracias [@Shizoqua](https://github.com/Shizoqua), [@zeus229](https://github.com/zeus229) y [@shadowinlife](https://github.com/shadowinlife)!- **2026-09-23** 🇦🇷 **Cotizaciones argentinas, un libro de cortos dimensionado al revés y la última mitad de la puerta de riesgo de cola**: los símbolos `.BA` —acciones de BYMA y CEDEARs— se enrutan a Yahoo como mercado propio en ARS, y la interfaz web los agrupa y etiqueta como a cualquier otro; un backtest argentino sigue fallando de forma explícita hasta que se modelen las reglas de ejecución de BYMA ([#1543](https://github.com/HKUDS/Vibe-Trading/pull/1543)). Los optimizadores de media-varianza y de rotación puntuaban cada posición como si fuera larga, así que los mejores cortos recibían el menor capital. Ahora ambos dimensionan sobre retornos de la posición, donde un largo y un corto de dos nombres correlacionados se cubren entre sí en vez de leerse como correlacionados: en un par con correlación +0,92 el objetivo anterior ponía todo el libro en el largo y el nuevo lo reparte 0,51 / -0,49 ([#1548](https://github.com/HKUDS/Vibe-Trading/pull/1548)). Y una cifra de riesgo de cola debe nombrar su propio campo en cuanto una sesión contiene más de una medida o nivel de confianza, de modo que un ES 95% ya no puede citar el valor del VaR 95% bajo el id de una llamada ([#1425](https://github.com/HKUDS/Vibe-Trading/issues/1425)). **Corregido:** la validación Monte Carlo anualiza con las barras por año del mercado en lugar de un 252 fijo, así su Sharpe concuerda con el resto del mismo informe ([#1546](https://github.com/HKUDS/Vibe-Trading/pull/1546)); una orden de futuros en una barra de precio negativo ya no se rechaza sin más ([#1547](https://github.com/HKUDS/Vibe-Trading/pull/1547)); el IC ratio de un factor queda sin definir cuando la línea base es negativa, en vez de leer un deterioro real como mejora ([#1549](https://github.com/HKUDS/Vibe-Trading/pull/1549)); y dos memorias que comparten título bajo tipos distintos conservan sus propias filas de índice y enlaces ([#1545](https://github.com/HKUDS/Vibe-Trading/pull/1545)). ¡Gracias [@zeus229](https://github.com/zeus229), [@Shizoqua](https://github.com/Shizoqua) y [@he-yufeng](https://github.com/he-yufeng)!diff --git a/README_id.md b/README_id.mdindex e361de3c8..115d75b0c 100644--- a/README_id.md+++ b/README_id.md@@ -53,7 +53,7 @@> ⚠️ **Peringatan keamanan:** Akun X `VibeTrading_HKU`, proyek Virtuals `101845`, dan kontrak token `0x640BDBF77b6447E8b7DB7894cED84BD1c40571f4` bukan aset resmi Vibe-Trading. Kami tidak pernah meluncurkan atau mendukung token maupun memecoin apa pun. Jangan membeli, menghubungkan wallet, atau menandatangani apa pun. [Detail](SECURITY.md#official-channels--impersonation).-- **2026-09-24** 💱 **Saham berdenominasi dolar yang dihitung dalam peso, Email dan WebSocket di Web UI, dan CI yang rusak karena pembaruan SDK**: BYMA dan TSX mencatatkan saham berdenominasi dolar AS di samping saham bermata uang lokal (GGALD.BA, DLR-U.TO), dan backtest Argentina atau Kanada menilainya dalam satu-satunya pool peso atau dolar Kanada. Loader kini hanya menerima saham yang dikutip dalam mata uang pasarnya, seperti yang sudah berlaku untuk saham LSE, dan mata uang kuotasi lain yang dideklarasikan sumber ikut terbawa bersama data sehingga jawaban menyebut mata uang yang benar ([#1576](https://github.com/HKUDS/Vibe-Trading/pull/1576)). Profil saham membawa bursa dan mata uang pencatatan itu sendiri di samping fundamental penerbit ([#1577](https://github.com/HKUDS/Vibe-Trading/pull/1577)), grounding dan pencarian simbol mengenali setiap pasar yang dirutekan lapisan data ([#1575](https://github.com/HKUDS/Vibe-Trading/pull/1575)), dan `technical_indicators` melaporkan volume beserta satuan yang dideklarasikan sumbernya — lot atau lembar saham, selisih 100× ([#1571](https://github.com/HKUDS/Vibe-Trading/pull/1571)). Email dan WebSocket bergabung ke pengaturan channel terpandu, dengan sertifikat server email kini diverifikasi dan penulisan pengaturan tertutup bagi halaman lintas situs ([#1544](https://github.com/HKUDS/Vibe-Trading/pull/1544)). **Diperbaiki:** header provider eksplisit yang kalah oleh header lingkungan bernama sama di openai 3.19.2 dan sempat membuat CI setiap PR merah ([#1568](https://github.com/HKUDS/Vibe-Trading/pull/1568)); backtest dari sumber beresolusi mikrodetik yang bertanggal 1970 ([#1560](https://github.com/HKUDS/Vibe-Trading/pull/1560)); target riset yang jelas-jelas berupa order kembali ditolak ([#1562](https://github.com/HKUDS/Vibe-Trading/pull/1562)); pembagian OOS strict bench yang bisa membuat satu sisi kosong ([#1559](https://github.com/HKUDS/Vibe-Trading/pull/1559)); penyelarasan label HRP, urutan label validasi silang, dan input kuant yang tidak hingga ([#1555](https://github.com/HKUDS/Vibe-Trading/pull/1555), [#1556](https://github.com/HKUDS/Vibe-Trading/pull/1556), [#1557](https://github.com/HKUDS/Vibe-Trading/pull/1557), [#1558](https://github.com/HKUDS/Vibe-Trading/pull/1558)); jendela overtrading akun bayangan ([#1563](https://github.com/HKUDS/Vibe-Trading/pull/1563)); serta pertumbuhan aset yang dihitung hari ke hari ([#1564](https://github.com/HKUDS/Vibe-Trading/pull/1564)). Terima kasih [@Shizoqua](https://github.com/Shizoqua), [@zeus229](https://github.com/zeus229), dan [@shadowinlife](https://github.com/shadowinlife)!+- **2026-09-24** 💱 **Saham berdenominasi dolar yang dihitung dalam peso, Email dan WebSocket di Web UI, dan CI yang rusak karena pembaruan SDK**: BYMA dan TSX mencatatkan saham berdenominasi dolar AS di samping saham bermata uang lokal (GGALD.BA, DLR-U.TO), dan backtest Argentina atau Kanada menilainya dalam satu-satunya pool peso atau dolar Kanada. Loader kini hanya menerima saham yang dikutip dalam mata uang pasarnya, seperti yang sudah berlaku untuk saham LSE, dan mata uang kuotasi lain yang dideklarasikan sumber ikut terbawa bersama data sehingga jawaban menyebut mata uang yang benar ([#1576](https://github.com/HKUDS/Vibe-Trading/pull/1576)). Counter RMB dan USD Hong Kong (80700.HK, 9834.HK), yang diberi nomor HKEX dalam rentang kodenya sendiri, ditolak dalam backtest Hong Kong karena alasan yang sama dan dikutip dalam mata uangnya sendiri. Profil saham membawa bursa dan mata uang pencatatan itu sendiri di samping fundamental penerbit ([#1577](https://github.com/HKUDS/Vibe-Trading/pull/1577)), grounding dan pencarian simbol mengenali setiap pasar yang dirutekan lapisan data ([#1575](https://github.com/HKUDS/Vibe-Trading/pull/1575)), dan `technical_indicators` melaporkan volume beserta satuan yang dideklarasikan sumbernya — lot atau lembar saham, selisih 100× ([#1571](https://github.com/HKUDS/Vibe-Trading/pull/1571)). Email dan WebSocket bergabung ke pengaturan channel terpandu, dengan sertifikat server email kini diverifikasi dan penulisan pengaturan tertutup bagi halaman lintas situs, serta login IMAP tanpa SSL yang kini dienkripsi dengan STARTTLS sebelum kata sandi dikirim ([#1544](https://github.com/HKUDS/Vibe-Trading/pull/1544)). **Diperbaiki:** header provider eksplisit yang kalah oleh header lingkungan bernama sama di openai 3.19.2 dan sempat membuat CI setiap PR merah ([#1568](https://github.com/HKUDS/Vibe-Trading/pull/1568)); backtest dari sumber beresolusi mikrodetik yang bertanggal 1970 ([#1560](https://github.com/HKUDS/Vibe-Trading/pull/1560)); target riset yang jelas-jelas berupa order kembali ditolak ([#1562](https://github.com/HKUDS/Vibe-Trading/pull/1562)); pembagian OOS strict bench yang bisa membuat satu sisi kosong ([#1559](https://github.com/HKUDS/Vibe-Trading/pull/1559)); penyelarasan label HRP, urutan label validasi silang, dan input kuant yang tidak hingga ([#1555](https://github.com/HKUDS/Vibe-Trading/pull/1555), [#1556](https://github.com/HKUDS/Vibe-Trading/pull/1556), [#1557](https://github.com/HKUDS/Vibe-Trading/pull/1557), [#1558](https://github.com/HKUDS/Vibe-Trading/pull/1558)); jendela overtrading akun bayangan ([#1563](https://github.com/HKUDS/Vibe-Trading/pull/1563)); serta pertumbuhan aset yang dihitung hari ke hari ([#1564](https://github.com/HKUDS/Vibe-Trading/pull/1564)). Terima kasih [@Shizoqua](https://github.com/Shizoqua), [@zeus229](https://github.com/zeus229), dan [@shadowinlife](https://github.com/shadowinlife)!- **2026-09-23** 🇦🇷 **Saham Argentina, buku short yang disizing terbalik, dan separuh terakhir gerbang risiko ekor**: simbol `.BA` — saham BYMA dan CEDEAR — dirutekan ke Yahoo sebagai pasar ARS sendiri, dan Web UI mengelompokkan serta melabelinya seperti pasar lain; backtest Argentina tetap gagal secara eksplisit sampai aturan eksekusi BYMA dimodelkan ([#1543](https://github.com/HKUDS/Vibe-Trading/pull/1543)). Optimizer mean-variance dan turnover-aware menilai setiap posisi seolah long, sehingga short terbaik mendapat modal paling sedikit. Keduanya kini disizing pada return posisi, di mana long dan short dua nama berkorelasi saling melindungi alih-alih terbaca berkorelasi — pada pasangan berkorelasi +0,92 objektif lama menaruh seluruh buku di long, yang baru membaginya 0,51 / -0,49 ([#1548](https://github.com/HKUDS/Vibe-Trading/pull/1548)). Selain itu, angka risiko ekor kini harus menyebut fieldnya sendiri begitu satu sesi memuat lebih dari satu ukuran atau tingkat keyakinan, sehingga ES 95% tidak bisa lagi mengutip nilai VaR 95% dengan id panggilan ([#1425](https://github.com/HKUDS/Vibe-Trading/issues/1425)). **Diperbaiki:** validasi Monte Carlo menyetahunkan dengan bar per tahun bursa, bukan 252 yang dipaku, sehingga Sharpe-nya sejalan dengan bagian lain laporan yang sama ([#1546](https://github.com/HKUDS/Vibe-Trading/pull/1546)); order futures pada bar berharga negatif tidak lagi ditolak seluruhnya ([#1547](https://github.com/HKUDS/Vibe-Trading/pull/1547)); IC ratio sebuah faktor dibiarkan kosong bila baseline-nya negatif, alih-alih membaca pelemahan nyata sebagai perbaikan ([#1549](https://github.com/HKUDS/Vibe-Trading/pull/1549)); dan dua memori dengan judul sama di tipe berbeda mempertahankan baris indeks serta target tautannya masing-masing ([#1545](https://github.com/HKUDS/Vibe-Trading/pull/1545)). Terima kasih [@zeus229](https://github.com/zeus229), [@Shizoqua](https://github.com/Shizoqua), dan [@he-yufeng](https://github.com/he-yufeng)!diff --git a/README_ja.md b/README_ja.mdindex 64f4db4f0..a379b0a96 100644--- a/README_ja.md+++ b/README_ja.md@@ -52,7 +52,7 @@> ⚠️ **セキュリティ警告:** Xアカウント `VibeTrading_HKU`、Virtualsプロジェクト `101845`、およびトークンコントラクト `0x640BDBF77b6447E8b7DB7894cED84BD1c40571f4` は、いずれもVibe-Trading公式のものではありません。Vibe-Tradingはこれまで、いかなるトークンやミームコインも発行・公認していません。購入、ウォレットの接続、署名は行わないでください。[詳細](SECURITY.md#official-channels--impersonation)-- **2026-09-24** 💱 **ペソで計上されていたドル建て銘柄、Web UI に加わった Email と WebSocket、そして SDK 更新による CI 障害**:BYMA とトロント証券取引所には自国通貨建てに加えて米ドル建ての銘柄(GGALD.BA、DLR-U.TO)があり、アルゼンチンやカナダのバックテストはそれらを単一のペソ/カナダドルのプールで評価していました。ローダーは市場の通貨で建値された銘柄だけを受け入れるようになり(LSE 銘柄と同じ規則)、それ以外に申告された建値通貨はデータとともに渡されるため、回答には正しい通貨が書かれます([#1576](https://github.com/HKUDS/Vibe-Trading/pull/1576))。銘柄プロファイルは発行体のファンダメンタルズとは別に、その上場銘柄自身の取引所と通貨を返し([#1577](https://github.com/HKUDS/Vibe-Trading/pull/1577))、グラウンディングと銘柄検索はデータ層が扱うすべての市場を認識し([#1575](https://github.com/HKUDS/Vibe-Trading/pull/1575))、`technical_indicators` は出来高をデータソースが申告する単位(単元か株か、100 倍違う)付きで返します([#1571](https://github.com/HKUDS/Vibe-Trading/pull/1571))。Email と WebSocket がガイド付きチャネル設定に加わり、メールサーバー証明書の検証と、クロスサイトのページからの設定書き込みの拒否も入りました([#1544](https://github.com/HKUDS/Vibe-Trading/pull/1544))。**修正:** openai 3.19.2 で明示したプロバイダーヘッダーが環境側の同名ヘッダーに負け、全 PR の CI が赤くなっていた問題([#1568](https://github.com/HKUDS/Vibe-Trading/pull/1568))、マイクロ秒精度のソースからのバックテストが 1970 年の日付になっていた問題([#1560](https://github.com/HKUDS/Vibe-Trading/pull/1560))、明らかに注文である研究ゴールを再び拒否([#1562](https://github.com/HKUDS/Vibe-Trading/pull/1562))、strict bench の OOS 分割で片側が空になりうる問題([#1559](https://github.com/HKUDS/Vibe-Trading/pull/1559))、HRP のラベル整列・交差検証のラベル順序・非有限な入力([#1555](https://github.com/HKUDS/Vibe-Trading/pull/1555)、[#1556](https://github.com/HKUDS/Vibe-Trading/pull/1556)、[#1557](https://github.com/HKUDS/Vibe-Trading/pull/1557)、[#1558](https://github.com/HKUDS/Vibe-Trading/pull/1558))、シャドーアカウントの過剰取引の期間([#1563](https://github.com/HKUDS/Vibe-Trading/pull/1563))、日次で比較されていた総資産成長率([#1564](https://github.com/HKUDS/Vibe-Trading/pull/1564))。[@Shizoqua](https://github.com/Shizoqua)、[@zeus229](https://github.com/zeus229)、[@shadowinlife](https://github.com/shadowinlife) に感謝します!+- **2026-09-24** 💱 **ペソで計上されていたドル建て銘柄、Web UI に加わった Email と WebSocket、そして SDK 更新による CI 障害**:BYMA とトロント証券取引所には自国通貨建てに加えて米ドル建ての銘柄(GGALD.BA、DLR-U.TO)があり、アルゼンチンやカナダのバックテストはそれらを単一のペソ/カナダドルのプールで評価していました。ローダーは市場の通貨で建値された銘柄だけを受け入れるようになり(LSE 銘柄と同じ規則)、それ以外に申告された建値通貨はデータとともに渡されるため、回答には正しい通貨が書かれます([#1576](https://github.com/HKUDS/Vibe-Trading/pull/1576))。香港取引所が独自のコード帯で採番する人民元建て・米ドル建てカウンター(80700.HK、9834.HK)も同じ理由で香港のバックテストから除外され、それぞれの通貨で扱われます。銘柄プロファイルは発行体のファンダメンタルズとは別に、その上場銘柄自身の取引所と通貨を返し([#1577](https://github.com/HKUDS/Vibe-Trading/pull/1577))、グラウンディングと銘柄検索はデータ層が扱うすべての市場を認識し([#1575](https://github.com/HKUDS/Vibe-Trading/pull/1575))、`technical_indicators` は出来高をデータソースが申告する単位(単元か株か、100 倍違う)付きで返します([#1571](https://github.com/HKUDS/Vibe-Trading/pull/1571))。Email と WebSocket がガイド付きチャネル設定に加わり、メールサーバー証明書の検証と、クロスサイトのページからの設定書き込みの拒否、SSL なしの IMAP でもパスワード送信前に STARTTLS で暗号化する変更も入りました([#1544](https://github.com/HKUDS/Vibe-Trading/pull/1544))。**修正:** openai 3.19.2 で明示したプロバイダーヘッダーが環境側の同名ヘッダーに負け、全 PR の CI が赤くなっていた問題([#1568](https://github.com/HKUDS/Vibe-Trading/pull/1568))、マイクロ秒精度のソースからのバックテストが 1970 年の日付になっていた問題([#1560](https://github.com/HKUDS/Vibe-Trading/pull/1560))、明らかに注文である研究ゴールを再び拒否([#1562](https://github.com/HKUDS/Vibe-Trading/pull/1562))、strict bench の OOS 分割で片側が空になりうる問題([#1559](https://github.com/HKUDS/Vibe-Trading/pull/1559))、HRP のラベル整列・交差検証のラベル順序・非有限な入力([#1555](https://github.com/HKUDS/Vibe-Trading/pull/1555)、[#1556](https://github.com/HKUDS/Vibe-Trading/pull/1556)、[#1557](https://github.com/HKUDS/Vibe-Trading/pull/1557)、[#1558](https://github.com/HKUDS/Vibe-Trading/pull/1558))、シャドーアカウントの過剰取引の期間([#1563](https://github.com/HKUDS/Vibe-Trading/pull/1563))、日次で比較されていた総資産成長率([#1564](https://github.com/HKUDS/Vibe-Trading/pull/1564))。[@Shizoqua](https://github.com/Shizoqua)、[@zeus229](https://github.com/zeus229)、[@shadowinlife](https://github.com/shadowinlife) に感謝します!- **2026-09-23** 🇦🇷 **アルゼンチン銘柄、逆向きにサイズされていたショート、そしてテールリスク・ゲートの残り半分**:`.BA`(BYMA 株式と CEDEAR)は独自の ARS 市場として Yahoo に接続され、Web UI でも他の市場と同じように分類・表示されます。BYMA の執行ルールをモデル化するまで、アルゼンチンのバックテストは他市場の仮定を流用せず明示的に失敗します([#1543](https://github.com/HKUDS/Vibe-Trading/pull/1543))。平均分散型と回転率考慮型のオプティマイザはすべてのポジションをロングとして評価していたため、最良のショートに最も少ない資金しか配分されませんでした。どちらもポジション収益でサイズを決めるようになり、相関する 2 銘柄のロングとショートは相関ではなくヘッジとして読まれます(相関 +0.92 の組で、旧目的関数はロングに全額、新しい配分は 0.51 / -0.49)([#1548](https://github.com/HKUDS/Vibe-Trading/pull/1548))。さらに、1 つのセッションが複数のテールリスク指標(VaR と ES、95% と 99%)を保持した時点で、テールリスクの数値は自分のフィールドを明示しなければならず、ES 95% が VaR 95% の値を借りることはできません([#1425](https://github.com/HKUDS/Vibe-Trading/issues/1425))。**修正:**モンテカルロ検証は 252 固定ではなく取引所の年間バー数で年率化し、同じレポート内のシャープと矛盾しなくなりました([#1546](https://github.com/HKUDS/Vibe-Trading/pull/1546))。負値バーでの先物発注が一律に拒否されなくなりました([#1547](https://github.com/HKUDS/Vibe-Trading/pull/1547))。ベースライン IC が負の場合、ファクターの IC ratio は未設定になり、実際の劣化が健全な改善として読まれることはありません([#1549](https://github.com/HKUDS/Vibe-Trading/pull/1549))。タイトルが同じでタイプが異なる 2 つのメモリは、それぞれの索引行とリンク先を保ちます([#1545](https://github.com/HKUDS/Vibe-Trading/pull/1545))。[@zeus229](https://github.com/zeus229)、[@Shizoqua](https://github.com/Shizoqua)、[@he-yufeng](https://github.com/he-yufeng) に感謝します!diff --git a/README_ko.md b/README_ko.mdindex 23ede404e..53a3e1d14 100644--- a/README_ko.md+++ b/README_ko.md@@ -52,7 +52,7 @@> ⚠️ **보안 경고:** X 계정 `VibeTrading_HKU`, Virtuals 프로젝트 `101845`, 토큰 컨트랙트 `0x640BDBF77b6447E8b7DB7894cED84BD1c40571f4`는 모두 Vibe-Trading 공식과 무관합니다. Vibe-Trading은 어떠한 토큰이나 밈코인도 발행하거나 공식적으로 지지한 적이 없습니다. 해당 토큰을 구매하거나 지갑을 연결하거나 어떠한 서명도 하지 마세요. [자세히 보기](SECURITY.md#official-channels--impersonation).-- **2026-09-24** 💱 **페소로 계산되던 달러 종목, Web UI에 들어온 Email과 WebSocket, 그리고 SDK 업데이트로 깨진 CI**: BYMA와 토론토 증권거래소에는 자국 통화 종목 옆에 미국 달러 종목(GGALD.BA, DLR-U.TO)도 상장되어 있는데, 아르헨티나·캐나다 백테스트는 이를 하나뿐인 페소·캐나다 달러 풀에서 평가했습니다. 이제 로더는 해당 시장 통화로 호가되는 종목만 받아들이고(LSE 종목과 같은 규칙), 그 밖에 소스가 선언한 호가 통화는 데이터와 함께 전달되어 답변에 올바른 통화가 적힙니다([#1576](https://github.com/HKUDS/Vibe-Trading/pull/1576)). 종목 프로필은 발행사 펀더멘털과 별도로 해당 상장 종목의 거래소와 통화를 담고([#1577](https://github.com/HKUDS/Vibe-Trading/pull/1577)), 그라운딩과 종목 검색은 데이터 계층이 다루는 모든 시장을 인식하며([#1575](https://github.com/HKUDS/Vibe-Trading/pull/1575)), `technical_indicators`는 거래량을 소스가 선언한 단위(매매 단위 lot 또는 주, 100배 차이)와 함께 반환합니다([#1571](https://github.com/HKUDS/Vibe-Trading/pull/1571)). Email과 WebSocket이 가이드형 채널 설정에 합류했고, 메일 서버 인증서를 검증하며 크로스사이트 페이지의 설정 쓰기를 막습니다([#1544](https://github.com/HKUDS/Vibe-Trading/pull/1544)). **수정:** openai 3.19.2에서 명시한 provider 헤더가 환경 변수의 같은 이름 헤더에 밀려 모든 PR의 CI가 빨갛게 되던 문제([#1568](https://github.com/HKUDS/Vibe-Trading/pull/1568)), 마이크로초 해상도 소스의 백테스트가 1970년으로 찍히던 문제([#1560](https://github.com/HKUDS/Vibe-Trading/pull/1560)), 명백한 주문인 리서치 목표를 다시 거부([#1562](https://github.com/HKUDS/Vibe-Trading/pull/1562)), strict bench의 OOS 분할이 한쪽을 비울 수 있던 문제([#1559](https://github.com/HKUDS/Vibe-Trading/pull/1559)), HRP 라벨 정렬·교차검증 라벨 순서·유한하지 않은 퀀트 입력([#1555](https://github.com/HKUDS/Vibe-Trading/pull/1555), [#1556](https://github.com/HKUDS/Vibe-Trading/pull/1556), [#1557](https://github.com/HKUDS/Vibe-Trading/pull/1557), [#1558](https://github.com/HKUDS/Vibe-Trading/pull/1558)), 섀도 계정의 과잉 매매 기간([#1563](https://github.com/HKUDS/Vibe-Trading/pull/1563)), 일 단위로 계산되던 자산 성장률([#1564](https://github.com/HKUDS/Vibe-Trading/pull/1564)). [@Shizoqua](https://github.com/Shizoqua), [@zeus229](https://github.com/zeus229), [@shadowinlife](https://github.com/shadowinlife) 님 감사합니다!+- **2026-09-24** 💱 **페소로 계산되던 달러 종목, Web UI에 들어온 Email과 WebSocket, 그리고 SDK 업데이트로 깨진 CI**: BYMA와 토론토 증권거래소에는 자국 통화 종목 옆에 미국 달러 종목(GGALD.BA, DLR-U.TO)도 상장되어 있는데, 아르헨티나·캐나다 백테스트는 이를 하나뿐인 페소·캐나다 달러 풀에서 평가했습니다. 이제 로더는 해당 시장 통화로 호가되는 종목만 받아들이고(LSE 종목과 같은 규칙), 그 밖에 소스가 선언한 호가 통화는 데이터와 함께 전달되어 답변에 올바른 통화가 적힙니다([#1576](https://github.com/HKUDS/Vibe-Trading/pull/1576)). 홍콩거래소가 별도 코드 구간으로 번호를 매기는 위안화·달러 카운터(80700.HK, 9834.HK)도 같은 이유로 홍콩 백테스트에서 거부되고 각자의 통화로 표시됩니다. 종목 프로필은 발행사 펀더멘털과 별도로 해당 상장 종목의 거래소와 통화를 담고([#1577](https://github.com/HKUDS/Vibe-Trading/pull/1577)), 그라운딩과 종목 검색은 데이터 계층이 다루는 모든 시장을 인식하며([#1575](https://github.com/HKUDS/Vibe-Trading/pull/1575)), `technical_indicators`는 거래량을 소스가 선언한 단위(매매 단위 lot 또는 주, 100배 차이)와 함께 반환합니다([#1571](https://github.com/HKUDS/Vibe-Trading/pull/1571)). Email과 WebSocket이 가이드형 채널 설정에 합류했고, 메일 서버 인증서를 검증하며 크로스사이트 페이지의 설정 쓰기를 막으며, SSL 없는 IMAP 로그인도 비밀번호를 보내기 전에 STARTTLS로 암호화합니다([#1544](https://github.com/HKUDS/Vibe-Trading/pull/1544)). **수정:** openai 3.19.2에서 명시한 provider 헤더가 환경 변수의 같은 이름 헤더에 밀려 모든 PR의 CI가 빨갛게 되던 문제([#1568](https://github.com/HKUDS/Vibe-Trading/pull/1568)), 마이크로초 해상도 소스의 백테스트가 1970년으로 찍히던 문제([#1560](https://github.com/HKUDS/Vibe-Trading/pull/1560)), 명백한 주문인 리서치 목표를 다시 거부([#1562](https://github.com/HKUDS/Vibe-Trading/pull/1562)), strict bench의 OOS 분할이 한쪽을 비울 수 있던 문제([#1559](https://github.com/HKUDS/Vibe-Trading/pull/1559)), HRP 라벨 정렬·교차검증 라벨 순서·유한하지 않은 퀀트 입력([#1555](https://github.com/HKUDS/Vibe-Trading/pull/1555), [#1556](https://github.com/HKUDS/Vibe-Trading/pull/1556), [#1557](https://github.com/HKUDS/Vibe-Trading/pull/1557), [#1558](https://github.com/HKUDS/Vibe-Trading/pull/1558)), 섀도 계정의 과잉 매매 기간([#1563](https://github.com/HKUDS/Vibe-Trading/pull/1563)), 일 단위로 계산되던 자산 성장률([#1564](https://github.com/HKUDS/Vibe-Trading/pull/1564)). [@Shizoqua](https://github.com/Shizoqua), [@zeus229](https://github.com/zeus229), [@shadowinlife](https://github.com/shadowinlife) 님 감사합니다!- **2026-09-23** 🇦🇷 **아르헨티나 종목, 거꾸로 사이징되던 숏 북, 그리고 테일리스크 게이트의 마지막 절반**: `.BA`(BYMA 주식과 CEDEAR)는 자체 ARS 시장으로 Yahoo에 연결되고 웹 UI도 다른 시장과 같이 묶어 표시합니다. BYMA 체결 규칙을 모델링하기 전까지 아르헨티나 백테스트는 다른 시장의 가정을 빌리지 않고 명시적으로 실패합니다([#1543](https://github.com/HKUDS/Vibe-Trading/pull/1543)). 평균-분산 및 회전율 고려 옵티마이저가 모든 포지션을 롱으로 평가해 가장 좋은 숏에 자본이 가장 적게 배분됐습니다. 이제 둘 다 포지션 수익으로 사이징하므로, 상관된 두 종목의 롱과 숏은 상관이 아니라 헤지로 읽힙니다(상관 +0.92인 쌍에서 기존 목적함수는 전액을 롱에, 새 방식은 0.51 / -0.49로 배분)([#1548](https://github.com/HKUDS/Vibe-Trading/pull/1548)). 또한 한 세션이 두 개 이상의 테일리스크 측정치(VaR와 ES, 95%와 99%)를 보유하면 테일리스크 수치는 자신의 필드를 지정해야 하며, ES 95%가 VaR 95% 값을 빌려 쓸 수 없습니다([#1425](https://github.com/HKUDS/Vibe-Trading/issues/1425)). **수정:** 몬테카를로 검증이 하드코딩된 252가 아니라 거래소의 연간 바 수로 연율화해 같은 리포트의 샤프와 어긋나지 않습니다([#1546](https://github.com/HKUDS/Vibe-Trading/pull/1546)). 음수 가격 바에서 선물 주문이 전부 거부되지 않습니다([#1547](https://github.com/HKUDS/Vibe-Trading/pull/1547)). 베이스라인 IC가 음수면 팩터의 IC ratio를 비워 두어 실제 감쇠를 건강한 개선으로 읽지 않습니다([#1549](https://github.com/HKUDS/Vibe-Trading/pull/1549)). 제목이 같고 타입이 다른 두 메모리는 각자의 색인 행과 링크 대상을 유지합니다([#1545](https://github.com/HKUDS/Vibe-Trading/pull/1545)). [@zeus229](https://github.com/zeus229), [@Shizoqua](https://github.com/Shizoqua), [@he-yufeng](https://github.com/he-yufeng) 님 감사합니다!diff --git a/README_zh.md b/README_zh.mdindex 0f9eda58f..ad696afcf 100644--- a/README_zh.md+++ b/README_zh.md@@ -52,7 +52,7 @@> ⚠️ **安全警告:** X 账号 `VibeTrading_HKU`、Virtuals 项目 `101845` 及代币合约 `0x640BDBF77b6447E8b7DB7894cED84BD1c40571f4` 均非 Vibe-Trading 官方。我们从未发行或背书任何代币或 meme 币。请勿购买、连接钱包或签名。[详细说明](SECURITY.md#official-channels--impersonation)。-- **2026-09-24** 💱 **美元标的被按比索记账、Email 与 WebSocket 进入 Web UI,以及一次 SDK 升级引发的 CI 故障**:BYMA 和多伦多交易所在本币标的之外还挂有美元报价的标的(GGALD.BA、DLR-U.TO),阿根廷或加拿大回测却把它们放进唯一的比索或加元资金池计价。现在加载器只接纳以本市场货币报价的标的,与 LSE 标的的既有规则一致;其他由数据源声明的报价货币随数据一起传递,回答写出的就是正确的货币([#1576](https://github.com/HKUDS/Vibe-Trading/pull/1576))。个股概况在发行人基本面之外给出该上市标的自己的交易所与货币([#1577](https://github.com/HKUDS/Vibe-Trading/pull/1577)),grounding 与标的搜索认识数据层支持的每个市场([#1575](https://github.com/HKUDS/Vibe-Trading/pull/1575)),`technical_indicators` 返回成交量时附上数据源声明的单位——手或股,相差 100 倍([#1571](https://github.com/HKUDS/Vibe-Trading/pull/1571))。Email 与 WebSocket 加入引导式频道配置,邮件服务器证书现在会被校验,设置写入也不再接受跨站页面的请求([#1544](https://github.com/HKUDS/Vibe-Trading/pull/1544))。**修复:** openai 3.19.2 下显式的 provider 请求头会被环境里的同名头挤掉,曾让所有 PR 的 CI 变红([#1568](https://github.com/HKUDS/Vibe-Trading/pull/1568));来自微秒精度数据源的回测被标成 1970 年([#1560](https://github.com/HKUDS/Vibe-Trading/pull/1560));明摆着是下单指令的研究目标重新被拒绝([#1562](https://github.com/HKUDS/Vibe-Trading/pull/1562));strict bench 的样本外切分可能让一侧为空([#1559](https://github.com/HKUDS/Vibe-Trading/pull/1559));HRP 标签对齐、交叉验证标签顺序和量化输入里的非有限值([#1555](https://github.com/HKUDS/Vibe-Trading/pull/1555)、[#1556](https://github.com/HKUDS/Vibe-Trading/pull/1556)、[#1557](https://github.com/HKUDS/Vibe-Trading/pull/1557)、[#1558](https://github.com/HKUDS/Vibe-Trading/pull/1558));影子账户过度交易的时间窗口([#1563](https://github.com/HKUDS/Vibe-Trading/pull/1563));以及按日而非按年计算的资产增长率([#1564](https://github.com/HKUDS/Vibe-Trading/pull/1564))。感谢 [@Shizoqua](https://github.com/Shizoqua)、[@zeus229](https://github.com/zeus229) 和 [@shadowinlife](https://github.com/shadowinlife)!+- **2026-09-24** 💱 **美元标的被按比索记账、Email 与 WebSocket 进入 Web UI,以及一次 SDK 升级引发的 CI 故障**:BYMA 和多伦多交易所在本币标的之外还挂有美元报价的标的(GGALD.BA、DLR-U.TO),阿根廷或加拿大回测却把它们放进唯一的比索或加元资金池计价。现在加载器只接纳以本市场货币报价的标的,与 LSE 标的的既有规则一致;其他由数据源声明的报价货币随数据一起传递,回答写出的就是正确的货币([#1576](https://github.com/HKUDS/Vibe-Trading/pull/1576))。港股的人民币柜台和美元柜台(80700.HK、9834.HK)在港交所有各自的代码区间,出于同样原因不再进入港股回测,并按其本身的货币报价。个股概况在发行人基本面之外给出该上市标的自己的交易所与货币([#1577](https://github.com/HKUDS/Vibe-Trading/pull/1577)),grounding 与标的搜索认识数据层支持的每个市场([#1575](https://github.com/HKUDS/Vibe-Trading/pull/1575)),`technical_indicators` 返回成交量时附上数据源声明的单位——手或股,相差 100 倍([#1571](https://github.com/HKUDS/Vibe-Trading/pull/1571))。Email 与 WebSocket 加入引导式频道配置,邮件服务器证书现在会被校验,设置写入也不再接受跨站页面的请求,不走 SSL 的 IMAP 登录也会先用 STARTTLS 加密再发送密码([#1544](https://github.com/HKUDS/Vibe-Trading/pull/1544))。**修复:** openai 3.19.2 下显式的 provider 请求头会被环境里的同名头挤掉,曾让所有 PR 的 CI 变红([#1568](https://github.com/HKUDS/Vibe-Trading/pull/1568));来自微秒精度数据源的回测被标成 1970 年([#1560](https://github.com/HKUDS/Vibe-Trading/pull/1560));明摆着是下单指令的研究目标重新被拒绝([#1562](https://github.com/HKUDS/Vibe-Trading/pull/1562));strict bench 的样本外切分可能让一侧为空([#1559](https://github.com/HKUDS/Vibe-Trading/pull/1559));HRP 标签对齐、交叉验证标签顺序和量化输入里的非有限值([#1555](https://github.com/HKUDS/Vibe-Trading/pull/1555)、[#1556](https://github.com/HKUDS/Vibe-Trading/pull/1556)、[#1557](https://github.com/HKUDS/Vibe-Trading/pull/1557)、[#1558](https://github.com/HKUDS/Vibe-Trading/pull/1558));影子账户过度交易的时间窗口([#1563](https://github.com/HKUDS/Vibe-Trading/pull/1563));以及按日而非按年计算的资产增长率([#1564](https://github.com/HKUDS/Vibe-Trading/pull/1564))。感谢 [@Shizoqua](https://github.com/Shizoqua)、[@zeus229](https://github.com/zeus229) 和 [@shadowinlife](https://github.com/shadowinlife)!- **2026-09-23** 🇦🇷 **阿根廷标的、方向反了的空头仓位定权,以及尾部风险闸门的最后一半**:`.BA`(BYMA 股票与 CEDEAR)作为独立的 ARS 市场走 Yahoo,Web UI 也按普通市场分组和显示;阿根廷回测在 BYMA 执行规则建模之前仍然直接拒绝,不套用别的市场假设([#1543](https://github.com/HKUDS/Vibe-Trading/pull/1543))。均值方差和考虑换手的优化器把每个仓位都按做多打分,于是最好的空头拿到最少资金。两者现在按仓位收益定权:两只正相关标的一多一空是互相对冲,而不是读成同向相关——在相关性 +0.92 的一对上,旧目标函数把全部资金压在多头,新的分成 0.51 / -0.49([#1548](https://github.com/HKUDS/Vibe-Trading/pull/1548))。另外,一旦一次会话里出现多于一个尾部风险口径(VaR 与 ES,或 95% 与 99%),尾部风险数字必须指明自己的字段,ES 95% 再也不能借用 VaR 95% 的数值([#1425](https://github.com/HKUDS/Vibe-Trading/issues/1425))。**修复:**蒙特卡洛校验按交易场所的年 bar 数折算,而不是硬编码 252,同一份报告里的夏普不再自相矛盾([#1546](https://github.com/HKUDS/Vibe-Trading/pull/1546));负价 bar 上的期货下单不再被整单拒绝([#1547](https://github.com/HKUDS/Vibe-Trading/pull/1547));基准 IC 为负时因子的 IC ratio 留空,不再把真实衰减读成健康改善([#1549](https://github.com/HKUDS/Vibe-Trading/pull/1549));同名但类型不同的两条记忆各自保留索引行和链接目标([#1545](https://github.com/HKUDS/Vibe-Trading/pull/1545))。感谢 [@zeus229](https://github.com/zeus229)、[@Shizoqua](https://github.com/Shizoqua) 和 [@he-yufeng](https://github.com/he-yufeng)!diff --git a/agent/backtest/engines/_market_hooks.py b/agent/backtest/engines/_market_hooks.pyindex 230e6c5ba..063a7e669 100644--- a/agent/backtest/engines/_market_hooks.py+++ b/agent/backtest/engines/_market_hooks.py@@ -185,6 +185,47 @@ _MARKET_CURRENCY = {_FUTURES_EXCHANGE_CURRENCY = {"EUREX": "EUR"}+# HKEX's Stock Code Allocation Plan (updated 2026-03-12) assigns a trading+# currency by code range: 80000-89999 are "Products traded in Renminbi" (the+# RMB counters, 80700.HK beside 00700.HK), and these sub-ranges trade in USD.+# Every other .HK code trades in HKD. The venue publishes the rule, so the+# currency is known whichever source served the bars -- unlike BYMA's dollar+# lines, where a trailing D is only a habit. Checked against the currency Yahoo+# declares for 24 codes across the ranges on 2026-09-24 (6 CNY, 10 USD, 8 HKD).+_HK_COUNTER_CURRENCY_RANGES: tuple[tuple[int, int, str], ...] = (+ (80000, 89999, "CNY"),+ (9000, 9199, "USD"), # ETFs+ (9200, 9399, "USD"), # leveraged and inverse products+ (9400, 9499, "USD"), # ETFs+ (9500, 9599, "USD"), # leveraged and inverse products+ (9700, 9799, "USD"), # leveraged and inverse products+ (9800, 9849, "USD"), # ETFs+ (10900, 10999, "USD"), # derivative warrants+ (41500, 41599, "USD"), # ETFs+)+_HK_CODE = re.compile(r"^(\d{3,5})\.HK$", re.I)+++def hk_counter_currency(code: str) -> str | None:+ """Return the currency HKEX's code allocation assigns to a ``.HK`` code.++ Args:+ code: Ticker / symbol string, optionally ``local:``-prefixed.++ Returns:+ ``"CNY"``, ``"USD"`` or ``"HKD"`` for a Hong Kong code, ``None`` for+ anything else.+ """+ match = _HK_CODE.match(strip_local_prefix(code).strip())+ if match is None:+ return None+ number = int(match.group(1))+ return next(+ (cur for low, high, cur in _HK_COUNTER_CURRENCY_RANGES if low <= number <= high),+ "HKD",+ )++def code_currency(code: str) -> str:"""Return the supported settlement-currency contract for a symbol.@@ -200,6 +241,8 @@ def code_currency(code: str) -> str:"""code = strip_local_prefix(code)market = _detect_market(code)+ if market == "hk_equity":+ return hk_counter_currency(code) or _MARKET_CURRENCY[market]if market in _MARKET_CURRENCY:return _MARKET_CURRENCY[market]if market == "forex":diff --git a/agent/backtest/runner.py b/agent/backtest/runner.pyindex 93d281fb3..d2c719dc7 100644--- a/agent/backtest/runner.py+++ b/agent/backtest/runner.py@@ -48,6 +48,7 @@ from backtest.engines._market_hooks import ( # noqa: F401 (re-exported)_detect_market,_detect_submarket,_is_china_futures,+ hk_counter_currency,strip_local_prefix,)from backtest.rebalance_mask import RebalanceMask, validate_rebalance_mask@@ -1494,6 +1495,21 @@ def _create_market_engine(source: str, config: dict, codes: List[str]):# Detect dominant market type from codesmarkets = {_detect_market(c) for c in codes} if codes else set()+ # The Hong Kong pool books in HKD. HKEX numbers its RMB and USD counters+ # in their own code ranges, and no source in the hk_equity chain but Yahoo+ # declares a currency, so the code decides before any engine prices them.+ foreign_counters = sorted(+ f"{c} ({hk_counter_currency(c)})"+ for c in codes+ if _detect_market(c) == "hk_equity" and hk_counter_currency(c) not in (None, "HKD")+ )+ if foreign_counters:+ raise ValueError(+ "Hong Kong backtests book in HKD, but these codes are HKEX counters traded "+ f"in another currency: {', '.join(foreign_counters)}. Use the HKD-traded "+ "counter of the same security instead."+ )+# Cross-market -> CompositeEngineif len(markets) > 1:from backtest.engines.composite import CompositeEnginediff --git a/agent/src/agent/grounding/identity.py b/agent/src/agent/grounding/identity.pyindex 1619340f8..e6b8535a6 100644--- a/agent/src/agent/grounding/identity.py+++ b/agent/src/agent/grounding/identity.py@@ -301,6 +301,14 @@ def _infer_venue(symbol: str) -> str | None:def _infer_currency(symbol: str) -> str | None:"""Infer quote currency without performing an implicit conversion."""upper = _normalize_symbol(symbol)+ # HKEX assigns the currency by code range (RMB counters 80000-89999, a few+ # USD ranges), so 80700.HK is a CNY line beside 00700.HK in HKD. One table,+ # shared with the backtest's currency guard.+ from backtest.engines._market_hooks import hk_counter_currency++ hk_currency = hk_counter_currency(upper)+ if hk_currency is not None:+ return hk_currencysuffixes = {".US": "USD",".SH": "CNY",diff --git a/agent/tests/test_hk_counter_currency.py b/agent/tests/test_hk_counter_currency.pynew file mode 100644index 000000000..62bff2f6e--- /dev/null+++ b/agent/tests/test_hk_counter_currency.py@@ -0,0 +1,73 @@+"""Hong Kong counters traded in CNY or USD never enter the HKD pool.++HKEX's Stock Code Allocation Plan (updated 2026-03-12) assigns 80000-89999 to+"Products traded in Renminbi" and a set of 09xxx / 10900-10999 / 41500-41599+sub-ranges to products traded in USD. Before this, 80700.HK (Tencent's RMB+counter, 375.40 CNY on 2026-09-24) and 9834.HK (a USD ETF) were booked in the+HKD pool and quoted as HKD by the grounding gate, because the hk_equity chain+leads with sources that declare no currency.+"""++from __future__ import annotations++import pytest++from backtest.engines._market_hooks import code_currency, hk_counter_currency+from backtest.runner import _create_market_engine+from src.agent.grounding.identity import _infer_currency++# The currency Yahoo declared for each code on 2026-09-24.+_LIVE = {+ "80700": "CNY", "82318": "CNY", "80388": "CNY", "83188": "CNY", "82800": "CNY",+ "89988": "CNY", "9010": "USD", "9067": "USD", "9081": "USD", "9141": "USD",+ "9173": "USD", "9403": "USD", "9807": "USD", "9820": "USD", "9834": "USD",+ "9846": "USD", "9988": "HKD", "9618": "HKD", "9999": "HKD", "9868": "HKD",+ "9626": "HKD", "0700": "HKD", "2800": "HKD", "3188": "HKD",+}++[email protected](("code", "currency"), sorted(_LIVE.items()))+def test_the_code_range_gives_the_currency_the_venue_quotes(code: str, currency: str) -> None:+ assert hk_counter_currency(f"{code}.HK") == currency+++ ("code", "currency"),+ [+ ("79999", "HKD"), ("80000", "CNY"), ("89999", "CNY"),+ ("8999", "HKD"), ("9000", "USD"), ("9599", "USD"), ("9600", "HKD"),+ ("9699", "HKD"), ("9700", "USD"), ("9849", "USD"), ("9850", "HKD"),+ ("10899", "HKD"), ("10900", "USD"), ("10999", "USD"), ("11000", "HKD"),+ ("41499", "HKD"), ("41500", "USD"), ("41599", "USD"), ("41600", "HKD"),+ ],+)+def test_both_sides_of_every_range_boundary(code: str, currency: str) -> None:+ assert hk_counter_currency(f"{code}.HK") == currency+++def test_codes_outside_hong_kong_are_not_classified() -> None:+ assert hk_counter_currency("AAPL.US") is None+ assert hk_counter_currency("600519.SH") is None+++def test_the_settlement_currency_and_the_grounding_currency_follow_the_counter() -> None:+ assert code_currency("80700.HK") == "CNY"+ assert code_currency("local:9834.HK") == "USD"+ assert code_currency("00700.HK") == "HKD"+ assert _infer_currency("80700.HK") == "CNY"+ assert _infer_currency("9834.HK") == "USD"+ assert _infer_currency("00700.HK") == "HKD"+++ "codes",+ [["00700.HK", "80700.HK"], ["80700.HK"], ["9834.HK"], ["80700.HK", "AAPL.US"]],+)+def test_a_backtest_holding_a_foreign_counter_is_refused(codes: list[str]) -> None:+ with pytest.raises(ValueError, match="HKEX counters traded in another currency"):+ _create_market_engine("tencent", {}, codes)+++def test_hkd_counters_still_build_an_engine() -> None:+ engine = _create_market_engine("tencent", {}, ["00700.HK", "09988.HK"])+ assert engine is not None