本文整理汇总了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;
}
示例2: ExecuteOrder
private void ExecuteOrder(long volume, TradeType tradeType)
{
var result = ExecuteMarketOrder(tradeType, Symbol, volume, "Alembex", StopLoss, TakeProfit);
if (result.Error == ErrorCode.NoMoney)
Stop();
}
示例3: Trade
internal Trade(double price, double amount, DateTime time, TradeType type)
{
Price = price;
Amount = amount;
Type = type;
Time = time;
}
示例4: Open
private void Open(TradeType tradeType)
{
var position = Positions.Find("SampleRSI", Symbol, tradeType);
if (position == null)
ExecuteMarketOrder(tradeType, Symbol, Volume, "SampleRSI");
}
示例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;
}
示例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;
}
示例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();
}
示例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;
}
示例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");
}
示例10: ToString
public static string ToString(TradeType v)
{
if (v == TradeType.Sell)
return "sell";
if (v == TradeType.Buy)
return "buy";
throw new NotSupportedException();
}
示例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");
}
示例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;
}
示例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;
}
示例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);
}
示例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");
}