Versions in this module Expand all Collapse all v0 v0.1.1 Jul 16, 2026 v0.1.0 Jul 16, 2026 Changes in this version + const ActionClose + const ActionOpen + const OrderStatusCanceled + const OrderStatusCanceledPartiallyFilled + const OrderStatusExpired + const OrderStatusFilled + const OrderStatusPartiallyFilled + const OrderStatusPendingCancel + const OrderStatusPlaced + const OrderStatusReceived + const OrderStatusRejected + const OrderStatusRejectedPartiallyFilled + const OrderTypeMarket + const OrderTypeMarketIfTouched + const SettlementCFD + const SettlementMarginTrade + const SettlementReal + const SettlementRealFutures + const StopLossFixed + const StopLossTrailing + const TransactionBuy + const TransactionBuyToCover + const TransactionSell + const TransactionSellShort + type APIError struct + Message string + Status int + func (e *APIError) Error() string + type AccountBalance struct + AccountID string + AccountType AccountType + Balance float64 + Currency string + DisplayBalance float64 + DisplayCurrency string + EquityDetails *EquityDetails + ExchangeRate float64 + SubType string + type AccountSnapshot struct + AccountID string + AccountType AccountType + Cash float64 + Currency string + DisplayCash float64 + DisplayInvestedAmount float64 + DisplayPnl float64 + DisplayTotal float64 + ExchangeRate float64 + InvestedAmount float64 + Pnl float64 + Total float64 + USDRate float64 + type AccountType string + const AccountTypeCash + const AccountTypeCrypto + const AccountTypeMoneyFarm + const AccountTypeOptions + const AccountTypeSpaceship + const AccountTypeTrading + func (a *AccountType) UnmarshalJSON(b []byte) error + type Balance struct + Balances []AccountBalance + DisplayCurrency string + GCID int64 + TotalBalance float64 + type BalanceHistory struct + DisplayCurrency string + FromDate string + GCID int64 + Snapshots []BalanceSnapshot + ToDate string + type BalanceHistoryParams struct + AccountTypes []AccountType + DisplayCurrency string + FromDate time.Time + ToDate time.Time + type BalanceSnapshot struct + AccountSnapshots []AccountSnapshot + Date string + DisplayTotalBalance float64 + DisplayTotalCash float64 + DisplayTotalInvestedAmount float64 + DisplayTotalPnl float64 + TotalBalance float64 + TotalCash float64 + TotalCurrencyISO string + TotalExchangeRate float64 + TotalInvestedAmount float64 + TotalPnl float64 + type BankIdentifier struct + Name string + Value string + type BankTransferTransactionDetails struct + BankIdentifier []BankIdentifier + Description string + PaymentReference string + type Candle struct + Close float64 + FromDate time.Time + High float64 + InstrumentID int + Low float64 + Open float64 + Volume float64 + type CardTransactionDetails struct + AuthorizationStatus string + CardID string + Country string + MerchantName string + type CashCounterparty struct + Name string + Type string + type CashPagination struct + HasNext bool + NextPageToken string + PageSize int + type CashTransaction struct + AccountID string + Amount string + BankTransferTransactionDetails *BankTransferTransactionDetails + CardTransactionDetails *CardTransactionDetails + ConversionRate string + Counterparty CashCounterparty + Currency string + Direction string + ID string + InternalTransferTransactionDetails *InternalTransferTransactionDetails + OriginalAmount string + OriginalCurrency string + PostedAt time.Time + Status string + TransactionSubtype string + TransactionType string + type CashTransactionsPage struct + Pagination CashPagination + Results []CashTransaction + type CashTransactionsParams struct + PageSize int + PageToken string + type Client struct + func New(apiKey, userKey string, opts ...Option) *Client + func (c *Client) AggregatedBalances(ctx context.Context) (Balance, error) + func (c *Client) Balance(ctx context.Context) (Balance, error) + func (c *Client) BalanceHistory(ctx context.Context, params BalanceHistoryParams) (BalanceHistory, error) + func (c *Client) BalancesByType(ctx context.Context, accountType AccountType) (Balance, error) + func (c *Client) CancelCloseOrder(ctx context.Context, orderID int64) (string, error) + func (c *Client) CancelOrder(ctx context.Context, orderID int64) (string, error) + func (c *Client) Candles(ctx context.Context, instrumentID int, interval Interval, count int) ([]Candle, error) + func (c *Client) CashTransactions(ctx context.Context, accountID string, params CashTransactionsParams) (CashTransactionsPage, error) + func (c *Client) CloseOrderInfo(ctx context.Context, orderID int64) (OrderLookup, error) + func (c *Client) ClosePosition(ctx context.Context, positionID int64, instrumentID int, ...) (ClosePositionResult, error) + func (c *Client) ClosingPrices(ctx context.Context) ([]InstrumentClosingPrices, error) + func (c *Client) CreateOrder(ctx context.Context, req OrderRequest) (OrderResult, error) + func (c *Client) Exchanges(ctx context.Context) ([]Exchange, error) + func (c *Client) Identity(ctx context.Context) (Identity, error) + func (c *Client) InstrumentDisplayData(ctx context.Context, ids []int) ([]InstrumentDisplayData, error) + func (c *Client) InstrumentTypes(ctx context.Context) ([]InstrumentType, error) + func (c *Client) ModifyPositionSLTP(ctx context.Context, positionID int64, stopLossRate, takeProfitRate *float64) (PositionEditResult, error) + func (c *Client) OrderInfo(ctx context.Context, orderID int64) (OrderLookup, error) + func (c *Client) OrderInfoByReference(ctx context.Context, referenceID string) (OrderLookup, error) + func (c *Client) PortfolioBreakdown(ctx context.Context) (ClientPortfolio, error) + func (c *Client) PortfolioSummary(ctx context.Context) (ClientPortfolio, error) + func (c *Client) Rates(ctx context.Context, ids []int) ([]Rate, error) + func (c *Client) ResolveInstrument(ctx context.Context, symbol string) (Instrument, error) + func (c *Client) SearchInstruments(ctx context.Context, symbol string) ([]Instrument, error) + func (c *Client) TradingCostEstimate(ctx context.Context, req OrderRequest) (CostEstimate, error) + func (c *Client) TradingEligibility(ctx context.Context, instrumentID int) (InstrumentEligibility, error) + func (c *Client) TradingHistory(ctx context.Context, params TradeHistoryParams) ([]ClosedTrade, error) + type ClientPortfolio struct + AccountCurrencyID int + BonusCredit float64 + Credit float64 + Mirrors []Mirror + Orders []PendingOrder + OrdersForClose []OrderForClose + OrdersForOpen []OrderForOpen + Positions []Position + UnrealizedPnL float64 + type CloseOrderReceipt struct + CID int64 + InstrumentID int + LastUpdate time.Time + OpenDateTime time.Time + OrderID int64 + OrderType int + PositionID int64 + StatusID int + UnitsToDeduct float64 + type ClosePositionResult struct + OrderForClose CloseOrderReceipt + Token string + type ClosedTrade struct + CloseRate float64 + CloseTimestamp time.Time + Fees float64 + InitialInvestment float64 + InstrumentID int + Investment float64 + IsBuy bool + Leverage int + NetProfit float64 + OpenRate float64 + OpenTimestamp time.Time + OrderID int64 + ParentPositionID int64 + PositionID int64 + SocialTradeID int64 + StopLossRate float64 + TakeProfitRate float64 + TrailingStopLoss bool + Units float64 + type ClosingPriceSet struct + Daily PeriodClose + Monthly PeriodClose + Weekly PeriodClose + type CostEstimate struct + Costs []TradeCost + InstrumentID int + LastUpdated time.Time + Symbol string + type EquityDetails struct + Available *float64 + Balance *float64 + BalanceInFiat *float64 + CryptoID *int + CurrentPNL *float64 + FiatConversionCurrency string + FrozenCash *float64 + OrderIndex *int + SpendableBalance *float64 + SpendableBalanceInFiat *float64 + TotalBalance *float64 + TotalBalanceInFiat *float64 + TotalUsedMargin *float64 + type Exchange struct + ExchangeDescription string + ExchangeID int + type Identity struct + AvatarURL string + DateOfBirth string + DemoCID int64 + FirstName string + GCID int64 + Gender int + Language int + LastName string + MiddleName string + PlayerLevel int + RealCID int64 + Scopes []string + Username string + type Instrument struct + CurrentRate float64 + DisplayName string + ExchangeID int + InstrumentID int + InstrumentTypeID int + InternalSymbolFull string + IsCurrentlyTradable bool + IsDelisted bool + type InstrumentClosingPrices struct + ClosingPrices ClosingPriceSet + InstrumentID int + OfficialClosingPrice float64 + type InstrumentDisplayData struct + ExchangeID int + HasExpirationDate bool + Images []InstrumentImage + InstrumentDisplayName string + InstrumentID int + InstrumentTypeID int + IsInternalInstrument bool + PriceSource string + StocksIndustryID int + SymbolFull string + type InstrumentEligibility struct + AdditionalBufferPercent *float64 + AllowClosePosition bool + AllowEntryOrders bool + AllowExitOrders bool + AllowMitOrders bool + AllowOpenPosition bool + AllowPartialClosePosition bool + AllowTrailingStopLoss bool + AllowedOrderQuantityType string + InitialMarginInAssetCurrency *float64 + InstrumentID int + LeverageConfigs []LeverageConfig + MaxUnitsPerOrder float64 + MinPositionExposure float64 + OrderFillBehaviorType string + RequiresW8Ben *bool + StopLossMarginInAssetCurrency *float64 + Symbol string + TradeUnitType string + UnitsQuantityType string + type InstrumentImage struct + BackgroundColor string + Height int + InstrumentID int + TextColor string + URI string + Width int + type InstrumentType struct + InstrumentTypeDescription string + InstrumentTypeID int + type InternalTransferTransactionDetails struct + TransferID string + type Interval string + const IntervalFifteenMinutes + const IntervalFiveMinutes + const IntervalFourHours + const IntervalOneDay + const IntervalOneHour + const IntervalOneMinute + const IntervalOneWeek + const IntervalTenMinutes + const IntervalThirtyMinutes + type LeverageConfig struct + AllowEditStopLoss bool + AllowEditTakeProfit bool + AllowStopLossTakeProfit bool + DefaultStopLossPercentage float64 + DefaultTakeProfitPercentage float64 + Direction string + IsPotential bool + LeverageValues []int + MaxStopLossPercentage float64 + MaxTakeProfitPercentage float64 + MinPositionAmount float64 + MinStopLossPercentage float64 + MinTakeProfitPercentage float64 + SettlementType string + type Mirror struct + AvailableAmount float64 + CID int64 + ClosedPositionsNetProfit float64 + CopyExistingPositions bool + DepositSummary float64 + InitialInvestment float64 + IsPaused bool + MirrorID int + MirrorStatusID int + OrdersForClose []OrderForClose + OrdersForOpen []OrderForOpen + ParentCID int64 + ParentUsername string + PendingForClosure bool + Positions []Position + StartedCopyDate time.Time + StopLossAmount float64 + StopLossPercentage float64 + WithdrawalSummary float64 + type Option func(*Client) + func Demo() Option + func Real() Option + func WithHTTPClient(h *http.Client) Option + type OrderAsset struct + Currency string + InstrumentID int + Leverage int + SettlementType string + Side string + Symbol string + type OrderForClose struct + CID int64 + InstrumentID int + LastUpdate time.Time + LotsToDeduct float64 + OpenDateTime time.Time + OrderID int64 + OrderType int + PositionID int64 + StatusID int + UnitsToDeduct float64 + type OrderForOpen struct + Amount float64 + AmountInUnits float64 + CID int64 + FrozenAmount float64 + InstrumentID int + IsBuy bool + IsNoStopLoss bool + IsNoTakeProfit bool + IsTslEnabled bool + LastUpdate time.Time + Leverage int + LotCount float64 + MirrorID int + OpenDateTime time.Time + OrderID int64 + OrderType int + StatusID int + StopLossRate float64 + TakeProfitRate float64 + TotalExternalCosts float64 + type OrderLookup struct + AccountID int64 + Action string + Asset OrderAsset + EtoroOrderTypeID int + FrozenAmount *float64 + GCID int64 + LastUpdate time.Time + OpenActionType string + OpenStopLossRate *float64 + OpenTakeProfitRate *float64 + OrderCurrency string + OrderID int64 + PortfolioID int + PositionExecutions []PositionExecution + PositionsToClose []int64 + RequestTime time.Time + RequestType string + RequestedAmount *float64 + RequestedContracts *float64 + RequestedTriggerRate *float64 + RequestedUnits *float64 + Status OrderStatus + StopLossType string + TotalCosts float64 + Transaction string + Type string + type OrderRequest struct + Action string + AdditionalMargin *float64 + Amount *float64 + Contracts *float64 + InstrumentID int + Leverage int + OrderCurrency string + OrderType string + PositionIDs []int64 + SettlementType string + StopLossRate *float64 + StopLossType string + Symbol string + TakeProfitRate *float64 + Transaction string + TriggerRate *float64 + Units *float64 + type OrderResult struct + OrderID int64 + ReferenceID string + RequestID string + Token string + type OrderStatus struct + ErrorCode int + ErrorMessage string + ID int + Name string + type PendingOrder struct + Amount float64 + CID int64 + InstrumentID int + IsBuy bool + IsNoStopLoss bool + IsNoTakeProfit bool + IsTslEnabled bool + Leverage int + OpenDateTime time.Time + OrderID int64 + Rate float64 + StopLossRate float64 + TakeProfitRate float64 + Units float64 + type PeriodClose struct + Date time.Time + Price float64 + func (p PeriodClose) HasData() bool + type Position struct + Amount float64 + CID int64 + InitialAmountInDollars float64 + InitialUnits float64 + InstrumentID int + IsBuy bool + IsDetached bool + IsNoStopLoss bool + IsNoTakeProfit bool + IsPartiallyAltered bool + IsTslEnabled bool + Leverage float64 + LotCount float64 + MirrorID int + OpenConversionRate float64 + OpenDateTime time.Time + OpenPositionActionType int + OpenRate float64 + OrderID int64 + OrderType int + ParentPositionID int64 + PnLVersion int + PositionID int64 + RedeemStatusID int + SettlementTypeID int + StopLossRate float64 + StopLossVersion int + TakeProfitRate float64 + TotalExternalFees float64 + TotalExternalTaxes float64 + TotalFees float64 + Units float64 + UnitsBaseValueDollars float64 + UnrealizedPnL *PositionPnL + type PositionEditResult struct + OperationID string + PositionID int64 + ReferenceID string + type PositionExecution struct + AddedFunds float64 + InitialExposureAccountCurrency float64 + InitialExposureAssetCurrency float64 + InvestedAmountCurrency float64 + MarginAccountCurrency float64 + MarginAssetCurrency float64 + OpeningData PositionOpeningData + PositionID int64 + RemainingContracts *float64 + RemainingUnits float64 + State string + StopLossRate *float64 + TakeProfitRate *float64 + type PositionOpeningData struct + AvgConversionRate float64 + AvgPrice float64 + Contracts *float64 + ExecutionTime time.Time + Fees float64 + MarketSpread float64 + Markup float64 + OpenTime time.Time + OrderID int64 + PriceID int64 + Taxes float64 + Units *float64 + type PositionPnL struct + AssetCurrencyID int + CloseConversionRate float64 + CloseRate float64 + ExposureInAccountCurrency float64 + ExposureInAssetCurrency float64 + MarginCurrencyID int + MarginInAccountCurrency float64 + MarginInAssetCurrency float64 + PnL float64 + PnLAssetCurrency float64 + Timestamp time.Time + type Rate struct + Ask float64 + Bid float64 + ConversionRateAsk float64 + ConversionRateBid float64 + Date time.Time + InstrumentID int + LastExecution float64 + PriceRateID int + type TradeCost struct + Amount float64 + CostType string + Currency string + type TradeHistoryParams struct + MinDate time.Time + Page int + PageSize int