github.com/polygon-io/client-go@v1.16.4/rest/example/options/technical-indicators-rsi/main.go (about) 1 // Options - Relative Strength Index (RSI) 2 // https://polygon.io/docs/options/get_v1_indicators_rsi__optionsticker 3 // https://github.com/polygon-io/client-go/blob/master/rest/indicators.go 4 package main 5 6 import ( 7 "context" 8 "log" 9 "os" 10 11 polygon "github.com/polygon-io/client-go/rest" 12 "github.com/polygon-io/client-go/rest/models" 13 ) 14 15 func main() { 16 17 // init client 18 c := polygon.New(os.Getenv("POLYGON_API_KEY")) 19 20 // set params 21 params := &models.GetRSIParams{ 22 Ticker: "O:SPY241220P00720000", 23 } 24 25 // make request 26 res, err := c.GetRSI(context.Background(), params) 27 if err != nil { 28 log.Fatal(err) 29 } 30 31 // do something with the result 32 log.Print(res) 33 34 }