Skip to content

Repository files navigation

Financial OHLC Chart with Trading Signals — WinForms

ProEssentials v10 WinForms .NET 8 — a complete financial charting app built on Pego (the categorical / date-axis graph object): OHLC candlesticks for ten real stock symbols with Bollinger Bands, RSI, a custom stochastic oscillator, and Buy/Sell signal annotations generated from stochastic turning points. Direct2D, four synchronized multi-axes.

Financial OHLC Chart WinForms


What This Demonstrates

  • OHLC candlesticks via SpecificPlotMode.BoxPlot with real CSV stock data (MSFT, AAPL, AMD, AMZN, CSCO, META, NFLX, QCOM, SBUX, TSLA).
  • Technical studies computed in StockPriceLoader.cs: 20-day Bollinger Bands (Upper / SMA / Lower), 10-day RSI, and a custom stochastic oscillator (30-day window, 15-day D-period).
  • Buy/Sell signal generation — turning-point detection on the Slow %D with a 7-point lookahead, a −6.0 slope threshold, and a 60 overbought floor. The tuned signals are the kind of feature you could feed to an AI/ML model.
  • Four synchronized axes — Price 70%, Volume 10%, RSI 10%, Stochastic 10% — with drag-to-resize dividers.
  • Interactive table annotations — a clickable portfolio selector panel plus a live OHLCV readout updated on mouse hover (DrawTable) and arrow-key cursor navigation after clicking a candlestick.
  • Date/time axis with serial OADate handling and automatic skipping of non-trading days.
  • Code-built UI — the form is constructed entirely in C# (no .Designer.cs, no .resx); the chart fills the window.

WinForms vs WPF

This is the WinForms sibling of the WPF Financial OHLC example. The ProEssentials chart configuration is identical between the two — only the host shell differs. Specifics of the port:

  • WPF PegoWpf → WinForms Pego; event-handler delegate types adjust accordingly (Pego.DataHotSpotEventHandler, etc.).
  • WPF Pego1.Loaded initialization → idiomatic MainForm_Load.
  • Cursor.LastMouseMove returns a System.Drawing.Point on WinForms (it was a System.Windows.Point on WPF), so the tooltip handler uses var and drops the (int) casts WPF needed — see the note in Pego1_PeCustomTrackingDataText.
  • The single WPF-only line, IsManipulationEnabled (WPF touch pinch/pan opt-in), has no WinForms equivalent on the control and is omitted; mouse-wheel zoom and middle-drag pan are unchanged.
  • CSV paths resolve against the executable folder (AppContext.BaseDirectory).

➡️ WPF version: wpf-chart-financial-ohlc-trading-signals-proessentials


Data

The ten *.csv files (≈65 KB each) are bundled and copied next to the executable on build. CSV format: Date, Close, Volume, Open, High, Low.


Prerequisites

  • Visual Studio 2022
  • .NET 8 SDK (Windows)
  • Internet connection for NuGet restore
  • x64

How to Run

  1. Clone this repository
  2. Open FinancialOhlcChart.sln in Visual Studio 2022
  3. Build → Rebuild Solution (restores the NuGet package automatically)
  4. Press F5
  5. Click a symbol in the left panel to switch; hover candlesticks for the live OHLCV readout; click a candle then use arrow keys to step through points

Designer note: This project has no .Designer.cs file by design — the UI is built in code in MainForm.cs. There is nothing for the WinForms designer to open, which avoids the native-control designer issues entirely.


NuGet Package

References ProEssentials.Chart.Net80.x64.Winforms from nuget.org. Package restore happens automatically on build.


License

Example code is MIT licensed. ProEssentials requires a commercial license for continued use.

About

Winforms .NET 8 OHLC candlestick chart: Bollinger Bands, RSI, custom stochastic oscillator with Buy/Sell signal annotations. 10 real stocks, 4 synchronized axes, live OHLCV hover, date/time axis. Signal logic designed as AI decision-system input features. ProEssentials v10 C# example.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages