Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var SectorsCmd = &cobra.Command{ Use: "sectors", Short: "Returns the performance of various sectors over a time period", Long: `The sectors cmd can also take the optional 't' flag which allows you to specify a time period to benchmark sector performance against. This cmd can also take the 's' stock flag which allows you to compare all the sectors against the performance of a particular equity.`, Example: " king-spy sectors \n" + " king-spy sectors -t=1M \n" + " king-spy sectors -t=1M -s=aapl \n", Run: func(cmd *cobra.Command, args []string) { ksCmd := "sectors" timeArg, _ := cmd.Flags().GetString("time") if timeArg == "" { timeVal = "YTD" } else { timeVal = timeArg } stockArg, _ := cmd.Flags().GetString("stock") if stockArg == "" { stockVal = "NA" } else { utils.TickerValidation(stockArg) stockVal = stockArg } _, key, secret := config.Init() cfg := GetSectorsConfig{ Key: key, Secret: secret, Cmd: ksCmd, } CompareSectors(cfg, timeVal, stockVal) }, }
SectorsCmd represents the sectors command
Functions ¶
func CompareSectors ¶
func CompareSectors(cfg GetSectorsConfig, timeVal string, stockVal string)
Types ¶
type GetSectorsConfig ¶
Click to show internal directories.
Click to hide internal directories.