本文整理汇总了C#中TradeType类的典型用法代码示例。如果您正苦于以下问题:C# TradeType类的具体用法?C# TradeType怎么用?C# TradeType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TradeType类属于命名空间,在下文中一共展示了TradeType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: TradeCoinRequest
public TradeCoinRequest(string fromCoin, string toCoin, TradeType tradeType, TradeSide tradeSide, decimal tradePrice, decimal units, TradeLevel tradeLevel)
{
this.FromCoinSymbol = fromCoin;
this.ToCoinSymbol = toCoin;
this.TradeType = (int)tradeType;
this.TradeSide = (int)tradeSide;
this.TradePrice = tradePrice;
this.Units = units;
this.TradeLevel = (int)tradeLevel;
}
开发者ID:laisee,项目名称:API-V1-DotNet,代码行数:10,代码来源:TradeCoinRequest.cs
示例17: Trade
public Trade(bool sim, int _lotDigits, string _logFileName, NQuotes.MqlApi mql4) : base(mql4)
{
this.logFileName = _logFileName;
this.tradeType = TradeType.FLAT;
this.startingBalance = mql4.AccountBalance();
this.endingBalance = 0;
this.lotDigits = _lotDigits;
this.state = null;
this.actualEntry = -1;
this.actualClose = -1;
this.takeProfit = 0;
this.cancelPrice = 0;
this.initialProfitTarget = 0;
this.plannedEntry = 0;
this.stopLoss = 0;
this.originalStopLoss = 0;
this.positionSize = 0;
this.logSize = 0;
this.realizedPL = 0.0;
this.minUnrealizedPL = 0.0;
this.maxUnrealizedPL = 0.0;
this.spreadOrderOpen = -1;
this.spreadOrderClose = -1;
this.tradeOpenedDate = mql4.TimeCurrent();
this.orderPlacedDate = new DateTime();
this.orderFilledDate = new DateTime();
this.tradeClosedDate = new DateTime();
this.finalState = false;
if (sim)
{
this.order = new biiuse.SimOrder(this, mql4);
this.id = "SIM_" + mql4.Symbol() + (mql4.TimeCurrent() + TimeSpan.FromSeconds(OFFSET)).ToString();
}
else
{
this.order = new Order(this, mql4);
this.id = mql4.Symbol() + (mql4.TimeCurrent() + TimeSpan.FromSeconds(OFFSET)).ToString();
}
if (!mql4.IsTesting())
{
string filename = mql4.Symbol() + "_" + mql4.TimeCurrent().ToString();
int filehandle = mql4.FileOpen(filename, MqlApi.FILE_WRITE | MqlApi.FILE_READ | MqlApi.FILE_TXT);
mql4.FileSeek(filehandle, 0, MqlApi.SEEK_END);
string output = "****Trade: " + this.id + " ****";
mql4.FileWriteString(filehandle, output, output.Length);
mql4.FileWriteString(filehandle, "\n", 1);
mql4.FileClose(filehandle);
}
}
开发者ID:dsinnig,项目名称:MQL-.NET-Git-Repo,代码行数:55,代码来源:Trade.cs
示例18: AbstractTrade
/// <summary>
/// Constructor
/// </summary>
/// <param name="ticker">The stock ticker symbol</param>
/// <param name="shares">The number of shares to trade</param>
/// <param name="tradeTradeType">TradeType.Buy or TradeType.Sell</param>
/// <param name="tradeStatus">
/// A TradeStatus enum that describes the status of the
/// Trade
/// </param>
/// <param name="tadingSessionId">
/// Each trading session is given a unique identifier of type, Guid.
/// Either create a TradingSessionId if you are starting a trade. Or pass in the existing
/// TradingSessionId if you are part of a trade.
/// </param>
/// <param name="message">An arbitrary message</param>
protected AbstractTrade(string ticker, int shares, TradeType tradeTradeType, TradeStatus tradeStatus,
Guid tadingSessionId, string message = null)
{
Ticker = ticker;
Shares = shares;
TradeType = tradeTradeType;
TadingSessionId = tadingSessionId;
CreateTime = DateTime.UtcNow;
TradeStatus = tradeStatus;
Message = message;
}
开发者ID:reselbob,项目名称:AkkaNetDemo,代码行数:27,代码来源:Messages.cs
示例19: ExecuteOrder
private void ExecuteOrder(int volume, TradeType tradeType)
{
var request = new MarketOrderRequest(tradeType, volume)
{
Label = "BerthoRobot",
StopLossPips = StopLoss,
TakeProfitPips = TakeProfit
};
Trade.Send(request);
}
开发者ID:redrhino,项目名称:cAlgo.Base,代码行数:11,代码来源:BlackAlgoIV.cs
示例20: New
public TradeCoinResponse New(string fromCoin, string toCoin, TradeType tradeType, TradeSide tradeSide, decimal tradePrice, decimal units, TradeLevel tradeLevel)
{
return
this.CallMethod<TradeCoinResponse>(
new RequestBuilder(RequestType.POST, "order/new")
.AddUrlSegment(new CoinsPairSegment(fromCoin, toCoin))
.AddUrlSegment(tradeType)
.AddUrlSegment(tradeSide)
.AddUrlSegment(tradePrice)
.AddUrlSegment(units)
.AddUrlSegment(tradeLevel));
}
开发者ID:laisee,项目名称:API-V1-DotNet,代码行数:12,代码来源:OrderResource.cs
注:本文中的TradeType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论