func (order StatusOrder) Execute(client bitcoin.Client) (err error) { if order.status == ORDER_KEEP { fmt.Printf("Keep order %v\n", order) return } if order.status == ORDER_REMOVE { return client.CancelOrder(order.Order.Id) } if order.Type == bitcoin.BUY_ORDER { return client.Buy(order.Price, order.Amount) } else { return client.Sell(order.Price, order.Amount) } }