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


C# TradeType类代码示例

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


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

示例1: SubmitTradeRequest

 /// <summary>
 /// Initializes a new instance of the <see cref="SubmitTradeRequest"/> class.
 /// </summary>
 /// <param name="tradepairId">The Cryptopia tradepair identifier.</param>
 /// <param name="type">The type of trade.</param>
 /// <param name="amount">The amount of coins.</param>
 /// <param name="rate">The price of the coins.</param>
 public SubmitTradeRequest(int tradepairId, TradeType type, decimal amount, decimal rate)
 {
     TradePairId = tradepairId;
     Type = type;
     Amount = amount;
     Rate = rate;
 }
开发者ID:CryptopiaNZ,项目名称:CryptopiaApi-Csharp,代码行数:14,代码来源:SubmitTradeRequest.cs

示例2: ExecuteOrder

        private void ExecuteOrder(long volume, TradeType tradeType)
        {
            var result = ExecuteMarketOrder(tradeType, Symbol, volume, "Alembex", StopLoss, TakeProfit);

            if (result.Error == ErrorCode.NoMoney)
                Stop();
        }
开发者ID:Mikai47,项目名称:cAlgoBot,代码行数:7,代码来源:Alembex.cs

示例3: Trade

 internal Trade(double price, double amount, DateTime time, TradeType type)
 {
     Price = price;
     Amount = amount;
     Type = type;
     Time = time;
 }
开发者ID:rarach,项目名称:exchange-bots,代码行数:7,代码来源:TradeHistory.cs

示例4: Open

        private void Open(TradeType tradeType)
        {
            var position = Positions.Find("SampleRSI", Symbol, tradeType);

            if (position == null)
                ExecuteMarketOrder(tradeType, Symbol, Volume, "SampleRSI");
        }
开发者ID:Mikai47,项目名称:cAlgoBot,代码行数:7,代码来源:RSI+Range+Robot.cs

示例5: Order

 public Order(BtcePair pair, TradeType type, decimal amount, decimal rate, UInt32 timestamp, int status)
 {
     Pair = pair;
     Amount = amount;
     Rate = rate;
     TimestampCreated = timestamp;
     Status = status;
 }
开发者ID:GnosisSuperFund,项目名称:BtceApi,代码行数:8,代码来源:Order.cs

示例6: Trade

 /// <summary>
 /// Initialize <see cref="Trade"/> class.
 /// </summary>
 /// <param name="clientName">Client name.</param>
 public Trade(string clientName, IDigicoinBroker broker, TradeType type, int order, decimal value)
 {
     ClientName = clientName;
     Broker = broker;
     Type = type;
     Order = order;
     Value = value;
 }
开发者ID:leszekkoc,项目名称:Citi1,代码行数:12,代码来源:Trade.cs

示例7: ExecuteOrder

        private void ExecuteOrder(double quantity, TradeType tradeType)
        {
            var volumeInUnits = Symbol.QuantityToVolume(quantity);
            var result = ExecuteMarketOrder(tradeType, Symbol, volumeInUnits, "Martingale", StopLoss, TakeProfit);

            if (result.Error == ErrorCode.NoMoney)
                Stop();
        }
开发者ID:Mikai47,项目名称:cAlgoBot,代码行数:8,代码来源:Sample+Martingale+cBot.cs

示例8: Buy

 /// <summary>
 /// Initializes a new instance of the Buy class.
 /// </summary>
 /// <param name="stockPoint">The stock point for the purchase.</param>
 /// <param name="tradeTypes">The type of the buy: short or long.</param>
 /// <param name="shares">The number of shares purchased.</param>
 public Buy(StockPoint stockPoint, TradeType tradeType, int shares)
 {
     this.Date = stockPoint.Date;
     this.Time = stockPoint.PointDateTime.AddMinutes(-5).ToString("HH:mm");
     this.Price = stockPoint.Open;
     this.TradeType = tradeType;
     this.Shares = shares;
 }
开发者ID:Kushagratrivedi,项目名称:GitHub,代码行数:14,代码来源:Buy.cs

