Exemplo n.º 1
0
        public Xing_CSPAT00800 get800()
        {
            Log.WriteLine("Xing_CSPAT00800 카운트::" + this.xing_CSPAT00800List.Count());
            for (int i = 0; i < this.xing_CSPAT00800List.Count(); i++)
            {
                if (this.xing_CSPAT00800List.ElementAt(i).completeAt)
                {
                    this.xing_CSPAT00800List.ElementAt(i).completeAt = false;
                    return(this.xing_CSPAT00800List.ElementAt(i));
                }
            }
            Xing_CSPAT00800 item800 = new Xing_CSPAT00800(mainForm);

            item800.completeAt = false;
            this.xing_CSPAT00800List.Add(item800);
            return(item800);
        }
Exemplo n.º 2
0
        }//btn_checkSell_Click END

        //취소
        private void button3_Click(object sender, EventArgs e)
        {
            Xing_CSPAT00800 xing_CSPAT00800 = CSPAT00600Mng.get800();

            xing_CSPAT00800.call_request(this.account, this.accountPw, "14074", "030270", "");
        }
Exemplo n.º 3
0
        }   // end function

        //미체결 주문취소
        public void orderCancle()
        {
            String 종목명;
            String 종목코드;
            String 주문번호;
            Double 미체결수량 = 0;
            Double 현재가격  = 0;
            String 매매구분;
            //현재시간.
            //String time = mainForm.xing_t0167.time;
            //if (time == "" || time == null) { time = "1530"; }//에러 안나게 기본값을 셋팅해준다.
            //int cTime = (int.Parse(time.Substring(0, 2)) * 60) + int.Parse(time.Substring(2, 2));//현재 시간


            //매수/매도 취소
            var varT0425VoList = from item in this.t0425VoList
                                 where item.qty != item.cheqty &&
                                 item.cancelOrdAt != "Y" &&   //주문취소 Y가 아닌거.
                                 item.ordermtd == "XING API" &&
                                 item.ordrem > 0
                                 select item;

            for (int i = 0; i < varT0425VoList.Count(); i++)
            {
                T0425Vo t0425Vo = varT0425VoList.ElementAt(i);
                종목명   = t0425Vo.hname;
                종목코드  = t0425Vo.expcode;
                주문번호  = t0425Vo.ordno;
                미체결수량 = t0425Vo.ordrem;
                현재가격  = t0425Vo.currentPrice;
                매매구분  = t0425Vo.medosu;
                //타임스펜
                //현재시간
                TimeSpan nowTimeSpan = TimeSpan.Parse(DateTime.Now.Hour + ":" + DateTime.Now.Minute + ":" + DateTime.Now.Second);
                // 주문시간
                TimeSpan ordTimeSpan = TimeSpan.Parse(t0425Vo.ordtime);
                double   타이머         = (nowTimeSpan.TotalSeconds - ordTimeSpan.TotalSeconds);
                if (매매구분.Equals("매수"))
                {
                    //Properties.Settings.Default.BUY_HO;
                    //Properties.Settings.Default.BUY_HO_CHANGE_TIMMER;
                    //Properties.Settings.Default.BUY_HO_CHANGE_SE;

                    if (타이머 > Double.Parse(Properties.Settings.Default.BUY_HO_CHANGE_TIMMER))
                    {
                        if (Properties.Settings.Default.BUY_HO_CHANGE_SE.Equals("주문취소"))
                        {
                            // 현물 취소 주문
                            //OrgOrdNo(원주문번호), IsuNo(종목번호), OrdQty(주문수량)
                            Xing_CSPAT00800 xing_CSPAT00800 = mainForm.CSPAT00600Mng.get800();
                            xing_CSPAT00800.call_request(mainForm.account, mainForm.accountPw, 주문번호, 종목코드, "");
                            orderAfterCall(t0425Vo, "취소");
                        }
                        else //시장가로정정
                             //호가 계산
                        {
                            if (!Properties.Settings.Default.BUY_HO.Equals("시장가"))
                            {
                                현재가격 = Util.getTickPrice(현재가격, double.Parse(Properties.Settings.Default.BUY_HO));
                            }

                            //OrgOrdNo(원주문번호), IsuNo(종목번호), OrdQty(주문수량),겨걱
                            Xing_CSPAT00700 xing_CSPAT00700 = mainForm.CSPAT00600Mng.get700();
                            xing_CSPAT00700.call_request(mainForm.account, mainForm.accountPw, 주문번호, 종목코드, 미체결수량, 현재가격);
                            orderAfterCall(t0425Vo, "정정");
                        }
                    }
                }

                if (매매구분.Equals("매도"))
                {
                    //Properties.Settings.Default.SELL_HO;
                    //Properties.Settings.Default.SELL_HO_CHANGE_TIMMER;
                    //Properties.Settings.Default.SELL_HO_CHANGE_SE;
                    if (타이머 > Double.Parse(Properties.Settings.Default.SELL_HO_CHANGE_TIMMER))
                    {
                        if (Properties.Settings.Default.SELL_HO_CHANGE_SE.Equals("주문취소"))
                        {
                            //취소 -OrgOrdNo(원주문번호), IsuNo(종목번호), OrdQty(주문수량)
                            Xing_CSPAT00800 xing_CSPAT00800 = mainForm.CSPAT00600Mng.get800();
                            xing_CSPAT00800.call_request(mainForm.account, mainForm.accountPw, 주문번호, 종목코드, "");
                            orderAfterCall(t0425Vo, "취소");
                        }
                        else    //시장가로정정
                        //호가 계산
                        {
                            if (!Properties.Settings.Default.SELL_HO.Equals("시장가"))
                            {
                                현재가격 = Util.getTickPrice(현재가격, double.Parse(Properties.Settings.Default.SELL_HO));
                            }
                            //OrgOrdNo(원주문번호), IsuNo(종목번호), OrdQty(주문수량),겨걱
                            Xing_CSPAT00700 xing_CSPAT00700 = mainForm.CSPAT00600Mng.get700();
                            xing_CSPAT00700.call_request(mainForm.account, mainForm.accountPw, 주문번호, 종목코드, 미체결수량, 현재가격);
                            orderAfterCall(t0425Vo, "정정");
                            //시간을 타이머 만큼 더해준다.
                            //ordtime = ordtime.Substring(0, 2) + ":" + ordtime.Substring(2, 2) + ":" + ordtime.Substring(4, 2);
                            //mainForm.grd_t0425.Rows[findIndex].Cells["ordtime"      ].Value = base.GetFieldData(  "t0425OutBlock1", "ordtime"    , i);  //주문시간
                            //mainForm.grd_t0425.Rows[findIndex].Cells["ordtime"].Value = ordtime; //주문시간
                        }
                    }
                }
            }
        }