Add KOSPI 200 Index (KM) Futures#9585
Merged
Martin-Molinero merged 4 commits intoJul 14, 2026
Merged
Conversation
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 task
Expand the compact single-line session arrays in Forex-interactivebrokers-[*] to the multi-line style used throughout the market-hours database. Add South Korean (KRX) market-closure holidays (2000-2027) to Future-krx-[*] and Future-krx-KM, including lunar holidays (Seollal, Buddha's Birthday, Chuseok), substitute holidays, election-day closures, year-end closures, and the reinstated Constitution Day (7/17/2026 onward). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Enables USD/KRW live trading/pricing through the Interactive Brokers brokerage. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Roll non-quarterly contract months forward to the HMUZ cycle in the Kospi200 expiry function, with regression tests covering the cycle normalization and holiday walk-backs (2002 election day, Chuseok 2003 double walk-back, Chuseok 2019) - Remove holidays duplicated in Future-krx-KM: they are inherited from Future-krx-[*] at load time (MarketHoursDatabaseJsonConverter unions specific entries with the market wildcard) - Add missing KRX closures: Constitution Day 2000-2007 (holiday until abolished in 2008), 7/1/2002 World Cup temporary holiday and 1/3/2000 Y2K closure - Fix KRX derivatives sessions per exchange specs: regular session 08:45-15:45 (pre-open auction 08:30-08:45) and night session 18:00-06:00 as extended hours - Add late opens (09:45) for the first trading day of each year and CSAT exam days 2000-2027, which delay the exchange open by one hour - Add Index-krx market hours entries (09:00-15:30, 10:00 late opens) and map the KM index ticker to Market.KRX in IndexSymbol Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Martin-Molinero
marked this pull request as ready for review
July 14, 2026 19:34
Martin-Molinero
added a commit
to QuantConnect/Lean.Brokerages.InteractiveBrokers
that referenced
this pull request
Jul 15, 2026
* Add Interactive Brokers KOSPI 200 (KM) futures support Route KM/Market.KRX futures to IB's KSE exchange and map IB's K200 ticker to LEAN's KM root, the brokerage counterpart to QuantConnect/Lean#9585. Also allow Forex subscriptions on Market.InteractiveBrokers so LEAN can derive the KRW->USD conversion rate from IB's USD/KRW spot (CASH IDEALPRO) feed, which is required to value KRW-denominated KOSPI 200 positions in a USD account. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Support KM index data --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: Martin Molinero <martin.molinero1@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Market.KRX(Korea Exchange) constant with market id 43Futures.Indices.Kospi200 = "KM"constantkrx,[*]index wildcardData/future/krx/margins/KM.csv(placeholder from current KRX rates: initial 8.1%, maintenance 5.4%)Future-krx-KMandFuture-krx-[*]market-hours entries (Asia/Seoul, 09:00–15:45 with 08:00–09:00 pre-open auction)FuturesExpiryFunctionsTestData.xml[TestCase(Indices.Kospi200, ThreeTwentyPMKoreaTime)]toIndicesExpiryDateFunction_WithDifferentDates_ShouldFollowContractDescription
Adds LEAN support for the KOSPI 200 Index Futures (KM) traded on the Korea Exchange (KRX). KOSPI 200 futures are cash-settled, quoted in KRW with a KRW 250,000 point multiplier and 0.05 tick, listed on the quarterly March/June/September/December cycle.
This PR is intentionally a draft. Two values are placeholders and should be confirmed against authoritative KRX sources before it is marked ready for review:
Data/future/krx/margins/KM.csv) — the initial/maintenance amounts are not real historical KRX margins. They were derived from the current KRX margin rates (initial 8.1%, maintenance 5.4%) applied to a representative notional (index ≈ 350 × KRW 250,000 ≈ KRW 87.5M), giving initial 7,087,500 / maintenance 4,725,000 under the19900101placeholder date. This should be replaced with the exchange's published performance-bond schedule (ideally with historical change dates).TimeSpan(15, 20, 0)in the expiry function and mirrored by theThreeTwentyPMKoreaTime = "15:20:00"test constant. Sources vary on the exact termination time of the expiring contract (15:15 / 15:20 / 15:45 KST). If a different time is authoritative, it is a one-line change in bothFuturesExpiryFunctions.csandFuturesExpiryFunctionsTests.cs.The contract multiplier (KRW 250,000/point), tick (0.05), currency (KRW), quarterly cycle, and second-Thursday last-trading-day rule are confirmed and not placeholders.
Related Issue
No linked issue.
Motivation and Context
The KOSPI 200 future is one of the most actively traded index futures in Asia. Without this entry, users cannot trade or backtest KOSPI 200 futures in LEAN.
Requires Documentation Change
N/A
How Has This Been Tested?
Added test cases to
Tests/Common/Securities/Futures/FuturesExpiryFunctionsTests.cs. All futures expiry tests pass locally (Failed: 0, Passed: 192), and Market / SymbolPropertiesDatabase / MarketHoursDatabase test suites pass (Failed: 0, Passed: 152).Types of changes
Checklist:
feature-[description]🤖 Generated with Claude Code