Repository navigation
feat: add Nasdaq Copenhagen (XCSE) as a supported exchange - #5
Open
knightmare2600 wants to merge 2 commits into
Open
knightmare2600 wants to merge 2 commits into
knightmare2600 wants to merge 2 commits into
Conversation
user-preferences.example.json has shipped MapStyle, MapProjection and MapOverlays since the map overhaul, but nothing read them: the map always started on Earth at Night / Flat / Day-Night, and Save-UserPreferences rewrote the file with a fixed key set, deleting the three keys on the first save. There is no save on window close (it minimises to the tray), so map changes were never persisted. - Save-UserPreferences now writes MapStyle, MapProjection and MapOverlays from the current toolbar state. - The style and projection pickers and the ten overlay toggles save when changed, as the exchange toggles already do. - Saved settings are applied straight after the pickers are populated, before change handlers are attached, so start-up does not redraw the map once per toggle. - New Private/Get-MapPreferenceState resolves the saved values. Unknown styles/projections fall back to the defaults; overlay names with no toggle (e.g. 'TimeLine' from the original example file) are ignored; an empty MapOverlays list means all overlays off; a missing key keeps the XAML defaults. - PSExchangeClock.psm1 now dot-sources Private/*.ps1 (not exported). - Pester tests in Tests/MapPreferences.Tests.ps1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds Nasdaq Copenhagen (Nasdaq København) as the 21st exchange, using the existing exchange, holiday, map, flyout, world-clock and preference mechanisms. It is not active by default; existing saved selections are left unchanged. Exchange - Code XCSE, symbol OMXC, Copenhagen, Denmark, DKK, 55.6761 / 12.5683. - TimeZoneId 'Romance Standard Time' (Windows ID that .NET maps from IANA Europe/Copenhagen); CET/CEST comes from the OS timezone rules. - Main-market equities 09:00-17:00 local. New optional exchange fields OpeningAuctionStart (08:45) and ClosingAuctionStart (16:55) make the status read "Opening auction - opens in ..." and "Closing auction - ends in ..." instead of presenting the call phases as pre-market or continuous trading. Status values, colours and notifications are unchanged. The flyout lists both auction windows. - Sources: Nasdaq European Markets Trading Hours and Holiday Schedule (https://www.nasdaq.com/european-market-activity/trading-hours) and the Nasdaq INET Nordic Auctions factsheet 1015-26. Holidays - holidays.json gains the official Nasdaq Copenhagen equity closures for 2025-2027 (checked 2026-10-09). Nasdaq lists no Copenhagen half days. These differ from Danish public holidays (24 and 31 December are exchange closures). Later years are not yet published. Supporting changes - Exchange status logic moved from the dashboard into Private/Get-ExchangeSessionStatus.ps1 (behaviour preserved) so it can be tested without WPF. Countdowns are now measured in UTC, so they stay correct on DST transition days. Format-CountdownSpan replaces the inline countdown formatting. - Private/Test-ExchangeActive holds the existing saved-selection logic. - Get-StockExchangeData appends built-in exchanges missing from a cache younger than 30 days, without overwriting cached entries, so existing installs see the new exchange without -ForceRefresh. - README, about help, docs and manifest description updated (20 -> 21 exchanges); README's ActiveExchanges default corrected to the seeded example list. - Pester tests: sessions, auctions, weekends, holidays, CET/CEST transitions, machine-timezone independence, missing holiday data, selection persistence and cache handling. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 9, 2026
This branch has not been deployed
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.
Summary
Adds Nasdaq Copenhagen (Nasdaq København,
XCSE) as the 21st exchange, using the existing exchange, holiday, map, flyout, world-clock and preference mechanisms. It is not active by default, and existing saved selections are not changed.What's added
XCSE, symbolOMXC;TimeZoneId = 'Romance Standard Time', the Windows ID that .NET maps from IANAEurope/Copenhagen. CET/CEST comes from the OS timezone rules, not a hard-coded offset.OpeningAuctionStart = '08:45': from 08:45 the status reads "Opening auction – opens in …";ClosingAuctionStart = '16:55': from 16:55 it reads "Closing auction – ends in …".holidays.jsongains the official Nasdaq Copenhagen equity closures for 2025–2027, from the same Nasdaq holiday schedule, checked 2026-10-09.n/arather than unsourced figures.ActiveExchangesdefault corrected to the seeded example list.Supporting changes
Private/Get-ExchangeSessionStatus.ps1so it can be tested without WPF. Existing behaviour is preserved. There's an explicit test that an exchange without the auction fields (XETR) is unchanged.Format-CountdownSpanhelper for countdown text. It truncates hours; see fix: truncate hours in countdowns instead of rounding them #2.Test-ExchangeActive, with unchanged behaviour.Get-StockExchangeData. It now appends built-in exchanges that are missing from a cache younger than 30 days, without overwriting cached entries. Without this, existing installs would not see a new exchange for up to 30 days.Interaction with other PRs
#2 edits five countdown lines that this PR replaces with
Format-CountdownSpan(which also truncates). If both are merged, the second conflicts on those lines — keep this PR's version.Known limitations
holidays.jsonis updated, later weekdays count as trading days.holidays.jsonmarks whole-day closures only, so early closes cannot be expressed.Checks
America/New_York,Asia/Tokyo,Pacific/Auckland);Lintworkflow already fails onmainbefore this change — PSScriptAnalyzer reports 120 Warning-level findings there (e.g. run 36486962685). This PR adds no new findings (compared by rule, file and message againstmain), so a red Lint check here is the pre-existing state.[Unreleased]. The PRs in this series are independent where possible, so whichever merges second will have a trivial conflict in that section — keep both entries.This is one of a series of small PRs (fixes and features kept separate so you can pick and choose): #2 countdown hours · #3 Refresh button · #4 map preferences · #5 Nasdaq Copenhagen · #6 OMXC25 · #7 FX DKK/SEK · #8 København clock · #9 FTSE 100 · #10 ETF labels.
🤖 Generated with Claude Code