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"
|
"fmt"
|
||||||
"sancus.carpanet.net/sjc/tastytrade"
|
"sancus.carpanet.net/sjc/tastytrade"
|
||||||
"os"
|
"os"
|
||||||
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@@ -95,4 +96,13 @@ func main() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
fmt.Println("Option chain:", optionChain)
|
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