Documentation
¶
Index ¶
- Constants
- func AddAgentProfile(tx *gorm.DB, ap *AgentProfile) error
- func AddBrokerProduct(tx *gorm.DB, pb *BrokerProduct) error
- func AddConnection(tx *gorm.DB, conn *Connection) error
- func AddCurrencyHistory(tx *gorm.DB, ci *CurrencyHistory) error
- func AddDataProduct(tx *gorm.DB, ts *DataProduct) error
- func AddTradingSession(tx *gorm.DB, s *TradingSession) error
- func AddTradingSystem(tx *gorm.DB, ts *TradingSystem) error
- func DeleteConnection(tx *gorm.DB, id uint) error
- func DeleteTradingSystem(tx *gorm.DB, id uint) error
- func DisconnectAll(tx *gorm.DB) error
- func GetAgentProfiles(tx *gorm.DB, filter map[string]any, offset int, limit int) (*[]AgentProfile, error)
- func GetBrokerInstrumentsByBrokerId(tx *gorm.DB, id uint) (*[]BrokerInstrument, error)
- func GetBrokerProducts(tx *gorm.DB, filter map[string]any, offset int, limit int) (*[]BrokerProductFull, error)
- func GetBrokerProductsFull(tx *gorm.DB, filter map[string]any, offset int, limit int) (*[]BrokerProductFull, error)
- func GetConnections(tx *gorm.DB, filter map[string]any, offset int, limit int) (*[]Connection, error)
- func GetCurrencies(tx *gorm.DB) (*[]Currency, error)
- func GetCurrenciesAsMap(tx *gorm.DB) (map[uint]*Currency, error)
- func GetDataProducts(tx *gorm.DB, filter map[string]any, offset int, limit int) (*[]DataProductFull, error)
- func GetDataProductsFull(tx *gorm.DB, filter map[string]any, offset int, limit int) (*[]DataProductFull, error)
- func GetExchanges(tx *gorm.DB) (*[]Exchange, error)
- func GetExchangesAsMap(tx *gorm.DB) (map[uint]*Exchange, error)
- func GetTradingSessions(tx *gorm.DB, username string) (*[]TradingSession, error)
- func GetTradingSystems(tx *gorm.DB, filter map[string]any, offset int, limit int) (*[]TradingSystemFull, error)
- func GetTradingSystemsById(tx *gorm.DB, username string, ids []uint) (*[]TradingSystem, error)
- func GetTradingSystemsFull(tx *gorm.DB, filter map[string]any, offset int, limit int) (*[]TradingSystemFull, error)
- func SetConnectionStatus(tx *gorm.DB, user, code string, flag bool) error
- func UpdateBrokerProduct(tx *gorm.DB, pb *BrokerProduct) error
- func UpdateConnection(tx *gorm.DB, conn *Connection) error
- func UpdateCurrency(tx *gorm.DB, c *Currency) error
- func UpdateDataProduct(tx *gorm.DB, ts *DataProduct) error
- func UpdateTradingSystem(tx *gorm.DB, ts *TradingSystem) error
- type AgentProfile
- type BrokerInstrument
- type BrokerProduct
- type BrokerProductFull
- type Common
- type Connection
- type Currency
- type CurrencyHistory
- type DPRollTrigger
- type DataProduct
- type DataProductFull
- type Exchange
- type TradingSession
- type TradingSystem
- type TradingSystemFull
Constants ¶
View Source
const ( DPRollTriggerSD4 = "sd4" DPRollTriggerSD6 = "sd6" DPRollTriggerSD30 = "sd30" )
Variables ¶
This section is empty.
Functions ¶
func AddAgentProfile ¶
func AddAgentProfile(tx *gorm.DB, ap *AgentProfile) error
func AddBrokerProduct ¶
func AddBrokerProduct(tx *gorm.DB, pb *BrokerProduct) error
func AddConnection ¶
func AddConnection(tx *gorm.DB, conn *Connection) error
func AddCurrencyHistory ¶
func AddCurrencyHistory(tx *gorm.DB, ci *CurrencyHistory) error
func AddDataProduct ¶
func AddDataProduct(tx *gorm.DB, ts *DataProduct) error
func AddTradingSession ¶
func AddTradingSession(tx *gorm.DB, s *TradingSession) error
func AddTradingSystem ¶
func AddTradingSystem(tx *gorm.DB, ts *TradingSystem) error
func DisconnectAll ¶
func GetAgentProfiles ¶
func GetBrokerInstrumentsByBrokerId ¶
func GetBrokerInstrumentsByBrokerId(tx *gorm.DB, id uint) (*[]BrokerInstrument, error)
func GetBrokerProducts ¶
func GetBrokerProductsFull ¶
func GetConnections ¶
func GetDataProducts ¶
func GetDataProductsFull ¶
func GetTradingSessions ¶
func GetTradingSessions(tx *gorm.DB, username string) (*[]TradingSession, error)
func GetTradingSystems ¶
func GetTradingSystemsById ¶
func GetTradingSystemsFull ¶
func SetConnectionStatus ¶
func UpdateBrokerProduct ¶
func UpdateBrokerProduct(tx *gorm.DB, pb *BrokerProduct) error
func UpdateConnection ¶
func UpdateConnection(tx *gorm.DB, conn *Connection) error
func UpdateDataProduct ¶
func UpdateDataProduct(tx *gorm.DB, ts *DataProduct) error
func UpdateTradingSystem ¶
func UpdateTradingSystem(tx *gorm.DB, ts *TradingSystem) error
Types ¶
type AgentProfile ¶
type AgentProfile struct {
Common
Username string `json:"username"`
Name string `json:"name"`
RemoteUrl string `json:"remoteUrl"`
SslKeyRef string `json:"sslKeyRef"`
SslCertRef string `json:"sslCertRef"`
ScanInterval int `json:"scanInterval"`
}
func GetAgentProfileById ¶
func GetAgentProfileById(tx *gorm.DB, id uint) (*AgentProfile, error)
func (AgentProfile) TableName ¶
func (AgentProfile) TableName() string
type BrokerInstrument ¶
type BrokerInstrument struct {
Id uint `json:"id" gorm:"primaryKey"`
BrokerProductId uint `json:"brokerProductId"`
Symbol string `json:"symbol"`
Name string `json:"name"`
ExpirationDate int `json:"expirationDate"`
}
func (BrokerInstrument) TableName ¶
func (BrokerInstrument) TableName() string
type BrokerProduct ¶
type BrokerProduct struct {
Common
ConnectionId uint `json:"connectionId"`
ExchangeId uint `json:"exchangeId"`
Username string `json:"username"`
Symbol string `json:"symbol"`
Name string `json:"name"`
PointValue float32 `json:"pointValue"`
CostPerOperation float32 `json:"costPerOperation"`
MarginValue float32 `json:"marginValue"`
Increment float64 `json:"increment"`
MarketType string `json:"marketType"`
ProductType string `json:"productType"`
}
func GetBrokerProductById ¶
func GetBrokerProductById(tx *gorm.DB, id uint) (*BrokerProduct, error)
func (BrokerProduct) TableName ¶
func (BrokerProduct) TableName() string
type BrokerProductFull ¶
type BrokerProductFull struct {
BrokerProduct
CurrencyCode string `json:"currencyCode,omitempty"`
ConnectionCode string `json:"connectionCode,omitempty"`
ConnectionName string `json:"connectionName,omitempty"`
SystemCode string `json:"systemCode,omitempty"`
ExchangeCode string `json:"exchangeCode,omitempty"`
}
type Connection ¶
type Connection struct {
Common
Username string `json:"username"`
Code string `json:"code"`
Name string `json:"name"`
SystemCode string `json:"systemCode"`
SystemName string `json:"systemName"`
SystemConfigParams string `json:"systemConfigParams"`
Connected bool `json:"connected"`
SupportsData bool `json:"supportsData"`
SupportsBroker bool `json:"supportsBroker"`
SupportsMultipleData bool `json:"supportsMultipleData"`
SupportsInventory bool `json:"supportsInventory"`
}
func GetConnectionByCode ¶
func GetConnectionByCode(tx *gorm.DB, user, code string) (*Connection, error)
func GetConnectionById ¶
func GetConnectionById(tx *gorm.DB, id uint) (*Connection, error)
func (Connection) TableName ¶
func (Connection) TableName() string
type Currency ¶
type CurrencyHistory ¶
type CurrencyHistory struct {
Id uint `json:"id"`
CurrencyId uint `json:"currencyId"`
Date types.Date `json:"date"`
Value float64 `json:"value"`
}
func (CurrencyHistory) TableName ¶
func (CurrencyHistory) TableName() string
type DPRollTrigger ¶
type DPRollTrigger string
type DataProduct ¶
type DataProduct struct {
Common
ConnectionId uint `json:"connectionId"`
ExchangeId uint `json:"exchangeId"`
Username string `json:"username"`
Symbol string `json:"symbol"`
Name string `json:"name"`
MarketType string `json:"marketType"`
ProductType string `json:"productType"`
Months string `json:"months"`
RolloverTrigger DPRollTrigger `json:"rolloverTrigger"`
SessionId uint `json:"sessionId"`
}
func GetDataProductById ¶
func GetDataProductById(tx *gorm.DB, id uint) (*DataProduct, error)
func (DataProduct) TableName ¶
func (DataProduct) TableName() string
type DataProductFull ¶
type DataProductFull struct {
DataProduct
ConnectionCode string `json:"connectionCode,omitempty"`
ConnectionName string `json:"connectionName,omitempty"`
SystemCode string `json:"systemCode,omitempty"`
ExchangeCode string `json:"exchangeCode,omitempty"`
}
type Exchange ¶
type TradingSession ¶
type TradingSession struct {
Common
Username string `json:"username"`
Name string `json:"name"`
Session string `json:"session"`
}
func GetTradingSessionById ¶
func GetTradingSessionById(tx *gorm.DB, id uint) (*TradingSession, error)
func (TradingSession) TableName ¶
func (TradingSession) TableName() string
type TradingSystem ¶
type TradingSystem struct {
Common
Username string `json:"username"`
DataProductId uint `json:"dataProductId"`
BrokerProductId uint `json:"brokerProductId"`
TradingSessionId uint `json:"tradingSessionId"`
AgentProfileId *uint `json:"agentProfileId"`
Name string `json:"name"`
Timeframe int `json:"timeframe"`
StrategyType string `json:"strategyType"`
Overnight bool `json:"overnight"`
Tags string `json:"tags"`
ExternalRef string `json:"externalRef"`
Finalized bool `json:"finalized"`
InSampleFrom types.Date `json:"inSampleFrom"`
InSampleTo types.Date `json:"inSampleTo"`
EngineCode string `json:"engineCode"`
}
func GetTradingSystemById ¶
func GetTradingSystemById(tx *gorm.DB, id uint) (*TradingSystem, error)
func (TradingSystem) TableName ¶
func (TradingSystem) TableName() string
type TradingSystemFull ¶
type TradingSystemFull struct {
TradingSystem
DataSymbol string `json:"dataSymbol,omitempty"`
BrokerSymbol string `json:"brokerSymbol,omitempty"`
TradingSession string `json:"tradingSession,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.