本文整理汇总了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
{
}
}
示例2: SetRangeType
public void SetRangeType(KaiTrade.Interfaces.TSRangeType rangeType)
{
foreach (TSQueryGroupTSDataSet dataSet in TsQueryGroup.TSDataSet)
{
dataSet.RangeType = (byte) rangeType;
}
}
示例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;
}
示例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);
}
}
示例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;
}
示例6: PriceUpdate
public void PriceUpdate(KaiTrade.Interfaces.IPXUpdate pxUpdate)
{
if (_priceHandler != null)
{
_priceHandler.ApplyPriceUpdate(pxUpdate);
}
}
示例7: ProductUpdate
public void ProductUpdate(string updateType, KaiTrade.Interfaces.IProduct product)
{
if (product != null)
{
string jsonData = JsonConvert.SerializeObject(product);
rmqHelper.Publish("", product);
}
}
示例8: OnBarUpdate
public void OnBarUpdate(string requestID, KaiTrade.Interfaces.ITSItem[] bars)
{
if (bars.Length > 0)
{
//rmqHelper.Publish("IBM", tsi);
rmqPub.Publish("", bars);
}
}
示例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)
{
}
}
示例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);
}
}
示例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;
}
示例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)
{
}
}
示例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);
}
}
示例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);
}
示例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
{
}
}