Example #1
0
        public void GetOrderBook(Dameer timeFrom, Dameer timeTo, string tableName, string symbolName)
        {
            string sql;
            int    count = 0;
            int    i     = 0;
            string sqlRange;
            string sqlFirst;

            sql = "SELECT id FROM " + tableName + " WHERE Time >= '" + timeFrom.Value + "' AND Time < '" + timeTo.Value +
                  "' AND SYMBOL = '" + symbolName + "' AND Lvl=1 ORDER BY id limit 1";
            i = GetFirstId(sql);

            sqlFirst =
                "SELECT Id, Time, TimeMS, Symbol, Currency, Lvl, BidP1, BidQ1, BidP2, BidQ2, BidP3, BidQ3, BidP4, BidQ4, BidP5, BidQ5, AskP1, AskQ1, AskP2, AskQ2, AskP3, AskQ3, AskP4, AskQ4, AskP5, AskQ5 FROM " +
                tableName + " WHERE Time >= '" + timeFrom.Value + "' AND Time < '" + timeTo.Value +
                "' AND SYMBOL = '" + symbolName + "' AND id >= " + i + " ORDER BY id";
            count = ExecQueryFprGraph(sqlFirst);
            int firstId = 0;

            firstId = i;
            int    afterId = firstId + count;
            string Id      = afterId.ToString();

            sqlRange =
                "SELECT Id, Time, TimeMS, Symbol, Currency, Lvl, BidP1, BidQ1, BidP2, BidQ2, BidP3, BidQ3, BidP4, BidQ4, BidP5, BidQ5, AskP1, AskQ1, AskP2, AskQ2, AskP3, AskQ3, AskP4, AskQ4, AskP5, AskQ5 FROM " +
                tableName + " WHERE Time >= '" + timeFrom.Value + "' AND Time < '" + timeTo.Value +
                "' AND SYMBOL = '" + symbolName + "' AND id >= " + firstId + " AND id <= " + afterId + " ORDER BY id";
            ExecQueryOrderBook(sqlRange, count);
        }
Example #2
0
        public void GetArrowses(Dameer timeFrom, Dameer timeTo, string tableName, string symbolName)
        {
            string sql;
            var    firstIdsql = "SELECT id FROM " + tableName + " WHERE Time >= '" + timeFrom.Value + "' AND Time < '" +
                                timeTo.Value + "' AND SYMBOL = '" + symbolName + "' AND Lvl=1 ORDER BY id limit 1";
            var i = GetFirstId(firstIdsql);

            sql = "SELECT Id, Time, TimeMS, Symbol,Price,Direction,Name FROM " + tableName + " WHERE Time >= '" +
                  timeFrom.Value + "' AND Time < '" + timeTo.Value + "' AND SYMBOL = '" + symbolName + "' AND id >= " +
                  i + " ORDER BY id";
            ExecQueryArrow(sql);
        }
Example #3
0
        public void GetChart1(Dameer timeFrom, Dameer timeTo, string tableName, string symbolName, bool IsRealTime)
        {
            string sql;
            int    count = 0;
            int    i     = 0;

            sql = "SELECT id FROM " + tableName + " WHERE Time >= '" + timeFrom.Value + "' AND Time < '" + timeTo.Value + "' AND SYMBOL = '" + symbolName + "' AND Lvl=1 ORDER BY id limit 1";
            i   = GetFirstId(sql);
            // while (true)
            {
                sql = "SELECT Id, Time, TimeMS, Symbol, Currency, Lvl, BidP1, BidQ1, BidP2, BidQ2, BidP3, BidQ3, BidP4, BidQ4, BidP5, BidQ5, AskP1, AskQ1, AskP2, AskQ2, AskP3, AskQ3, AskP4, AskQ4, AskP5, AskQ5 FROM " + tableName + " WHERE Time >= '" + timeFrom.Value + "' AND Time < '" + timeTo.Value + "' AND SYMBOL = '" + symbolName + "' AND id >= " + i + " ORDER BY id";
                // sql = "SELECT Id, Time, TimeMS, Symbol, Currency, Lvl, BidP1, BidQ1, BidP2, BidQ2, BidP3, BidQ3, BidP4, BidQ4, BidP5, BidQ5, AskP1, AskQ1, AskP2, AskQ2, AskP3, AskQ3, AskP4, AskQ4, AskP5, AskQ5 FROM " + tableName + " WHERE Time >= '" + timeFrom.Value + "' AND Time < '" + timeTo.Value + "' AND SYMBOL = '" + symbolName + "'ORDER BY id";
                count = ExecQueryFprGraph(sql);
            }
        }