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


C# POrder.ConvertOverPriceToInRMDPriceIfNotZero方法代码示例

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


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

示例1: RequestInitOrder

        void RequestInitOrder(POrder goalOrder, List<POrder> realOrders)
        {
            POrder o = new POrder(goalOrder);
            o.AddComment(String.Format("EOS#({0}), GoalOrder", CurID));
            o.SetAsLegalPrice();
            o.ConvertOverPriceToInRMDPriceIfNotZero();

            POrderUtil.RequestOrder(o, realOrders);
        }
开发者ID:HongSeokHwan,项目名称:legacy,代码行数:9,代码来源:ElwArbSweepUnit.cs

示例2: ReqOrderStepBehindPart

        void ReqOrderStepBehindPart(POrder goal, List<POrder> real, double targetExposurePercent, RawMarketData rmd)
        {
            double curExposurePercent = GetCurExposurePercent(goal, real);

            double diffExposure = targetExposurePercent - curExposurePercent;
            if (diffExposure <= 0)
            {
                return;
            }

            long goalCount = POrderUtil.GetSignedReqCount(goal);
            long reqCount = (long)(Math.Round(diffExposure * goalCount / 100, 0));
            long curCount = POrderUtil.GetSignedMaxPossibleExposureCount(real);

            if (Math.Abs(goalCount) < Math.Abs(reqCount + curCount))
            {
                //reqCount = goalCount - curCount;
                logger.Error("({0}, {1}, {2})", reqCount, goalCount, curCount);
                Util.KillWithNotice("error");
                return;
            }

            if (reqCount != 0)
            {
                reqCount = Math.Abs(reqCount);

                if (goal.TargetAccount.LineType == Account.OrderLineType.StockSpotLine)
                {
                    reqCount = ElwUtil.RoundElwCount(reqCount);
                }

                POrder o = new POrder(
                                goal.LongShort,
                                goal.Code,
                                reqCount,
                                goal.ReqPrice,
                                goal.TargetAccount,
                                rmd);

                o.AddComment(String.Format("EOS#({0}), StepBehindPart, {1}", CurID, o.Code));
                o.SetAsLegalPrice();
                o.ConvertOverPriceToInRMDPriceIfNotZero();

                POrderUtil.RequestOrder(o, real);
            }
        }
开发者ID:HongSeokHwan,项目名称:legacy,代码行数:46,代码来源:ElwArbSweepUnit.cs

示例3: MakeOrder_Raw

        Boolean MakeOrder_Raw(RawMarketData rmd, long remainCount100k, Dictionary<String, long> blocksLB, ref List<POrder> newOrders, ref String log)
        {
            if (remainCount100k == 0)
            {
                log += "remainCount100k == 0";
                return true;
            }

            long signedRealCount = ElwOptionUtil.Convert100KToRealCount(rmd.Code, remainCount100k);

            if (signedRealCount == 0 || remainCount100k - ElwOptionUtil.ConvertRealToCount100k(rmd.Code, signedRealCount) != 0)
            {
                log += String.Format("signRealCount({0}) remainCount100k({1}) code({2})|", signedRealCount, remainCount100k, rmd.Code);
                return false;
            }

            long reqCount = Math.Abs(signedRealCount);

            TradingDirection ls = TradingDirection.Long;
            if (signedRealCount < 0)
            {
                ls = TradingDirection.Short;

                if (!blocksLB.ContainsKey(rmd.Code))
                {
                    log += String.Format("[22], {0}|", rmd.Code);

                    return false;
                }

                if (blocksLB[rmd.Code] < Math.Abs(signedRealCount))
                {
                    log += String.Format("[23] BlockLB[{2}]({0}) < signedRealCount({1})", blocksLB[rmd.Code], signedRealCount, rmd.Code);
                    return false;
                }

                reqCount = Math.Abs(signedRealCount);
                long tmp = ProductUtil.Ins().RoundProductCount(Math.Abs(reqCount), rmd.DPT);

                if (tmp != reqCount)
                {
                    logger.Error("tmp({0}) != reqCount({1}) in MakeOrder_Raw", tmp, reqCount);
                    Util.KillWithNotice("tmp != reqCount in MakeOrder_Raw");
                }
            }

            Account account = _accountFO;
            if (rmd.DPT == Detail.ProductType.ELW || rmd.DPT == Detail.ProductType.Stock)
            {
                account = _accountSpot;
            }

            double price = ProductUtil.Ins().GetMidPrice(rmd);
            price = AdjustPrice(ls, rmd, price);

            POrder o = new POrder(ls, rmd.Code, reqCount, price, account, rmd);
            o.AddComment("SweepUnit_OE.MakeOrder_Raw");

            log += String.Format("[23], {0}|", o.ToString());

            if (o.ReqCount > 0)
            {
                // 여기서 Reserve하고 법적 문제가 있는지 확인한다.
                o.SetAsLegalPrice();
                o.ConvertOverPriceToInRMDPriceIfNotZero();

                log += String.Format("[24], {0}|", o.ToString());

                newOrders.Add(o);
            }
            else
            {
                o.Free();

                log += String.Format("[24], ReqCount <= 0");
                return false;
            }

            long ret = remainCount100k - ElwOptionUtil.ConvertRealToCount100k(rmd.Code, signedRealCount);

            if (ret != 0)
            {
                logger.Error(
                    "CRITICAL ERROR!!! in MakeOrder_Raw ret != 0 ret({0}), remainCount100k({1}), signedRealCount({2}), Code({3})",
                    ret,
                    remainCount100k,
                    signedRealCount,
                    rmd.Code);
                Util.KillWithNotice("CRITICAL ERROR!!! in MakeOrder_Raw");

                return false;
            }

            return true;
        }
