本文整理汇总了C#中OrderType类的典型用法代码示例。如果您正苦于以下问题:C# OrderType类的具体用法?C# OrderType怎么用?C# OrderType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OrderType类属于命名空间,在下文中一共展示了OrderType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ExecuteOrder
public NewOrderResponse ExecuteOrder(OrderSymbol symbol, decimal amount, decimal price, OrderExchange exchange, OrderSide side, OrderType type)
{
NewOrderRequest req = new NewOrderRequest(Nonce, symbol, amount, price, exchange, side, type);
string response = SendRequest(req,"POST");
NewOrderResponse resp = NewOrderResponse.FromJSON(response);
return resp;
}
开发者ID:romkatv,项目名称:BitfinexAPI,代码行数:7,代码来源:BitfinexApi.cs
示例2: GetLibraryList
public static async Task GetLibraryList(
Action<LibraryList> onSuccess,
Action<Error> onFail,
int channelId,
OrderType orderType = OrderType.LASTEST,
Dictionary<string, string> filters = null,
int pageCount = 1,
int pageSize = 20)
{
string methodName = "getLibraryList";
MGDataLoader<LibraryList> loader = new MGDataLoader<LibraryList>(CATEGORY, methodName);
loader.AddParameter("channelId", channelId.ToString());
loader.AddParameter("pageCount", pageCount.ToString());
loader.AddParameter("pageSize", pageSize.ToString());
loader.AddParameter("orderType", orderType.ToString());
if(filters != null)
{
foreach (KeyValuePair<string, string> kv in filters)
{
loader.AddParameter(kv.Key, kv.Value);
}
}
await loader.LoadDataAsync(onSuccess, onFail);
}
开发者ID:Yardley999,项目名称:MGTV,代码行数:28,代码来源:ChannelAPI.cs
示例3: AIControlMobileTarget
public AIControlMobileTarget( BaseAI ai, OrderType order ) : base( -1, false, ( order == OrderType.Attack ? TargetFlags.Harmful : TargetFlags.None ) )
{
m_List = new List<BaseAI>();
m_Order = order;
AddAI( ai );
}
开发者ID:Godkong,项目名称:RunUO,代码行数:7,代码来源:AIControlMobileTarget.cs
示例4: WeRefundRequest
public WeRefundRequest(OrderType orderType, string orderId, string outRefundNo, int totalFee, int refundFee)
: this()
{
TkDebug.AssertArgumentNullOrEmpty(orderId, "orderId", null);
TkDebug.AssertArgumentNullOrEmpty(outRefundNo, "outRefundNo", null);
switch (orderType)
{
case OrderType.TransactionId:
TransactionId = orderId;
break;
case OrderType.OutTradeNo:
OutTradeNo = orderId;
break;
case OrderType.OutRefundNo:
case OrderType.RefundId:
TkDebug.ThrowToolkitException(string.Format(ObjectUtil.SysCulture,
"当前不支持{0}这种枚举,请确认", orderType), null);
break;
}
OutRefundNo = outRefundNo;
TotalFee = totalFee;
RefundFee = refundFee;
OpUserId = MchId;
}
开发者ID:ZLLselfRedeem,项目名称:zllinmitu,代码行数:26,代码来源:WeRefundRequest.cs
示例5: NewOrderSingle
/// <summary>
/// Create a NewOrderSingle message.
/// </summary>
/// <param name="customFields"></param>
/// <param name="orderType"></param>
/// <param name="side"></param>
/// <param name="symbol"></param>
/// <param name="orderQty"></param>
/// <param name="tif"></param>
/// <param name="price">ignored if orderType=Market</param>
/// <returns></returns>
static public QuickFix.FIX42.NewOrderSingle NewOrderSingle(
Dictionary<int,string> customFields,
OrderType orderType, Side side, string symbol,
int orderQty, TimeInForce tif, decimal price)
{
// hard-coded fields
QuickFix.Fields.HandlInst fHandlInst = new QuickFix.Fields.HandlInst(QuickFix.Fields.HandlInst.AUTOMATED_EXECUTION_ORDER_PRIVATE);
// from params
QuickFix.Fields.OrdType fOrdType = FixEnumTranslator.ToField(orderType);
QuickFix.Fields.Side fSide = FixEnumTranslator.ToField(side);
QuickFix.Fields.Symbol fSymbol = new QuickFix.Fields.Symbol(symbol);
QuickFix.Fields.TransactTime fTransactTime = new QuickFix.Fields.TransactTime(DateTime.Now);
QuickFix.Fields.ClOrdID fClOrdID = GenerateClOrdID();
QuickFix.FIX42.NewOrderSingle nos = new QuickFix.FIX42.NewOrderSingle(
fClOrdID, fHandlInst, fSymbol, fSide, fTransactTime, fOrdType);
nos.OrderQty = new QuickFix.Fields.OrderQty(orderQty);
nos.TimeInForce = FixEnumTranslator.ToField(tif);
if (orderType == OrderType.Limit)
nos.Price = new QuickFix.Fields.Price(price);
// add custom fields
foreach (KeyValuePair<int,string> p in customFields)
nos.SetField(new QuickFix.Fields.StringField(p.Key, p.Value));
return nos;
}
开发者ID:cbusbey,项目名称:qfn_uidemo,代码行数:40,代码来源:MessageCreator42.cs
示例6: Sort
public static void Sort(List<FriendInfo> infos, OrderType orderType)
{
if(infos == null || infos.Count <= 1)
{
return;
}
switch(orderType)
{
case OrderType.Atk:
{
infos.Sort(CompareFriendByAtk);
break;
}
case OrderType.Level:
{
infos.Sort(CompareFriendByLevel);
break;
}
case OrderType.MaxDamage:
{
infos.Sort(CompareFriendByMaxHit);
break;
}
}
}
开发者ID:wuxin0602,项目名称:Nothing,代码行数:25,代码来源:FriendUtils.cs
示例7: Order
public Order(OrderType type, string symbol, decimal limitPrice, decimal quantity)
{
Type = type;
Symbol = symbol;
Price = limitPrice;
Quantity = quantity;
}
开发者ID:KNeal,项目名称:EtradeAlloc,代码行数:7,代码来源:Order.cs
示例8: OrdersButton
public OrdersButton(List<Ship> shiplist, Vector2 Location, OrderType ot, int tipid)
{
this.ID_tip = tipid;
this.ShipList = shiplist;
this.orderType = ot;
this.clickRect = new Rectangle((int)Location.X, (int)Location.Y, 48, 48);
}
开发者ID:castroev,项目名称:StardriveBlackBox-verRadicalElements-,代码行数:7,代码来源:OrdersButton.cs
示例9: GetNextOrder
public async Task<TransactionExportResponse> GetNextOrder(OrderType orderType = OrderType.OutletToDistributor, DocumentStatus documentStatus = DocumentStatus.Closed)
{
HttpClient client = MiddlewareHttpClient;
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
try
{
string urlSuffix = client.BaseAddress + "api/new/Integration/GetNextOrderToExport?username={0}&password={1}&orderType={2}&documentStatus={3}";
string url = string.Format(urlSuffix, _userName,_otherUtilities.MD5Hash(_password), orderType, documentStatus);
var response = client.GetAsync(url).Result;
TransactionExportResponse _response = response.Content.ReadAsAsync<TransactionExportResponse>().Result;
if (_response == null)
{
return new TransactionExportResponse() { Success = false };
}
return _response;
}
catch (Exception ex)
{
return new TransactionExportResponse { Info = ex.Message };
}
}
开发者ID:asanyaga,项目名称:BuildTest,代码行数:26,代码来源:TransactionsDownloadService.cs
示例10: SendNewOrderRequest
public virtual RequestStatus SendNewOrderRequest(Account account,
MarketOrder order,
OrderType orderType,
decimal requestedPrice,
decimal slippagePoints)
{
order.State = PositionState.Opened;
order.TimeEnter = DateTime.Now;
//if (magic.HasValue)
// order.ExpertComment = comment;
//else
// order.Comment = comment;
// подставить текущую цену
var quote = QuoteStorage.Instance.ReceiveValue(order.Symbol);
if (quote == null)
return RequestStatus.NoPrice;
order.PriceEnter = order.Side > 0 ? quote.ask : quote.bid;
// проверить проскальзывание
if (slippagePoints != 0)
{
var slippageAbs = DalSpot.Instance.GetAbsValue(order.Symbol, slippagePoints);
var delta = Math.Abs(order.PriceEnter - (float)requestedPrice);
if (delta > (float)slippageAbs) return RequestStatus.Slippage;
}
int posID;
// сохранить ордер (и уведомить клиента)
var result = ServerInterface.SaveOrderAndNotifyClient(order, out posID);
return result ? RequestStatus.OK : RequestStatus.SerializationError;
}
开发者ID:johnmensen,项目名称:TradeSharp,代码行数:31,代码来源:DemoDealer.cs
示例11: GetAutoPlacedOrderName
protected string GetAutoPlacedOrderName(OrderType orderType, OrderSide orderSide, string info, string instrument, int retrials, string ibAccountNumber)
{
if (string.IsNullOrEmpty(info))
return string.Format("ACCT: {4} -- {0}: {1} order for {2} [#{3}]", orderType, orderSide, instrument, retrials, ibAccountNumber);
else
return string.Format("ACCT: {5} -- {0}: {1} ({2}) order {3} [#{4}]", orderType, orderSide, info, instrument, retrials, ibAccountNumber);
}
开发者ID:aggarwalmanuj,项目名称:open-quant,代码行数:7,代码来源:BaseStrategy.Public.Methods.cs
示例12: TableOrColumnName
public TableOrColumnName(IAstNode preNode, string originalValue)
: base(preNode, originalValue)
{
// SQLが成立していないとき
if (ParentNode == null || ParentNode.ParentNode == null)
{
Order = OrderType.Unknown;
throw new Exception("SQLが成立していません");
}
// 定義の親がStatementでその親が予約語
if (ParentNode.ParentNode.GetType() == typeof (ReservedTopLevel))
{
string reservedWord = ParentNode.ParentNode.OriginalValue;
Match m = _regex.Match(reservedWord);
if (m.Success)
{
// FROMやUPDATEなど、カラム名称が定義されない予約語ならテーブル名
Order = OrderType.Table;
}
else
{
// SELECT句やWHERE区ででてきたカラム定義
Order = OrderType.Column;
}
}
else
{
// JOIN句など、予約語とは違うネスト階層により出現する定義
Order = OrderType.Column;
}
}
开发者ID:NaoyaOura,项目名称:SqlFormatter,代码行数:32,代码来源:TableOreColumnName.cs
示例13: Order
public readonly UnitType unitTypeBuild; // Nullable
#endregion Fields
#region Constructors
public Order(OrderType orderType, Position targetPosition=null, Unit targetUnit=null, UnitType unitTypeBuild=null)
{
this.orderType = orderType;
this.targetPosition = targetPosition;
this.targetUnit = targetUnit;
this.unitTypeBuild = unitTypeBuild;
}
开发者ID:XNAWizards,项目名称:mst-boredom-remover,代码行数:13,代码来源:Order.cs
示例14: AddPendingOrder
static void AddPendingOrder(LiveOpenPositionsEditor openPositionData, Symbol symbol, string orderId, long size, DateTime submittedTime,
OrderType orderType, TransactionType transactionType, double price, string customString)
{
if (openPositionData.PortfolioXml.PendingOrders.Any(o => o.OrderId == orderId))
{
// Order already tracked
return;
}
PositionType positionType = (transactionType == TransactionType.Buy || transactionType == TransactionType.Sell) ? PositionType.Long : PositionType.Short;
// This assumes there is just one position per symbol. If this isn't the case then you will need to find a way of figuring out which
// position a pending order corresponds to.
PositionDataXml position = openPositionData.PortfolioXml.Positions.FirstOrDefault(pos => pos.Symbol.Equals(symbol) && pos.PositionType == positionType);
if (position == null)
{
// No existing position, so create a new one
position = openPositionData.AddPosition(symbol, positionType);
position.CustomString = customString;
}
BrokerOrder brokerOrder = new BrokerOrder();
if (orderType == OrderType.Limit || orderType == OrderType.LimitOnClose)
{
brokerOrder.LimitPrice = price;
}
else if (orderType == OrderType.Stop || orderType == OrderType.TrailingStop)
{
brokerOrder.StopPrice = price;
}
brokerOrder.CustomString = customString;
TradeOrderXml tradeOrder = openPositionData.AddPendingOrder(position, brokerOrder, orderId, size, submittedTime, orderType, transactionType);
}
开发者ID:dsplaisted,项目名称:RightEdgeUtil,代码行数:35,代码来源:Program.cs
示例15: AddToCart
public override OrderProduct AddToCart(OrderType opType, int productId, int quantity, NameValueCollection paras)
{
int typecode;
if (int.TryParse(paras["typecode"],out typecode))
{
typecode =0;
}
OrderProduct op = OrderProducts.Find(c => c.ProductID == productId && c.TypeCode == typecode);
if (op == null)
{
op = OrderProductFactory.Instance().CreateOrderProduct(productId, quantity, opType, paras);
op.Key = this.Key + "_op" + this.GetSerial();
op.Container = this;
this.ContinueShopUrl = op.ProductUrl;
if (op != null)
{
OrderProducts.Add(op);
}
}
else
{
op.SetQuantiy(op.Quantity + quantity);
}
return op;
}
开发者ID:ViniciusConsultor,项目名称:noname-netshop,代码行数:27,代码来源:CommShopCart.cs
示例16: GetListings
public static List<ClassifiedsListing> GetListings(Item item, ListingProperties props,
OrderType orderType)
{
VersatileIO.Info("Searching bp.tf classifieds for {0}...", props.ToString(item));
List<ClassifiedsListing> all = ClassifiedsScraper.GetClassifieds(item, props);
List<ClassifiedsListing> res = new List<ClassifiedsListing>();
foreach (ClassifiedsListing c in all)
{
if (c.ItemInstance.Item.IsSkin())
{
continue;
}
if (c.OrderType == orderType)
{
res.Add(c);
}
}
if (res.IsNullOrEmpty())
{
VersatileIO.Warning("No classifieds found for {0}.", props.ToString(item));
return res.EmptyIfNull().ToList();
}
VersatileIO.Info("{0} listings found.", res.Count);
return res;
}
开发者ID:einsteinsci,项目名称:custom-steam-tools,代码行数:29,代码来源:CmdClassifiedsBase.cs
示例17: AddOrder
public void AddOrder()
{
Assert.IsNotNull(TestData.NewItem, "Failed because no item available -- requires successful AddItem test");
// Make API call.
ApiException gotException = null;
try
{
AddOrderCall api = new AddOrderCall(this.apiContext);
OrderType order = new OrderType();
api.Order = order;
TransactionType t1 = new TransactionType();
t1.Item = TestData.NewItem;
t1.TransactionID = "0";
TransactionType t2 = new TransactionType();
t2.Item = TestData.NewItem;
t2.TransactionID = "0";
TransactionTypeCollection tary = new TransactionTypeCollection();
tary.Add(t1); tary.Add(t2);
order.TransactionArray = tary;
api.Order = order;
// Make API call.
/*AddOrderResponseType resp =*/ api.Execute();
}
catch(ApiException ex)
{
gotException = ex;
}
Assert.IsNotNull(gotException);
}
开发者ID:fudder,项目名称:cs493,代码行数:29,代码来源:T_070_AddOrderLibrary.cs
示例18: AddToCart
public override OrderProduct AddToCart(OrderType opType, int productId, int quantity, NameValueCollection paras)
{
SuitId = productId;
int typecode;
if (int.TryParse(paras["typecode"],out typecode))
{
typecode =0;
}
NoName.NetShop.Solution.BLL.SuiteBll sbll = new SuiteBll();
SolutionProductBll spbll = new SolutionProductBll();
SuiteModel smodel = sbll.GetModel(SuitId);
List<SolutionProductModel> list = spbll.GetModelList(SuitId);
this.OrderProducts.Clear();
foreach (SolutionProductModel model in list)
{
OrderProduct op = OrderProductFactory.Instance().CreateOrderProduct(model.ProductId, model.Quantity, opType, paras);
op.Key = this.Key + "_op" + this.GetSerial();
op.Container = this;
if (op != null)
{
OrderProducts.Add(op);
}
}
this.DerateFee = this.ProductSum - smodel.Price;
_score = smodel.Score;
return null;
}
开发者ID:ViniciusConsultor,项目名称:noname-netshop,代码行数:32,代码来源:SuitShopCart.cs
示例19: Order
internal Order(Expression expr, OrderType order)
{
expr.ThrowIfNullArgument(nameof(expr));
_expr = expr;
_order = order;
}
开发者ID:rexzh,项目名称:RexToy,代码行数:7,代码来源:Order.cs
示例20: GetProductBySupplier
public List<ProductPopUpItem> GetProductBySupplier(Outlet outlet, OrderType orderType, Supplier supplier)
{
vm.SetUpWithSupplier(outlet, orderType, supplier);
this.Owner = Application.Current.MainWindow;
this.ShowDialog();
return vm.GetProductsLineItem();
}
开发者ID:asanyaga,项目名称:BuildTest,代码行数:7,代码来源:ProductLookUp.xaml.cs
注:本文中的OrderType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论