Documentation
¶
Index ¶
- Constants
- type Book
- type Booking
- type Bookings
- type Bookingv2
- type BrokerOrders
- type Candle
- type CandleV2
- type ExecutedOrderSide
- type ExecutedOrders
- type FirstExecutedOrder
- type FirstOrder
- type MarketDirection
- type MessageType
- type NewOrderRespType
- type OrderSide
- type OrderType
- type Orders
- type SecondExecutedOrder
- type SecondOrder
- type Trade
- type TypeInForce
Constants ¶
View Source
const ( // Add book BookAdd byte = 'A' // Update book BookUpdate byte = 'U' // End of messages BookEnd byte = 'E' // Cancel book BookCancel byte = 'D' // Direction of the book in case Buy BookBuy byte = 'A' // Direction of the book in case Sell BookSell byte = 'V' )
View Source
const ( // Last Price type on Quotes. LastPrice byte = '2' // Accumulated Volume. Volume byte = '9' )
View Source
const ( // Read Latest Book BookReadMessage string = "GET LASTEST BOOK" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Book ¶ added in v0.1.3
type Book struct {
Id string `json:"ID"`
StockName string `json:"StockName"`
BookType byte `json:"BookType"`
Position uint `json:"Position"`
Direction byte `json:"Direction"`
Price float64 `json:"Price"`
DateTime string `json:"DateTime"`
OrderId string `json:"OrderId"`
Quantity uint `json:"Quantity"`
OfferType byte `json:"OfferType"`
Average uint64 `json:"Average"`
}
type Booking ¶ added in v0.1.25
type Booking struct {
ID string `json:"ID"` // Unique identifier for the signal
Orders Orders `json:"Orders"` // The candle that generated the signal
Quantity float64 `json:"Quantity"` // The quantity of the order
QuantityAfterComission float64 `json:"QuantityAfterComission"` // The quantity of the order after comission
MarketDirection MarketDirection `json:"MarketDirection"` // The type of order
}
Quote struct for the Order.
type Bookingv2 ¶ added in v0.1.39
type Bookingv2 struct {
ID string `json:"ID"` // Unique identifier for the signal
Trades []Trade `json:"Trades"` // Details of the Trades
MarketDirection MarketDirection `json:"MarketDirection"` // The type of order
}
type BrokerOrders ¶ added in v0.1.28
type BrokerOrders struct {
FirstExecutedOrder FirstExecutedOrder `json:"FirstExecutedOrder"` // Details of the First Executed Order
SecondExecutedOrder SecondExecutedOrder `json:"SecondExecutedOrder"` // Details of the Second Executed Order
}
type Candle ¶ added in v0.1.1
type Candle struct {
ID string `json:"ID"`
Symbol string `json:"Symbol"`
TimeStamp string `json:"TimeStamp"`
Date string `json:"Date"`
Current float64 `json:"Current"`
Open float64 `json:"Open"`
High float64 `json:"High"`
Low float64 `json:"Low"`
Close float64 `json:"Close"`
Volume uint64 `json:"Volume"`
VolumeVariation float64 `json:"VolumeVariation"`
}
Quote struct for quote.
type CandleV2 ¶ added in v0.1.32
type CandleV2 struct {
Carrier propagation.MapCarrier `json:"Carrier"`
Candle Candle `json:"Candle"`
}
type ExecutedOrderSide ¶ added in v0.1.28
type ExecutedOrderSide int
const ( EXECUTED_BUY ExecutedOrderSide = iota EXECUTED_SELL )
func (ExecutedOrderSide) String ¶ added in v0.1.28
func (d ExecutedOrderSide) String() string
type ExecutedOrders ¶ added in v0.1.28
type ExecutedOrders struct {
ID string `json:"ID"` // Unique identifier for the signal
Orders Orders `json:"Orders"` // Details of the Orders
BrokerOrders BrokerOrders `json:"BrokerOrders"` // Details of the Broker Orders
}
type FirstExecutedOrder ¶ added in v0.1.28
type FirstExecutedOrder struct {
ID string `json:"ID"` // Unique identifier for the signal
ClientOrderId string `json:"ClientOrderId"` // The client order id
TimeStamp int64 `json:"TimeStamp"` // The time stamp of the order
Price string `json:"Price"` // The price of the order
OrigQty string `json:"OrigQty"` // The original quantity of the order
Status string `json:"Status"` // The status of the order
WorkingTime int64 `json:"workingTime"` // The time the order was placed
Commission string `json:"Commission"` // The commission of the order
TradeId int64 `json:"tradeId"` // The trade id of the order
ExecutedOrderSide ExecutedOrderSide `json:"OrderSide"` // The side of order
}
type FirstOrder ¶ added in v0.1.25
type FirstOrder struct {
ID string `json:"ID"` // Unique identifier for the signal
OrderSide OrderSide `json:"OrderSide"` // The side of order
OrderType OrderType `json:"OrderType"` // The type of order
Price float64 `json:"Price"` // The price of the order
}
FirstOrder struct for the First Order.
type MarketDirection ¶ added in v0.1.25
type MarketDirection int
const ( BULLISH MarketDirection = iota BEARISH )
func (MarketDirection) String ¶ added in v0.1.25
func (d MarketDirection) String() string
String returns the string representation of the SignalDirection.
type MessageType ¶
type MessageType byte
const ( // Quote Messages. QuoteType MessageType = 'T' // Book Messages. BookType MessageType = 'B' // News Messages. SynType MessageType = 'S' )
type NewOrderRespType ¶ added in v0.1.28
type NewOrderRespType int
const ( ACK NewOrderRespType = iota FULL RESULT )
func (NewOrderRespType) String ¶ added in v0.1.28
func (d NewOrderRespType) String() string
type Orders ¶ added in v0.1.25
type Orders struct {
ID string `json:"ID"` // Unique identifier for the signal
First FirstOrder `json:"FirstOrder"` // Details of the First Signal
Second SecondOrder `json:"SecondOrder"` // Details of the Second Signal
Strength float64 `json:"Strength"` // 0.0 to 1.0
Candle Candle `json:"Candle"` // The candle that generated the signal
Volume float64 `json:"Volume"` // The volume of the signal
}
Orders struct for the Orders.
type SecondExecutedOrder ¶ added in v0.1.28
type SecondExecutedOrder struct {
ID string `json:"ID"` // Unique identifier for the signal
ClientOrderId string `json:"ClientOrderId"` // The client order id
TimeStamp int64 `json:"TimeStamp"` // The time stamp of the order
Price string `json:"Price"` // The price of the order
OrigQty string `json:"OrigQty"` // The original quantity of the order
Status string `json:"Status"` // The status of the order
WorkingTime int64 `json:"workingTime"` // The time the order was placed
ExecutedOrderSide ExecutedOrderSide `json:"OrderSide"` // The side of order
}
type SecondOrder ¶ added in v0.1.25
type SecondOrder struct {
ID string `json:"ID"` // Unique identifier for the signal
StopGain float64 `json:"StopGain"` // The price target for the signal
OrderSide OrderSide `json:"OrderSide"` // The side of order
OrderType OrderType `json:"OrderType"` // The type of order
}
SecondOrder struct for the Second Order.
type Trade ¶ added in v0.1.41
type Trade struct {
ID string `json:"ID"` // Unique identifier for the signal
FristOrder FirstOrder `json:"FirstOrder"` // Details of the First Signal
SecondOrder SecondOrder `json:"SecondOrder"` // Details of the Second Signal
Quantity float64 `json:"Quantity"` // The quantity of the order
Candle Candle `json:"Candle"` // The candle that generated the signal
Gain float64 `json:"Gain"` // The gain of the trade
}
type TypeInForce ¶ added in v0.1.28
type TypeInForce int
const (
GTC TypeInForce = iota
)
func (TypeInForce) String ¶ added in v0.1.28
func (d TypeInForce) String() string
Click to show internal directories.
Click to hide internal directories.