cathyli99 / Project1_MVC_ASXAuditTrail

Stored-procedure practice on high-frequency stock trading

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ASX Audit Trail

This project's purpose is used to display ASX trading data with candlestick diagram with amChart JavaScript version package.

Apply amChart css and script files into _layout.cshtml

Add the following files:

stylesheet: candlestick.css

JavaScript: charts.js | animated.js | candlestick.js

 </environment>
        <link rel="stylesheet" href="~/css/site.css" />
        <link rel="stylesheet" href="~/css/candlestick.css" />                  // /css/candlestick.css
    </head>
    <body>
        <header>
            ... ... ...
        <!--<script src="~/js/site.js" asp-append-version="true"></script>-->
        <script src="~/js/core.js" asp-append-version="true"></script>
        <script src="~/js/charts.js" asp-append-version="true"></script>        // /js/core.js
        <script src="~/themes/animated.js" asp-append-version="true"></script>  // /themes/animated.js
        <script src="~/js/candlestick.js" asp-append-version="true"></script>   // /js/candlestick.js

Add candlestick on a View

Add <div id="chartdiv"></div> under /Views/index.cshtml for the candelstick chart to display.

Create an API controller - MarketDataController.cs to GET api/<controller>/5

Raw Data contains {date, openPrice, highestPrice, lowestPrice, closePrice}

 [HttpGet("{code}/{offset}/{rows}")]
        public List<MarketChartPrice> Get(string code, int offset, int rows)
        {
            return db.GetMarketChartPricesAsync(code, offset, rows);
        }

Output result

candlestick chart

About

Stored-procedure practice on high-frequency stock trading


Languages

Language:C# 83.3%Language:JavaScript 8.7%Language:HTML 6.2%Language:CSS 1.4%Language:Dockerfile 0.3%