mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
show trade ID in the console
This commit is contained in:
parent
7b60e34821
commit
3ad1f0e351
|
@ -18,6 +18,11 @@ type TradeBatchQuery struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e TradeBatchQuery) Query(ctx context.Context, symbol string, options *types.TradeQueryOptions) (c chan types.Trade, errC chan error) {
|
func (e TradeBatchQuery) Query(ctx context.Context, symbol string, options *types.TradeQueryOptions) (c chan types.Trade, errC chan error) {
|
||||||
|
if options.EndTime == nil {
|
||||||
|
now := time.Now()
|
||||||
|
options.EndTime = &now
|
||||||
|
}
|
||||||
|
|
||||||
startTime := *options.StartTime
|
startTime := *options.StartTime
|
||||||
endTime := *options.EndTime
|
endTime := *options.EndTime
|
||||||
query := &AsyncTimeRangedBatchQuery{
|
query := &AsyncTimeRangedBatchQuery{
|
||||||
|
|
|
@ -146,7 +146,7 @@ func trimTrailingZero(a float64) string {
|
||||||
|
|
||||||
// String is for console output
|
// String is for console output
|
||||||
func (trade Trade) String() string {
|
func (trade Trade) String() string {
|
||||||
return fmt.Sprintf("TRADE %s %s %4s %-4s @ %-6s | AMOUNT %s | FEE %s %s | OrderID %d | %s",
|
return fmt.Sprintf("TRADE %s %s %4s %-4s @ %-6s | AMOUNT %s | FEE %s %s | OrderID %d | TID %d | %s",
|
||||||
trade.Exchange.String(),
|
trade.Exchange.String(),
|
||||||
trade.Symbol,
|
trade.Symbol,
|
||||||
trade.Side,
|
trade.Side,
|
||||||
|
@ -156,6 +156,7 @@ func (trade Trade) String() string {
|
||||||
trade.Fee.String(),
|
trade.Fee.String(),
|
||||||
trade.FeeCurrency,
|
trade.FeeCurrency,
|
||||||
trade.OrderID,
|
trade.OrderID,
|
||||||
|
trade.ID,
|
||||||
trade.Time.Time().Format(time.StampMilli),
|
trade.Time.Time().Format(time.StampMilli),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user