Esempio n. 1
0
        public void InsertHistory(string collectionName, int period, string json)
        {
            IHistory h;

            switch (period)
            {
            case 60:
                h = new TradeHistory60();
                break;

            case 30:
                h = new TradeHistory30();
                break;

            case 15:
                h = new TradeHistory15();
                break;

            case 5:
                h = new TradeHistory5();
                break;

            case 10:
                h = new TradeHistory10();
                break;

            default:
                h = new TradeHistoryDaily();
                break;
            }

            h.InsertHistory(collectionName, json);
        }
Esempio n. 2
0
        public void InsertHistory(string collectionName, int period, string json)
        {
            IHistory history;
            int      num = period;

            if (num > 10)
            {
                if (num == 15)
                {
                    history = new TradeHistory15();
                    goto TR_0000;
                }
                else if (num == 30)
                {
                    history = new TradeHistory30();
                    goto TR_0000;
                }
                else if (num == 60)
                {
                    history = new TradeHistory60();
                    goto TR_0000;
                }
            }
            else if (num == 5)
            {
                history = new TradeHistory5();
                goto TR_0000;
            }
            else if (num == 10)
            {
                history = new TradeHistory10();
                goto TR_0000;
            }
            history = new TradeHistoryDaily();
TR_0000:
            history.InsertHistory(collectionName, json);
        }