Documentation ¶
Index ¶
- type Event
- type Order
- func (o *Order) GetAllocatedFunds() decimal.Decimal
- func (o *Order) GetAmount() decimal.Decimal
- func (o *Order) GetBuyLimit() decimal.Decimal
- func (o *Order) GetClosePrice() decimal.Decimal
- func (o *Order) GetDirection() order.Side
- func (o *Order) GetFillDependentEvent() signal.Event
- func (o *Order) GetID() string
- func (o *Order) GetLeverage() decimal.Decimal
- func (o *Order) GetSellLimit() decimal.Decimal
- func (o *Order) GetStatus() order.Status
- func (o *Order) IsClosingPosition() bool
- func (o *Order) IsLeveraged() bool
- func (o *Order) IsLiquidating() bool
- func (o *Order) IsOrder() bool
- func (o *Order) Pair() currency.Pair
- func (o *Order) SetAmount(i decimal.Decimal)
- func (o *Order) SetDirection(s order.Side)
- func (o *Order) SetID(id string)
- func (o *Order) SetLeverage(l decimal.Decimal)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event interface { common.Event common.Directioner GetClosePrice() decimal.Decimal GetBuyLimit() decimal.Decimal GetSellLimit() decimal.Decimal SetAmount(decimal.Decimal) GetAmount() decimal.Decimal IsOrder() bool GetStatus() order.Status SetID(id string) GetID() string IsLeveraged() bool GetAllocatedFunds() decimal.Decimal GetFillDependentEvent() signal.Event IsClosingPosition() bool IsLiquidating() bool }
Event inherits common event interfaces along with extra functions related to handling orders
type Order ¶
type Order struct { *event.Base ID string Direction order.Side Status order.Status ClosePrice decimal.Decimal Amount decimal.Decimal OrderType order.Type Leverage decimal.Decimal AllocatedFunds decimal.Decimal BuyLimit decimal.Decimal SellLimit decimal.Decimal FillDependentEvent signal.Event ClosingPosition bool LiquidatingPosition bool }
Order contains all details for an order event
func (*Order) GetAllocatedFunds ¶
GetAllocatedFunds returns the amount of funds the portfolio manager has allocated to this potential position
func (*Order) GetBuyLimit ¶
GetBuyLimit returns the buy limit
func (*Order) GetClosePrice ¶
GetClosePrice returns the close price
func (*Order) GetDirection ¶
GetDirection returns the side of the order
func (*Order) GetFillDependentEvent ¶
GetFillDependentEvent returns the fill dependent event so it can be added the event queue
func (*Order) GetLeverage ¶
GetLeverage returns leverage rate
func (*Order) GetSellLimit ¶
GetSellLimit returns the sell limit
func (*Order) IsClosingPosition ¶
IsClosingPosition returns whether position is being closed
func (*Order) IsLeveraged ¶
IsLeveraged returns if it is leveraged
func (*Order) IsLiquidating ¶
IsLiquidating returns whether position is being liquidated
func (*Order) SetDirection ¶
SetDirection sets the side of the order
func (*Order) SetLeverage ¶
SetLeverage sets leverage