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


C# KaiTrade类代码示例

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


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

示例1: ApplyDOMUpdate

        public void ApplyDOMUpdate(IProduct product, KaiTrade.Interfaces.IPXUpdate update)
        {
            try
            {

                KaiTrade.Interfaces.IDOM dom = _mnemonicDOM[product.Mnemonic];
                if (dom == null)
                {
                    // must have a least a price
                    decimal? initPx = null;
                    if (update.BidPrice.HasValue)
                    {
                        initPx = update.BidPrice;
                    }
                    else if (update.OfferPrice.HasValue)
                    {
                        initPx = update.OfferPrice;
                    }
                    else if (update.TradePrice.HasValue)
                    {
                        initPx = update.TradePrice;
                    }
                    if (initPx.HasValue)
                    {
                        dom = GetProductDOM(product, initPx.Value);

                    }
                }
                dom.Update(update);

            }
            catch
            {
            }
        }
开发者ID:junwin,项目名称:TradingTools,代码行数:35,代码来源:MemoryPriceHandler.cs

示例2: SetRangeType

 public void SetRangeType(KaiTrade.Interfaces.TSRangeType rangeType)
 {
     foreach (TSQueryGroupTSDataSet dataSet in TsQueryGroup.TSDataSet)
     {
         dataSet.RangeType = (byte) rangeType;
     }
 }
开发者ID:junwin,项目名称:TradingTools,代码行数:7,代码来源:TSGroupTool.cs

示例3: CancelRequestData

        public CancelRequestData(crrType type, KaiTrade.Interfaces.ICancelOrderRequest cancelRequest)
        {
            _cancelRequest = cancelRequest;
            if(_cancelRequest == null)
            {
                Exception myE = new Exception("a non null cancel request must be supplied");
                throw myE;
            }

            Mnemonic = cancelRequest.Mnemonic;

            _lastChangeTicks = DateTime.Now.Ticks;

            if(_cancelRequest.ClOrdID.Length == 0 )
            {
                Exception myE = new Exception("a clordid must be specified on a cancelOrder");
                throw myE;
            }
            if (_cancelRequest.OrigClOrdID.Length == 0)
            {
                Exception myE = new Exception("a original clordid must be specified on a cancelOrder");
                throw myE;
            }
            ClOrdID = cancelRequest.ClOrdID;
            OrigClOrdID = cancelRequest.OrigClOrdID;
            CRRType = crrType.cancel;
        }
开发者ID:junwin,项目名称:TradingTools,代码行数:27,代码来源:ReplaceData.cs

示例4: UpdateVenue

        public void UpdateVenue(KaiTrade.Interfaces.IVenue myVenue)
        {
            try
                {
                    using (K2DataObjects.DataContext db = Factory.Instance().GetDSContext())
                    {
                        var venue = db.Venues.Where(s => s.Name == myVenue.Name).FirstOrDefault();
                        venue.AccountNumber = myVenue.AccountNumber;
                        venue.Code = myVenue.Code;
                        venue.DataFeedVenue = myVenue.DataFeedVenue;
                        venue.DefaultCFICode = myVenue.DefaultCFICode;
                        venue.DefaultCurrencyCode = myVenue.DefaultCurrencyCode;
                        venue.DefaultSecurityExchange = myVenue.DefaultSecurityExchange;
                        venue.DriverCode = myVenue.DriverCode;
                        venue.TargetVenue = myVenue.TargetVenue;
                        venue.UseSymbol = myVenue.UseSymbol;

                        db.SubmitChanges();
                    }

                }
                catch (Exception myE)
                {

                    m_Log.Error("Update Venue", myE);
                }
        }
开发者ID:junwin,项目名称:TradingTools,代码行数:27,代码来源:K2VenueDS.cs

示例5: GetCurveValue

 /// <summary>
 /// Gets the curve values contained in a TSItem
 /// </summary>
 /// <returns>
 /// The curve value.
 /// </returns>
 /// <param name='tsItem'>
 /// Ts item.
 /// </param>
 public static K2DataObjects.CurveValue[] GetCurveValue(KaiTrade.Interfaces.ITSItem tsItem)
 {
     if (tsItem.CurveValues.Length > 0)
     {
         K2DataObjects.CurveValue[] curveVals = new K2DataObjects.CurveValue[tsItem.CurveValues.Length];
         int i = 0;
         foreach (var parm in tsItem.CurveValues)
         {
             try
             {
                 K2DataObjects.CurveValue cv = new K2DataObjects.CurveValue();
                 cv.Mnemonic = tsItem.Mnemonic;
                 cv.HeaderID = parm.ParameterName;
                 cv.TimeStamp = tsItem.TimeStamp.Ticks;
                 cv.ItemType = (int)tsItem.ItemType;
                 cv.ItemSize = 1;
                 cv.RequestID = "1";
                 cv.Value = decimal.Parse(parm.ParameterValue);
                 curveVals[i++] = cv;
             }
             catch (Exception ex)
             {
             }
         }
         return curveVals;
     }
     return null;
 }
