README ¶
GoCryptoTrader Backtester: Order package
This order package is part of the GoCryptoTrader codebase.
This is still in active development
You can track ideas, planned features and what's in progress on this Trello board: https://trello.com/b/ZAhMhpOy/gocryptotrader.
Join our slack to discuss all things related to GoCryptoTrader! GoCryptoTrader Slack
Order package overview
The Order Event Type is an event type raised after the portfolio manager has passed all its checks and wishes to make an order It is sent to the Exchange to process and if successful, will raise a Fill Event.
The Order Event Type is based on common.EventHandler
and common.Directioner
while also having the following custom functions
SetAmount(float64)
GetAmount() float64
IsOrder() bool
GetStatus() order.Status
SetID(id string)
GetID() string
GetLimit() float64
IsLeveraged() bool
Please click GoDocs chevron above to view current GoDoc information for this package
Contribution
Please feel free to submit any pull requests or suggest any desired features to be added.
When submitting a PR, please abide by our coding guidelines:
- Code must adhere to the official Go formatting guidelines (i.e. uses gofmt).
- Code must be documented adhering to the official Go commentary guidelines.
- Code must adhere to our coding style.
- Pull requests need to be based on and opened against the
master
branch.
Donations
If this framework helped you in any way, or you would like to support the developers working on it, please donate Bitcoin to:
bc1qk0jareu4jytc0cfrhr5wgshsq8282awpavfahc
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