public override global::System.Data.DataSet Clone()
        {
            AISTOCK_STOCK_WMS_V_DATA cln = ((AISTOCK_STOCK_WMS_V_DATA)(base.Clone()));

            cln.InitVars();
            cln.SchemaSerializationMode = this.SchemaSerializationMode;
            return(cln);
        }
Ejemplo n.º 2
0
        public AISTOCK_STOCK_WMS_V_DATA GetStockWmsData(string dateFrom, string dateTo, string code)
        {
            AISTOCK_STOCK_WMS_V_DATA data = new AISTOCK_STOCK_WMS_V_DATA();

            using (DaStock da = new DaStock())
            {
                da.LoadWMSIndex(data.AISTOCK_STOCK_WMS_V, dateFrom, dateTo, code);
            }
            return(data);
        }
        public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs)
        {
            AISTOCK_STOCK_WMS_V_DATA ds = new AISTOCK_STOCK_WMS_V_DATA();

            global::System.Xml.Schema.XmlSchemaComplexType type     = new global::System.Xml.Schema.XmlSchemaComplexType();
            global::System.Xml.Schema.XmlSchemaSequence    sequence = new global::System.Xml.Schema.XmlSchemaSequence();
            global::System.Xml.Schema.XmlSchemaAny         any      = new global::System.Xml.Schema.XmlSchemaAny();
            any.Namespace = ds.Namespace;
            sequence.Items.Add(any);
            type.Particle = sequence;
            global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
            if (xs.Contains(dsSchema.TargetNamespace))
            {
                global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
                global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
                try {
                    global::System.Xml.Schema.XmlSchema schema = null;
                    dsSchema.Write(s1);
                    for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext();)
                    {
                        schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
                        s2.SetLength(0);
                        schema.Write(s2);
                        if ((s1.Length == s2.Length))
                        {
                            s1.Position = 0;
                            s2.Position = 0;
                            for (; ((s1.Position != s1.Length) &&
                                    (s1.ReadByte() == s2.ReadByte()));)
                            {
                                ;
                            }
                            if ((s1.Position == s1.Length))
                            {
                                return(type);
                            }
                        }
                    }
                }
                finally {
                    if ((s1 != null))
                    {
                        s1.Close();
                    }
                    if ((s2 != null))
                    {
                        s2.Close();
                    }
                }
            }
            xs.Add(dsSchema);
            return(type);
        }
Ejemplo n.º 4
0
        private void DrawWmsTableBody(AISTOCK_STOCK_STATS_DATA stockData, AISTOCK_STOCK_WMS_V_DATA data)
        {
            if (stockData == null)
            {
                return;
            }
            if (stockData.AISTOCK_STOCK_INFORMATION.Count <= 0)
            {
                return;
            }
            decimal  max_price = 0;
            decimal  min_price = 0;
            decimal  end_price = 0;
            decimal  index     = 0;
            TableRow bodyRow;

            for (int i = 0; i < stockData.AISTOCK_STOCK_INFORMATION.Rows.Count; i++)
            {
                AISTOCK_STOCK_STATS_DATA.AISTOCK_STOCK_INFORMATIONRow stockRow = (AISTOCK_STOCK_STATS_DATA.AISTOCK_STOCK_INFORMATIONRow)stockData.AISTOCK_STOCK_INFORMATION.Rows[i];
                DataRow[] row = data.AISTOCK_STOCK_WMS_V.Select("STOCK_CODE = '" + stockRow.STOCK_CODE + "' AND STOCK_NAME = '" + stockRow.STOCK_NAME + "'");
                max_price = ((AISTOCK_STOCK_WMS_V_DATA.AISTOCK_STOCK_WMS_VRow)row[0]).MAX_PRICE;
                min_price = ((AISTOCK_STOCK_WMS_V_DATA.AISTOCK_STOCK_WMS_VRow)row[0]).MIN_PRICE;
                end_price = stockRow.TODAY_END;
                if (max_price - min_price != 0)
                {
                    index = (max_price - end_price) / (max_price - min_price) * 100;
                }
                bodyRow             = this.BmBlafTable.AddBodyRow();
                bodyRow.BorderColor = Color.Black;
                bodyRow.BorderWidth = Unit.Point(1);
                this.BmBlafTable.AddCell(bodyRow, stockRow.STOCK_CODE, HorizontalAlign.Left);
                this.BmBlafTable.AddCell(bodyRow, stockRow.STOCK_NAME, HorizontalAlign.Left);
                this.BmBlafTable.AddCell(bodyRow, index.ToString(), HorizontalAlign.Left);
                this.BmBlafTable.AddCell(bodyRow, stockRow.IsTODAY_BEGINNull() ? string.Empty : stockRow.TODAY_BEGIN.ToString(), HorizontalAlign.Left);
                this.BmBlafTable.AddCell(bodyRow, stockRow.IsYESTERDAY_ENDNull() ? string.Empty : stockRow.YESTERDAY_END.ToString(), HorizontalAlign.Left);
                this.BmBlafTable.AddCell(bodyRow, stockRow.IsTODAY_ENDNull() ? string.Empty : stockRow.TODAY_END.ToString(), HorizontalAlign.Left);
                this.BmBlafTable.AddCell(bodyRow, stockRow.IsINCREASE_PERCENTNull() ? string.Empty : stockRow.INCREASE_PERCENT.ToString(), HorizontalAlign.Left);
                this.BmBlafTable.AddCell(bodyRow, stockRow.IsCHARTNull() ? string.Empty : stockRow.CHART.ToString(), HorizontalAlign.Left);
            }
        }
