rename placeOrder to submitOrder for making the api consistent

This commit is contained in:
c9s 2021-05-12 20:08:25 +08:00
parent 2aea0dee4f
commit 3437515d6a

View File

@ -103,9 +103,14 @@ var listOrdersCmd = &cobra.Command{
}, },
} }
// go run ./cmd/bbgo placeorder --session=ftx --symbol=BTC/USDT --side=buy --price=<price> --quantity=<quantity> // go run ./cmd/bbgo placeorder --session=ftx --symbol=BTC/USDT --side=buy --price=<price> --quantity=<quantity>
var placeOrderCmd = &cobra.Command{ var submitOrderCmd = &cobra.Command{
Use: "placeorder", Use: "submit-order",
SilenceUsage: true, SilenceUsage: true,
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
ctx := context.Background() ctx := context.Background()
@ -200,12 +205,12 @@ func init() {
listOrdersCmd.Flags().String("session", "", "the exchange session name for sync") listOrdersCmd.Flags().String("session", "", "the exchange session name for sync")
listOrdersCmd.Flags().String("symbol", "", "the trading pair, like btcusdt") listOrdersCmd.Flags().String("symbol", "", "the trading pair, like btcusdt")
placeOrderCmd.Flags().String("session", "", "the exchange session name for sync") submitOrderCmd.Flags().String("session", "", "the exchange session name for sync")
placeOrderCmd.Flags().String("symbol", "", "the trading pair, like btcusdt") submitOrderCmd.Flags().String("symbol", "", "the trading pair, like btcusdt")
placeOrderCmd.Flags().String("side", "", "the trading side: buy or sell") submitOrderCmd.Flags().String("side", "", "the trading side: buy or sell")
placeOrderCmd.Flags().String("price", "", "the trading price") submitOrderCmd.Flags().String("price", "", "the trading price")
placeOrderCmd.Flags().String("quantity", "", "the trading quantity") submitOrderCmd.Flags().String("quantity", "", "the trading quantity")
RootCmd.AddCommand(listOrdersCmd) RootCmd.AddCommand(listOrdersCmd)
RootCmd.AddCommand(placeOrderCmd) RootCmd.AddCommand(submitOrderCmd)
} }