Trade Application / Dashboard in C#
Download Demo.zip
and run TradeApplication.exe
for a compiled executable or check SolutionDir/bin/Release/ for the release build.
trade-application-hx is created to showcase desktop development rather than quantitative modeling - the analytics in this project is very basic. The project is currently in alpha and many areas can be further polished.
trade-application-hx is developed with .NET.Framework V4.0.30319 using OxyPlot as the WPF charting library.
The application takes a trade_data.csv
in the Data\
directory relative to the executable root as DataFeedSimulator source. A sample zipped csv file of real trading data is provided. The prices are uniformly altered and the prints are in the format [date, time, type, price, volume]
Using the data feed, the application will asynchronously new print events and create the follwing:
-
OHLC - standard Open-High-Low-Close timeseries data for Traded prints only
-
Volume - aggregate Bid1, Ask1, Traded volume.
-
Quotes - Price and Volume on the current / last Bid, Ask, Traded prints
-
VWAP - Volume Weighted Average Price in given timeframe (in minutes)
-
BATV Dist - Bid1, Ask1, Traded volume distribution for a given price in x timeframe, updated every y minutes, value in z interval2
-
PriceRange Dist - price range distribution in x timeframe, updated every y minutes, value in z interval2
-
Total Volume Dist - total Traded volume distribution in x timeframe, updated every y minutes, value in z interval
1 volume on the Bid and Ask prints are updates to the volume, so the sum is not very meanful and used for demo purposes
2 eg. 60 minute timeframe updated everyminute, 0.01 value interval for price, 100 value interval for volume
Note: all time in minutes, data classes can handle non traditional time parameters like 17 mins.
Trade Application is developed with performance in mind. Without the graphical user interface1, the program processes 4 million+ prints in the sample data file in around 20 seconds. Once the graphical user interface is added, the simulation will take hours. Depending on Thread.Sleep
settings in SolutionDir\DataSimulator.cs
method SimulationMethod
, the display source buttons may be less responsive. To address this the user interface can be change to only update on Traded prints or other filtering methods.
1 To do so in GUI, click PauseSim, enter 5000000 click Forward, or in code comment out line
DBuilder.DataUpdate += MWindow.VM.HandleDataUpdate;
in SolutionDir\App.xaml.cs
Thread.Sleep(1);
in SolutionDir\DataFeedSimulator.cs
future improvements for this project, in no particular order:
- add test cases
- improve documentation and comments
- unify chart viewmodels to inherit from common parent class, common parameter data source
- add simulation control methods and user interface
- start, stop, pause, continue simulation
- run x prints in background
- start simulation at x prints
- add functionality to allow user defined inputs, layout
- multi-panelled user interface
- add more variable checks
- 2016-07-25: Added more documentation and comments
- 2016-07-26: Added simulation control, pause, continue, forward. Note: default DataFeedSimulator Thread.Sleep() is now set to 10 to improve GUI responsiveness to mouse clicks. Simulation with GUI with take longer to run.