{"modulePath":"github.com/QuantProcessing/exchanges","version":"v1.0.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package account\n\n## Functions\n\n```go\nfunc CanOrderTransition(from model.OrderStatus, to model.OrderStatus) bool\n```\n\n```go\nfunc NextOrderStatus(from model.OrderStatus, to model.OrderStatus) (model.OrderStatus, bool)\n```\n\n## Types\n\n```go\ntype MissingOpenOrderRepairPolicy struct {\n\tMissingStatus        model.OrderStatus\n\tRecentActivityWindow time.Duration\n\tNow                  time.Time\n}\n```\n\n```go\ntype OrderTracker struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (t *OrderTracker) C() \u003c-chan model.OrderStatusReport\n```\n\n```go\nfunc (t *OrderTracker) Close()\n```\n\n```go\nfunc (t *OrderTracker) Fills() \u003c-chan model.FillReport\n```\n\n```go\nfunc (t *OrderTracker) Latest() (model.OrderStatusReport, bool)\n```\n\n```go\ntype PositionRepairDiscrepancy struct {\n\tKind         string\n\tAccountID    model.AccountID\n\tInstrumentID model.InstrumentID\n\tPositionID   model.PositionID\n\tAttempts     int\n\tReason       string\n}\n```\n\n```go\ntype PositionRepairPolicy struct {\n\tMaxAttempts int\n\tNow         time.Time\n}\n```\n\n```go\ntype PositionRepairResult struct {\n\tGenerated  []model.PositionStatusReport\n\tUnresolved []PositionRepairDiscrepancy\n}\n```\n\n```go\ntype Reconciler struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewReconciler(c *cache.Cache) *Reconciler\n```\n\n```go\nfunc (r *Reconciler) Apply(event model.ExecutionEvent) error\n```\n\n```go\nfunc (r *Reconciler) MissingPositionReports(accountID model.AccountID, instrumentID model.InstrumentID, reports []model.PositionStatusReport) ([]model.PositionStatusReport, error)\n```\n\n```go\nfunc (r *Reconciler) ReconcileMissingOpenOrders(accountID model.AccountID, instrumentID model.InstrumentID, reports []model.OrderStatusReport, missingStatus model.OrderStatus) ([]model.OrderStatusReport, error)\n```\n\n```go\nfunc (r *Reconciler) ReconcileMissingOpenOrdersWithPolicy(accountID model.AccountID, instrumentID model.InstrumentID, reports []model.OrderStatusReport, policy MissingOpenOrderRepairPolicy) ([]model.OrderStatusReport, error)\n```\n\n```go\nfunc (r *Reconciler) RepairPositionReports(accountID model.AccountID, instrumentID model.InstrumentID, reports []model.PositionStatusReport, policy PositionRepairPolicy) (PositionRepairResult, error)\n```\n\n```go\ntype TradingAccount struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewTradingAccount(client venue.ExecutionClient, cfg TradingAccountConfig) (*TradingAccount, error)\n```\n\n```go\nfunc (a *TradingAccount) Cache() *cache.Cache\n```\n\n```go\nfunc (a *TradingAccount) CancelOrder(ctx context.Context, cancel model.CancelOrder) (model.OrderStatusReport, error)\n```\n\n```go\nfunc (a *TradingAccount) Health() TradingAccountHealth\n```\n\n```go\nfunc (a *TradingAccount) ModifyOrder(ctx context.Context, modify model.ModifyOrder) (model.OrderStatusReport, error)\n```\n\n```go\nfunc (a *TradingAccount) QueryAccount(ctx context.Context) (model.AccountSnapshot, error)\n```\n\n```go\nfunc (a *TradingAccount) QueryOrder(ctx context.Context, query model.QueryOrder) (model.OrderStatusReport, error)\n```\n\n```go\nfunc (a *TradingAccount) Start(ctx context.Context) error\n```\n\n```go\nfunc (a *TradingAccount) Stop(ctx context.Context) error\n```\n\n```go\nfunc (a *TradingAccount) SubmitOrder(ctx context.Context, order model.SubmitOrder) (*OrderTracker, error)\n```\n\n```go\ntype TradingAccountConfig struct {\n\tCache                   *cache.Cache\n\tInstruments             []model.InstrumentID\n\tBufferSize              int\n\tReconcileInterval       time.Duration\n\tMissingOrderRepairDelay time.Duration\n}\n```\n\n```go\ntype TradingAccountHealth struct {\n\tReady                bool\n\tAccountReady         bool\n\tOrderStreamReady     bool\n\tFillsUnsupported     bool\n\tPositionsUnsupported bool\n\tReconnects           int64\n\tReconciliations      int64\n\tAccountEvents        int64\n\tOrderEvents          int64\n\tFillEvents           int64\n\tPositionEvents       int64\n\tSlowSubscriberDrops  int64\n\tLastEventTime        time.Time\n\tLastReconcileTime    time.Time\n\tLastError            error\n}\n```\n\n","path":"github.com/QuantProcessing/exchanges/account","name":"account","synopsis":"","isRedistributable":true}
