//SelectedAvgVolume private void mfnSelectedAvgVolume() { sAvg volumeAvg = new sAvg(0, 0, 0, 0, 0, 0); int iBeforeDate = mfnStringToInt(txtBeforeDate.Text); //Get Avg volumeAvg.Avg5 = mfnAvgVolCalc(5, iBeforeDate); volumeAvg.Avg12 = mfnAvgVolCalc(12, iBeforeDate); volumeAvg.Avg20 = mfnAvgVolCalc(20, iBeforeDate); volumeAvg.Avg60 = mfnAvgVolCalc(60, iBeforeDate); volumeAvg.Avg120 = mfnAvgVolCalc(120, iBeforeDate); volumeAvg.Current = mDetailInfo[iBeforeDate].volumn; //Input Avg TextBox txtAvgV5.Text = volumeAvg.Avg5.ToString("#,##"); txtAvgV12.Text = volumeAvg.Avg12.ToString("#,##"); txtAvgV20.Text = volumeAvg.Avg20.ToString("#,##"); txtAvgV60.Text = volumeAvg.Avg60.ToString("#,##"); txtAvgV120.Text = volumeAvg.Avg120.ToString("#,##"); txtCurrentV.Text = volumeAvg.Current.ToString("#,##"); //Input Diff TextBox txtAvgVD5.Text = mfnDiffCalc(volumeAvg.Avg5, volumeAvg.Current, txtAvgVD5).ToString("#,##"); txtAvgVD12.Text = mfnDiffCalc(volumeAvg.Avg12, volumeAvg.Current, txtAvgVD12).ToString("#,##"); txtAvgVD20.Text = mfnDiffCalc(volumeAvg.Avg20, volumeAvg.Current, txtAvgVD20).ToString("#,##"); txtAvgVD60.Text = mfnDiffCalc(volumeAvg.Avg60, volumeAvg.Current, txtAvgVD60).ToString("#,##"); txtAvgVD120.Text = mfnDiffCalc(volumeAvg.Avg120, volumeAvg.Current, txtAvgVD120).ToString("#,##"); }
//TapAvgPrice private void mfnSelectedAvgPrice() { sAvg priceAvg = new sAvg(0, 0, 0, 0, 0, 0); int iBeforeDate = mfnStringToInt(txtBeforeDate.Text); //Get Avg priceAvg.Avg5 = mfnAvgPriceCalc(5, iBeforeDate); priceAvg.Avg12 = mfnAvgPriceCalc(12, iBeforeDate); priceAvg.Avg20 = mfnAvgPriceCalc(20, iBeforeDate); priceAvg.Avg60 = mfnAvgPriceCalc(60, iBeforeDate); priceAvg.Avg120 = mfnAvgPriceCalc(120, iBeforeDate); priceAvg.Current = mDetailInfo[iBeforeDate].price; //Input Avg TextBox txtAvgP5.Text = priceAvg.Avg5.ToString("#,##"); txtAvgP12.Text = priceAvg.Avg12.ToString("#,##"); txtAvgP20.Text = priceAvg.Avg20.ToString("#,##"); txtAvgP60.Text = priceAvg.Avg60.ToString("#,##"); txtAvgP120.Text = priceAvg.Avg120.ToString("#,##"); //txtPrice.Text = priceAvg.Current.ToString("#,##"); //Input Diff TextBox txtAvgPD5.Text = mfnDiffCalc(priceAvg.Avg5, priceAvg.Current, txtAvgPD5).ToString("#,##"); txtAvgPD12.Text = mfnDiffCalc(priceAvg.Avg12, priceAvg.Current, txtAvgPD12).ToString("#,##"); txtAvgPD20.Text = mfnDiffCalc(priceAvg.Avg20, priceAvg.Current, txtAvgPD20).ToString("#,##"); txtAvgPD60.Text = mfnDiffCalc(priceAvg.Avg60, priceAvg.Current, txtAvgPD60).ToString("#,##"); txtAvgPD120.Text = mfnDiffCalc(priceAvg.Avg120, priceAvg.Current, txtAvgPD120).ToString("#,##"); //Input Per TextBox txtPDPer5.Text = ((mfnDiffCalc(priceAvg.Avg5, priceAvg.Current, txtPDPer5) / Convert.ToDouble(priceAvg.Avg5)) * 100).ToString("#,#0.##"); txtPDPer12.Text = ((mfnDiffCalc(priceAvg.Avg12, priceAvg.Current, txtPDPer12) / Convert.ToDouble(priceAvg.Avg12)) * 100).ToString("#,#0.##"); txtPDPer20.Text = ((mfnDiffCalc(priceAvg.Avg20, priceAvg.Current, txtPDPer20) / Convert.ToDouble(priceAvg.Avg20)) * 100).ToString("#,#0.##"); txtPDPer60.Text = ((mfnDiffCalc(priceAvg.Avg60, priceAvg.Current, txtPDPer60) / Convert.ToDouble(priceAvg.Avg60)) * 100).ToString("#,#0.##"); txtPDPer120.Text = ((mfnDiffCalc(priceAvg.Avg120, priceAvg.Current, txtPDPer120) / Convert.ToDouble(priceAvg.Avg5)) * 100).ToString("#,#0.##"); }