mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 14:55:16 +00:00
ftx: remove back slash from symbol
This commit is contained in:
parent
28c9ac95ac
commit
a659bacb0d
|
@ -17,7 +17,7 @@ func toGlobalCurrency(original string) string {
|
|||
}
|
||||
|
||||
func toGlobalSymbol(original string) string {
|
||||
return TrimUpperString(original)
|
||||
return strings.ReplaceAll(TrimUpperString(original), "/", "")
|
||||
}
|
||||
|
||||
func TrimUpperString(original string) string {
|
||||
|
@ -133,7 +133,7 @@ func toGlobalTrade(f fill) (types.Trade, error) {
|
|||
func toGlobalKLine(symbol string, interval types.Interval, h Candle) (types.KLine, error) {
|
||||
return types.KLine{
|
||||
Exchange: types.ExchangeFTX.String(),
|
||||
Symbol: symbol,
|
||||
Symbol: toGlobalSymbol(symbol),
|
||||
StartTime: h.StartTime.Time,
|
||||
EndTime: h.StartTime.Add(interval.Duration()),
|
||||
Interval: interval,
|
||||
|
|
|
@ -96,3 +96,7 @@ func TestTrimLowerString(t *testing.T) {
|
|||
})
|
||||
}
|
||||
}
|
||||
|
||||
func Test_toGlobalSymbol(t *testing.T) {
|
||||
assert.Equal(t, "BTCUSDT", toGlobalSymbol("BTC/USDT"))
|
||||
}
|
||||
|
|
|
@ -416,7 +416,7 @@ func TestExchange_QueryMarkets(t *testing.T) {
|
|||
|
||||
assert.Len(t, resp, 1)
|
||||
assert.Equal(t, types.Market{
|
||||
Symbol: "BTC/USD",
|
||||
Symbol: "BTCUSD",
|
||||
PricePrecision: 0,
|
||||
VolumePrecision: 4,
|
||||
QuoteCurrency: "USD",
|
||||
|
@ -424,7 +424,7 @@ func TestExchange_QueryMarkets(t *testing.T) {
|
|||
MinQuantity: 0.001,
|
||||
StepSize: 0.0001,
|
||||
TickSize: 1,
|
||||
}, resp["BTC/USD"])
|
||||
}, resp["BTCUSD"])
|
||||
}
|
||||
|
||||
func TestExchange_QueryDepositHistory(t *testing.T) {
|
||||
|
@ -606,7 +606,7 @@ func TestExchange_QueryTrades(t *testing.T) {
|
|||
Price: 672.5,
|
||||
Quantity: 1.0,
|
||||
QuoteQuantity: 672.5 * 1.0,
|
||||
Symbol: "TSLA/USD",
|
||||
Symbol: "TSLAUSD",
|
||||
Side: types.SideTypeSell,
|
||||
IsBuyer: false,
|
||||
IsMaker: true,
|
||||
|
|
Loading…
Reference in New Issue
Block a user