Documentation ¶
Index ¶
- Constants
- type AlgorithmResponse
- type AlgorithmsResponse
- type CreateAlgorithmRequest
- type HistStatIdDto
- type HistStatInRangeResponse
- type HistStatResponse
- type InstrumentInfo
- type InstrumentStat
- type InstrumentValue
- type InstrumentsInfo
- type LoadHistoryRequest
- type MoneyStat
- type MoneyValue
- type StatAlgoRequest
- type StatAlgoResponse
- type StopAlgorithmRequest
- type StopAlgorithmResponse
- type TradeStartResponse
Constants ¶
View Source
const (
InstrAmountField string = "instrAmount"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlgorithmResponse ¶
type AlgorithmResponse struct { AlgorithmID uint Strategy string `json:"strategy"` AccountId string `json:"accountId"` Figis []string `json:"figis"` MoneyLimits []*MoneyValue `json:"moneyLimits"` Params map[string]string `json:"params"` IsActive bool `json:"isActive"` InstrAvail *InstrumentsInfo `json:"instrAvail"` //Information about available instruments for algorithm CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` }
type AlgorithmsResponse ¶
type AlgorithmsResponse struct {
Algorithms []*AlgorithmResponse `json:"algorithms"`
}
AlgorithmsResponse represents algorithm list response
type CreateAlgorithmRequest ¶
type CreateAlgorithmRequest struct { AccountId string `json:"accountId"` Figis []string `json:"figis"` Strategy string `json:"strategy"` Limits []MoneyValue `json:"limits"` //Algorithm limits on using money Params map[string]string `json:"params"` InstrInit *InstrumentsInfo `json:"instrInit"` //Optional - to specify initial instrument available }
CreateAlgorithmRequest request to create new trade algorithm or history algorithm config
type HistStatIdDto ¶
type HistStatIdDto struct { Id uint HistStat *HistStatResponse Param map[string]string }
HistStatIdDto represents auxiliary dto used by range analysis
func (HistStatIdDto) String ¶
func (hs HistStatIdDto) String() string
type HistStatInRangeResponse ¶
type HistStatInRangeResponse struct { BestRes *HistStatResponse `json:"bestRes"` //best stat result Params map[string]string `json:"params"` //best stat result parameters }
HistStatInRangeResponse history range analysis result
type HistStatResponse ¶
type HistStatResponse struct { BuyOpNum uint `json:"buyOpNum"` //Number of buy operations SellOpNum uint `json:"sellOpNum"` //Number of sell operations CurBalance map[string]decimal.Decimal `json:"curBalance"` //Result profit }
HistStatResponse statistics retrieved by algorithm analysis CurBalance is result balance by the end algorithm simulation. If there are not sold instruments, price is taken from the last data and converted to currency
type InstrumentInfo ¶
type InstrumentStat ¶
type InstrumentStat struct { InstrFigi string //Instrument figi FinalAmount int64 //Final amount of lots of instrument OperationNum uint //Number of success operations with instrument made by algorithm LastLotPrice decimal.Decimal //Last price of instrument FinalMoneyVal decimal.Decimal //Final money balance by operations with instrument (sum of money spend/receive by instrument figi) Currency string //Currency of instrument }
type InstrumentValue ¶
type InstrumentsInfo ¶
type InstrumentsInfo struct {
Instruments []*InstrumentInfo `json:"instruments"`
}
type LoadHistoryRequest ¶
type MoneyValue ¶
type StatAlgoRequest ¶
type StatAlgoRequest struct {
AlgorithmID uint `form:"algorithm_id"`
}
type StatAlgoResponse ¶
type StatAlgoResponse struct { AlgorithmID uint SuccessOrders uint //Number of success orders FailedOrders uint //Number of failed orders CanceledOrders uint //Number of cancelled orders MoneyChanges []MoneyStat //Data about how money amount changed by each currency InstrumentChanges []InstrumentStat //Data about how instrument amount changed by each instrument }
type StopAlgorithmRequest ¶
type StopAlgorithmRequest struct {
AlgorithmId uint `form:"algorithmId"`
}
type StopAlgorithmResponse ¶
type TradeStartResponse ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.