Documentation ¶
Index ¶
- Variables
- func CalculateMinuteToExpire(strategy int) int
- func DeleteStrangeBuyOrderRecords() int
- func FilledCheck(productCode string) ([]string, error)
- func GetResults() (string, error)
- func NewMysqlBase()
- func ShouldPlaceBuyOrder(max_buy_orders, max_sell_orders int) (bool, error)
- func SyncBuyOrders(events *[]OrderEvent)
- func UpdateCancelledBuyOrder(order_id string) error
- func UpdateFilledOrder(order_id string) error
- func UpdateFilledOrderWithBuyOrder(order_id string) error
- type BuyOrder
- type BuyOrderInfo
- type OrderEvent
Constants ¶
This section is empty.
Variables ¶
View Source
var AppDB *sql.DB
View Source
var GormDB *gorm.DB
Functions ¶
func CalculateMinuteToExpire ¶
func DeleteStrangeBuyOrderRecords ¶
func DeleteStrangeBuyOrderRecords() int
func FilledCheck ¶
func NewMysqlBase ¶
func NewMysqlBase()
func ShouldPlaceBuyOrder ¶
- 注文前の判断メソッド
- 買り注文の前に呼ばれ、 1. 未約定の買い注文数 < 最大買い注文数 2. 未約定の売り注文数 < 最大売り注文数 を両方満たす場合にtrueを返却。
func SyncBuyOrders ¶
func SyncBuyOrders(events *[]OrderEvent)
func UpdateCancelledBuyOrder ¶
func UpdateFilledOrder ¶
Types ¶
type BuyOrder ¶
type BuyOrder struct { ID uint `gorm:"primary_key"` OrderID string `json:"order_id"` ProductCode string `json:"product_code"` Side string `json:"side"` Price float64 `json:"price"` Size float64 `json:"size"` Exchange string `json:"exchange"` Filled int `json:"filled"` Timestamp string `json:"timestamp"` Updatetime string `json:"updatetime"` }
TODO structを整理すること TODO timestampはstring以外の型にすること
func GetCancelledBuyOrders ¶
type BuyOrderInfo ¶
type BuyOrderInfo struct { OrderID string `json:"order_id"` Price float64 `json:"price"` ProductCode string `json:"product_code"` Size float64 `json:"size"` Exchange string `json:"exchange"` Strategy float64 `json:"strategy"` }
func CheckFilledBuyOrders ¶
func CheckFilledBuyOrders() []BuyOrderInfo
func (*BuyOrderInfo) CalculateSellOrderPrice ¶
func (buyOrderInfo *BuyOrderInfo) CalculateSellOrderPrice() float64
type OrderEvent ¶
type OrderEvent struct { OrderID string `json:"order_id"` Time time.Time `json:"time"` ProductCode string `json:"product_code"` Side string `json:"side"` Price float64 `json:"price"` Size float64 `json:"size"` Exchange string `json:"exchange"` Filled int `json:"filled"` Strategy int `json:"strategy"` }
func (*OrderEvent) BuyOrder ¶
func (e *OrderEvent) BuyOrder() error
func (*OrderEvent) SellOrder ¶
func (e *OrderEvent) SellOrder(pid string) error
Click to show internal directories.
Click to hide internal directories.