开发者ID:HongSeokHwan,项目名称:legacy,代码行数:95,代码来源:XXX_SweepUnit_OE.cs

示例4: RequestOrder_Raw

        // 주문을 하고 정해놓은 컨테이너에 담는 역할을 수행한다.
        void RequestOrder_Raw(POrder order, List<POrder> container)
        {
            try
            {
                order.SetAsLegalPrice();
                order.ConvertOverPriceToInRMDPriceIfNotZero();

                Boolean bSuccess = true;
                if (order.TargetAccount.LineType == Account.OrderLineType.StockSpotLine)
                {
                    Trace.Assert(false);
                }
                else if (order.TargetAccount.LineType == Account.OrderLineType.FutureOptionSpreadLine)
                {
                    bSuccess = order.TargetAccount.RequestOrder(order);
                }
                else
                {
                    logger.Error("{0} unsupported ProductType", order.TargetAccount.LineType);
                    Util.KillWithNotice("unsupported ProductType");
                    Trace.Assert(false);
                }

                if (!bSuccess)
                {
                    logger.Error(order.ToString());
                    Util.KillWithNotice(order.ToString());
                    _State = State._0_Exception;
                    SoundManager.Ins().PlayExceptionSound();
                    ShowState();
                }
                else
                {
                    // 성공했으면 담는다.
                    container.Add(order);
                }
            }
            catch (System.Exception ex)
            {
                logger.Error(ex.ToString());
                Util.KillWithNotice(ex.ToString());
            }
        }
开发者ID:HongSeokHwan,项目名称:legacy,代码行数:44,代码来源:XXX_SweepUnit_FO.cs

示例5: RequestOrder_Raw

        void RequestOrder_Raw(POrder order, List<POrder> container)
        {
            try
            {
                order.SetAsLegalPrice();
                order.ConvertOverPriceToInRMDPriceIfNotZero();

                Boolean bSuccess = true;
                bSuccess = order.TargetAccount.RequestOrder(order);

                if (!bSuccess)
                {
                    logger.Error("{0} order error", order.ToString());
                    Util.KillWithNotice("order error");
                    _State = State._0_Exception;
                    SoundManager.Ins().PlayExceptionSound();
                    ShowState();
                }
                else
                {
                    // 성공했으면 담는다.
                    container.Add(order);
                }
            }
            catch (System.Exception ex)
            {
                logger.Error(ex.ToString());
                Util.KillWithNotice(ex.ToString());
            }
        }
开发者ID:HongSeokHwan,项目名称:legacy,代码行数:30,代码来源:XXX_SweepUnit_OE.cs


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