示例9: Open

        private void Open(TradeType tradeType)
        {
            var position = Positions.Find("SampleRSI", Symbol, tradeType);
            var volumeInUnits = Symbol.QuantityToVolume(Quantity);

            if (position == null)
                ExecuteMarketOrder(tradeType, Symbol, volumeInUnits, "SampleRSI");
        }
开发者ID:Mikai47,项目名称:cAlgoBot,代码行数:8,代码来源:Sample+RSI+cBot.cs

示例10: ToString

        public static string ToString(TradeType v)
        {
            if (v == TradeType.Sell)
                return "sell";
            if (v == TradeType.Buy)
                return "buy";

            throw new NotSupportedException();
        }
开发者ID:pepyakin,项目名称:BtceApi,代码行数:9,代码来源:TradeType.cs

示例11: ExecuteOrder

        private void ExecuteOrder(TradeType tradeType, long volume, string prefixLabel = partialLabel)
        {
            int parties = 6, part1 = 2, part2 = 2;
			long partialVolume = Symbol.NormalizeVolume(volume/parties,RoundingMode.ToNearest);

            var result1 = ExecuteMarketOrder(tradeType, Symbol, partialVolume * part1, prefixLabel + "1");
            var result2 = ExecuteMarketOrder(tradeType, Symbol, partialVolume * part2, prefixLabel + "2");
            var result3 = ExecuteMarketOrder(tradeType, Symbol, volume - (part1 + part2) * partialVolume, prefixLabel + "3");
        }
开发者ID:Mikai47,项目名称:cAlgoBot,代码行数:9,代码来源:PayBack+I.cs

示例12: Trade

        private decimal Trade(string clientName, TradeType type, int order)
        {
            Validate(clientName, order);

            var hundreds = (int)(order / 100);
            var result = TradeHundrets(clientName, type, order, hundreds);
            result = TradeTens(clientName, type, order, hundreds, result);

            return result;
        }
开发者ID:leszekkoc,项目名称:Citi1,代码行数:10,代码来源:DigicoinTrader.cs

示例13: Trade

 public Trade(BtcePair pair, TradeType type, decimal amount, decimal rate, int orderId, bool isYourOrder, UInt32 timestamp)
 {
     Pair = pair;
     Type = type;
     Amount = amount;
     Rate = rate;
     OrderId = orderId;
     IsYourOrder = isYourOrder;
     Timestamp = timestamp;
 }
开发者ID:GnosisSuperFund,项目名称:BtceApi,代码行数:10,代码来源:Trade.cs

示例14: TestDisplayName

        public void TestDisplayName()
        {
            Assert.AreEqual("Trailer (TR)", new TradeType { Code = "TR", Name = "Trailer" }.DisplayName);
            Assert.AreEqual("Buy (B)", new TradeType { Code = "\r B\n\r", Name = "\t  Buy\t\n\r" }.DisplayName);
            Assert.AreEqual("Surrender", new TradeType { Name = "Surrender" }.DisplayName);
            Assert.AreEqual("BUY", new TradeType { Code = "BUY" }.DisplayName);

            var tradeType = new TradeType { Name = "   " };
            Assert.AreEqual("TradeType (Id: '{0}')".Form(tradeType.Id.ToString()), tradeType.DisplayName);
        }
开发者ID:eithery,项目名称:core,代码行数:10,代码来源:SimpleDictionaryItemTest.cs

示例15: manageOpen

        private void manageOpen(TradeType tradeType, long volume, string prefixLabel = botLabel)
        {
            int nVolumePartition = 10, part1 = 5, part2 = 3;
            long nVol = (long)Math.Floor((double)(volume / (microVolume * nVolumePartition)));
            long partialVolume = nVol * microVolume;

            var result1 = ExecuteMarketOrder(tradeType, Symbol, partialVolume * part1, prefixLabel + tradeType.ToString() + "-1");
            var result2 = ExecuteMarketOrder(tradeType, Symbol, partialVolume * part2, prefixLabel + tradeType.ToString() + "-2");
            var result3 = ExecuteMarketOrder(tradeType, Symbol, volume - (part1 + part2) * partialVolume, prefixLabel + tradeType.ToString() + "-3");
        }
开发者ID:redrhino,项目名称:cAlgo.Base,代码行数:10,代码来源:PayBackII.cs


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