Documentation
¶
Overview ¶
Package jsontypes holds raw JSON-deserialization structs for the signal package. These types use the exact API field names with json tags and are not part of the public surface; callers should use the types in the parent signal package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnomalyDetection ¶
type AnomalyDetection struct {
AnomalyResult string `json:"anomaly_result"`
SignificanceLevel string `json:"significance_level"`
TestMethod string `json:"test_method"`
Thresholds AnomalyThresholds `json:"thresholds"`
}
AnomalyDetection is the outcome of the anomaly test behind a factor.
type AnomalyThresholds ¶
type AnomalyThresholds struct {
Low string `json:"low"`
Medium string `json:"medium"`
High string `json:"high"`
}
AnomalyThresholds are the thresholds an anomaly test was scored against.
type FactDataSource ¶
type FactDataSource struct {
SourceName string `json:"source_name"`
SourceType string `json:"type"`
URL string `json:"url"`
Icon string `json:"icon"`
}
FactDataSource is where a fact came from.
type FactFactor ¶
type FactFactor struct {
Name string `json:"name"`
FactorGroups []string `json:"factor_groups"`
LongShortDirection string `json:"long_short_direction"`
TriggerCondition string `json:"trigger_condition"`
AnomalyDetection AnomalyDetection `json:"anomaly_detection"`
}
FactFactor is one factor that contributed to a fact.
type FactNlInfo ¶
type FactNlInfo struct {
Title string `json:"title"`
SubTitle string `json:"sub_title"`
Summary string `json:"summary"`
InvestAnal string `json:"invest_anal"`
EliExplain string `json:"eli_explain"`
}
FactNlInfo is the natural-language rendering of a fact.
type FactSymbol ¶
FactSymbol is a security a fact is about.
type MilliTimestamp ¶
type MilliTimestamp int64
MilliTimestamp is a unix-millisecond timestamp that the API may send as either a JSON number or a JSON string. It tolerates both.
func (MilliTimestamp) Time ¶
func (m MilliTimestamp) Time() time.Time
Time converts the millisecond timestamp to a time.Time (zero value when unset).
func (*MilliTimestamp) UnmarshalJSON ¶
func (m *MilliTimestamp) UnmarshalJSON(b []byte) error
UnmarshalJSON accepts a bare number (123), a quoted number ("123"), or null.
type SecurityFact ¶
type SecurityFact struct {
FactID string `json:"fact_id"`
FactType string `json:"fact_type"`
Direction string `json:"direction"`
OccurTime string `json:"occur_time"` // RFC3339
SymbolsInfo []FactSymbol `json:"symbols_info"`
Factors []FactFactor `json:"factors"`
DataSource []FactDataSource `json:"data_source"`
NlInfo FactNlInfo `json:"nl_info"`
}
SecurityFact is the raw wire type for a fact (catalyst) event.
type SecurityFactsResponse ¶
type SecurityFactsResponse struct {
Facts []SecurityFact `json:"facts"`
}
SecurityFactsResponse is the raw response for GET /v1/facts/security_facts.
type Signal ¶
type Signal struct {
ID string `json:"id"`
Symbol string `json:"symbol"`
CompanyName string `json:"company_name"`
Market string `json:"market"`
Title string `json:"title"`
Summary string `json:"summary"`
StrategyID string `json:"strategy_id"`
StrategyName string `json:"strategy_name"`
RecommendBy string `json:"recommend_by"`
Expression string `json:"expression"`
KeyFactID string `json:"key_fact_id"`
KeyCatalyst string `json:"key_catalyst"`
AnalysisPrice float64 `json:"analysis_price"`
ConservativePrice float64 `json:"conservative_price"`
BenchmarkPrice float64 `json:"benchmark_price"`
OptimisticPrice float64 `json:"optimistic_price"`
Outlook string `json:"outlook"`
OutlookDesc string `json:"outlook_desc"`
Status int32 `json:"status"`
JsonData string `json:"json_data"`
CreatedAtMs MilliTimestamp `json:"created_at"` // unix milliseconds (string or number on the wire)
UpdatedAtMs MilliTimestamp `json:"updated_at"` // unix milliseconds (string or number on the wire)
}
Signal is the raw wire type for one strategy signal.
type SignalResponse ¶
type SignalResponse struct {
Signal Signal `json:"signal"`
}
SignalResponse is the raw response for GET /v1/signals/{signal_id}.
type SignalsResponse ¶
SignalsResponse is the raw response for GET /v1/signals.