开发者ID:junwin,项目名称:TradingTools,代码行数:37,代码来源:BarDataUtils.cs

示例6: PriceUpdate

 public void PriceUpdate(KaiTrade.Interfaces.IPXUpdate pxUpdate)
 {
     if (_priceHandler != null)
     {
         _priceHandler.ApplyPriceUpdate(pxUpdate);
     }
 }
开发者ID:junwin,项目名称:TradingTools,代码行数:7,代码来源:OrderTest.cs

示例7: ProductUpdate

 public void ProductUpdate(string updateType, KaiTrade.Interfaces.IProduct product)
 {
     if (product != null)
     {
         string jsonData = JsonConvert.SerializeObject(product);
         rmqHelper.Publish("", product);
     }
 }
开发者ID:junwin,项目名称:TradingTools,代码行数:8,代码来源:Form1.cs

示例8: OnBarUpdate

 public void OnBarUpdate(string requestID, KaiTrade.Interfaces.ITSItem[] bars)
 {
     if (bars.Length > 0)
     {
         //rmqHelper.Publish("IBM", tsi);
         rmqPub.Publish("", bars);
     }
 }
开发者ID:junwin,项目名称:TradingTools,代码行数:8,代码来源:Form1.cs

示例9: addProductPriceFile

 private void addProductPriceFile(string filepath, KaiTrade.Interfaces.IProduct prod, int interval, bool runRealTime, bool repeatOnEnd, bool playOnSubscribe)
 {
     try
     {
         m_Simulator.AddPriceFile(prod.Mnemonic, filepath, interval, runRealTime, repeatOnEnd, playOnSubscribe);
     }
     catch (Exception myE)
     {
     }
 }
开发者ID:junwin,项目名称:TradingTools,代码行数:10,代码来源:SimulatorMainUI.cs

示例10: Add

 /// <summary>
 /// Add/replace a publisher to the manager
 /// </summary>
 /// <param name="myPub"></param>
 public void Add(KaiTrade.Interfaces.Publisher myPub)
 {
     if(m_PublisherMap.ContainsKey(myPub.TopicID()))
     {
         m_PublisherMap[myPub.TopicID()] = myPub;
     }
     else
     {
         m_PublisherMap.Add(myPub.TopicID(), myPub);
     }
 }
开发者ID:junwin,项目名称:TradingTools,代码行数:15,代码来源:PublisherMgr.cs

示例11: GetTrade

        /// <summary>
        /// Get a trade given the order
        /// </summary>
        /// <param name="o"></param>
        /// <returns></returns>
        public KaiTrade.Interfaces.ITrade GetTrade(KaiTrade.Interfaces.IOrder o)
        {
            K2DS.K2TradeDS tradeDS = new K2DS.K2TradeDS();
            IEnumerable<K2DataObjects.Trade> trades = tradeDS.GetTrade((o as K2DataObjects.Order));

            foreach(K2DataObjects.Trade t in trades)
            {
                return t;
            }
            return null;
        }
开发者ID:junwin,项目名称:TradingTools,代码行数:16,代码来源:Order.cs

示例12: InsertFill

 public void InsertFill(KaiTrade.Interfaces.IFill f)
 {
     try
     {
         K2DS.K2TradeDS tradeDS = new K2DS.K2TradeDS();
         tradeDS.InsertFill(f as K2DataObjects.Fill,true);
     }
     catch (Exception myE)
     {
     }
 }
开发者ID:junwin,项目名称:TradingTools,代码行数:11,代码来源:Trade.cs

示例13: InsertOrder

 public void InsertOrder(KaiTrade.Interfaces.IOrder o)
 {
     try
     {
         K2DS.K2OrderDS orderDS = new K2DS.K2OrderDS();
         orderDS.InsertOrder(o as K2DataObjects.Order, true);
     }
     catch (Exception myE)
     {
         m_Log.Error("InsertOrder", myE);
     }
 }
开发者ID:junwin,项目名称:TradingTools,代码行数:12,代码来源:Order.cs

示例14: recordMessage

 private void recordMessage(KaiTrade.Interfaces.IMessage message)
 {
     if (_messages == null)
     {
         _messages = new Dictionary<string, List<KaiTrade.Interfaces.IMessage>>();
     }
     if (!_messages.ContainsKey(message.Label))
     {
         _messages.Add(message.Label, new List<KaiTrade.Interfaces.IMessage>());
     }
     _messages[message.Label].Add(message);
 }
开发者ID:junwin,项目名称:TradingTools,代码行数:12,代码来源:StartStopTest.cs

示例15: PXUpdateBase

 public PXUpdateBase(KaiTrade.Interfaces.IProduct myProduct)
 {
     try
     {
         m_DataArray = new decimal?[KaiTrade.Interfaces.PXFields.MAXPXFIELDS];
         throw new Exception("Not Implimemnted");
         //this.From(myProduct.Mnemonic, myProduct.L1PX);
     }
     catch
     {
     }
 }
开发者ID:junwin,项目名称:TradingTools,代码行数:12,代码来源:PXUpdateBase.cs


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