private void StockCharts() { Stock1Collection.Clear(); SimpleLinearResult slr = LinearAnalysisHelper.GetSimpleRegression(StockData, "Price1", "Price2"); Title3 = string.Format("Prices : {0} ~ SPX, a = {1}, b = {2}, R2 = {3}, R2Adj = {4}", Ticker, Math.Round(slr.Alpha, 4), Math.Round(slr.Beta, 4), Math.Round(slr.RSquared, 4), Math.Round(slr.RSquaredAdj, 4)); Stock1Collection.AddRange(MSChartHelper.ScatterChart(StockData, "Price1", "Price2", RegressionType.SimpleLinear)); Stock2Collection.Clear(); slr = LinearAnalysisHelper.GetSimpleRegression(StockReturnData, "Price1", "Price2"); Title4 = string.Format("Returns: {0} ~ SPX, a = {1}, b = {2}, R2 = {3}, R2Adj = {4} ", Ticker, Math.Round(slr.Alpha, 4), Math.Round(slr.Beta, 4), Math.Round(slr.RSquared, 4), Math.Round(slr.RSquaredAdj, 4)); Stock2Collection.AddRange(MSChartHelper.ScatterChart(StockReturnData, "Price1", "Price2", RegressionType.SimpleLinear)); }
private void IndexCharts() { HySpxCollection.Clear(); SimpleLinearResult slr = LinearAnalysisHelper.GetSimpleRegression(IndexData, "SPX", "HYSpread"); Title1 = string.Format("HY ~ SPX, a = {0}, b = {1}, R2 = {2}, R2Adj = {3} ", Math.Round(slr.Alpha, 4), Math.Round(slr.Beta, 4), Math.Round(slr.RSquared, 4), Math.Round(slr.RSquaredAdj, 4)); HySpxCollection.AddRange(MSChartHelper.ScatterChart(IndexData, "SPX", "HYSpread", RegressionType.SimpleLinear)); HyVixCollection.Clear(); slr = LinearAnalysisHelper.GetSimpleRegression(IndexData, "VIX", "HYSpread"); Title2 = string.Format("HY ~ VIX, a = {0}, b = {1}, R2 = {2}, R2Adj = {3}", Math.Round(slr.Alpha, 4), Math.Round(slr.Beta, 4), Math.Round(slr.RSquared, 4), Math.Round(slr.RSquaredAdj, 4)); HyVixCollection.AddRange(MSChartHelper.ScatterChart(IndexData, "VIX", "HYSpread", RegressionType.SimpleLinear)); }