React-Stockcharts for PowerShell Universal Dashboard

Update: 18 June 2020
v1.0.3 is now Code Signed and includes 2 additional charts;
- Candle Stick Stock Scale Chart with Volume Bar
- Candle Stick Chart with Edge

Update: 30 Jan 2020
v1.0.2 includes 4 additional charts;
- Candle Stick Chart with SAR
- Candle Stick Chart with Gann Fan
- OHLC Chart with Elder Ray Indicator
- OHLC Chart with Elder Impulse Indicator
Examples here

Update: 21 Jan 2020
v1.0.1 that includes 4 additional charts;
- Candle Stick Chart with MACD Indicator
- Candle Stick Chart with RSI Indicator
- Candle Stick Chart with Bollinger Band Overlay
- Candle Stick Chart with MA
Examples here

I’ve just published my first custom component for the PowerShell Universal Dashboard. The React-Stockcharts for PowerShell Universal Dashboard PowerShell Module is available in the PowerShell Gallery. The React-Stockcharts PowerShell Module contains three React-Stockcharts;

  • CandleStick Chart with Full Stochastics Indicator
  • Moving Average Cross Over Algorithm V2
  • CandleStick Chart for Continuous IntraDay

v1.0 React-StockCharts for PowerShell Universal Dashboard

Installing React-Stockcharts for PowerShell Universal Dashboard

I’ve published the module to the PowerShell Gallery. Therefore, with PowerShell Desktop 5.1 and later you can install direct from the PowerShell Gallery (in an Administrative PowerShell Session) using Install-Module.

Install-Module -name UniversalDashboard.UDFinancialChart

Using React-Stockcharts for PowerShell Universal Dashboard

The function exposed for Universal Dashboard is New-FinancialChart. Stockdata is passed to the function by providing a URL to obtain the stockdata from. This will need to be local to where you are running your Universal Dashboard. I have built it to leverage a simple Node WebServer to server the files. An example is available here. To run the Node WebServer run

node server.js <path_to_stockdata> port

Example

node server.js 'C:\chartdata' 10010

Generating a Financial Chart

To generate the Default Chart (MovingAverageCrossOverAlgorithmV2) from Universal Dashboard use the following syntax

New-FinancialChart -stockData "http://localhost:10010/StockData.csv"
MovingAverageCrossOverAlgorithmV2 Chart

Stockdata Format

The Stockdata format is very specific in order for React-Stockcharts to render the graphs.

The header columns are:

Open,High,Close,Low,Volume,Date

The format of Date is dependant on the graph type. For the Candlestick Chart with Full Stochastics Indicator and Moving Average Cross Over Algorithm V2 charts the format MUST be dd-mm-yyyy (e.g 17-01-2017).

For the Candlestick Chart for Continuous Intra Day chart the format MUST be in dd-mm-yyyy hh:mm:ss format.

For all charts the day date field for days less than 10 must be 0 padded.
e.g 01-12-2020 for 1 Dec 2020.

Example files in the correct format are available on the GitHub repo.

Example Universal Dashboard Script

Summary

Financial Charts are now available in Universal Dashboard. I wrote this custom component for myself for a couple of dashboards I needed to build. I’m publishing it for future Darren and also making it available in case they are of use to anyone else. Source is on GitHub here.