Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ public ExchangeOrderResult ExchangeOrderResult
OrderDate = CryptoUtility.UnixTimeStampToDateTimeMilliseconds(OrderCreationTime),
CompletedDate = status.IsCompleted() ? (DateTime?)CryptoUtility.UnixTimeStampToDateTimeMilliseconds(TransactionTime) : null,
TradeDate = CryptoUtility.UnixTimeStampToDateTimeMilliseconds(TransactionTime),
UpdateSequence = EventTime, // in Binance, the sequence nymber is also the EventTime
MarketSymbol = Symbol,
// IsBuy is not provided here
Fees = CommissionAmount,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ internal class BaseMessage

internal class Activate : BaseMessage
{
private ExchangeOrderResult exchangeOrderResult;

public Guid OrderId { get; set; }
public StopType OrderType { get; set; }
public decimal Size { get; set; }
Expand Down Expand Up @@ -52,7 +50,8 @@ internal class Activate : BaseMessage
MarketSymbol = ProductId,
IsBuy = Side == OrderSide.Buy,
Fees = null, // only TakerFeeRate is specified - no fees have been charged yet
TradeId = null // no trades have been made
TradeId = null, // no trades have been made
UpdateSequence = null, // unfortunately, the Activate event doesn't provide a sequence number
};
}

Expand Down Expand Up @@ -84,7 +83,8 @@ internal class Change : BaseMessage
MarketSymbol = ProductId,
IsBuy = Side == OrderSide.Buy,
Fees = null, // only TakerFeeRate is specified - no fees have been charged yet
TradeId = null // not a trade msg
TradeId = null, // not a trade msg
UpdateSequence = Sequence,
};
}

Expand Down Expand Up @@ -116,7 +116,8 @@ internal class Done : BaseMessage
MarketSymbol = ProductId,
IsBuy = Side == OrderSide.Buy,
Fees = null, // not specified here
TradeId = null // not a trade msg
TradeId = null, // not a trade msg
UpdateSequence = Sequence,
};
}

Expand Down Expand Up @@ -189,6 +190,7 @@ internal class Match : BaseMessage
IsBuy = Side == OrderSide.Buy,
Fees = (MakerFeeRate ?? TakerFeeRate) * Price * Size,
TradeId = TradeId.ToString(),
UpdateSequence = Sequence,
};
}

Expand Down Expand Up @@ -218,7 +220,8 @@ internal class Open : BaseMessage
MarketSymbol = ProductId,
IsBuy = Side == OrderSide.Buy,
Fees = null, // not specified here
TradeId = null // not a trade msg
TradeId = null, // not a trade msg
UpdateSequence = Sequence,
};
}

Expand Down Expand Up @@ -250,7 +253,8 @@ internal class Received : BaseMessage
MarketSymbol = ProductId,
IsBuy = Side == OrderSide.Buy,
Fees = null, // not specified here
TradeId = null // not a trade msg
TradeId = null, // not a trade msg
UpdateSequence = Sequence,
};
}

Expand Down
6 changes: 6 additions & 0 deletions src/ExchangeSharp/Model/ExchangeOrderResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ public sealed class ExchangeOrderResult
/// <summary>datetime in UTC of the trade. Null if not a trade.</summary>
public DateTime? TradeDate { get; set; }

/// <summary>
/// sequence that the order update was sent from the server, usually used to keep updates in order or for debugging purposes.
/// Not all exchanges provide this value, so it may be null.
/// </summary>
public long? UpdateSequence { get; set; }

/// <summary>Append another order to this order - order id and type must match</summary>
/// <param name="other">Order to append</param>
public void AppendOrderWithOrder(ExchangeOrderResult other)
Expand Down