T0短线操作

    技术2025-03-30  12

    公式来源与财经的谈股论金节目

     

     

    WebService地址

    http://www.webxml.com.cn/WebServices/ChinaStockWebService.asmx

     

     

    using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;

    namespace T0短线计算公式{    public partial class Form1 : Form    {        ChinaStockWebService.ChinaStockWebServiceSoapClient _ChinaStockWebService = new ChinaStockWebService.ChinaStockWebServiceSoapClient("ChinaStockWebServiceSoap");                public Form1()        {            InitializeComponent();                    }

            private void Form1_Load(object sender, EventArgs e)        {            T0(txtCode.Text);        }

            private void T0(string code)         {            //CDP(需求值) = (H+L+2C)/4;            //H = 昨日最高价            //L = 昨日最低价            //C = 昨日收盘价                        //最高值 = CDP+H-L            //最低值 = CDP-(H-L)            //近高值 = CDP*2-L            //近低值 = CDP*2-H

                string[] s = _ChinaStockWebService.getStockInfoByCode(txtCode.Text);            decimal c = Convert.ToDecimal(s[3]);            decimal l = Convert.ToDecimal(s[7]);            decimal h = Convert.ToDecimal(s[8]);            decimal cdp= (h+l+2*c)/4;

                txtMax.Text = (cdp + h - l).ToString();            txtMin.Text = (cdp - (h - l)).ToString();            txtLowerMax.Text = (cdp * 2 - l).ToString();            txtLowerMin.Text = (cdp * 2 - h).ToString();        }

            private void btnSearch_Click(object sender, EventArgs e)        {            T0(txtCode.Text);        }    }}

    最新回复(0)