mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 00:35:15 +00:00
pass string format quantity and price
This commit is contained in:
parent
9f77236999
commit
471e0a4c45
|
@ -163,24 +163,28 @@ 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)
|
||||||
}
|
}
|
||||||
|
|
||||||
so := types.SubmitOrder{
|
so := types.SubmitOrder{
|
||||||
ClientOrderID: uuid.New().String(),
|
ClientOrderID: uuid.New().String(),
|
||||||
Symbol: symbol,
|
Symbol: symbol,
|
||||||
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),
|
||||||
Price: util.MustParseFloat(price),
|
QuantityString: quantity,
|
||||||
Market: types.Market{Symbol: symbol},
|
Price: util.MustParseFloat(price),
|
||||||
TimeInForce: "GTC",
|
PriceString: price,
|
||||||
|
Market: types.Market{Symbol: symbol},
|
||||||
|
TimeInForce: "GTC",
|
||||||
}
|
}
|
||||||
co, err := session.Exchange.SubmitOrders(ctx, so)
|
co, err := session.Exchange.SubmitOrders(ctx, so)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user