Пример #1
0
        public static string Type2Text(PriceDataType value)
        {
            switch (value)
            {
            case PriceDataType.High: return(Languages.Libs.GetString("highData"));

            case PriceDataType.Low: return(Languages.Libs.GetString("lowData"));

            case PriceDataType.Open: return(Languages.Libs.GetString("openData"));

            case PriceDataType.Close: return(Languages.Libs.GetString("closeData"));

            case PriceDataType.Volume: return(Languages.Libs.GetString("volumeData"));

            default: return("<" + Languages.Libs.GetString("select") + ">");
            }
        }
Пример #2
0
 public static string Type2Text(PriceDataType value)
 {
     switch (value)
     {
         case PriceDataType.High: return Languages.Libs.GetString("highData");
         case PriceDataType.Low: return Languages.Libs.GetString("lowData");
         case PriceDataType.Open: return Languages.Libs.GetString("openData");
         case PriceDataType.Close: return Languages.Libs.GetString("closeData");
         case PriceDataType.Volume: return Languages.Libs.GetString("volumeData");
         default: return "<" + Languages.Libs.GetString("select") + ">";
     }
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="type"></param>
 public PricesEventArg(PriceDataType type)
 {
     m_OrderType = type;
 }
Пример #4
0
        private static commonClass.DataSeries GetData(data.baseDS.priceDataDataTable dataTbl, int startIdx, PriceDataType type)
        {
            commonClass.DataSeries ds = new commonClass.DataSeries();
            switch (type)
            {
            case PriceDataType.High:
                for (int i = startIdx, j = 0; i < dataTbl.Count; i++, j++)
                {
                    if (dataTbl[i].RowState == System.Data.DataRowState.Deleted)
                    {
                        continue;
                    }
                    ds.Add((double)dataTbl[i].highPrice);
                }
                break;

            case PriceDataType.Low:
                for (int i = startIdx, j = 0; i < dataTbl.Count; i++, j++)
                {
                    if (dataTbl[i].RowState == System.Data.DataRowState.Deleted)
                    {
                        continue;
                    }
                    ds.Add((double)dataTbl[i].lowPrice);
                }
                break;

            case PriceDataType.Open:
                for (int i = startIdx, j = 0; i < dataTbl.Count; i++, j++)
                {
                    if (dataTbl[i].RowState == System.Data.DataRowState.Deleted)
                    {
                        continue;
                    }
                    ds.Add((double)dataTbl[i].openPrice);
                }
                break;

            case PriceDataType.Close:
                for (int i = startIdx, j = 0; i < dataTbl.Count; i++, j++)
                {
                    if (dataTbl[i].RowState == System.Data.DataRowState.Deleted)
                    {
                        continue;
                    }
                    ds.Add((double)dataTbl[i].closePrice);
                }
                break;

            case PriceDataType.Volume:
                for (int i = startIdx, j = 0; i < dataTbl.Count; i++, j++)
                {
                    if (dataTbl[i].RowState == System.Data.DataRowState.Deleted)
                    {
                        continue;
                    }
                    ds.Add((double)dataTbl[i].volume);
                }
                break;

            case PriceDataType.DateTime:
                for (int i = startIdx, j = 0; i < dataTbl.Count; i++, j++)
                {
                    if (dataTbl[i].RowState == System.Data.DataRowState.Deleted)
                    {
                        continue;
                    }
                    ds.Add(dataTbl[i].onDate.ToOADate());
                }
                break;

            default:
                common.system.ThrowException("Invalid dataField in MakeDataList()"); break;
            }
            return(ds);
        }
Пример #5
0
        private static commonClass.DataSeries GetData(data.baseDS.priceDataDataTable dataTbl, int startIdx, PriceDataType type)
        {
            commonClass.DataSeries ds = new commonClass.DataSeries();
            switch (type)
            {
                case PriceDataType.High:
                    for (int i = startIdx, j = 0; i < dataTbl.Count; i++, j++)
                    {
                        if (dataTbl[i].RowState == System.Data.DataRowState.Deleted) continue;
                        ds.Add((double)dataTbl[i].highPrice);
                    }
                    break;
                case PriceDataType.Low:
                    for (int i = startIdx, j = 0; i < dataTbl.Count; i++, j++)
                    {
                        if (dataTbl[i].RowState == System.Data.DataRowState.Deleted) continue;
                        ds.Add((double)dataTbl[i].lowPrice);
                    }
                    break;
                case PriceDataType.Open:
                    for (int i = startIdx, j = 0; i < dataTbl.Count; i++, j++)
                    {
                        if (dataTbl[i].RowState == System.Data.DataRowState.Deleted) continue;
                        ds.Add((double)dataTbl[i].openPrice);
                    }
                    break;
                case PriceDataType.Close:
                    for (int i = startIdx, j = 0; i < dataTbl.Count; i++, j++)
                    {
                        if (dataTbl[i].RowState == System.Data.DataRowState.Deleted) continue;
                        ds.Add((double)dataTbl[i].closePrice);
                    }
                    break;
                case PriceDataType.Volume:
                    for (int i = startIdx, j = 0; i < dataTbl.Count; i++, j++)
                    {
                        if (dataTbl[i].RowState == System.Data.DataRowState.Deleted) continue;
                        ds.Add((double)dataTbl[i].volume);
                    }
                    break;

                case PriceDataType.DateTime:
                    for (int i = startIdx, j = 0; i < dataTbl.Count; i++, j++)
                    {
                        if (dataTbl[i].RowState == System.Data.DataRowState.Deleted)
                            continue;
                        ds.Add(dataTbl[i].onDate.ToOADate());
                    }
                    break;
                default:
                    common.system.ThrowException("Invalid dataField in MakeDataList()"); break;
            }
            return ds;
        }