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


C# Business.LogRequestSuper方法代码示例

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


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

示例1: AutoSuperDealerOpen

        /// <summary>
        /// 
        /// </summary>
        /// <param name="command"></param>
        /// <param name="digits"></param>
        internal void AutoSuperDealerOpen(Business.RequestDealer command, int digits)
        {
            ProcessQuoteLibrary.Business.BarTick barBid = new ProcessQuoteLibrary.Business.BarTick();
            barBid = this.GetCandlesTwoM(command.Request.Symbol.Name);
            barBid.High = Math.Round(barBid.High, digits);
            barBid.Low = Math.Round(barBid.Low, digits);
            barBid.HighAsk = Math.Round(barBid.HighAsk, digits);
            barBid.LowAsk = Math.Round(barBid.LowAsk, digits);

            //double spreadDifference = command.Request.Symbol.SpreadDifference;
            double spreadDifference = command.Request.SpreaDifferenceInOpenTrade;
            double spreadDefault = 0;

            for (int i = command.Request.Symbol.ParameterItems.Count - 1; i >= 0; i--)
            {
                if (command.Request.Symbol.ParameterItems[i].Code == "S013")
                {
                    double.TryParse(command.Request.Symbol.ParameterItems[i].NumValue, out spreadDefault);
                    break;
                }
            }

            int type = Business.Symbol.ConvertCommandIsBuySell(command.Request.Type.ID);
            if (type == 1)
            {
                ProcessQuoteLibrary.Business.BarTick barAsk = new ProcessQuoteLibrary.Business.BarTick();
                barAsk = barBid;
                double spreadDiff = Business.Symbol.ConvertNumberPip(digits, spreadDifference);
                double spreadDef = Business.Symbol.ConvertNumberPip(digits, spreadDefault);
                if (command.Request.Symbol.ApplySpread)
                {
                    double high = (double)barBid.High + (double)spreadDiff + (double)spreadDef;
                    barAsk.High = Math.Round(high, digits);
                    double low = (double)barBid.Low + (double)spreadDiff + (double)spreadDef;
                    barAsk.Low = Math.Round(low, digits);
                }
                else
                {
                    double high = (double)barBid.HighAsk + (double)spreadDiff;
                    barAsk.High = Math.Round(high, digits);
                    double low = (double)barBid.LowAsk + (double)spreadDiff;
                    barAsk.Low = Math.Round(low, digits);
                }

                if (barAsk.High >= command.Request.OpenPrice && command.Request.OpenPrice >= barAsk.Low)
                {
                    command.FlagConfirm = true;
                    command.Notice = "RD03";
                    //this.AddRequestDealerToInvestor(command);
                    command.Request.Symbol.MarketAreaRef.AddCommand(command.Request);
                    command.AgentCode = "system";
                    command.Answer = "Confirm";
                    TradingServer.Facade.FacadeSendNoticeManagerDealerRequest(command);
                    return;
                }
                else
                {
                    command.FlagConfirm = false;
                    command.Notice = "RD04";
                    this.AddRequestDealerToInvestor(command);
                    command.AgentCode = "system";
                    command.Answer = "Requote";
                    TradingServer.Facade.FacadeSendNoticeManagerDealerRequest(command);
                    TradingServer.Facade.FacadeAddNewSystemLog(3, "'" + command.Request.Investor.Code + "': system requote " + command.LogRequestSuper(barAsk.Low, barAsk.High), "Requote", "", "system");
                    return;
                }
            }
            else if (type == 2)
            {
                if (barBid.Low <= command.Request.OpenPrice && command.Request.OpenPrice <= barBid.High)
                {
                    command.FlagConfirm = true;
                    command.Notice = "RD06";
                    //this.AddRequestDealerToInvestor(command);
                    command.Request.Symbol.MarketAreaRef.AddCommand(command.Request);
                    command.AgentCode = "system";
                    command.Answer = "Confirm";
                    TradingServer.Facade.FacadeSendNoticeManagerDealerRequest(command);
                    return;
                }
                else
                {
                    command.FlagConfirm = false;
                    command.Notice = "RD07";
                    this.AddRequestDealerToInvestor(command);
                    command.AgentCode = "system";
                    command.Answer = "Requote";
                    TradingServer.Facade.FacadeSendNoticeManagerDealerRequest(command);
                    TradingServer.Facade.FacadeAddNewSystemLog(3, "'" + command.Request.Investor.Code + "': system requote " + command.LogRequestSuper(barBid.Low, barBid.High), "Requote", "", "system");
                    return;
                }
            }
        }
开发者ID:ngthanhducit,项目名称:TradingServer1502,代码行数:98,代码来源:Agent.Dealer.cs


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