Exemplo n.º 1
0
        public static XQChartIndexOutBlock1[] ListFromQuery(XQCHARTINDEX query)
        {
            int count = query.GetBlockCount(XQChartIndexOutBlock1.BlockName);
            List <XQChartIndexOutBlock1> list = new List <XQChartIndexOutBlock1>();

            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                return(list.ToArray());
            }
            for (int i = 0; i < count; i++)
            {
                XQChartIndexOutBlock1 block = new XQChartIndexOutBlock1();
                block.IsValidData   = true;
                block.InvalidReason = "";
                try
                {
                    block.date   = query.GetFieldData(block.GetBlockName(), "date", i).TrimEnd('?');                   // char 8
                    block.time   = query.GetFieldData(block.GetBlockName(), "time", i).TrimEnd('?');                   // char 6
                    block.open   = query.GetFieldData(block.GetBlockName(), "open", i).ParseFloat("open");             // float 10
                    block.high   = query.GetFieldData(block.GetBlockName(), "high", i).ParseFloat("high");             // float 10
                    block.low    = query.GetFieldData(block.GetBlockName(), "low", i).ParseFloat("low");               // float 10
                    block.close  = query.GetFieldData(block.GetBlockName(), "close", i).ParseFloat("close");           // float 10
                    block.volume = query.GetFieldData(block.GetBlockName(), "volume", i).ParseFloat("volume");         // float 12
                    block.value1 = query.GetFieldData(block.GetBlockName(), "value1", i).ParseFloat("value1");         // float 10
                    block.value2 = query.GetFieldData(block.GetBlockName(), "value2", i).ParseFloat("value2");         // float 10
                    block.value3 = query.GetFieldData(block.GetBlockName(), "value3", i).ParseFloat("value3");         // float 10
                    block.value4 = query.GetFieldData(block.GetBlockName(), "value4", i).ParseFloat("value4");         // float 10
                    block.value5 = query.GetFieldData(block.GetBlockName(), "value5", i).ParseFloat("value5");         // float 10
                    block.pos    = query.GetFieldData(block.GetBlockName(), "pos", i).ParseLong("pos");                // long 8
                } catch (InvalidDataFormatException e) {
                    block.IsValidData   = false;
                    block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
                }
                list.Add(block);
            }
            return(list.ToArray());
        }
Exemplo n.º 2
0
 public XQChartIndexOutBlock1[] GetBlock1s()
 {
     XQChartIndexOutBlock1[] instance = XQChartIndexOutBlock1.ListFromQuery(this);
     return(instance);
 }