Documentation
¶
Index ¶
- Variables
- func GetOKexResults() (string, error)
- func SyncOkexBuyOrders(exchange string, orders *[]OkexOrderEvent)
- func SyncOkexSellOrders(orders *[]OkexOrderEvent)
- func UpdateCancelledOrder(order_id string) error
- func UpdateOkexSellOrders(order_id, sell_order_id string, sell_price, sell_size float64)
- type APIClient
- func (apiClient *APIClient) CancelOrder(orderID, pair string) (*OrderResponse, error)
- func (apiClient *APIClient) GetBlance(currency string) (*Balance, error)
- func (apiClient *APIClient) GetOkexTicker(productCode string) (*Ticker, error)
- func (apiClient *APIClient) GetOrderList(productCode, state string) (*[]Order, error)
- func (apiClient *APIClient) PlaceOrder(order *Order) (*OrderResponse, error)
- type Balance
- type BuyOrder
- type OkexFilledBuyOrder
- type OkexOrderEvent
- type OkjBuyOrder
- type Order
- type OrderResponse
- type Ticker
Constants ¶
This section is empty.
Variables ¶
View Source
var BaseURL string
View Source
var TableName string
Functions ¶
func SyncOkexBuyOrders ¶
func SyncOkexBuyOrders(exchange string, orders *[]OkexOrderEvent)
OKEXからデータを取得して、DBと同期するメソッド
func SyncOkexSellOrders ¶
func SyncOkexSellOrders(orders *[]OkexOrderEvent)
func UpdateCancelledOrder ¶
func UpdateOkexSellOrders ¶
売り注文を発注した際にDBのレコードをアップデートする
Types ¶
type APIClient ¶
type APIClient struct {
// contains filtered or unexported fields
}
func (*APIClient) CancelOrder ¶
func (apiClient *APIClient) CancelOrder(orderID, pair string) (*OrderResponse, error)
Cancel an Order
func (*APIClient) GetOkexTicker ¶
GetTickerInfo
func (*APIClient) GetOrderList ¶
GetOrderList
func (*APIClient) PlaceOrder ¶
func (apiClient *APIClient) PlaceOrder(order *Order) (*OrderResponse, error)
Place an Order
type BuyOrder ¶
type BuyOrder struct { ID uint `gorm:"primary_key"` OrderID string `json:"order_id"` Pair string `json:"pair"` Price float64 `json:"price"` Size float64 `json:"size"` Exchange string `json:"exchange"` State int `json:"state"` SellOrderID string `json:"sell_order_id"` SellOrderState string `json:"sell_order_state"` SellPrice float64 `json:"sell_price"` Side string `json:"side"` Timestamp string `json:"timestamp"` Updatetime string `json:"updatetime"` }
TODO structを整理すること TODO timestampはstring以外の型にすること
func GetCancelledOrders ¶
type OkexFilledBuyOrder ¶
type OkexFilledBuyOrder struct { OrderID string `json:"order_id"` Price float64 `json:"price"` Size float64 `json:"size"` }
func GetSoldBuyOrderList ¶
func GetSoldBuyOrderList(pair string) []OkexFilledBuyOrder
type OkexOrderEvent ¶
type OkexOrderEvent struct { OrderID string `json:"order_id"` ClientOid string `json:"client_oid"` Type string `json:"type"` Side string `json:"side"` InstrumentID string `json:"instrument_id"` OrderType string `json:"order_type"` Price string `json:"price"` Size string `json:"size"` State string `json:"state"` Timestamp time.Time `json:"time"` }
type OkjBuyOrder ¶
type OkjBuyOrder struct { ID uint `gorm:"primary_key"` OrderID string `json:"order_id"` Pair string `json:"pair"` Price float64 `json:"price"` Size float64 `json:"size"` Exchange string `json:"exchange"` State int `json:"state"` SellOrderID string `json:"sell_order_id"` SellOrderState string `json:"sell_order_state"` SellPrice float64 `json:"sell_price"` Side string `json:"side"` Timestamp string `json:"timestamp"` Updatetime string `json:"updatetime"` }
func GetOKJCancelledOrders ¶
func GetOKJCancelledOrders() ([]OkjBuyOrder, error)
func (*OkjBuyOrder) ConverToBuyOrder ¶
func (o *OkjBuyOrder) ConverToBuyOrder() *BuyOrder
type Order ¶
type Order struct { OrderID string `json:"order_id"` ClientOid string `json:"client_oid"` Type string `json:"type"` Side string `json:"side"` InstrumentID string `json:"instrument_id"` OrderType string `json:"order_type"` Price string `json:"price"` Size string `json:"size"` State string `json:"state"` Timestamp string `json:"timestamp"` }
type OrderResponse ¶
Click to show internal directories.
Click to hide internal directories.