Documentation ¶
Index ¶
- Variables
- type Exchange
- func (e *Exchange) ExecuteOrder(o order.Event, dh data.Handler, om *engine.OrderManager, ...) (fill.Event, error)
- func (e *Exchange) GetCurrencySettings(exch string, a asset.Item, cp currency.Pair) (Settings, error)
- func (e *Exchange) Reset() error
- func (e *Exchange) SetExchangeAssetCurrencySettings(a asset.Item, cp currency.Pair, c *Settings)
- type ExecutionHandler
- type Leverage
- type MinMax
- type Settings
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrCannotTransact returns when its an issue to do nothing for an event ErrCannotTransact = errors.New("cannot transact") )
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, dh data.Handler, om *engine.OrderManager, funds funding.IFundReleaser) (fill.Event, 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
func (*Exchange) GetCurrencySettings ¶
func (e *Exchange) GetCurrencySettings(exch string, a asset.Item, cp currency.Pair) (Settings, error)
GetCurrencySettings returns the settings for an exchange, asset currency
type ExecutionHandler ¶
type ExecutionHandler interface { SetExchangeAssetCurrencySettings(asset.Item, currency.Pair, *Settings) GetCurrencySettings(string, asset.Item, currency.Pair) (Settings, error) ExecuteOrder(order.Event, data.Handler, *engine.OrderManager, funding.IFundReleaser) (fill.Event, error) Reset() error }
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 exchange.IBotExchange UseRealOrders bool Pair currency.Pair Asset asset.Item MakerFee decimal.Decimal TakerFee decimal.Decimal BuySide MinMax SellSide MinMax Leverage Leverage MinimumSlippageRate decimal.Decimal MaximumSlippageRate decimal.Decimal Limits gctorder.MinMaxLevel CanUseExchangeLimits bool SkipCandleVolumeFitting bool UseExchangePNLCalculation 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.