Ejemplo n.º 5
0
        private void Refresh()
        {
            StockQueryCondition qc = new StockQueryCondition();

            qc.DeserializeFromString(this.ViewState["_StockQueryCondition"].ToString());
            this.labPrompt.Text = "";

            int indexDay = 14;

            if (qc.Index.Equals("RSI(5)"))
            {
                indexDay = 5;
            }
            else if (qc.Index.Equals("RSI(9)"))
            {
                indexDay = 9;
            }
            else if (qc.Index.Equals("RSI(14)") || qc.Index.Equals("ADR(14)"))
            {
                indexDay = 11;
            }
            else if (qc.Index.Equals("WMS(10)") || qc.Index.Equals("ADR(10)"))
            {
                indexDay = 10;
            }
            else if (qc.Index.Equals("WMS(20)"))
            {
                indexDay = 20;
            }

            string dateTo = DateTimeFunction.ConvertDate(qc.DatePickerFrom);

            string date = new StockSystem().GetIndexDay(qc.DatePickerFrom, indexDay);

            date = DateTimeFunction.ConvertDate(DateTime.Parse(date).ToShortDateString());

            AISTOCK_STOCK_STATS_DATA stockData = new StockSystem().GetStockData(dateTo, txtStockCode.Text.Trim());

            if (qc.Index.Equals("RSI(5)") || qc.Index.Equals("RSI(9)") || qc.Index.Equals("RSI(14)"))
            {
                string today = DateTimeFunction.ConvertDate(DateTime.Now.ToShortDateString());
                today = new StockSystem().GetToday(today);
                bool flag = false;
                if (int.Parse(dateTo) < int.Parse(today))
                {
                    flag = true;
                }
                AISTOCK_STOCK_INDEX_V_DATA dataRSI = new AISTOCK_STOCK_INDEX_V_DATA();
                dataRSI = new StockSystem().GetStockDataIndex(date, dateTo, txtStockCode.Text.Trim());

                this.BmBlafTable.Clear();
                DrawRsiTableHeader();
                DrawRsiTableBody(dataRSI, stockData, txtStockCode.Text.Trim(), flag, today, qc.DatePickerFrom, indexDay);
            }
            else if (qc.Index.Equals("WMS(10)") || qc.Index.Equals("WMS(20)"))
            {
                AISTOCK_STOCK_WMS_V_DATA dataWms = new AISTOCK_STOCK_WMS_V_DATA();
                dataWms = new StockSystem().GetStockWmsData(date, dateTo, txtStockCode.Text.Trim());

                this.BmBlafTable.Clear();
                DrawWmsTableHeader();
                DrawWmsTableBody(stockData, dataWms);
            }
            else if (qc.Index.Equals("ADR(10)") || qc.Index.Equals("ADR(14)"))
            {
                AISTOCK_STOCK_ADR_INDEX_V_DATA dataAdr = new AISTOCK_STOCK_ADR_INDEX_V_DATA();
                dataAdr = new StockSystem().GetStockAdrData(date, dateTo, txtStockCode.Text.Trim());

                this.BmBlafTable.Clear();
                DrawAdrTableHeader();
                DrawAdrTableBody(dataAdr);
            }
        }
            public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs)
            {
                global::System.Xml.Schema.XmlSchemaComplexType type     = new global::System.Xml.Schema.XmlSchemaComplexType();
                global::System.Xml.Schema.XmlSchemaSequence    sequence = new global::System.Xml.Schema.XmlSchemaSequence();
                AISTOCK_STOCK_WMS_V_DATA ds = new AISTOCK_STOCK_WMS_V_DATA();

                global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny();
                any1.Namespace       = "http://www.w3.org/2001/XMLSchema";
                any1.MinOccurs       = new decimal(0);
                any1.MaxOccurs       = decimal.MaxValue;
                any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
                sequence.Items.Add(any1);
                global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny();
                any2.Namespace       = "urn:schemas-microsoft-com:xml-diffgram-v1";
                any2.MinOccurs       = new decimal(1);
                any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
                sequence.Items.Add(any2);
                global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute();
                attribute1.Name       = "namespace";
                attribute1.FixedValue = ds.Namespace;
                type.Attributes.Add(attribute1);
                global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute();
                attribute2.Name       = "tableTypeName";
                attribute2.FixedValue = "AISTOCK_STOCK_WMS_VDataTable";
                type.Attributes.Add(attribute2);
                type.Particle = sequence;
                global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
                if (xs.Contains(dsSchema.TargetNamespace))
                {
                    global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
                    global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
                    try {
                        global::System.Xml.Schema.XmlSchema schema = null;
                        dsSchema.Write(s1);
                        for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext();)
                        {
                            schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
                            s2.SetLength(0);
                            schema.Write(s2);
                            if ((s1.Length == s2.Length))
                            {
                                s1.Position = 0;
                                s2.Position = 0;
                                for (; ((s1.Position != s1.Length) &&
                                        (s1.ReadByte() == s2.ReadByte()));)
                                {
                                    ;
                                }
                                if ((s1.Position == s1.Length))
                                {
                                    return(type);
                                }
                            }
                        }
                    }
                    finally {
                        if ((s1 != null))
                        {
                            s1.Close();
                        }
                        if ((s2 != null))
                        {
                            s2.Close();
                        }
                    }
                }
                xs.Add(dsSchema);
                return(type);
            }
