public void Test_GetTickerListByShareDB()
        {
            TickerBLL tBll = new TickerBLL(_unit);

            var tickerList = tBll.GetTickerListByShareDB(1585, 20100101, 20160320);

            tickerList = tBll.GetTickerListByShareDB(1585, 20100101, null);
        }
Beispiel #2
0
        public void TestCalculateRealData()
        {
            TickerBLL tbll = new TickerBLL(_unit);

            List <Ticker> tList = tbll.GetTickerListByShareDB(1585, null, 21100000);

            double[] inputData = new double[tList.Count];
            double[] h         = new double[tList.Count];
            double[] lo        = new double[tList.Count];

            double?[] k = new double?[tList.Count];

            var i = 0;

            foreach (var t in tList)
            {
                inputData[i] = t.Close;
                h[i]         = t.High;
                lo[i]        = t.Low;

                i++;
            }


            WilliamR.Calculate(inputData, h, lo, 14, k);
        }
Beispiel #3
0
            public void TestCalculateRealData()
            {
                TickerBLL tbll = new TickerBLL(_unit);

                List <Ticker> tList = tbll.GetTickerListByShareDB(1585, null, 21100000);

                double[] close = new double[tList.Count];
                double[] h     = new double[tList.Count];
                double[] lo    = new double[tList.Count];

                double?[] adx     = new double?[tList.Count];
                double?[] diPlus  = new double?[tList.Count];
                double?[] diMinus = new double?[tList.Count];

                var i = 0;

                foreach (var t in tList)
                {
                    close[i] = t.Close;
                    h[i]     = t.High;
                    lo[i]    = t.Low;

                    i++;
                }


                ADX.Calculate(h, lo, close, diPlus, diMinus, adx);
            }
Beispiel #4
0
        public void TestCalculateRealData()
        {
            TickerBLL tbll = new TickerBLL(_unit);

            List <Ticker> tList = tbll.GetTickerListByShareDB(1585, 0, 21100000);
            var           input = new SMAIn();

            input.Data = new SMAItem[tList.Count];

            var i = 0;

            foreach (var t in tList)
            {
                input.Data[i]             = new SMAItem();
                input.Data[i].TradingDate = t.TradingDate;
                input.Data[i].iClose      = t.Close;
                i++;
            }

            var setting = new SMASetting();

            setting.Period = 50;
            setting.Offset = 0;

            Result res = new SMA().Calculate(input, setting);
        }
Beispiel #5
0
        public void TestCalculate()
        {
            TickerBLL tbll = new TickerBLL(_unit);

            List <Ticker> tList = tbll.GetTickerListByShareDB(1585, 20160401, 21100000);

            double[] o = new double[tList.Count];
            double[] h = new double[tList.Count];
            double[] l = new double[tList.Count];
            double[] c = new double[tList.Count];

            double?[] oo = new double?[tList.Count];
            double?[] oh = new double?[tList.Count];
            double?[] ol = new double?[tList.Count];
            double?[] oc = new double?[tList.Count];

            var i = 0;

            foreach (var t in tList)
            {
                o[i] = t.Open;
                h[i] = t.High;
                l[i] = t.Low;
                c[i] = t.Close;

                i++;
            }

            Result res = HeikinAshi.Calculate(o, c, h, l, oo, oc, oh, ol);
        }
        public void Test_GetIndicators()
        {
            IndicatorBLL iBLL = new IndicatorBLL(_unit);
            TickerBLL    tBll = new TickerBLL(_unit);

            var tickerList = tBll.GetTickerListByShareDB(1585, 20100101, 20160520);

            iBLL.GetIndicators(tickerList, "sma,10|ema,20");
        }
        public void Test_GetTickerListByShareDB_Full_AllShares()
        {
            ShareBLL  sBll = new ShareBLL(_unit);
            TickerBLL tBll = new TickerBLL(_unit);

            var shareList = sBll.GetList().ToList();

            foreach (var s in shareList)
            {
                var tickerList = tBll.GetTickerListByShareDB(s.Id, null, null);
                Debug.WriteLine("share {0}  {1}", s.Id, tickerList.Count);
            }
        }
Beispiel #8
0
        public void TestCalculateRealData()
        {
            TickerBLL tbll = new TickerBLL(_unit);

            List <Ticker> tList = tbll.GetTickerListByShareDB(1585, null, 21100000);

            double[]  inputData = new double[tList.Count];
            double?[] outData   = new double?[tList.Count];

            var i = 0;

            foreach (var t in tList)
            {
                inputData[i] = t.Close;
                i++;
            }

            Result res = RSI.Calculate(inputData, 14, outData);
        }
Beispiel #9
0
        public void TestCalculateRealData()
        {
            TickerBLL tbll = new TickerBLL(_unit);

            List <Ticker> tList = tbll.GetTickerListByShareDB(1585, null, 21100000);

            double[]  inputData = new double[tList.Count];
            double?[] m         = new double?[tList.Count];
            double?[] h         = new double?[tList.Count];
            double?[] l         = new double?[tList.Count];

            var i = 0;

            foreach (var t in tList)
            {
                inputData[i] = t.Close;
                i++;
            }


            Result res = BollingerBand.Calculate(inputData, 20, 2.5, m, h, l);
        }
        public void TestCalculate()
        {
            TickerBLL tbll = new TickerBLL(_unit);

            List <Ticker> tList = tbll.GetTickerListByShareDB(1585, 0, 21100000);

            double[] inputData = new double[tList.Count];

            var i = 0;

            foreach (var t in tList)
            {
                inputData[i] = t.Close;
                i++;
            }

            double?[] m = new double?[tList.Count];
            double?[] s = new double?[tList.Count];
            double?[] h = new double?[tList.Count];

            Result res = MACD.Calculate(inputData, 26, 12, 9, m, s, h);
        }
        public void Test_GetTickerListByShareDB_Full()
        {
            TickerBLL tBll = new TickerBLL(_unit);

            var tickerList = tBll.GetTickerListByShareDB(1585, null, null);
        }