Esempio n. 1
0
        private void ShowCurPrice(int a_price)
        {
            if (labelCurPrice.InvokeRequired)
            {
                AddDGCallback d = new AddDGCallback(ShowCurPrice);
                Invoke(d, new object[] { a_price });
            }
            else
            {
                lastPrice = curPrice;
                curPrice  = a_price;

                labelCurPrice.Text = a_price.ToString();

                if (lastPrice <= numBoxUp.Value &&
                    curPrice > numBoxUp.Value)
                {
                    SystemSounds.Exclamation.Play();
                }

                if (lastPrice >= numBoxDown.Value &&
                    curPrice < numBoxDown.Value)
                {
                    SystemSounds.Hand.Play();
                }
            }
        }
Esempio n. 2
0
        private void AddBigSell(int a_vol)
        {
            if (dgBigSell.InvokeRequired)
            {
                AddDGCallback d = new AddDGCallback(AddBigSell);
                Invoke(d, new object[] { a_vol });
            }
            else
            {
                totalSell       += a_vol;
                tbTotalSell.Text = totalSell.ToString();

                accSell       += a_vol;
                tbAccSell.Text = accSell.ToString();

                RefreshSub();

                if (a_vol >= BIG_VOL)
                {
                    bigSell       += a_vol;
                    tbBigSell.Text = bigSell.ToString();

                    int oldBigSell = accBigSell;
                    accBigSell       += a_vol;
                    tbAccBigSell.Text = accBigSell.ToString();

                    RefreshBigSub();

                    if (oldBigSell / ALERT_VOL != accBigSell / ALERT_VOL)
                    {
                        //SystemSounds.Beep.Play();
                        bigSellCnt       += 1;
                        tbBigSellCnt.Text = bigSellCnt.ToString();
                    }

                    dgBigSell.Rows.Insert(0, a_vol.ToString());
                    dgBigSell.Rows[0].Cells[0].Selected = true;
                }

                if (totalSell > 0)
                {
                    sellPct        = bigSell * 100 / totalSell;
                    tbSellPct.Text = sellPct.ToString();
                }

                if (accSell > 0)
                {
                    accBigSellPct        = accBigSell * 100 / accSell;
                    tbAccBigSellPct.Text = accBigSellPct.ToString();
                }
            }
        }
Esempio n. 3
0
 private void AddTest(int a_vol)
 {
     if (dgTest.InvokeRequired)
     {
         AddDGCallback d = new AddDGCallback(AddTest);
         Invoke(d, new object[] { a_vol });
     }
     else
     {
         dgTest.Rows.Insert(0, a_vol.ToString());
         dgTest.Rows[0].Cells[0].Selected = true;
     }
 }
Esempio n. 4
0
        private void AddBigBuy(int a_vol)
        {
            if (dgBigBuy.InvokeRequired)
            {
                AddDGCallback d = new AddDGCallback(AddBigBuy);
                Invoke(d, new object[] { a_vol });
            }
            else
            {
                totalBuy       += a_vol;
                tbTotalBuy.Text = totalBuy.ToString();

                accBuy       += a_vol;
                tbAccBuy.Text = accBuy.ToString();

                RefreshSub();

                if (a_vol >= BIG_VOL)
                {
                    bigBuy       += a_vol;
                    tbBigBuy.Text = bigBuy.ToString();

                    int oldBigBuy = accBigBuy;
                    accBigBuy       += a_vol;
                    tbAccBigBuy.Text = accBigBuy.ToString();

                    RefreshBigSub();

                    if (oldBigBuy / ALERT_VOL != accBigBuy / ALERT_VOL)
                    {
                        //SystemSounds.Asterisk.Play();
                        bigBuyCnt       += 1;
                        tbBigBuyCnt.Text = bigBuyCnt.ToString();
                    }

                    dgBigBuy.Rows.Insert(0, a_vol.ToString());
                    dgBigBuy.Rows[0].Cells[0].Selected = true;
                }

                buyPct        = bigBuy * 100 / totalBuy;
                tbBigPct.Text = buyPct.ToString();

                accBigBuyPct        = accBigBuy * 100 / accBuy;
                tbAccBigBuyPct.Text = accBigBuyPct.ToString();
            }
        }
Esempio n. 5
0
        private void ShowVolumn(int a_vol)
        {
            if (labelCurVol.InvokeRequired)
            {
                AddDGCallback d = new AddDGCallback(ShowVolumn);
                Invoke(d, new object[] { a_vol });
            }
            else
            {
                volumn = a_vol;

                lastCurVol = curVol;
                curVol     = volumn - lastVolumn1;

                labelCurVol.Text = curVol.ToString();

                //cur >= 850
                if (lastCurVol < 850 && curVol >= 850)
                {
                    SystemSounds.Exclamation.Play();
                }

                //last >= 300 & cur >= 500
                if (lastVol >= 300)
                {
                    if (lastCurVol < 500 && curVol >= 500)
                    {
                        SystemSounds.Exclamation.Play();
                    }
                }

                if (lastCurVol / ALERT_VOL != curVol / ALERT_VOL)
                {
                    SystemSounds.Asterisk.Play();
                }
            }
        }