Ejemplo n.º 7
0
        private void RSIData(string dateTo, string date1)
        {
            int    indexDay = 14;
            string date     = new StockSystem().GetIndexDay(date1, indexDay);

            date = DateTimeFunction.ConvertDate(DateTime.Parse(date).ToShortDateString());
            AISTOCK_STOCK_INDEX_V_DATA dataRSI = new AISTOCK_STOCK_INDEX_V_DATA();

            dataRSI = new StockSystem().GetStockDataIndex(date, dateTo, "");
            AISTOCK_STOCK_STATS_DATA stockData = new StockSystem().GetStockData(dateTo, "");
            AISTOCK_STOCK_WMS_V_DATA dataWms   = new AISTOCK_STOCK_WMS_V_DATA();

            dataWms = new StockSystem().GetStockWmsData(date, dateTo, "");
            if (dataRSI == null)
            {
                return;
            }
            if (dataRSI.AISTOCK_STOCK_INDEX_V.Count <= 0)
            {
                return;
            }
            int           count = 0;
            StringBuilder sb    = new StringBuilder();
            AISTOCK_STOCK_COMMAND_DATA saveData = new AISTOCK_STOCK_COMMAND_DATA();

            for (int i = 0; i < stockData.AISTOCK_STOCK_INFORMATION.Rows.Count; i++)
            {
                decimal sumA  = 0;
                decimal sumB  = 0;
                decimal index = 0;
                AISTOCK_STOCK_STATS_DATA.AISTOCK_STOCK_INFORMATIONRow stockRow = ((AISTOCK_STOCK_STATS_DATA.AISTOCK_STOCK_INFORMATIONRow)stockData.AISTOCK_STOCK_INFORMATION.Rows[i]);
                string    stockCode = stockRow.STOCK_CODE.ToString();
                DataRow[] rows      = dataRSI.AISTOCK_STOCK_INDEX_V.Select("STOCK_CODE = '" + stockCode + "'");
                if (!stockCode.ToLower().StartsWith("sz002"))
                {
                    continue;
                }
                if (rows.Length <= 0)
                {
                    continue;
                }
                for (int j = 0; j < rows.Length; j++)
                {
                    AISTOCK_STOCK_INDEX_V_DATA.AISTOCK_STOCK_INDEX_VRow row = (AISTOCK_STOCK_INDEX_V_DATA.AISTOCK_STOCK_INDEX_VRow)rows[j];
                    if (row.DIFF > 0)
                    {
                        sumA += row.DIFF;
                    }
                    else
                    {
                        sumB += row.DIFF;
                    }
                }
                if (sumA - sumB != 0)
                {
                    index = sumA / (sumA - sumB) * 100;
                }
                if (index == 0 || index > 10)
                {
                    continue;
                }

                //WM Index
                DataRow[] wmrow     = dataWms.AISTOCK_STOCK_WMS_V.Select("STOCK_CODE = '" + stockCode + "'");
                decimal   max_price = 0;
                decimal   min_price = 0;
                decimal   end_price = 0;
                decimal   wmindex   = 0;
                max_price = ((AISTOCK_STOCK_WMS_V_DATA.AISTOCK_STOCK_WMS_VRow)wmrow[0]).MAX_PRICE;
                min_price = ((AISTOCK_STOCK_WMS_V_DATA.AISTOCK_STOCK_WMS_VRow)wmrow[0]).MIN_PRICE;
                end_price = stockRow.TODAY_END;
                if (max_price - min_price != 0)
                {
                    wmindex = (max_price - end_price) / (max_price - min_price) * 100;
                }

                if (wmindex > 0)
                {
                    continue;
                }

                int     quantity = new StockSystem().GetQuantity(stockCode);
                decimal ratio;
                if (quantity == 0)
                {
                    ratio = -1;
                }
                else
                {
                    ratio = (decimal)stockRow.QUANTITY / (decimal)quantity;
                }

                count++;
                AISTOCK_STOCK_COMMAND_DATA.AISTOCK_STOCK_COMMANDRow saveRow = saveData.AISTOCK_STOCK_COMMAND.NewAISTOCK_STOCK_COMMANDRow();
                saveRow.STOCK_ID    = Guid.NewGuid().ToString();
                saveRow.STOCK_CODE  = stockCode;
                saveRow.STOCK_NAME  = stockRow.STOCK_NAME;
                saveRow.STOCK_DAY   = stockRow.STOCK_DAY;
                saveRow.TODAY_BEGIN = stockRow.TODAY_BEGIN;
                saveRow.TODAY_END   = stockRow.TODAY_END;
                saveRow.MAX_PRICE   = stockRow.MAX_PRICE;
                saveRow.MIN_PRICE   = stockRow.MIN_PRICE;
                saveRow.RSI         = index;
                saveRow.WM          = wmindex;
                saveRow.RATIO       = ratio;
                saveData.AISTOCK_STOCK_COMMAND.AddAISTOCK_STOCK_COMMANDRow(saveRow);
                sb.Append("@" + stockCode + "@" + index.ToString("0.00") + "\n");
            }
            if (count > 0)
            {
                new StockSystem().SaveRSIData(saveData);
                SendEmail("敌情资讯", sb.ToString());
            }
        }
