Ejemplo n.º 1
0
        private void UpdateSellAutoTradingDataGridStatePrice(string orderNum, string conclusionPrice)
        {
            coreEngine.SendLogWarningMessage("요청 주문 넘버 : " + orderNum);
            foreach (TradingStrategy ts in tradingStrategyList)
            {
                foreach (var item in ts.tradingItemList)
                {
                    coreEngine.SendLogWarningMessage("검색식 : " + ts.buyCondition.Name + " 종목명 : " + axKHOpenAPI1.GetMasterCodeName(item.itemCode) + "orderNum : " + item.sellOrderNum);
                }

                TradingItem tradeItem = ts.tradingItemList.Find(o => o.sellOrderNum.Equals(orderNum));
                if (tradeItem != null)
                {
                    tradeItem.GetUiConnectRow().Cells["매매진행_진행상황"].Value = TradingItem.StateToString(tradeItem.state);
                    tradeItem.GetUiConnectRow().Cells["매매진행_매도가"].Value  = conclusionPrice;
                    tradeItem.GetUiConnectRow().Cells["매매진행_매도시간"].Value = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                }
            }
        }
Ejemplo n.º 2
0
 private void UpdateBuyAutoTradingDataGridState(string itemCode)
 {
     foreach (TradingStrategy ts in tradingStrategyList)
     {
         coreEngine.SendLogWarningMessage("ui update" + ts.buyCondition.Name);
         List <TradingItem> tradeItemArray = ts.tradingItemList.FindAll(o => o.itemCode.Equals(itemCode));
         foreach (TradingItem tradeItem in tradeItemArray)
         {
             if (tradeItem != null)
             {
                 coreEngine.SendLogWarningMessage("tradeItem uid" + tradeItem.Uid);
                 tradeItem.GetUiConnectRow().Cells["매매진행_진행상황"].Value = TradingItem.StateToString(tradeItem.state);
                 tradeItem.GetUiConnectRow().Cells["매매진행_매수가"].Value  = tradeItem.buyingPrice;
                 tradeItem.GetUiConnectRow().Cells["매매진행_매수량"].Value  = tradeItem.curQnt;
                 tradeItem.GetUiConnectRow().Cells["매매진행_매수금"].Value  = tradeItem.curQnt * tradeItem.buyingPrice;
                 break;
             }
         }
     }
 }
Ejemplo n.º 3
0
 private void UpdateBuyAutoTradingDataGridState(string orderNum, bool buyComplete = false)
 {
     foreach (TradingStrategy ts in tradingStrategyList)
     {
         coreEngine.SendLogWarningMessage(ts.buyCondition.Name);
         TradingItem tradeItem = ts.tradingItemList.Find(o => o.buyOrderNum.Equals(orderNum));
         foreach (var item in ts.tradingItemList)
         {
             coreEngine.SendLogWarningMessage(item.itemName + " 요청 주문 넘버 : " + orderNum);
         }
         if (tradeItem != null)
         {
             tradeItem.GetUiConnectRow().Cells["매매진행_진행상황"].Value = TradingItem.StateToString(tradeItem.state);
             tradeItem.GetUiConnectRow().Cells["매매진행_매수가"].Value  = tradeItem.buyingPrice;
             tradeItem.GetUiConnectRow().Cells["매매진행_매수량"].Value  = tradeItem.curQnt;
             tradeItem.GetUiConnectRow().Cells["매매진행_매수금"].Value  = tradeItem.curQnt * tradeItem.buyingPrice;
             break;
         }
     }
 }