当前位置: 首页>>代码示例>>C#>>正文


C# POrder.UpdateForRemain方法代码示例

本文整理汇总了C#中MadViper.POrder.UpdateForRemain方法的典型用法代码示例。如果您正苦于以下问题:C# POrder.UpdateForRemain方法的具体用法?C# POrder.UpdateForRemain怎么用?C# POrder.UpdateForRemain使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MadViper.POrder的用法示例。


在下文中一共展示了POrder.UpdateForRemain方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ElwArbSweepUnit

        public ElwArbSweepUnit(
            KospiOptionInfo koi,
            ElwInfo elwInfo,

            long optionCount,

            POrder optionOrder,
            POrder elwOrder, 

            STR_ElwArb parent)
        {
            try
            {
                // 이 생성자는 인수인계를 받을 때만 사용하도록 한다.
                // 주의한다.
                _state = State._5_Done;

                if (optionOrder.LongShort == elwOrder.LongShort)
                {
                    logger.Error("OptionOrder, ElwOrder same trading direction");
                    Util.KillWithNotice("OptionOrder, ElwOrder same trading direction");
                    throw new Exception();
                }

                OptionAccount = null;
                ElwAccount = null;

                long elwCount = ElwOptionUtil.ConvertOptionCountToElwCount(elwInfo, optionCount);

                OptionOrderGoal = new POrder(
                    TradingDirection.Short,
                    optionOrder.Code,
                    optionCount,
                    optionOrder.ReqPrice,
                    optionOrder.TargetAccount,
                    optionOrder.RMDClone,
                    MarketType._3_Default,
                    true);

                OptionOrderGoal.AddComment("ElwOptionSweeper.TakeOver.OptionOrderGoal");
                OptionOrderGoal.UpdateForRemain(OptionOrderGoal.ReqCount, OptionOrderGoal.InitReqPrice);

                ElwOrderGoal = new POrder(
                    TradingDirection.Long,
                    elwOrder.Code,
                    elwCount,
                    elwOrder.ReqPrice,
                    elwOrder.TargetAccount,
                    elwOrder.RMDClone,
                    MarketType._3_Default,
                    true);

                ElwOrderGoal.AddComment("ElwOptionSweeper.TakeOver.ElwOrderGoal");
                ElwOrderGoal.UpdateForRemain(ElwOrderGoal.ReqCount, ElwOrderGoal.InitReqPrice);

                ElwOrdersReal = new List<POrder>();
                OptionOrdersReal = new List<POrder>();

                POrder elwOrderReal = new POrder(ElwOrderGoal);

                elwOrderReal.AddComment("ElwOptionSweeper.TakeOver.elwOrderReal");
                elwOrderReal.UpdateForRemain(elwOrderReal.ReqCount, elwOrderReal.InitReqPrice);
                ElwOrdersReal.Add(elwOrderReal);

                POrder optionOrderReal = new POrder(OptionOrderGoal);

                optionOrderReal.AddComment("ElwOptionSweeper.TakeOver.optionOrderReal");
                optionOrderReal.UpdateForRemain(optionOrderReal.ReqCount, optionOrderReal.InitReqPrice);
                OptionOrdersReal.Add(optionOrderReal);

                _parent = parent;

                KOI = koi;

                Key = String.Format("{0};{1}", OptionOrderGoal.Code, ElwOrderGoal.Code);

                IsBodySweepQuickly = false;
            }
            catch (System.Exception ex)
            {
                logger.Error(ex.ToString());
                Util.KillWithNotice(ex.ToString());
            }
        }
开发者ID:HongSeokHwan,项目名称:legacy,代码行数:84,代码来源:ElwArbSweepUnit.cs

示例2: MakePOrder

        void MakePOrder()
        {
            foreach (RawPOrderData rpd in _elwRemains.Values)
            {
                RawMarketData rmd = RmdManager.Ins().GetData(rpd.Code);

                if (rmd == null)
                {
                    logger.Warn(String.Format("{0} code does not exist. is is ok the day after maturity", rpd.Code));
                    continue;
                }

                POrder o = new POrder(TradingDirection.Long, rpd.Code, rpd.ReqCount, rpd.ReqPrice, _account, rmd);
                o.AddComment("ADHR_SPOT");
                o.OrderNumber = 0;
                o.UpdateForRemain(rpd.ReqCount, rpd.ReqPrice);

                _remainPOrders.Add(o);
            }
        }
