Updated Main.go for metrics
Some checks failed
Continuous Integration / CI (push) Failing after 2m6s
Some checks failed
Continuous Integration / CI (push) Failing after 2m6s
Added metrics to example
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"fmt"
|
||||
"sancus.carpanet.net/sjc/tastytrade"
|
||||
"os"
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -95,4 +96,13 @@ func main() {
|
||||
return
|
||||
}
|
||||
fmt.Println("Option chain:", optionChain)
|
||||
|
||||
// Get Metrics
|
||||
metrics, err := api.GetMarketMetricInfo("AAPL")
|
||||
if err != nil {
|
||||
fmt.Println("Error fetching market metrics", err)
|
||||
return
|
||||
}
|
||||
jmet, _ := json.MarshalIndent(metrics.Data, "", " ")
|
||||
fmt.Println("Market Metrics for AAPL: ", string(jmet))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user