command

package
v0.1.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Application = "stock"
	MinVersion  = "0.0.1" // 版本号

)
View Source
var CmdPrint = &cmder.Command{
	Use:     "print",
	Example: Application + " print sh000001",
	Short:   "打印K线概要",

	Run: func(cmd *cmder.Command, args []string) {
		tradeDate = trading.FixTradeDate(tradeDate)
		if len(exchangeCode) > 0 {

		} else if len(f10Code) > 0 {
			printF10(f10Code)
		} else if len(maCode) > 0 {

		} else if len(boxCode) > 0 {

		} else {
			if len(args) != 1 {
				fmt.Println(cmd.Help())
				return
			}

			securityCode := args[0]
			printKline(securityCode)
		}
	},
}

CmdPrint 打印命令

View Source
var CmdRepair = &cmder.Command{
	Use:     "repair",
	Example: Application + " repair --all",

	Args: func(cmd *cmder.Command, args []string) error {
		return nil
	},
	Short: "回补股市数据",
	Long:  `回补股市数据`,
	Run: func(cmd *cmder.Command, args []string) {
		beginDate := trading.FixTradeDate(flagStartDate.Value)
		endDate := cache.DefaultCanReadDate()
		if len(flagEndDate.Value) > 0 {
			endDate = trading.FixTradeDate(flagEndDate.Value)
		}
		dates := trading.TradeRange(beginDate, endDate)
		count := len(dates)
		fmt.Printf("修复数据: %s => %s"+strings.Repeat("\r\n", 2), dates[0], dates[count-1])
		if flagAll.Value {
			handleRepairAll(dates)
		} else if flagDataSet.Value {
			handleRepairDataSet(dates)
		} else if flagHistory.Value {

			handleRepair(dates)
		}
	},
}

CmdRepair 补登历史数据

View Source
var CmdUpdate = &cmder.Command{
	Use:     "update",
	Example: Application + " update --all",

	Args: func(cmd *cmder.Command, args []string) error {
		return nil
	},
	Short: "更新股市数据",
	Long:  `更新股市数据`,
	Run: func(cmd *cmder.Command, args []string) {
		if flagAll.Value {

			handleUpdateAll()
		} else if flagHistory.Value {

		}
	},
}

CmdUpdate 更新数据

View Source
var CmdVersion = &cmder.Command{
	Use:   "version",
	Short: "显示版本号",
	Run: func(cmd *cmder.Command, args []string) {
		fmt.Println(MinVersion)
	},
}

CmdVersion CommandVersion 版本

Functions

func UpdateApplicationVersion added in v0.1.5

func UpdateApplicationVersion(v string)

UpdateApplicationVersion 更新版本号

Types

type Command added in v0.1.3

type Command = cmder.Command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL