pass string format quantity and price

This commit is contained in:
c9s 2021-04-28 19:48:17 +08:00
parent 9f77236999
commit 471e0a4c45

View File

@ -163,10 +163,12 @@ var placeOrderCmd = &cobra.Command{
if err != nil { if err != nil {
return fmt.Errorf("can't get side: %w", err) return fmt.Errorf("can't get side: %w", err)
} }
price, err := cmd.Flags().GetString("price") price, err := cmd.Flags().GetString("price")
if err != nil { if err != nil {
return fmt.Errorf("can't get price: %w", err) return fmt.Errorf("can't get price: %w", err)
} }
quantity, err := cmd.Flags().GetString("quantity") quantity, err := cmd.Flags().GetString("quantity")
if err != nil { if err != nil {
return fmt.Errorf("can't get quantity: %w", err) return fmt.Errorf("can't get quantity: %w", err)
@ -178,7 +180,9 @@ var placeOrderCmd = &cobra.Command{
Side: types.SideType(ftx.TrimUpperString(side)), Side: types.SideType(ftx.TrimUpperString(side)),
Type: types.OrderTypeLimit, Type: types.OrderTypeLimit,
Quantity: util.MustParseFloat(quantity), Quantity: util.MustParseFloat(quantity),
QuantityString: quantity,
Price: util.MustParseFloat(price), Price: util.MustParseFloat(price),
PriceString: price,
Market: types.Market{Symbol: symbol}, Market: types.Market{Symbol: symbol},
TimeInForce: "GTC", TimeInForce: "GTC",
} }