Pain Point: Night Session Displays Last Night's Close, Not Real-Time Price

Wanting to add the weighted index and Taiwan futures night session to a personal trading info page, clicking the card to see the K-line chart. The weighted index was easy, but the night session got stuck: the card showed the last night's closing price at 3 PM when the night session actually opens, and clicking in showed no K-line chart.

The issue wasn’t a lack of data but that real-time price sources were never correctly identified.

Tests: Three Pitfalls Explained at Once

First Pitfall: White Screen. Embedding TradingView's price widget into the card made the entire page go white — the loaded script modifies page elements and blanked out the whole page inside the app.

Second Pitfall: Wrong Symbol Code. Switching to embedding the quote component page still showed a blank screen. Eventually, it was discovered the symbol given to TradingView was wrong: "TX1!" doesn’t exist, whereas the correct one is "TXF1!". Without a valid symbol, the component stays empty.

Third Pitfall: Numbers Only, No K-Line. Then the server was used to fetch real-time prices directly; numbers appeared and updated, but clicking still showed no K-line. Finally, the solution was fetching official data from the exchange server to draw K-lines: 5-minute K from night session opening at 15:00, with moving averages, volume, and reference price dashed lines, updating every 30 seconds. Numbers and charts appeared together.

Approach: For Real-Time Data Pages, Pass These 3 Checks

  1. Confirm the symbol exists first: If the symbol is incorrect, nothing will display. This should be checked first.
  2. Activate the numbers first: Real-time prices should update with timestamp. Get the numbers right before adding charts.
  3. Draw charts using official data: The server pulls official data to draw 5-minute K-lines, updating every 30 seconds. Avoid relying on third-party components.

Three Reminders

  • If data can’t be pulled, revert to last night’s close instead of faking numbers: When the API cannot connect, show last night’s closing price with date clearly labeled. Fake numbers are worse than none.
  • Third-party components failing shouldn’t crash the whole page: If an embedded element breaks, only affect that small section, not blank the entire page.
  • Include timestamps with quotes: Display clear retrieval times next to real-time prices so users know how fresh the data is.

Transparent Explanation

This is based on a real page with documented failures across three pitfalls. The final method has been validated as functional. Data is sourced from the official exchange and the approach fits other pages requiring real-time data.

Related Links