Skip to content

Add KOSPI 200 Index (KM) Futures#9585

Draft
AlexCatarino wants to merge 1 commit into
QuantConnect:masterfrom
AlexCatarino:feature-km-futures
Draft

Add KOSPI 200 Index (KM) Futures#9585
AlexCatarino wants to merge 1 commit into
QuantConnect:masterfrom
AlexCatarino:feature-km-futures

Conversation

@AlexCatarino

@AlexCatarino AlexCatarino commented Jul 2, 2026

Copy link
Copy Markdown
Member
  • Add Market.KRX (Korea Exchange) constant with market id 43
  • Add Futures.Indices.Kospi200 = "KM" constant
  • Add expiry function: last trading day is the second Thursday of the contract month (quarterly Mar/Jun/Sep/Dec), holiday-adjusted backward, terminating 15:20 KST
  • Add symbol properties: multiplier 250,000, tick 0.05 (krx, KRW), plus krx,[*] index wildcard
  • Add margin file Data/future/krx/margins/KM.csv (placeholder from current KRX rates: initial 8.1%, maintenance 5.4%)
  • Add Future-krx-KM and Future-krx-[*] market-hours entries (Asia/Seoul, 09:00–15:45 with 08:00–09:00 pre-open auction)
  • Add 8 test date pairs (2024–2025 quarterly contracts) to FuturesExpiryFunctionsTestData.xml
  • Add [TestCase(Indices.Kospi200, ThreeTwentyPMKoreaTime)] to IndicesExpiryDateFunction_WithDifferentDates_ShouldFollowContract

Description

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.

⚠️ Draft — placeholder values to firm up before merging

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:

  1. Margin file (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 the 19900101 placeholder date. This should be replaced with the exchange's published performance-bond schedule (ideally with historical change dates).
  2. Last-trading-day settlement time (15:20 KST) — encoded as TimeSpan(15, 20, 0) in the expiry function and mirrored by the ThreeTwentyPMKoreaTime = "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 both FuturesExpiryFunctions.cs and FuturesExpiryFunctionsTests.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

  • New feature (non-breaking change which adds functionality)

Checklist:

  • My code follows the code style of this project.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • My branch follows the naming convention feature-[description]

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant