Exemplo n.º 1
0
 public void addNewOrder(string orderId, FDDLExecutionData exeData)
 {
     m_rawData[orderId] = exeData;
     if (m_mainList != null)
     {
         addToMainList(exeData);
     }
 }
Exemplo n.º 2
0
        private void thirdTrial(object sender, ElapsedEventArgs e)
        {
            var exeData = new FDDLExecutionData(m_stockName, OrderType.SELL, getQuantity(), getQuantity() - getAchieved());
            FDDLContractionEventCallback evcall = new FDDLContractionEventCallback(null, exeData, FDDLUIBinder.getAAfterWrapper());

            ContractionEventManager.addCallback("FDDL-ThirdSell", evcall);
            int res = ProgramControl.getGateway().SendOrder("FDDL-ThirdSell", Screens.SCREEN_FDDLORDER, SystemInfo.ACCOUNT, 2, getStockCode(), getQuantity(), getPrice(), "62", "");

            if (res != 0)
            {
                //Debug Log -> 리턴코드 값 / 리턴코드표 참고
            }
        }
Exemplo n.º 3
0
        private void addToMainList(FDDLExecutionData exeData)
        {
            ListViewItem lvi = new ListViewItem();

            lvi.Text = exeData.getStockName();
            string orderTypeStr = exeData.getOrderType() == OrderType.BUY ? "매수" : "매도";

            lvi.SubItems.Add(orderTypeStr);
            lvi.SubItems.Add(exeData.getQuantity().ToString());
            lvi.SubItems.Add(exeData.getOrderedQuantity().ToString());
            lvi.SubItems.Add(exeData.getAchieved().ToString());
            m_mainList.Items.Add(lvi);
        }
Exemplo n.º 4
0
        private void firstTrial(object sender, ElapsedEventArgs e)
        {
            var exeData = new FDDLExecutionData(m_stockName, OrderType.BUY, getQuantity(), getQuantity());
            FDDLContractionEventCallback evcall = new FDDLContractionEventCallback(this, exeData, FDDLUIBinder.getBeforeWrapper());

            ContractionEventManager.addCallback("FDDL-Before", evcall);
            int res = ProgramControl.getGateway().SendOrder("FDDL-Before", Screens.SCREEN_FDDLORDER, SystemInfo.ACCOUNT, 1, getStockCode(), getQuantity(), 0, "61", "");

            if (res != 0)
            {
                //Debug Log -> 리턴코드 값 / 리턴코드표 참고
            }
        }
Exemplo n.º 5
0
        private void secondTrial(object sender, ElapsedEventArgs e)
        {
            int orderQuantity = getQuantity() - getAchieved();
            var exeData       = new FDDLExecutionData(m_stockName, OrderType.BUY, getQuantity(), orderQuantity);
            FDDLContractionEventCallback evcall = new FDDLContractionEventCallback(this, exeData, FDDLUIBinder.getRegularWrapper());

            ContractionEventManager.addCallback("FDDL-Regular", evcall);
            int res = ProgramControl.getGateway().SendOrder("FDDL-Regular", Screens.SCREEN_FDDLORDER, SystemInfo.ACCOUNT, 1, getStockCode(), orderQuantity, getPrice(), "00", "");

            if (res != 0)
            {
                //Debug Log -> 리턴코드 값 / 리턴코드표 참고
            }
        }
Exemplo n.º 6
0
        public void addNewContracted(string orderId, int price, int quantity)
        {
            m_rawData[orderId].addContracted(price, quantity);

            FDDLExecutionData data = m_rawData[orderId];

            if (m_mainList != null)
            {
                updateMainList(data.getStockName(), data.getAchieved());
            }
            if (m_subList != null)
            {
                addToSubList(price, quantity);
            }
        }
Exemplo n.º 7
0
        public void eventCallback(TrInfoWrapper wrapper)
        {
            int ep = int.Parse(wrapper.getData("현재가", 0));

            if (ep <= m_parent.getPrice())
            {
                int orderQuantity = m_parent.getQuantity() - m_parent.getAchieved();
                var exeData       = new FDDLExecutionData(m_parent.getStockName(), OrderType.BUY, m_parent.getQuantity(), orderQuantity);
                FDDLContractionEventCallback evcall = new FDDLContractionEventCallback(m_parent, exeData, FDDLUIBinder.getAfterWrapper());
                ContractionEventManager.addCallback("FDDL-AfterOrder", evcall);
                int res = ProgramControl.getGateway().SendOrder("FDDL-AfterOrder", Screens.SCREEN_FDDLORDER, SystemInfo.ACCOUNT, 1, m_parent.getStockCode(), orderQuantity, 0, "81", "");
                if (res != 0)
                {
                    //Debug Log -> 리턴코드 값 / 리턴코드표 참고
                }
            }
        }
 public FDDLContractionEventCallback(ScheduledExecution plan, FDDLExecutionData exeData, FDDLUIWrapper uiWrapper)
 {
     m_plan      = plan;
     m_exeData   = exeData;
     m_uiWrapper = uiWrapper;
 }