Documentation ¶
Index ¶
- type Exchange
- func (e *Exchange) ExecuteOrder(o order.Event, data data.Handler, orderManager *engine.OrderManager, ...) (*fill.Fill, error)
- func (e *Exchange) GetCurrencySettings(exch string, a asset.Item, cp currency.Pair) (Settings, error)
- func (e *Exchange) Reset()
- func (e *Exchange) SetExchangeAssetCurrencySettings(exch string, a asset.Item, cp currency.Pair, c *Settings)
- type ExecutionHandler
- type Leverage
- type MinMax
- type Settings
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Exchange ¶
type Exchange struct {
CurrencySettings []Settings
}
Exchange contains all the currency settings
func (*Exchange) ExecuteOrder ¶
func (e *Exchange) ExecuteOrder(o order.Event, data data.Handler, orderManager *engine.OrderManager, funds funding.IPairReleaser) (*fill.Fill, error)
ExecuteOrder assesses the portfolio manager's order event and if it passes validation will send an order to the exchange/fake order manager to be stored and raise a fill event
type ExecutionHandler ¶
type ExecutionHandler interface { SetExchangeAssetCurrencySettings(string, asset.Item, currency.Pair, *Settings) GetCurrencySettings(string, asset.Item, currency.Pair) (Settings, error) ExecuteOrder(order.Event, data.Handler, *engine.OrderManager, funding.IPairReleaser) (*fill.Fill, error) Reset() }
ExecutionHandler interface dictates what functions are required to submit an order
type Leverage ¶
type Leverage struct { CanUseLeverage bool MaximumOrdersWithLeverageRatio decimal.Decimal MaximumLeverageRate decimal.Decimal }
Leverage rules are used to allow or limit the use of leverage in orders when supported
type MinMax ¶
type MinMax struct { MinimumSize decimal.Decimal MaximumSize decimal.Decimal MaximumTotal decimal.Decimal }
MinMax are the rules which limit the placement of orders.
type Settings ¶
type Settings struct { Exchange string UseRealOrders bool Pair currency.Pair Asset asset.Item ExchangeFee decimal.Decimal MakerFee decimal.Decimal TakerFee decimal.Decimal BuySide MinMax SellSide MinMax Leverage Leverage MinimumSlippageRate decimal.Decimal MaximumSlippageRate decimal.Decimal Limits *gctorder.Limits CanUseExchangeLimits bool SkipCandleVolumeFitting bool }
Settings allow the eventhandler to size an order within the limitations set by the config file
Click to show internal directories.
Click to hide internal directories.