开发者ID:HongSeokHwan,项目名称:legacy,代码行数:20,代码来源:PB_RemainLoader_Spot.cs

示例3: RegisterAsAllContract

        // 이 함수는 신중하게 불러야 한다.
        // 현재는 KBHTS의 경우 remain을 못 얻어오기 때문에 기존 포지션 정보를 파일에서 읽어오는 데에 사용한다.
        public void RegisterAsAllContract(POrder o)
        {
            Trace.Assert(o.Market != MarketType._3_Default);

            o.UpdateForRemain(o.ReqCount, o.ReqPrice);
            this.Hts.RegisterRemainFromAccount(o);
        }
开发者ID:HongSeokHwan,项目名称:legacy,代码行数:9,代码来源:Account.cs

示例4: _bizServer_ReceiveResult

        void _bizServer_ReceiveResult(int nRowSize, int nColSize)
        {
            try
            {
                if (_bDone)
                {
                    return;
                }

                _remainPOrders.Clear();

                // 결과 처리
                Array pArr = Array.CreateInstance(typeof(string), nRowSize, nColSize);
                _bizServer.GetRepeatResult(ref pArr);

                int rowCount = pArr.GetUpperBound(0);
                int colCount = pArr.GetUpperBound(1);

                if (rowCount == 0)
                {
                    logger.Warn(String.Format("No header info in account ({0})", _accountName));
                    _bDone = true;
                    return;
                }

                Dictionary<String, int> _dic = new Dictionary<string, int>();

                for (int iCol = 0; iCol <= colCount; iCol++)
                {
                    String name = Convert.ToString(pArr.GetValue(0, iCol)).Trim();
                    _dic.Add(name, iCol);
                }

                // 여기서 원하는 Col을 알아낸다.
                for (int iRow = 1; iRow <= rowCount; iRow++)
                {
                    String code = Convert.ToString(pArr.GetValue(iRow, _dic["종목코드"]));
                    String codeDescription = Convert.ToString(pArr.GetValue(iRow, _dic["종목명"]));
                    long contractedCount = Convert.ToInt64(pArr.GetValue(iRow, _dic["미결재수량"]));
                    int lsFlag = Convert.ToInt32(pArr.GetValue(iRow, _dic["매매구분"])); // 2가 매수, 1이 매도
                    double avgPrice = Convert.ToDouble(pArr.GetValue(iRow, _dic["평균매수가"]));
                    String curPriceFormPB = Convert.ToString(pArr.GetValue(iRow, _dic["현재가"]));

                    TradingDirection longShort = (lsFlag == 2) ? TradingDirection.Long : TradingDirection.Short;

                    //주문번호가 없다. 가라 주문번호를 준다.
                    RawMarketData rmd = RmdManager.Ins().GetData(code);

                    if (rmd != null)
                    {
                        POrder o = new POrder(longShort, code, contractedCount, avgPrice, _account, rmd);
                        o.OrderNumber = 0;
                        o.UpdateForRemain(contractedCount, avgPrice);
                        _remainPOrders.Add(o);
                    }
                    else
                    {
                        logger.Warn("{0}({1}) is not in RMD list", code, codeDescription);
                    }
                }
                // 모두 잘 받았다.

                logger.Info("{0}의 기존 잔고 정보를 모두 받았습니다.", _accountName);
                _bDone = true;
            }
            catch (System.Exception ex)
            {
                logger.Error(ex.ToString());
                Util.KillWithNotice(ex.ToString());
            }
        }
开发者ID:HongSeokHwan,项目名称:legacy,代码行数:71,代码来源:PB_RemainLoader_FO.cs


注:本文中的MadViper.POrder.UpdateForRemain方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。