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


C# FastQuant.Order类代码示例

本文整理汇总了C#中FastQuant.Order的典型用法代码示例。如果您正苦于以下问题:C# Order类的具体用法?C# Order怎么用?C# Order使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Order类属于FastQuant命名空间,在下文中一共展示了Order类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ExecutionMessage

 public ExecutionMessage(ExecutionMessage executionMessage) : base(executionMessage)
 {
     Id = executionMessage.Id;
     this.order = executionMessage.Order;
     OrderId = executionMessage.OrderId;
     ClOrderId = executionMessage.ClOrderId;
     ProviderOrderId = executionMessage.ProviderOrderId;
     this.instrument = executionMessage.Instrument;
     InstrumentId = executionMessage.InstrumentId;
     ClientId = executionMessage.ClientId;
     IsLoaded = executionMessage.IsLoaded;
     CurrencyId = executionMessage.CurrencyId;
     Fields = new ObjectTable(executionMessage.Fields);
 }
开发者ID:fastquant,项目名称:fastquant.dll,代码行数:14,代码来源:ExecutionMessage.cs

示例2: Register

        public void Register(Order order)
        {
            if (order.Id != -1)
            {
                Console.WriteLine($"OrderManager::Register Error Order is already registered : id = {order.Id}");
                return;
            }

            lock (this.obj)
                order.Id = this.counter++;

            if (this.framework.Mode == FrameworkMode.Realtime && string.IsNullOrEmpty(order.ClOrderId))
                order.ClOrderId = $"{this.framework.Clock.DateTime} {order.Id}";
        }
开发者ID:fastquant,项目名称:fastquant.dll,代码行数:14,代码来源:OrderManager.cs

示例3: OnOrder

        public override void OnOrder(Order order)
        {
            if (order.Text == "TakeProfit")
                order.OCA = (++OCACount).ToString();

            if (order.Text == "StopLoss")
                order.OCA = OCACount.ToString();

            if (order.Text == "StopLoss")
                stopLossOrder = order;

            if (order.Text == "StopExit" || order.Text == "StopSession")
                framework.OrderManager.Cancel(stopLossOrder);

            base.OnOrder(order);
        }
开发者ID:fastquant,项目名称:fastquant.dll,代码行数:16,代码来源:Program.cs

示例4: Cancel

        public void Cancel(Order order)
        {
            if (order.IsNotSent)
                throw new ArgumentException($"Can not cancel order that is not sent {order}");

            var command = new ExecutionCommand(ExecutionCommandType.Cancel, order)
            {
                DateTime = this.framework.Clock.DateTime,
                OrderId = order.Id,
                ClOrderId = order.ClOrderId,
                ProviderOrderId = order.ProviderOrderId,
                ProviderId = order.ProviderId,
                RouteId = order.RouteId,
                PortfolioId = order.PortfolioId
            };
            command.DateTime = order.DateTime;
            command.Instrument = order.Instrument;
            command.InstrumentId = order.InstrumentId;
            command.Provider = order.Provider;
            command.Portfolio = order.Portfolio;
            command.Side = order.Side;
            command.OrdType = order.Type;
            command.TimeInForce = order.TimeInForce;
            command.Price = order.Price;
            command.StopPx = order.StopPx;
            command.Qty = order.Qty;
            command.OCA = order.OCA;
            command.Text = order.Text;
            command.Account = order.Account;
            command.ClientID = order.ClientID;
            command.ClientId = order.ClientId;
            Messages.Add(command);
            order.OnExecutionCommand(command);
            this.framework.EventServer.OnExecutionCommand(command);
            if (IsPersistent)
                Server?.Save(command, -1);
            order.Provider.Send(command);
        }
开发者ID:fastquant,项目名称:fastquant.dll,代码行数:38,代码来源:OrderManager.cs

示例5: ExecutionCommand

 public ExecutionCommand(ExecutionCommandType type, Order order)
     : this()
 {
     Type = type;
     Order = order;
     OrderId = order.Id;
     ProviderId = order.ProviderId;
     RouteId = order.RouteId;
     AlgoId = order.AlgoId;
     PortfolioId = order.PortfolioId;
     InstrumentId = order.InstrumentId;
     TransactTime = order.TransactTime;
     DateTime = order.DateTime;
     Instrument = order.Instrument;
     Provider = order.Provider;
     Portfolio = order.Portfolio;
     Side = order.Side;
     OrdType = order.Type;
     TimeInForce = order.TimeInForce;
     ExpireTime = order.ExpireTime;
     Price = order.Price;
     StopPx = order.StopPx;
     Qty = order.Qty;
     MinQty = order.MinQty;
     PegDifference = order.PegDifference;
     ExecInst = order.ExecInst;
     OCA = order.OCA;
     Text = order.Text;
     Account = order.Account;
     ClientID = order.ClientID;
     Fields = new ObjectTable(order.Fields);
 }
开发者ID:fastquant,项目名称:fastquant.dll,代码行数:32,代码来源:ExecutionMessage.cs

示例6: OrderProcessor

        public OrderProcessor(SpreadSellSide strategy, ExecutionCommand command)
        {
            // Add current processor to SellSide processor's list. 
            strategy.processors.AddLast(this);

            // Init OrderProcessor fields.
            this.strategy = strategy;
            this.command = command;
            order = command.Order;
            spreadInstrument = order.Instrument;
            orders = new Dictionary<Order, Leg>();

            // Send leg orders if order type is market.
            if (order.Type == OrderType.Market)
                SendLegOrders();
        }
开发者ID:fastquant,项目名称:fastquant.dll,代码行数:16,代码来源:Program.cs

示例7: method_8

 private void method_8(Order order_0, Bid bid_0, Ask ask_0)
 {
 }
开发者ID:fastquant,项目名称:fastquant.dll,代码行数:3,代码来源:MatchingEngine.cs

示例8: method_6

 private void method_6(Order order_0)
 {
 }
开发者ID:fastquant,项目名称:fastquant.dll,代码行数:3,代码来源:MatchingEngine.cs

示例9: UpdateExitLimit

        private void UpdateExitLimit()
        {
            if (exitOrder != null && !exitOrder.IsDone)
                Cancel(exitOrder);

            if (HasPosition(Instrument))
            {
                if (Position.Side == PositionSide.Long)
                    exitOrder = SellLimitOrder(Instrument, Qty, sma.Last, "Exit");
                else
                    exitOrder = BuyLimitOrder(Instrument, Qty, sma.Last, "Exit");

                Send(exitOrder);
            }
        }
开发者ID:fastquant,项目名称:fastquant.dll,代码行数:15,代码来源:Program.cs


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