Ejemplo n.º 8
0
        private void Refresh()
        {
            string dateFrom     = Request.QueryString["datefrom"] == null ? string.Empty : Request.QueryString["datefrom"];
            string market       = Request.QueryString["market"] == null ? string.Empty : Request.QueryString["market"];
            string field        = Request.QueryString["field"] == null ? string.Empty : Request.QueryString["field"];
            string index        = Request.QueryString["index"] == null ? string.Empty : Request.QueryString["index"];
            string province     = Request.QueryString["province"] == null ? string.Empty : Request.QueryString["province"];
            string stockName    = Request.QueryString["stockName"] == null ? string.Empty : Request.QueryString["stockName"].ToString().Trim();
            string stockcode    = Request.QueryString["stockcode"] == null ? string.Empty : Request.QueryString["stockcode"];
            string MarketName   = Request.QueryString["MarketName"] == "--请选择--" ? string.Empty : Request.QueryString["MarketName"];
            string FieldName    = Request.QueryString["FieldName"] == "--请选择--" ? string.Empty : Request.QueryString["FieldName"].Trim();
            string IndexName    = Request.QueryString["IndexName"].Trim();
            string ProvinceName = Request.QueryString["ProvinceName"] == "--请选择--" ? string.Empty : Request.QueryString["ProvinceName"].Trim();

            StockQueryCondition qc = new StockQueryCondition();

            qc.DatePickerFrom = dateFrom;
            qc.StockCode      = stockcode;
            qc.StockName      = stockName;
            qc.Market         = MarketName;
            qc.Field          = FieldName;
            qc.Index          = IndexName;
            qc.Province       = ProvinceName;

            this.ViewState["_StockQueryCondition"] = qc.SerializeToString();

            int indexDay = 14;

            if (qc.Index.Equals("RSI(5)"))
            {
                indexDay = 5;
            }
            else if (qc.Index.Equals("RSI(9)"))
            {
                indexDay = 9;
            }
            else if (qc.Index.Equals("RSI(14)"))
            {
                indexDay = 14;
            }
            else if (qc.Index.Equals("WMS(10)"))
            {
                indexDay = 10;
            }
            else if (qc.Index.Equals("WMS(20)"))
            {
                indexDay = 20;
            }

            string dateTo = DateTimeFunction.ConvertDate(qc.DatePickerFrom);
            string date   = new StockSystem().GetIndexDay(qc.DatePickerFrom, indexDay);

            date = DateTimeFunction.ConvertDate(DateTime.Parse(date).ToShortDateString());

            AISTOCK_STOCK_STATS_DATA stockData = new StockSystem().GetStockData(dateTo, stockcode);

            if (qc.Index.Equals("RSI(5)") || qc.Index.Equals("RSI(9)") || qc.Index.Equals("RSI(14)"))
            {
                AISTOCK_STOCK_INDEX_V_DATA dataRSI = new AISTOCK_STOCK_INDEX_V_DATA();
                dataRSI = new StockSystem().GetStockDataIndex(date, dateTo, stockcode);

                this.BmBlafTable.Clear();
                this.BmBlafTable.BorderColor = Color.Black;
                this.BmBlafTable.BorderWidth = Unit.Point(1);
                DrawRsiTableHeader();
                DrawRsiTableBody(dataRSI, stockData);
            }
            else if (qc.Index.Equals("WMS(10)") || qc.Index.Equals("WMS(20)"))
            {
                AISTOCK_STOCK_WMS_V_DATA dataWms = new AISTOCK_STOCK_WMS_V_DATA();
                dataWms = new StockSystem().GetStockWmsData(date, dateTo, stockcode);

                this.BmBlafTable.Clear();
                this.BmBlafTable.BorderColor = Color.Black;
                this.BmBlafTable.BorderWidth = Unit.Point(1);
                DrawWmsTableHeader();
                DrawWmsTableBody(stockData, dataWms);
            }
            this.LabelTitle.Text = "名称:股票指标分析<br>" +
                                   "创建时间:" + DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss") + "<br>" +
                                   "时间:" + qc.DatePickerFrom + "<br>" +
                                   "所属证券市场:" + (qc.Market == string.Empty ? "ALL" : qc.Market) + "<br>" +
                                   "所属证监会行业:" + (qc.Field == string.Empty ? "ALL" : qc.Field) + "<br>" +
                                   "所属省份:" + (qc.Province == string.Empty ? "ALL" : qc.Province) + "<br>" +
                                   "指标类型:" + (qc.Index == string.Empty ? "ALL" : qc.Index) + "<br>" +
                                   "股票代码:" + (qc.StockCode == string.Empty ? "ALL" : qc.StockCode) +
                                   "股票名称:" + (qc.StockName == string.Empty ? "ALL" : qc.StockName);
        }