Documentation
¶
Index ¶
- Constants
- Variables
- type AcceptDatetimeFormat
- type Account
- type AccountChanges
- type AccountChangesResponse
- type AccountChangesState
- type AccountConfigurationError
- type AccountConfigurationRequest
- type AccountConfigurationResponse
- type AccountFinancingMode
- type AccountID
- type AccountInstrumentsResponse
- type AccountProperties
- type AccountResponse
- type AccountSummary
- type AccountSummaryResponse
- type AccountUnits
- type AccountsResponse
- type AccumulatedAccountState
- type BaseOrderRequest
- type CalculatedAccountState
- type CalculatedPositionState
- type CalculatedTradeState
- type CancelOrderError
- type CancelOrderResponse
- type CancellableOrderType
- type CandleSpecification
- type CandlesLatestRequest
- func (c *CandlesLatestRequest) AddCandleSpecification(specification CandleSpecification) *CandlesLatestRequest
- func (c *CandlesLatestRequest) AppendQuery(b *bytebufferpool.ByteBuffer) string
- func (v CandlesLatestRequest) MarshalEasyJSON(w *jwriter.Writer)
- func (v CandlesLatestRequest) MarshalJSON() ([]byte, error)
- func (v *CandlesLatestRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (v *CandlesLatestRequest) UnmarshalJSON(data []byte) error
- func (c *CandlesLatestRequest) WithAlignmentTimezone(timezone string) *CandlesLatestRequest
- func (c *CandlesLatestRequest) WithDailyAlignment(dailyAlignment int) *CandlesLatestRequest
- func (c *CandlesLatestRequest) WithSmooth(smooth bool) *CandlesLatestRequest
- func (c *CandlesLatestRequest) WithUnits(units DecimalNumber) *CandlesLatestRequest
- func (c *CandlesLatestRequest) WithWeeklyAlignment(alignment WeeklyAlignment) *CandlesLatestRequest
- type CandlesLatestResponse
- type Candlestick
- type CandlestickData
- type CandlestickGranularity
- type CandlestickResponse
- type ClientComment
- type ClientConfigureRejectTransaction
- func (v ClientConfigureRejectTransaction) MarshalEasyJSON(w *jwriter.Writer)
- func (v ClientConfigureRejectTransaction) MarshalJSON() ([]byte, error)
- func (v *ClientConfigureRejectTransaction) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (v *ClientConfigureRejectTransaction) UnmarshalJSON(data []byte) error
- type ClientConfigureTransaction
- type ClientExtensions
- type ClientID
- type ClientPrice
- type ClientRequestID
- type ClientTag
- type CloseTransaction
- type ConversionFactor
- type CreateOrderError
- type CreateOrderRequest
- type CreateOrderResponse
- type CreateTransaction
- type Currency
- type DailyFinancingTransaction
- type DateTime
- type DayOfWeek
- type DecimalNumber
- type DelayedTradeClosureTransaction
- type Direction
- type DividendAdjustmentTransaction
- type DynamicOrderState
- type FinancingDayOfWeek
- type FixedPriceOrder
- type FixedPriceOrderReason
- type FixedPriceOrderTransaction
- type FundingReason
- type GuaranteedStopLossDetails
- type GuaranteedStopLossOrder
- type GuaranteedStopLossOrderEntryData
- func (v GuaranteedStopLossOrderEntryData) MarshalEasyJSON(w *jwriter.Writer)
- func (v GuaranteedStopLossOrderEntryData) MarshalJSON() ([]byte, error)
- func (v *GuaranteedStopLossOrderEntryData) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (v *GuaranteedStopLossOrderEntryData) UnmarshalJSON(data []byte) error
- type GuaranteedStopLossOrderLevelRestriction
- func (v GuaranteedStopLossOrderLevelRestriction) MarshalEasyJSON(w *jwriter.Writer)
- func (v GuaranteedStopLossOrderLevelRestriction) MarshalJSON() ([]byte, error)
- func (v *GuaranteedStopLossOrderLevelRestriction) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (v *GuaranteedStopLossOrderLevelRestriction) UnmarshalJSON(data []byte) error
- type GuaranteedStopLossOrderMode
- type GuaranteedStopLossOrderModeForInstrument
- type GuaranteedStopLossOrderMutability
- type GuaranteedStopLossOrderParameters
- func (v GuaranteedStopLossOrderParameters) MarshalEasyJSON(w *jwriter.Writer)
- func (v GuaranteedStopLossOrderParameters) MarshalJSON() ([]byte, error)
- func (v *GuaranteedStopLossOrderParameters) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (v *GuaranteedStopLossOrderParameters) UnmarshalJSON(data []byte) error
- type GuaranteedStopLossOrderReason
- type GuaranteedStopLossOrderRejectTransaction
- func (v GuaranteedStopLossOrderRejectTransaction) MarshalEasyJSON(w *jwriter.Writer)
- func (v GuaranteedStopLossOrderRejectTransaction) MarshalJSON() ([]byte, error)
- func (v *GuaranteedStopLossOrderRejectTransaction) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (v *GuaranteedStopLossOrderRejectTransaction) UnmarshalJSON(data []byte) error
- type GuaranteedStopLossOrderRequest
- type GuaranteedStopLossOrderTransaction
- func (v GuaranteedStopLossOrderTransaction) MarshalEasyJSON(w *jwriter.Writer)
- func (v GuaranteedStopLossOrderTransaction) MarshalJSON() ([]byte, error)
- func (v *GuaranteedStopLossOrderTransaction) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (v *GuaranteedStopLossOrderTransaction) UnmarshalJSON(data []byte) error
- type HomeConversionFactors
- type HomeConversions
- type Instrument
- type InstrumentCandlesRequest
- func (s *InstrumentCandlesRequest) AppendQuery(b *bytebufferpool.ByteBuffer) string
- func (v InstrumentCandlesRequest) MarshalEasyJSON(w *jwriter.Writer)
- func (v InstrumentCandlesRequest) MarshalJSON() ([]byte, error)
- func (v *InstrumentCandlesRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (v *InstrumentCandlesRequest) UnmarshalJSON(data []byte) error
- func (s *InstrumentCandlesRequest) WithAlignmentTimezone(timezone string) *InstrumentCandlesRequest
- func (s *InstrumentCandlesRequest) WithCount(count int) *InstrumentCandlesRequest
- func (s *InstrumentCandlesRequest) WithDailyAlignment(dailyAlignment int) *InstrumentCandlesRequest
- func (s *InstrumentCandlesRequest) WithFrom(from time.Time) *InstrumentCandlesRequest
- func (s *InstrumentCandlesRequest) WithGranularity(granularity CandlestickGranularity) *InstrumentCandlesRequest
- func (s *InstrumentCandlesRequest) WithIncludeFirst(v bool) *InstrumentCandlesRequest
- func (s *InstrumentCandlesRequest) WithInstrument(instrument InstrumentName) *InstrumentCandlesRequest
- func (s *InstrumentCandlesRequest) WithPrice(price PricingComponent) *InstrumentCandlesRequest
- func (s *InstrumentCandlesRequest) WithRange(from, to time.Time) *InstrumentCandlesRequest
- func (s *InstrumentCandlesRequest) WithSmooth(v bool) *InstrumentCandlesRequest
- func (s *InstrumentCandlesRequest) WithTo(to time.Time) *InstrumentCandlesRequest
- func (s *InstrumentCandlesRequest) WithWeeklyAlignment(alignment WeeklyAlignment) *InstrumentCandlesRequest
- type InstrumentCommission
- type InstrumentFinancing
- type InstrumentName
- type InstrumentType
- type LimitOrder
- type LimitOrderReason
- type LimitOrderRejectTransaction
- type LimitOrderRequest
- type LimitOrderTransaction
- type LiquidityRegenerationSchedule
- type LiquidityRegenerationScheduleStep
- func (v LiquidityRegenerationScheduleStep) MarshalEasyJSON(w *jwriter.Writer)
- func (v LiquidityRegenerationScheduleStep) MarshalJSON() ([]byte, error)
- func (v *LiquidityRegenerationScheduleStep) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (v *LiquidityRegenerationScheduleStep) UnmarshalJSON(data []byte) error
- type MarginCallEnterTransaction
- type MarginCallExitTransaction
- type MarginCallExtendTransaction
- type MarketIfTouchedOrder
- type MarketIfTouchedOrderReason
- type MarketIfTouchedOrderRejectTransaction
- func (v MarketIfTouchedOrderRejectTransaction) MarshalEasyJSON(w *jwriter.Writer)
- func (v MarketIfTouchedOrderRejectTransaction) MarshalJSON() ([]byte, error)
- func (v *MarketIfTouchedOrderRejectTransaction) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (v *MarketIfTouchedOrderRejectTransaction) UnmarshalJSON(data []byte) error
- type MarketIfTouchedOrderRequest
- type MarketIfTouchedOrderTransaction
- type MarketOrder
- type MarketOrderDelayedTradeClose
- type MarketOrderMarginCloseout
- type MarketOrderMarginCloseoutReason
- type MarketOrderPositionCloseout
- type MarketOrderReason
- type MarketOrderRejectTransaction
- type MarketOrderRequest
- type MarketOrderTradeClose
- type MarketOrderTransaction
- type Message
- type OpenTradeDividendAdjustment
- type OpenTradeFinancing
- type Order
- type OrderBook
- type OrderBookBucket
- type OrderBookResponse
- type OrderCancelReason
- type OrderCancelRejectTransaction
- type OrderCancelTransaction
- type OrderClientExtensionsError
- type OrderClientExtensionsModifyRejectTransaction
- func (v OrderClientExtensionsModifyRejectTransaction) MarshalEasyJSON(w *jwriter.Writer)
- func (v OrderClientExtensionsModifyRejectTransaction) MarshalJSON() ([]byte, error)
- func (v *OrderClientExtensionsModifyRejectTransaction) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (v *OrderClientExtensionsModifyRejectTransaction) UnmarshalJSON(data []byte) error
- type OrderClientExtensionsModifyTransaction
- func (v OrderClientExtensionsModifyTransaction) MarshalEasyJSON(w *jwriter.Writer)
- func (v OrderClientExtensionsModifyTransaction) MarshalJSON() ([]byte, error)
- func (v *OrderClientExtensionsModifyTransaction) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (v *OrderClientExtensionsModifyTransaction) UnmarshalJSON(data []byte) error
- type OrderClientExtensionsRequest
- type OrderClientExtensionsResponse
- type OrderFillReason
- type OrderFillTransaction
- type OrderID
- type OrderIdentifier
- type OrderParser
- type OrderPositionFill
- type OrderRequest
- type OrderRequestParser
- type OrderSpecifier
- type OrderState
- type OrderStateFilter
- type OrderTriggerCondition
- type OrderType
- type OrdersRequest
- func (g *OrdersRequest) AppendQuery(b *bytebufferpool.ByteBuffer)
- func (v OrdersRequest) MarshalEasyJSON(w *jwriter.Writer)
- func (v OrdersRequest) MarshalJSON() ([]byte, error)
- func (v *OrdersRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (v *OrdersRequest) UnmarshalJSON(data []byte) error
- func (g *OrdersRequest) WithBeforeID(beforeID OrderID) *OrdersRequest
- func (g *OrdersRequest) WithCount(count int) *OrdersRequest
- func (g *OrdersRequest) WithIDs(ids ...OrderID) *OrdersRequest
- func (g *OrdersRequest) WithInstrument(instrument InstrumentName) *OrdersRequest
- func (g *OrdersRequest) WithState(state OrderStateFilter) *OrdersRequest
- type OrdersResponse
- type Position
- type PositionAggregationMode
- type PositionBook
- type PositionBookBucket
- type PositionBookResponse
- type PositionCloseError
- type PositionCloseRequest
- type PositionCloseResponse
- type PositionFinancing
- type PositionResponse
- type PositionSide
- type PositionsResponse
- type PriceBucket
- type PriceValue
- type PricingCandlesRequest
- func (s *PricingCandlesRequest) AppendQuery(b *bytebufferpool.ByteBuffer) string
- func (v PricingCandlesRequest) MarshalEasyJSON(w *jwriter.Writer)
- func (v PricingCandlesRequest) MarshalJSON() ([]byte, error)
- func (v *PricingCandlesRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (v *PricingCandlesRequest) UnmarshalJSON(data []byte) error
- func (s *PricingCandlesRequest) WithAlignmentTimezone(timezone string) *PricingCandlesRequest
- func (s *PricingCandlesRequest) WithCount(count int) *PricingCandlesRequest
- func (s *PricingCandlesRequest) WithDailyAlignment(dailyAlignment int) *PricingCandlesRequest
- func (s *PricingCandlesRequest) WithFrom(from time.Time) *PricingCandlesRequest
- func (s *PricingCandlesRequest) WithGranularity(granularity CandlestickGranularity) *PricingCandlesRequest
- func (s *PricingCandlesRequest) WithIncludeFirst(includeFirst bool) *PricingCandlesRequest
- func (s *PricingCandlesRequest) WithPrice(price PricingComponent) *PricingCandlesRequest
- func (s *PricingCandlesRequest) WithRange(from, to time.Time) *PricingCandlesRequest
- func (s *PricingCandlesRequest) WithSmooth(v bool) *PricingCandlesRequest
- func (s *PricingCandlesRequest) WithTo(to time.Time) *PricingCandlesRequest
- func (s *PricingCandlesRequest) WithUnits(units DecimalNumber) *PricingCandlesRequest
- func (s *PricingCandlesRequest) WithWeeklyAlignment(alignment WeeklyAlignment) *PricingCandlesRequest
- type PricingCandlesResponse
- type PricingComponent
- type PricingHeartbeat
- type PricingRequest
- func (p *PricingRequest) AppendQuery(b *bytebufferpool.ByteBuffer)
- func (v PricingRequest) MarshalEasyJSON(w *jwriter.Writer)
- func (v PricingRequest) MarshalJSON() ([]byte, error)
- func (v *PricingRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (v *PricingRequest) UnmarshalJSON(data []byte) error
- func (p *PricingRequest) WithIncludeHomeConversions(includeHomeConversions bool) *PricingRequest
- func (p *PricingRequest) WithInstruments(instruments ...InstrumentName) *PricingRequest
- func (p *PricingRequest) WithSince(since time.Time) *PricingRequest
- type PricingResponse
- type PricingStreamRequest
- func (p *PricingStreamRequest) AppendQuery(url *bytebufferpool.ByteBuffer)
- func (v PricingStreamRequest) MarshalEasyJSON(w *jwriter.Writer)
- func (v PricingStreamRequest) MarshalJSON() ([]byte, error)
- func (v *PricingStreamRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (v *PricingStreamRequest) UnmarshalJSON(data []byte) error
- func (p *PricingStreamRequest) WithIncludeHomeConversions(includeHomeConversions bool) *PricingStreamRequest
- func (p *PricingStreamRequest) WithInstruments(instruments ...InstrumentName) *PricingStreamRequest
- func (p *PricingStreamRequest) WithSnapshot(snapshot bool) *PricingStreamRequest
- type QuoteHomeConversionFactors
- type ReopenTransaction
- type RequestID
- type ResetResettablePLTransaction
- type StopLossDetails
- type StopLossOrder
- type StopLossOrderReason
- type StopLossOrderRejectTransaction
- type StopLossOrderRequest
- type StopLossOrderTransaction
- type StopOrder
- type StopOrderReason
- type StopOrderRejectTransaction
- type StopOrderRequest
- type StopOrderTransaction
- type StreamClientPrice
- type StreamPriceBucket
- type Tag
- type TakeProfitDetails
- type TakeProfitOrder
- type TakeProfitOrderReason
- type TakeProfitOrderRejectTransaction
- func (v TakeProfitOrderRejectTransaction) MarshalEasyJSON(w *jwriter.Writer)
- func (v TakeProfitOrderRejectTransaction) MarshalJSON() ([]byte, error)
- func (v *TakeProfitOrderRejectTransaction) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (v *TakeProfitOrderRejectTransaction) UnmarshalJSON(data []byte) error
- type TakeProfitOrderRequest
- type TakeProfitOrderTransaction
- type TimeInForce
- type Trade
- type TradeClientExtensionsError
- type TradeClientExtensionsModifyRejectTransaction
- func (v TradeClientExtensionsModifyRejectTransaction) MarshalEasyJSON(w *jwriter.Writer)
- func (v TradeClientExtensionsModifyRejectTransaction) MarshalJSON() ([]byte, error)
- func (v *TradeClientExtensionsModifyRejectTransaction) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (v *TradeClientExtensionsModifyRejectTransaction) UnmarshalJSON(data []byte) error
- type TradeClientExtensionsModifyTransaction
- func (v TradeClientExtensionsModifyTransaction) MarshalEasyJSON(w *jwriter.Writer)
- func (v TradeClientExtensionsModifyTransaction) MarshalJSON() ([]byte, error)
- func (v *TradeClientExtensionsModifyTransaction) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (v *TradeClientExtensionsModifyTransaction) UnmarshalJSON(data []byte) error
- type TradeClientExtensionsRequest
- type TradeClientExtensionsResponse
- type TradeCloseError
- type TradeCloseResponse
- type TradeID
- type TradeModifyError
- type TradeModifyRequest
- type TradeModifyResponse
- type TradeOpen
- type TradePL
- type TradeReduce
- type TradeResponse
- type TradeSpecifier
- type TradeState
- type TradeStateFilter
- type TradeSummary
- type TradesRequest
- type TradesResponse
- type TrailingStopLossDetails
- type TrailingStopLossOrder
- type TrailingStopLossOrderReason
- type TrailingStopLossOrderRejectTransaction
- func (v TrailingStopLossOrderRejectTransaction) MarshalEasyJSON(w *jwriter.Writer)
- func (v TrailingStopLossOrderRejectTransaction) MarshalJSON() ([]byte, error)
- func (v *TrailingStopLossOrderRejectTransaction) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (v *TrailingStopLossOrderRejectTransaction) UnmarshalJSON(data []byte) error
- type TrailingStopLossOrderRequest
- type TrailingStopLossOrderTransaction
- func (v TrailingStopLossOrderTransaction) MarshalEasyJSON(w *jwriter.Writer)
- func (v TrailingStopLossOrderTransaction) MarshalJSON() ([]byte, error)
- func (v *TrailingStopLossOrderTransaction) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (v *TrailingStopLossOrderTransaction) UnmarshalJSON(data []byte) error
- type Transaction
- type TransactionFilter
- type TransactionHeartbeat
- type TransactionID
- type TransactionMessage
- type TransactionParser
- func (p *TransactionParser) Get() *Transaction
- func (v TransactionParser) MarshalEasyJSON(w *jwriter.Writer)
- func (v TransactionParser) MarshalJSON() ([]byte, error)
- func (p *TransactionParser) Parse() TransactionMessage
- func (v *TransactionParser) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (v *TransactionParser) UnmarshalJSON(data []byte) error
- type TransactionRejectReason
- type TransactionResponse
- type TransactionType
- type TransactionsIDRangeRequest
- func (g *TransactionsIDRangeRequest) AppendQuery(b *bytebufferpool.ByteBuffer)
- func (v TransactionsIDRangeRequest) MarshalEasyJSON(w *jwriter.Writer)
- func (v TransactionsIDRangeRequest) MarshalJSON() ([]byte, error)
- func (v *TransactionsIDRangeRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (v *TransactionsIDRangeRequest) UnmarshalJSON(data []byte) error
- func (t *TransactionsIDRangeRequest) WithFrom(from TransactionID) *TransactionsIDRangeRequest
- func (t *TransactionsIDRangeRequest) WithRange(from, to TransactionID) *TransactionsIDRangeRequest
- func (t *TransactionsIDRangeRequest) WithTo(to TransactionID) *TransactionsIDRangeRequest
- func (t *TransactionsIDRangeRequest) WithType(types ...TransactionFilter) *TransactionsIDRangeRequest
- type TransactionsPagesResponse
- type TransactionsRequest
- func (g *TransactionsRequest) AppendQuery(b *bytebufferpool.ByteBuffer)
- func (v TransactionsRequest) MarshalEasyJSON(w *jwriter.Writer)
- func (v TransactionsRequest) MarshalJSON() ([]byte, error)
- func (v *TransactionsRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (v *TransactionsRequest) UnmarshalJSON(data []byte) error
- func (t *TransactionsRequest) WithFrom(from DateTime) *TransactionsRequest
- func (t *TransactionsRequest) WithPageSize(pageSize int) *TransactionsRequest
- func (t *TransactionsRequest) WithRange(from, to DateTime) *TransactionsRequest
- func (t *TransactionsRequest) WithTo(to DateTime) *TransactionsRequest
- func (t *TransactionsRequest) WithType(types ...TransactionFilter) *TransactionsRequest
- type TransactionsResponse
- type TransactionsSinceIDRequest
- func (g *TransactionsSinceIDRequest) AppendQuery(b *bytebufferpool.ByteBuffer)
- func (v TransactionsSinceIDRequest) MarshalEasyJSON(w *jwriter.Writer)
- func (v TransactionsSinceIDRequest) MarshalJSON() ([]byte, error)
- func (v *TransactionsSinceIDRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (v *TransactionsSinceIDRequest) UnmarshalJSON(data []byte) error
- func (t *TransactionsSinceIDRequest) WithID(id TransactionID) *TransactionsSinceIDRequest
- func (t *TransactionsSinceIDRequest) WithType(types ...TransactionFilter) *TransactionsSinceIDRequest
- type TransferFundsRejectTransaction
- type TransferFundsTransaction
- type UnitsAvailable
- type UnitsAvailableDetails
- type UserAttributes
- type WeeklyAlignment
Constants ¶
const ( InstrumentType_CURRENCY InstrumentType = "CURRENCY" // Currency InstrumentType_CFD = "CFD" // Contract For Difference InstrumentType_METAL = "METAL" // Metal )
const ( // The Account is not permitted to create Guaranteed Stop Loss Orders for this Instrument. GuaranteedStopLossOrderModeForInstrument_DISABLED GuaranteedStopLossOrderModeForInstrument = "DISABLED" // The Account is able, but not required to have Guaranteed Stop Loss Orders for open Trades for this Instrument. GuaranteedStopLossOrderModeForInstrument_ALLOWED = "ALLOWED" // The Account is required to have Guaranteed Stop Loss Orders for all open Trades for this Instrument. GuaranteedStopLossOrderModeForInstrument_REQUIRED = "REQUIRED" )
Variables ¶
var (
UrlEncodedComma = url.PathEscape(",")
)
Functions ¶
This section is empty.
Types ¶
type AcceptDatetimeFormat ¶
type AcceptDatetimeFormat string
DateTime header
const ( // If “UNIX” is specified DateTime fields will be specified or returned // in the “12345678.000000123” format. AcceptDatetimeFormat_UNIX AcceptDatetimeFormat = "UNIX" // If “RFC3339” is specified DateTime will be specified or returned in // “YYYY-MM-DDTHH:MM:SS.nnnnnnnnnZ” format. AcceptDatetimeFormat_RFC3339 AcceptDatetimeFormat = "RFC3339" )
type Account ¶
type Account struct { // The Account’s identifier Id AccountID `json:"id"` // Client-assigned alias for the Account. Only provided if the Account has an alias set Alias string `json:"alias"` // The home currency of the Account Currency Currency `json:"currency"` // AccountID of the user that created the Account. CreatedByUserID int64 `json:"createdByUserID"` // The date/time when the Account was created. CreatedTime DateTime `json:"createdTime"` // The current guaranteed Stop Loss Order settings of the Account. This // field will only be present if the guaranteedStopLossOrderMode is not ‘DISABLED’. GuaranteedStopLossOrderParameters *GuaranteedStopLossOrderParameters `json:"guaranteedStopLossOrderParameters"` // The current guaranteed Stop Loss Order mode of the Account. GuaranteedStopLossOrderMode GuaranteedStopLossOrderMode `json:"guaranteedStopLossOrderMode"` // The current guaranteed Stop Loss Order mutability setting of the Account. // This field will only be present if the guaranteedStopLossOrderMode is not ‘DISABLED’. // DEPREACTED GuaranteedStopLossOrderMutability GuaranteedStopLossOrderMutability `json:"guaranteedStopLossOrderMutability"` // The date/time that the Account’s resettablePL was last reset. ResettablePLTime DateTime `json:"resettablePLTime"` // Client-provided margin rate override for the Account. The effective // margin rate of the Account is the lesser of this value and the OANDA // margin rate for the Account’s division. This value is only provided if a // margin rate override exists for the Account. MarginRate DecimalNumber `json:"marginRate"` // The number of Trades currently open in the Account. OpenTradeCount int64 `json:"openTradeCount"` // The number of Positions currently open in the Account. OpenPositionCount int64 `json:"openPositionCount"` // The number of Orders currently pending in the Account. PendingOrderCount int64 `json:"pendingOrderCount"` // Flag indicating that the Account has hedging enabled. HedgingEnabled bool `json:"hedgingEnabled"` // The total unrealized profit/loss for all Trades currently open in the Account. UnrealizedPL AccountUnits `json:"unrealizedPL"` // The net asset value of the Account. Equal to Account balance + unrealizedPL. NAV AccountUnits `json:"NAV"` // Margin currently used for the Account. MarginUsed AccountUnits `json:"marginUsed"` // Margin available for Account currency. MarginAvailable AccountUnits `json:"marginAvailable"` // The value of the Account’s open positions represented in the Account’s home currency. PositionValue AccountUnits `json:"positionValue"` // The Account’s margin closeout unrealized PL. MarginCloseoutUnrealizedPL AccountUnits `json:"marginCloseoutUnrealizedPL"` // The Account’s margin closeout NAV. MarginCloseoutNAV AccountUnits `json:"marginCloseoutNAV"` // The Account’s margin closeout margin used. MarginCloseoutMarginUsed AccountUnits `json:"marginCloseoutMarginUsed"` // The Account’s margin closeout percentage. When this value is 1.0 or above // the Account is in a margin closeout situation. MarginCloseoutPercent DecimalNumber `json:"marginCloseoutPercent"` // The value of the Account’s open positions as used for margin closeout // calculations represented in the Account’s home currency. MarginCloseoutPositionValue DecimalNumber `json:"marginCloseoutPositionValue"` // The current WithdrawalLimit for the account which will be zero or a // positive value indicating how much can be withdrawn from the account. WithdrawalLimit AccountUnits `json:"withdrawalLimit"` // The Account’s margin call margin used. MarginCallMarginUsed AccountUnits `json:"marginCallMarginUsed"` // The Account’s margin call percentage. When this value is 1.0 or above the // Account is in a margin call situation. MarginCallPercent DecimalNumber `json:"marginCallPercent"` // The current balance of the account. Balance AccountUnits `json:"balance"` // The total profit/loss realized over the lifetime of the Account. PL AccountUnits `json:"pl"` // The total realized profit/loss for the account since it was last reset by the client. ResettablePL AccountUnits `json:"resettablePL"` // The total amount of financing paid/collected over the lifetime of the account. Financing AccountUnits `json:"financing"` // The total amount of commission paid over the lifetime of the Account. Commission AccountUnits `json:"commission"` // The total amount of dividend adjustment paid over the lifetime of the Account in the Account’s home currency. DividendAdjustment AccountUnits `json:"dividendAdjustment"` // The total amount of fees charged over the lifetime of the Account for the // execution of guaranteed Stop Loss Orders. GuaranteedExecutionFees AccountUnits `json:"guaranteedExecutionFees"` // The date/time when the Account entered a margin call state. Only provided // if the Account is in a margin call. MarginCallEnterTime DateTime `json:"marginCallEnterTime"` // The number of times that the Account’s current margin call was extended. MarginCallExtensionCount int64 `json:"marginCallExtensionCount"` // The date/time of the Account’s last margin call extension. LastMarginCallExtensionTime DateTime `json:"lastMarginCallExtensionTime"` // The AccountID of the last Transaction created for the Account. LastTransactionID TransactionID `json:"lastTransactionID"` // The details of the Trades currently open in the Account. Trades []*TradeSummary `json:"trades"` // The details all Account Positions. Positions []*Position `json:"positions"` // The details of the Orders currently pending in the Account. Orders []*Order `json:"orders"` }
The full details of a client’s Account. This includes full open Trade, open Position and pending Order representation.
func (Account) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Account) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Account) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Account) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type AccountChanges ¶
type AccountChanges struct { // The Orders created. These Orders may have been filled, cancelled or triggered in the same period. OrdersCreated []*Order `json:"ordersCreated"` // The Orders cancelled. OrdersCancelled []*Order `json:"ordersCancelled"` // The Orders filled. OrdersFilled []*Order `json:"ordersFilled"` // The Orders triggered. OrdersTriggered []*Order `json:"ordersTriggered"` // The Trades opened. TradesOpened []*TradeSummary `json:"tradesOpened"` // The Trades reduced. TradesReduced []*TradeSummary `json:"tradesReduced"` // The Trades closed. TradesClosed []*TradeSummary `json:"tradesClosed"` // The Positions changed. Positions []*Position `json:"positions"` // The Transactions that have been generated. Transactions []*Transaction `json:"transactions"` }
An AccountChanges Object is used to represent the changes to an Account’s Orders, Trades and Positions since a specified Account TransactionID in the past.
func (AccountChanges) MarshalEasyJSON ¶
func (v AccountChanges) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (AccountChanges) MarshalJSON ¶
func (v AccountChanges) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*AccountChanges) UnmarshalEasyJSON ¶
func (v *AccountChanges) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*AccountChanges) UnmarshalJSON ¶
func (v *AccountChanges) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type AccountChangesResponse ¶
type AccountChangesResponse struct { // The changes to the Account’s Orders, Trades and Positions since the // specified Transaction ID. Only provided if the sinceTransactionID is // supplied to the poll request. Changes *AccountChanges `json:"changes"` // The ID of the last Transaction created for the Account. This Transaction // ID should be used for future poll requests, as the client has already // observed all changes up to and including it. LastTransactionID TransactionID `json:"lastTransactionID"` // The Account’s current price-dependent state. State *AccountChangesState `json:"state"` }
func (AccountChangesResponse) MarshalEasyJSON ¶
func (v AccountChangesResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (AccountChangesResponse) MarshalJSON ¶
func (v AccountChangesResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*AccountChangesResponse) UnmarshalEasyJSON ¶
func (v *AccountChangesResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*AccountChangesResponse) UnmarshalJSON ¶
func (v *AccountChangesResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type AccountChangesState ¶
type AccountChangesState struct { // The total unrealized profit/loss for all Trades currently open in the Account. UnrealizedPL AccountUnits `json:"unrealizedPL"` // The net asset value of the Account. Equal to Account balance + unrealizedPL. NAV AccountUnits `json:"NAV"` // Margin currently used for the Account. MarginUsed AccountUnits `json:"marginUsed"` // Margin available for Account currency. MarginAvailable AccountUnits `json:"marginAvailable"` // The value of the Account’s open positions represented in the Account’s home currency. PositionValue AccountUnits `json:"positionValue"` // The Account’s margin closeout unrealized PL. MarginCloseoutUnrealizedPL AccountUnits `json:"marginCloseoutUnrealizedPL"` // The Account’s margin closeout NAV. MarginCloseoutNAV AccountUnits `json:"marginCloseoutNAV"` // The Account’s margin closeout margin used. MarginCloseoutMarginUsed AccountUnits `json:"marginCloseoutMarginUsed"` // The Account’s margin closeout percentage. When this value is 1.0 or above // the Account is in a margin closeout situation. MarginCloseoutPercent DecimalNumber `json:"marginCloseoutPercent"` // The value of the Account’s open positions as used for margin closeout // calculations represented in the Account’s home currency. MarginCloseoutPositionValue DecimalNumber `json:"marginCloseoutPositionValue"` // The current WithdrawalLimit for the account which will be zero or a // positive value indicating how much can be withdrawn from the account. WithdrawalLimit AccountUnits `json:"withdrawalLimit"` // The Account’s margin call margin used. MarginCallMarginUsed AccountUnits `json:"marginCallMarginUsed"` // The Account’s margin call percentage. When this value is 1.0 or above the // Account is in a margin call situation. MarginCallPercent DecimalNumber `json:"marginCallPercent"` // The current balance of the account. Balance AccountUnits `json:"balance"` // The total profit/loss realized over the lifetime of the Account. PL AccountUnits `json:"pl"` // The total realized profit/loss for the account since it was last reset by the client. ResettablePL AccountUnits `json:"resettablePL"` // The total amount of financing paid/collected over the lifetime of the account. Financing AccountUnits `json:"financing"` // The total amount of commission paid over the lifetime of the Account. Commission AccountUnits `json:"commission"` // The total amount of dividend adjustment paid over the lifetime of the Account in the Account’s home currency. DividendAdjustment AccountUnits `json:"dividendAdjustment"` // The total amount of fees charged over the lifetime of the Account for the // execution of guaranteed Stop Loss Orders. GuaranteedExecutionFees AccountUnits `json:"guaranteedExecutionFees"` // The date/time when the Account entered a margin call state. Only provided // if the Account is in a margin call. MarginCallEnterTime DateTime `json:"marginCallEnterTime"` // The number of times that the Account’s current margin call was extended. MarginCallExtensionCount int64 `json:"marginCallExtensionCount"` // The date/time of the Account’s last margin call extension. LastMarginCallExtensionTime DateTime `json:"lastMarginCallExtensionTime"` // The price-dependent state of each pending Order in the Account. Orders []*DynamicOrderState `json:"orders"` // The price-dependent state for each open Trade in the Account. Trades []*CalculatedTradeState `json:"trades"` // The price-dependent state for each open Position in the Account. Positions []*CalculatedPositionState `json:"positions"` }
func (AccountChangesState) MarshalEasyJSON ¶
func (v AccountChangesState) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (AccountChangesState) MarshalJSON ¶
func (v AccountChangesState) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*AccountChangesState) UnmarshalEasyJSON ¶
func (v *AccountChangesState) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*AccountChangesState) UnmarshalJSON ¶
func (v *AccountChangesState) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type AccountConfigurationError ¶
type AccountConfigurationError struct { // The transaction that rejects the configuration of the Account. ClientConfigureRejectTransaction *ClientConfigureRejectTransaction `json:"clientConfigureRejectTransaction"` // The ID of the most recent Transaction created for the Account LastTransactionID TransactionID `json:"lastTransactionID"` // The code of the error that has occurred. This field may not be returned // for some errors. ErrorCode string `json:"errorCode"` // The human-readable description of the error that has occurred. ErrorMessage string `json:"errorMessage"` }
func (AccountConfigurationError) MarshalEasyJSON ¶
func (v AccountConfigurationError) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (AccountConfigurationError) MarshalJSON ¶
func (v AccountConfigurationError) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*AccountConfigurationError) UnmarshalEasyJSON ¶
func (v *AccountConfigurationError) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*AccountConfigurationError) UnmarshalJSON ¶
func (v *AccountConfigurationError) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type AccountConfigurationRequest ¶
type AccountConfigurationRequest struct { // Client-defined alias (name) for the Account Alias string `json:"alias"` // Margin rate MarginRate DecimalNumber `json:"marginRate"` }
func (AccountConfigurationRequest) MarshalEasyJSON ¶
func (v AccountConfigurationRequest) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (AccountConfigurationRequest) MarshalJSON ¶
func (v AccountConfigurationRequest) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*AccountConfigurationRequest) UnmarshalEasyJSON ¶
func (v *AccountConfigurationRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*AccountConfigurationRequest) UnmarshalJSON ¶
func (v *AccountConfigurationRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type AccountConfigurationResponse ¶
type AccountConfigurationResponse struct { // The transaction that configures the Account. ClientConfigureTransaction *ClientConfigureTransaction `json:"clientConfigureTransaction"` // The ID of the last Transaction created for the Account. LastTransactionID TransactionID `json:"lastTransactionID"` }
func (AccountConfigurationResponse) MarshalEasyJSON ¶
func (v AccountConfigurationResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (AccountConfigurationResponse) MarshalJSON ¶
func (v AccountConfigurationResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*AccountConfigurationResponse) UnmarshalEasyJSON ¶
func (v *AccountConfigurationResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*AccountConfigurationResponse) UnmarshalJSON ¶
func (v *AccountConfigurationResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type AccountFinancingMode ¶
type AccountFinancingMode string
The financing mode of an Account
const ( // No financing is paid/charged for open Trades in the Account FinancingMode_NO_FINANCING AccountFinancingMode = "NO_FINANCING" // Second-by-second financing is paid/charged for open Trades in the Account, // both daily and when the the Trade is closed FinancingMode_SECOND_BY_SECOND AccountFinancingMode = "SECOND_BY_SECOND" // A full day’s worth of financing is paid/charged for open Trades in the Account daily at 5pm New York time FinancingMode_DAILY AccountFinancingMode = "DAILY" )
type AccountID ¶
type AccountID string
The string representation of an Account Identifier. “-“-delimited string with format “{siteID}-{divisionID}-{userID}-{accountNumber}” Example: 001-011-5838423-001
type AccountInstrumentsResponse ¶
type AccountInstrumentsResponse struct { // The requested list of instruments. Instruments []*Instrument `json:"instruments"` // The ID of the most recent Transaction created for the Account. LastTransactionID TransactionID `json:"lastTransactionID"` }
func (AccountInstrumentsResponse) MarshalEasyJSON ¶
func (v AccountInstrumentsResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (AccountInstrumentsResponse) MarshalJSON ¶
func (v AccountInstrumentsResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*AccountInstrumentsResponse) UnmarshalEasyJSON ¶
func (v *AccountInstrumentsResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*AccountInstrumentsResponse) UnmarshalJSON ¶
func (v *AccountInstrumentsResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type AccountProperties ¶
type AccountProperties struct { // The Account’s identifier ID AccountID `json:"id"` // The Account’s associated MT4 Account ID. This field will not be present // if the Account is not an MT4 account. MT4AccountID int64 `json:"mt4AccountID"` // The Account’s tags Tags []string `json:"tags"` }
Properties related to an Account.
func (AccountProperties) MarshalEasyJSON ¶
func (v AccountProperties) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (AccountProperties) MarshalJSON ¶
func (v AccountProperties) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*AccountProperties) UnmarshalEasyJSON ¶
func (v *AccountProperties) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*AccountProperties) UnmarshalJSON ¶
func (v *AccountProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type AccountResponse ¶
type AccountResponse struct { // The full details of the requested Account. Account *Account `json:"account"` // The ID of the most recent Transaction created for the Account. LastTransactionID TransactionID `json:"lastTransactionID"` }
func (AccountResponse) MarshalEasyJSON ¶
func (v AccountResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (AccountResponse) MarshalJSON ¶
func (v AccountResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*AccountResponse) UnmarshalEasyJSON ¶
func (v *AccountResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*AccountResponse) UnmarshalJSON ¶
func (v *AccountResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type AccountSummary ¶
type AccountSummary struct { // The Account’s identifier Id AccountID `json:"id"` // Client-assigned alias for the Account. Only provided if the Account has an alias set Alias string `json:"alias"` // The home currency of the Account Currency Currency `json:"currency"` // AccountID of the user that created the Account. CreatedByUserID int64 `json:"createdByUserID"` // The date/time when the Account was created. CreatedTime DateTime `json:"createdTime"` // The current guaranteed Stop Loss Order settings of the Account. This // field will only be present if the guaranteedStopLossOrderMode is not ‘DISABLED’. GuaranteedStopLossOrderParameters *GuaranteedStopLossOrderParameters `json:"guaranteedStopLossOrderParameters"` // The current guaranteed Stop Loss Order mode of the Account. GuaranteedStopLossOrderMode GuaranteedStopLossOrderMode `json:"guaranteedStopLossOrderMode"` // The current guaranteed Stop Loss Order mutability setting of the Account. // This field will only be present if the guaranteedStopLossOrderMode is not ‘DISABLED’. // DEPREACTED GuaranteedStopLossOrderMutability GuaranteedStopLossOrderMutability `json:"guaranteedStopLossOrderMutability"` // The date/time that the Account’s resettablePL was last reset. ResettablePLTime DateTime `json:"resettablePLTime"` // Client-provided margin rate override for the Account. The effective // margin rate of the Account is the lesser of this value and the OANDA // margin rate for the Account’s division. This value is only provided if a // margin rate override exists for the Account. MarginRate DecimalNumber `json:"marginRate"` // The number of Trades currently open in the Account. OpenTradeCount int64 `json:"openTradeCount"` // The number of Positions currently open in the Account. OpenPositionCount int64 `json:"openPositionCount"` // The number of Orders currently pending in the Account. PendingOrderCount int64 `json:"pendingOrderCount"` // Flag indicating that the Account has hedging enabled. HedgingEnabled bool `json:"hedgingEnabled"` // The total unrealized profit/loss for all Trades currently open in the Account. UnrealizedPL AccountUnits `json:"unrealizedPL"` // The net asset value of the Account. Equal to Account balance + unrealizedPL. NAV AccountUnits `json:"NAV"` // Margin currently used for the Account. MarginUsed AccountUnits `json:"marginUsed"` // Margin available for Account currency. MarginAvailable AccountUnits `json:"marginAvailable"` // The value of the Account’s open positions represented in the Account’s home currency. PositionValue AccountUnits `json:"positionValue"` // The Account’s margin closeout unrealized PL. MarginCloseoutUnrealizedPL AccountUnits `json:"marginCloseoutUnrealizedPL"` // The Account’s margin closeout NAV. MarginCloseoutNAV AccountUnits `json:"marginCloseoutNAV"` // The Account’s margin closeout margin used. MarginCloseoutMarginUsed AccountUnits `json:"marginCloseoutMarginUsed"` // The Account’s margin closeout percentage. When this value is 1.0 or above // the Account is in a margin closeout situation. MarginCloseoutPercent DecimalNumber `json:"marginCloseoutPercent"` // The value of the Account’s open positions as used for margin closeout // calculations represented in the Account’s home currency. MarginCloseoutPositionValue DecimalNumber `json:"marginCloseoutPositionValue"` // The current WithdrawalLimit for the account which will be zero or a // positive value indicating how much can be withdrawn from the account. WithdrawalLimit AccountUnits `json:"withdrawalLimit"` // The Account’s margin call margin used. MarginCallMarginUsed AccountUnits `json:"marginCallMarginUsed"` // The Account’s margin call percentage. When this value is 1.0 or above the // Account is in a margin call situation. MarginCallPercent DecimalNumber `json:"marginCallPercent"` // The current balance of the account. Balance AccountUnits `json:"balance"` // The total profit/loss realized over the lifetime of the Account. PL AccountUnits `json:"pl"` // The total realized profit/loss for the account since it was last reset by the client. ResettablePL AccountUnits `json:"resettablePL"` // The total amount of financing paid/collected over the lifetime of the account. Financing AccountUnits `json:"financing"` // The total amount of commission paid over the lifetime of the Account. Commission AccountUnits `json:"commission"` // The total amount of dividend adjustment paid over the lifetime of the Account in the Account’s home currency. DividendAdjustment AccountUnits `json:"dividendAdjustment"` // The total amount of fees charged over the lifetime of the Account for the // execution of guaranteed Stop Loss Orders. GuaranteedExecutionFees AccountUnits `json:"guaranteedExecutionFees"` // The date/time when the Account entered a margin call state. Only provided // if the Account is in a margin call. MarginCallEnterTime DateTime `json:"marginCallEnterTime"` // The number of times that the Account’s current margin call was extended. MarginCallExtensionCount int64 `json:"marginCallExtensionCount"` // The date/time of the Account’s last margin call extension. LastMarginCallExtensionTime DateTime `json:"lastMarginCallExtensionTime"` // The AccountID of the last Transaction created for the Account. LastTransactionID TransactionID `json:"lastTransactionID"` }
A summary representation of a client’s Account. The AccountSummary does not provide to full specification of pending Orders, open Trades and Positions.
func (AccountSummary) MarshalEasyJSON ¶
func (v AccountSummary) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (AccountSummary) MarshalJSON ¶
func (v AccountSummary) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*AccountSummary) UnmarshalEasyJSON ¶
func (v *AccountSummary) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*AccountSummary) UnmarshalJSON ¶
func (v *AccountSummary) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type AccountSummaryResponse ¶
type AccountSummaryResponse struct { // The summary of the requested Account. Account *AccountSummary `json:"account"` // The ID of the most recent Transaction created for the Account. LastTransactionID TransactionID `json:"lastTransactionID"` }
func (AccountSummaryResponse) MarshalEasyJSON ¶
func (v AccountSummaryResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (AccountSummaryResponse) MarshalJSON ¶
func (v AccountSummaryResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*AccountSummaryResponse) UnmarshalEasyJSON ¶
func (v *AccountSummaryResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*AccountSummaryResponse) UnmarshalJSON ¶
func (v *AccountSummaryResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type AccountUnits ¶
type AccountUnits DecimalNumber
The string representation of a quantity of an Account’s home currency. A decimal number encoded as a string. The amount of precision provided depends on the Account’s home currency.
type AccountsResponse ¶
type AccountsResponse struct { // The list of Accounts the client is authorized to access and their // associated properties. Accounts []*AccountProperties `json:"accounts"` }
func (AccountsResponse) MarshalEasyJSON ¶
func (v AccountsResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (AccountsResponse) MarshalJSON ¶
func (v AccountsResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*AccountsResponse) UnmarshalEasyJSON ¶
func (v *AccountsResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*AccountsResponse) UnmarshalJSON ¶
func (v *AccountsResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type AccumulatedAccountState ¶
type AccumulatedAccountState struct { // The current balance of the account. Balance AccountUnits `json:"balance"` // The total profit/loss realized over the lifetime of the Account. PL AccountUnits `json:"pl"` // The total realized profit/loss for the account since it was last reset by the client. ResettablePL AccountUnits `json:"resettablePL"` // The total amount of financing paid/collected over the lifetime of the account. Financing AccountUnits `json:"financing"` // The total amount of commission paid over the lifetime of the Account. Commission AccountUnits `json:"commission"` // The total amount of dividend adjustment paid over the lifetime of the Account in the Account’s home currency. DividendAdjustment AccountUnits `json:"dividendAdjustment"` // The total amount of fees charged over the lifetime of the Account for the // execution of guaranteed Stop Loss Orders. GuaranteedExecutionFees AccountUnits `json:"guaranteedExecutionFees"` // The date/time when the Account entered a margin call state. Only provided // if the Account is in a margin call. MarginCallEnterTime DateTime `json:"marginCallEnterTime"` // The number of times that the Account’s current margin call was extended. MarginCallExtensionCount int64 `json:"marginCallExtensionCount"` // The date/time of the Account’s last margin call extension. LastMarginCallExtensionTime DateTime `json:"lastMarginCallExtensionTime"` }
The mutable state of a client’s Account.
func (AccumulatedAccountState) MarshalEasyJSON ¶
func (v AccumulatedAccountState) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (AccumulatedAccountState) MarshalJSON ¶
func (v AccumulatedAccountState) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*AccumulatedAccountState) UnmarshalEasyJSON ¶
func (v *AccumulatedAccountState) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*AccumulatedAccountState) UnmarshalJSON ¶
func (v *AccumulatedAccountState) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type BaseOrderRequest ¶
type BaseOrderRequest struct {
OrderRequest
}
The base Order specification used when requesting that an Order be created. Each specific Order-type extends this definition.
MarketOrderRequest LimitOrderRequest StopOrderRequest MarketIfTouchedOrderRequest TakeProfitOrderRequest StopLossOrderRequest GuaranteedStopLossOrderRequest TrailingStopLossOrderRequest
The base Order specification used when requesting that an Order be created. Each specific Order-type extends this definition.
func (BaseOrderRequest) MarshalEasyJSON ¶
func (v BaseOrderRequest) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (BaseOrderRequest) MarshalJSON ¶
func (v BaseOrderRequest) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*BaseOrderRequest) UnmarshalEasyJSON ¶
func (v *BaseOrderRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*BaseOrderRequest) UnmarshalJSON ¶
func (v *BaseOrderRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type CalculatedAccountState ¶
type CalculatedAccountState struct { // The total unrealized profit/loss for all Trades currently open in the Account. UnrealizedPL AccountUnits `json:"unrealizedPL"` // The net asset value of the Account. Equal to Account balance + unrealizedPL. NAV AccountUnits `json:"NAV"` // Margin currently used for the Account. MarginUsed AccountUnits `json:"marginUsed"` // Margin available for Account currency. MarginAvailable AccountUnits `json:"marginAvailable"` // The value of the Account’s open positions represented in the Account’s home currency. PositionValue AccountUnits `json:"positionValue"` // The Account’s margin closeout unrealized PL. MarginCloseoutUnrealizedPL AccountUnits `json:"marginCloseoutUnrealizedPL"` // The Account’s margin closeout NAV. MarginCloseoutNAV AccountUnits `json:"marginCloseoutNAV"` // The Account’s margin closeout margin used. MarginCloseoutMarginUsed AccountUnits `json:"marginCloseoutMarginUsed"` // The Account’s margin closeout percentage. When this value is 1.0 or above // the Account is in a margin closeout situation. MarginCloseoutPercent DecimalNumber `json:"marginCloseoutPercent"` // The value of the Account’s open positions as used for margin closeout // calculations represented in the Account’s home currency. MarginCloseoutPositionValue DecimalNumber `json:"marginCloseoutPositionValue"` // The current WithdrawalLimit for the account which will be zero or a // positive value indicating how much can be withdrawn from the account. WithdrawalLimit AccountUnits `json:"withdrawalLimit"` // The Account’s margin call margin used. MarginCallMarginUsed AccountUnits `json:"marginCallMarginUsed"` // The Account’s margin call percentage. When this value is 1.0 or above the // Account is in a margin call situation. MarginCallPercent DecimalNumber `json:"marginCallPercent"` }
The dynamically calculated state of a client’s Account.
func (CalculatedAccountState) MarshalEasyJSON ¶
func (v CalculatedAccountState) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (CalculatedAccountState) MarshalJSON ¶
func (v CalculatedAccountState) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*CalculatedAccountState) UnmarshalEasyJSON ¶
func (v *CalculatedAccountState) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*CalculatedAccountState) UnmarshalJSON ¶
func (v *CalculatedAccountState) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type CalculatedPositionState ¶
type CalculatedPositionState struct { // The Position’s Instrument. Instrument InstrumentName `json:"instrument"` // The Position’s net unrealized profit/loss NetUnrealizedPL AccountUnits `json:"netUnrealizedPL"` // The unrealized profit/loss of the Position’s long open Trades LongUnrealizedPL AccountUnits `json:"longUnrealizedPL"` // The unrealized profit/loss of the Position’s short open Trades ShortUnrealizedPL AccountUnits `json:"shortUnrealizedPL"` // Margin currently used by the Position. MarginUsed AccountUnits `json:"marginUsed"` }
The dynamic (calculated) state of a Position
func (CalculatedPositionState) MarshalEasyJSON ¶
func (v CalculatedPositionState) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (CalculatedPositionState) MarshalJSON ¶
func (v CalculatedPositionState) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*CalculatedPositionState) UnmarshalEasyJSON ¶
func (v *CalculatedPositionState) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*CalculatedPositionState) UnmarshalJSON ¶
func (v *CalculatedPositionState) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type CalculatedTradeState ¶
type CalculatedTradeState struct { // The Trade's ID ID TradeID `json:"id"` // The Trade’s unrealized profit/loss. UnrealizedPL AccountUnits `json:"unrealizedPL"` // Margin currently used by the Trade. MarginUsed AccountUnits `json:"marginUsed"` }
The dynamic (calculated) state of an open Trade
func (CalculatedTradeState) MarshalEasyJSON ¶
func (v CalculatedTradeState) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (CalculatedTradeState) MarshalJSON ¶
func (v CalculatedTradeState) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*CalculatedTradeState) UnmarshalEasyJSON ¶
func (v *CalculatedTradeState) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*CalculatedTradeState) UnmarshalJSON ¶
func (v *CalculatedTradeState) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type CancelOrderError ¶
type CancelOrderError struct { // The Transaction that rejected the cancellation of the Order. Only present // if the Account exists. OrderCancelRejectTransaction *OrderCancelRejectTransaction `json:"orderCancelRejectTransaction"` // The IDs of all Transactions that were created while satisfying the // request. Only present if the Account exists. RelatedTransactionIDs []TransactionID `json:"relatedTransactionIDs"` // The ID of the most recent Transaction created for the Account LastTransactionID TransactionID `json:"lastTransactionID"` // The ID of the most recent Transaction created for the Account. Only // present if the Account exists. ErrorCode string `json:"errorCode"` // The human-readable description of the error that has occurred. ErrorMessage string `json:"errorMessage"` }
func (CancelOrderError) MarshalEasyJSON ¶
func (v CancelOrderError) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (CancelOrderError) MarshalJSON ¶
func (v CancelOrderError) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*CancelOrderError) UnmarshalEasyJSON ¶
func (v *CancelOrderError) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*CancelOrderError) UnmarshalJSON ¶
func (v *CancelOrderError) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type CancelOrderResponse ¶
type CancelOrderResponse struct { // The Transaction that cancelled the Order OrderCancelTransaction *OrderCancelTransaction `json:"orderCancelTransaction"` // The IDs of all Transactions that were created while satisfying the // request. RelatedTransactionIDs []TransactionID `json:"relatedTransactionIDs"` // The ID of the most recent Transaction created for the Account LastTransactionID TransactionID `json:"lastTransactionID"` }
func (CancelOrderResponse) MarshalEasyJSON ¶
func (v CancelOrderResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (CancelOrderResponse) MarshalJSON ¶
func (v CancelOrderResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*CancelOrderResponse) UnmarshalEasyJSON ¶
func (v *CancelOrderResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*CancelOrderResponse) UnmarshalJSON ¶
func (v *CancelOrderResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type CandleSpecification ¶
type CandleSpecification string
An instrument name, a granularity, and a price component to get candlestick data for. A string containing the following, all delimited by “:” characters:
- InstrumentName
- CandlestickGranularity
- PricingComponent e.g. EUR_USD:S10:BM
func NewCandleSpecification ¶
func NewCandleSpecification( instrument InstrumentName, granularity CandlestickGranularity, price PricingComponent, ) CandleSpecification
func (CandleSpecification) Parse ¶
func (c CandleSpecification) Parse() (InstrumentName, string, PricingComponent)
type CandlesLatestRequest ¶
type CandlesLatestRequest struct { // List of candle specifications to get pricing for. // [required] CandleSpecifications []CandleSpecification `json:"candleSpecifications"` // The number of units used to calculate the volume-weighted average // bid and ask prices in the returned candles. // [default=1] Units DecimalNumber `json:"units"` // A flag that controls whether the candlestick is “smoothed” or not. // A smoothed candlestick uses the previous candle’s close price as its // open price, while an unsmoothed candlestick uses the first price from // its time range as its open price. // [default=False] Smooth bool `json:"smooth"` // The hour of the day (in the specified timezone) to use for granularities // that have daily alignments. // [default=17, minimum=0, maximum=23] DailyAlignment int `json:"dailyAlignment"` // The timezone to use for the dailyAlignment parameter. Candlesticks with // daily alignment will be aligned to the dailyAlignment hour within the // alignmentTimezone. // Note that the returned times will still be represented in UTC. // [default=America/New_York] AlignmentTimezone string `json:"alignmentTimezone"` // The day of the week used for granularities that have weekly alignment. // [default=Friday] WeeklyAlignment WeeklyAlignment `json:"weeklyAlignment"` }
func NewCandlesLatestRequest ¶
func NewCandlesLatestRequest(specs ...CandleSpecification) *CandlesLatestRequest
func (*CandlesLatestRequest) AddCandleSpecification ¶
func (c *CandlesLatestRequest) AddCandleSpecification(specification CandleSpecification) *CandlesLatestRequest
List of candle specifications to get pricing for. [required]
func (*CandlesLatestRequest) AppendQuery ¶
func (c *CandlesLatestRequest) AppendQuery(b *bytebufferpool.ByteBuffer) string
func (CandlesLatestRequest) MarshalEasyJSON ¶
func (v CandlesLatestRequest) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (CandlesLatestRequest) MarshalJSON ¶
func (v CandlesLatestRequest) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*CandlesLatestRequest) UnmarshalEasyJSON ¶
func (v *CandlesLatestRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*CandlesLatestRequest) UnmarshalJSON ¶
func (v *CandlesLatestRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
func (*CandlesLatestRequest) WithAlignmentTimezone ¶
func (c *CandlesLatestRequest) WithAlignmentTimezone(timezone string) *CandlesLatestRequest
The timezone to use for the dailyAlignment parameter. Candlesticks with daily alignment will be aligned to the dailyAlignment hour within the alignmentTimezone. Note that the returned times will still be represented in UTC. [default=America/New_York]
func (*CandlesLatestRequest) WithDailyAlignment ¶
func (c *CandlesLatestRequest) WithDailyAlignment(dailyAlignment int) *CandlesLatestRequest
The hour of the day (in the specified timezone) to use for granularities that have daily alignments. [default=17, minimum=0, maximum=23]
func (*CandlesLatestRequest) WithSmooth ¶
func (c *CandlesLatestRequest) WithSmooth(smooth bool) *CandlesLatestRequest
A flag that controls whether the candlestick is “smoothed” or not. A smoothed candlestick uses the previous candle’s close price as its open price, while an unsmoothed candlestick uses the first price from its time range as its open price. [default=False]
func (*CandlesLatestRequest) WithUnits ¶
func (c *CandlesLatestRequest) WithUnits(units DecimalNumber) *CandlesLatestRequest
The number of units used to calculate the volume-weighted average bid and ask prices in the returned candles. [default=1]
func (*CandlesLatestRequest) WithWeeklyAlignment ¶
func (c *CandlesLatestRequest) WithWeeklyAlignment(alignment WeeklyAlignment) *CandlesLatestRequest
The day of the week used for granularities that have weekly alignment. [default=Friday]
type CandlesLatestResponse ¶
type CandlesLatestResponse struct { // The latest candle sticks. LatestCandles []*CandlestickResponse `json:"latestCandles"` }
func (CandlesLatestResponse) MarshalEasyJSON ¶
func (v CandlesLatestResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (CandlesLatestResponse) MarshalJSON ¶
func (v CandlesLatestResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*CandlesLatestResponse) UnmarshalEasyJSON ¶
func (v *CandlesLatestResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*CandlesLatestResponse) UnmarshalJSON ¶
func (v *CandlesLatestResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type Candlestick ¶
type Candlestick struct { // The start time of the candlestick. Time DateTime `json:"time"` // The candlestick data based on bids. Only provided if bid-based candles were requested. Bid *CandlestickData `json:"bid"` // The candlestick data based on asks. Only provided if ask-based candles were requested. Ask *CandlestickData `json:"ask"` // The candlestick data based on midpoints. Only provided if midpoint-based candles were requested. Mid *CandlestickData `json:"mid"` // The number of prices created during the time-range represented by the candlestick. Volume int64 `json:"volume"` // A flag indicating if the candlestick is complete. A complete candlestick // is one whose ending time is not in the future. Complete bool `json:"complete"` }
The candlestick representation
func (Candlestick) MarshalEasyJSON ¶
func (v Candlestick) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (Candlestick) MarshalJSON ¶
func (v Candlestick) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*Candlestick) UnmarshalEasyJSON ¶
func (v *Candlestick) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Candlestick) UnmarshalJSON ¶
func (v *Candlestick) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type CandlestickData ¶
type CandlestickData struct { // The first (open) price in the time-range represented by the candlestick. Open PriceValue `json:"o"` // The highest price in the time-range represented by the candlestick. High PriceValue `json:"h"` // The lowest price in the time-range represented by the candlestick. Low PriceValue `json:"l"` // The last (closing) price in the time-range represented by the candlestick. Close PriceValue `json:"c"` }
The price data (open, high, low, close) for the Candlestick representation.
func (CandlestickData) MarshalEasyJSON ¶
func (v CandlestickData) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (CandlestickData) MarshalJSON ¶
func (v CandlestickData) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*CandlestickData) UnmarshalEasyJSON ¶
func (v *CandlestickData) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*CandlestickData) UnmarshalJSON ¶
func (v *CandlestickData) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type CandlestickGranularity ¶
type CandlestickGranularity string
The granularity of the candlestick
const ( CandlestickGranularity_S5 CandlestickGranularity = "S5" // 5 second candlesticks, minute alignment CandlestickGranularity_S10 CandlestickGranularity = "S10" // 10 second candlesticks, minute alignment CandlestickGranularity_S15 CandlestickGranularity = "S15" // 15 second candlesticks, minute alignment CandlestickGranularity_S30 CandlestickGranularity = "S30" // 30 second candlesticks, minute alignment CandlestickGranularity_M1 CandlestickGranularity = "M1" // 1 minute candlesticks, minute alignment CandlestickGranularity_M2 CandlestickGranularity = "M2" // 2 minute candlesticks, hour alignment CandlestickGranularity_M4 CandlestickGranularity = "M4" // 4 minute candlesticks, hour alignment CandlestickGranularity_M5 CandlestickGranularity = "M5" // 5 minute candlesticks, hour alignment CandlestickGranularity_M10 CandlestickGranularity = "M10" // 10 minute candlesticks, hour alignment CandlestickGranularity_M15 CandlestickGranularity = "M15" // 15 minute candlesticks, hour alignment CandlestickGranularity_M30 CandlestickGranularity = "M30" // 30 minute candlesticks, hour alignment CandlestickGranularity_H1 CandlestickGranularity = "H1" // 1 hour candlesticks, hour alignment CandlestickGranularity_H2 CandlestickGranularity = "H2" // 2 hour candlesticks, day alignment CandlestickGranularity_H3 CandlestickGranularity = "H3" // 3 hour candlesticks, day alignment CandlestickGranularity_H4 CandlestickGranularity = "H4" // 4 hour candlesticks, day alignment CandlestickGranularity_H6 CandlestickGranularity = "H6" // 6 hour candlesticks, day alignment CandlestickGranularity_H8 CandlestickGranularity = "H8" // 8 hour candlesticks, day alignment CandlestickGranularity_H12 CandlestickGranularity = "H12" // 12 hour candlesticks, day alignment CandlestickGranularity_D CandlestickGranularity = "D" // 1 day candlesticks, day alignment CandlestickGranularity_W CandlestickGranularity = "W" // 1 week candlesticks, aligned to start of week CandlestickGranularity_M CandlestickGranularity = "M" // 1 month candlesticks, aligned to first day of the month )
type CandlestickResponse ¶
type CandlestickResponse struct { // The instrument whose Prices are represented by the candlesticks. Instrument InstrumentName `json:"instrument"` // The granularity of the candlesticks provided. Granularity CandlestickGranularity `json:"granularity"` // The list of candlesticks that satisfy the request. Candles []*Candlestick `json:"candles"` }
Response containing instrument, granularity, and list of candles.
func (CandlestickResponse) MarshalEasyJSON ¶
func (v CandlestickResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (CandlestickResponse) MarshalJSON ¶
func (v CandlestickResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*CandlestickResponse) UnmarshalEasyJSON ¶
func (v *CandlestickResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*CandlestickResponse) UnmarshalJSON ¶
func (v *CandlestickResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type ClientComment ¶
type ClientComment string
A client-provided comment that can contain any data and may be assigned to their Orders or Trades. Comments are typically used to provide extra context or meaning to an Order or Trade.
type ClientConfigureRejectTransaction ¶
type ClientConfigureRejectTransaction struct { Transaction // The Type of the Transaction. Always set to “CLIENT_CONFIGURE_REJECT” in a ClientConfigureRejectTransaction. Type TransactionType `json:"type"` // The client-provided alias for the Account. Alias string `json:"alias"` // The margin rate override for the Account. MarginRate DecimalNumber `json:"marginRate"` // The reason that the Reject Transaction was created RejectReason TransactionRejectReason `json:"rejectReason"` }
A ClientConfigureRejectTransaction represents the reject of configuration of an Account by a client.
func (ClientConfigureRejectTransaction) MarshalEasyJSON ¶
func (v ClientConfigureRejectTransaction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (ClientConfigureRejectTransaction) MarshalJSON ¶
func (v ClientConfigureRejectTransaction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*ClientConfigureRejectTransaction) UnmarshalEasyJSON ¶
func (v *ClientConfigureRejectTransaction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*ClientConfigureRejectTransaction) UnmarshalJSON ¶
func (v *ClientConfigureRejectTransaction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type ClientConfigureTransaction ¶
type ClientConfigureTransaction struct { Transaction // The Type of the Transaction. Always set to “CLIENT_CONFIGURE” in a ClientConfigureTransaction. Type TransactionType `json:"type"` // The client-provided alias for the Account. Alias string `json:"alias"` // The margin rate override for the Account. MarginRate DecimalNumber `json:"marginRate"` }
A ClientConfigureTransaction represents the configuration of an Account by a client.
func (ClientConfigureTransaction) MarshalEasyJSON ¶
func (v ClientConfigureTransaction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (ClientConfigureTransaction) MarshalJSON ¶
func (v ClientConfigureTransaction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*ClientConfigureTransaction) UnmarshalEasyJSON ¶
func (v *ClientConfigureTransaction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*ClientConfigureTransaction) UnmarshalJSON ¶
func (v *ClientConfigureTransaction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type ClientExtensions ¶
type ClientExtensions struct { // The Client ID of the Order/Trade ID ClientID `json:"id"` // A tag associated with the Order/Trade Tag ClientTag `json:"tag"` // A comment associated with the Order/Trade Comment ClientComment `json:"comment"` }
A ClientExtensions object allows a client to attach a clientID, tag and comment to Orders and Trades in their Account. Do not set, modify, or delete this field if your account is associated with MT4.
func (ClientExtensions) MarshalEasyJSON ¶
func (v ClientExtensions) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (ClientExtensions) MarshalJSON ¶
func (v ClientExtensions) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*ClientExtensions) UnmarshalEasyJSON ¶
func (v *ClientExtensions) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*ClientExtensions) UnmarshalJSON ¶
func (v *ClientExtensions) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type ClientID ¶
type ClientID string
A client-provided identifier, used by clients to refer to their Orders or Trades with an identifier that they have provided.
type ClientPrice ¶
type ClientPrice struct { // The string “PRICE”. Used to identify the a Price object when found in a stream. Type string `json:"type"` // The Price’s Instrument. Instrument InstrumentName `json:"instrument"` // The date/time when the Price was created Time DateTime `json:"time"` // Flag indicating if the Price is tradeable or not Tradeable bool `json:"tradeable"` // The list of prices and liquidity available on the Instrument’s bid side. // It is possible for this list to be empty if there is no bid liquidity // currently available for the Instrument in the Account. Bids []PriceBucket `json:"bids"` // The list of prices and liquidity available on the Instrument’s ask side. // It is possible for this list to be empty if there is no ask liquidity // currently available for the Instrument in the Account. Asks []PriceBucket `json:"asks"` // The closeout bid Price. This Price is used when a bid is required to // closeout a Position (margin closeout or manual) yet there is no bid // liquidity. The closeout bid is never used to open a new position. CloseoutBid PriceValue `json:"closeoutBid"` // The closeout ask Price. This Price is used when a ask is required to // closeout a Position (margin closeout or manual) yet there is no ask // liquidity. The closeout ask is never used to open a new position. CloseoutAsk PriceValue `json:"closeoutAsk"` }
The specification of an Account-specific Price.
func (ClientPrice) MarshalEasyJSON ¶
func (v ClientPrice) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (ClientPrice) MarshalJSON ¶
func (v ClientPrice) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*ClientPrice) UnmarshalEasyJSON ¶
func (v *ClientPrice) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*ClientPrice) UnmarshalJSON ¶
func (v *ClientPrice) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type ClientTag ¶
type ClientTag string
A client-provided tag that can contain any data and may be assigned to their Orders or Trades. Tags are typically used to associate groups of Trades and/or Orders together.
type CloseTransaction ¶
type CloseTransaction struct { Transaction // The Type of the Transaction. Always set to “CLOSE” in a CloseTransaction. Type TransactionType `json:"type"` }
A CloseTransaction represents the closing of an Account.
func (CloseTransaction) MarshalEasyJSON ¶
func (v CloseTransaction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (CloseTransaction) MarshalJSON ¶
func (v CloseTransaction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*CloseTransaction) UnmarshalEasyJSON ¶
func (v *CloseTransaction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*CloseTransaction) UnmarshalJSON ¶
func (v *CloseTransaction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type ConversionFactor ¶
type ConversionFactor struct { // The factor by which to multiply the amount in the given currency to // obtain the amount in the home currency of the Account. Factor DecimalNumber `json:"factor"` }
A ConversionFactor contains information used to convert an amount, from an Instrument’s base or quote currency, to the home currency of an Account.
func (ConversionFactor) MarshalEasyJSON ¶
func (v ConversionFactor) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (ConversionFactor) MarshalJSON ¶
func (v ConversionFactor) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*ConversionFactor) UnmarshalEasyJSON ¶
func (v *ConversionFactor) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*ConversionFactor) UnmarshalJSON ¶
func (v *ConversionFactor) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type CreateOrderError ¶
type CreateOrderError struct { // The Transaction that rejected the creation of the Order as requested. // Only present if the Account exists. OrderRejectTransaction *TransactionParser `json:"orderRejectTransaction"` // The IDs of all Transactions that were created while satisfying the // request. RelatedTransactionIDs []TransactionID `json:"relatedTransactionIDs"` // The ID of the most recent Transaction created for the Account LastTransactionID TransactionID `json:"lastTransactionID"` // The code of the error that has occurred. This field may not be returned // for some errors. ErrorCode string `json:"errorCode"` // The human-readable description of the error that has occurred. ErrorMessage string `json:"errorMessage"` }
func (CreateOrderError) MarshalEasyJSON ¶
func (v CreateOrderError) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (CreateOrderError) MarshalJSON ¶
func (v CreateOrderError) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*CreateOrderError) UnmarshalEasyJSON ¶
func (v *CreateOrderError) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*CreateOrderError) UnmarshalJSON ¶
func (v *CreateOrderError) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type CreateOrderRequest ¶
type CreateOrderRequest struct {
Order *OrderRequestParser `json:"order"`
}
func (CreateOrderRequest) MarshalEasyJSON ¶
func (v CreateOrderRequest) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (CreateOrderRequest) MarshalJSON ¶
func (v CreateOrderRequest) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*CreateOrderRequest) UnmarshalEasyJSON ¶
func (v *CreateOrderRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*CreateOrderRequest) UnmarshalJSON ¶
func (v *CreateOrderRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type CreateOrderResponse ¶
type CreateOrderResponse struct { // The Transaction that created the Order specified by the request. OrderCreateTransaction *TransactionParser `json:"orderCreateTransaction"` // The Transaction that filled the newly created Order. Only provided when // the Order was immediately filled. OrderFillTransaction *OrderFillTransaction `json:"orderFillTransaction"` // The Transaction that cancelled the newly created Order. Only provided // when the Order was immediately cancelled. OrderCancelTransaction *OrderCancelTransaction `json:"orderCancelTransaction"` // The Transaction that reissues the Order. Only provided when the Order is // configured to be reissued for its remaining units after a partial fill // and the reissue was successful. OrderReissueTransaction *TransactionParser `json:"orderReissueTransaction"` // The Transaction that rejects the reissue of the Order. Only provided when // the Order is configured to be reissued for its remaining units after a // partial fill and the reissue was rejected. OrderReissueRejectTransaction *TransactionParser `json:"orderReissueRejectTransaction"` // The IDs of all Transactions that were created while satisfying the // request. RelatedTransactionIDs []TransactionID `json:"relatedTransactionIDs"` // The ID of the most recent Transaction created for the Account LastTransactionID TransactionID `json:"lastTransactionID"` }
func (CreateOrderResponse) MarshalEasyJSON ¶
func (v CreateOrderResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (CreateOrderResponse) MarshalJSON ¶
func (v CreateOrderResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*CreateOrderResponse) UnmarshalEasyJSON ¶
func (v *CreateOrderResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*CreateOrderResponse) UnmarshalJSON ¶
func (v *CreateOrderResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type CreateTransaction ¶
type CreateTransaction struct { Transaction // The Type of the Transaction. Always set to “CREATE” in a CreateTransaction. Type TransactionType `json:"type"` // The ID of the Division that the Account is in DivisionID int64 `json:"divisionID"` // The ID of the Site that the Account was created at SiteID int64 `json:"siteID"` // The ID of the user that the Account was created for AccountUserID int64 `json:"accountUserID"` // The number of the Account within the site/division/user AccountNumber int64 `json:"accountNumber"` // The home currency of the Account HomeCurrency Currency `json:"homeCurrency"` }
A CreateTransaction represents the creation of an Account.
func (CreateTransaction) MarshalEasyJSON ¶
func (v CreateTransaction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (CreateTransaction) MarshalJSON ¶
func (v CreateTransaction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*CreateTransaction) UnmarshalEasyJSON ¶
func (v *CreateTransaction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*CreateTransaction) UnmarshalJSON ¶
func (v *CreateTransaction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type Currency ¶
type Currency string
Currency name identifier. Used by clients to refer to currencies. A string containing an ISO 4217 currency (http://en.wikipedia.org/wiki/ISO_4217)
type DailyFinancingTransaction ¶
type DailyFinancingTransaction struct { Transaction // The Type of the Transaction. Always set to “DAILY_FINANCING” for a DailyFinancingTransaction. Type TransactionType `json:"type"` // The amount of financing paid/collected for the Account. Financing AccountUnits `json:"financing"` // The Account’s balance after daily financing. AccountBalance AccountUnits `json:"accountBalance"` // The account financing mode at the time of the daily financing. This field is no // longer in use moving forward and was replaced by accountFinancingMode in individual // positionFinancings since the financing mode could differ between instruments. Deprecated: // Will be removed in a future API update. AccountFinancingMode AccountFinancingMode `json:"accountFinancingMode"` // The financing paid/collected for each Position in the Account. PositionFinancings []*PositionFinancing `json:"positionFinancings"` }
A DailyFinancingTransaction represents the daily payment/collection of financing for an Account.
func (DailyFinancingTransaction) MarshalEasyJSON ¶
func (v DailyFinancingTransaction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (DailyFinancingTransaction) MarshalJSON ¶
func (v DailyFinancingTransaction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*DailyFinancingTransaction) UnmarshalEasyJSON ¶
func (v *DailyFinancingTransaction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*DailyFinancingTransaction) UnmarshalJSON ¶
func (v *DailyFinancingTransaction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type DateTime ¶
type DateTime string
DateTime A date and time value using either RFC3339 or UNIX time representation. The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places).
type DayOfWeek ¶
type DayOfWeek string
The DayOfWeek provides a representation of the day of the week.
const ( DayOfWeek_SUNDAY DayOfWeek = "SUNDAY" // Sunday DayOfWeek_MONDAY DayOfWeek = "MONDAY" // Monday DayOfWeek_TUESDAY DayOfWeek = "TUESDAY" // Tuesday DayOfWeek_WEDNESDAY DayOfWeek = "WEDNESDAY" // Wednesday DayOfWeek_THURSDAY DayOfWeek = "THURSDAY" // Thursday DayOfWeek_FRIDAY DayOfWeek = "FRIDAY" // Friday DayOfWeek_SATURDAY DayOfWeek = "SATURDAY" // Sunday )
type DecimalNumber ¶
type DecimalNumber string
The string representation of a decimal number. A decimal number encoded as a string. The amount of precision provided depends on what the number represents.
func (DecimalNumber) AsFloat64 ¶
func (d DecimalNumber) AsFloat64(or float64) float64
type DelayedTradeClosureTransaction ¶
type DelayedTradeClosureTransaction struct { Transaction // The Type of the Transaction. Always set to “DELAYED_TRADE_CLOSURE” for an DelayedTradeClosureTransaction. Type TransactionType `json:"type"` // The reason for the delayed trade closure Reason MarketOrderReason `json:"reason"` // List of Trade ID’s identifying the open trades that will be closed when their // respective instruments become tradeable TradeIDs TradeID `json:"tradeIDs"` }
A DelayedTradeClosure Transaction is created administratively to indicate open trades that should have been closed but weren’t because the open trades’ instruments were untradeable at the time. Open trades listed in this transaction will be closed once their respective instruments become tradeable.
func (DelayedTradeClosureTransaction) MarshalEasyJSON ¶
func (v DelayedTradeClosureTransaction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (DelayedTradeClosureTransaction) MarshalJSON ¶
func (v DelayedTradeClosureTransaction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*DelayedTradeClosureTransaction) UnmarshalEasyJSON ¶
func (v *DelayedTradeClosureTransaction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*DelayedTradeClosureTransaction) UnmarshalJSON ¶
func (v *DelayedTradeClosureTransaction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type Direction ¶
type Direction string
Direction In the context of an Order or a Trade, defines whether the units are positive or negative.
const ( // A long Order is used to to buy units of an Instrument. A Trade is long when it has // bought units of an Instrument. Direction_LONG Direction = "LONG" // A short Order is used to to sell units of an Instrument. A Trade is short when it has // sold units of an Instrument. Direction_SHORT = "SHORT" )
type DividendAdjustmentTransaction ¶
type DividendAdjustmentTransaction struct { Transaction // The Type of the Transaction. Always set to “DIVIDEND_ADJUSTMENT” for a DividendAdjustmentTransaction. Type TransactionType `json:"type"` // The name of the instrument for the dividendAdjustment transaction Instrument InstrumentName `json:"instrument"` // The total dividend adjustment amount paid or collected in the Account’s home currency // for the Account as a result of applying the DividendAdjustment Transaction. This // is the sum of the dividend adjustments paid/collected for each OpenTradeDividendAdjustment // found within the Transaction. DividendAdjustment AccountUnits `json:"dividendAdjustment"` // The total dividend adjustment amount paid or collected in the Instrument’s quote // currency for the Account as a result of applying the DividendAdjustment Transaction. // This is the sum of the quote dividend adjustments paid/collected for each OpenTradeDividendAdjustment // found within the Transaction. QuoteDividendAdjustment DecimalNumber `json:"quoteDividendAdjustment"` // The HomeConversionFactors in effect at the time of the DividendAdjustment. HomeConversionFactors *HomeConversionFactors `json:"homeConversionFactors"` // The Account balance after applying the DividendAdjustment Transaction AccountBalance AccountUnits `json:"accountBalance"` // The dividend adjustment payment/collection details for each open Trade, within the // Account, for which a dividend adjustment is to be paid or collected. OpenTradeDividendAdjustments []*OpenTradeDividendAdjustment `json:"openTradeDividendAdjustments"` }
A DividendAdjustment Transaction is created administratively to pay or collect dividend adjustment mounts to or from an Account.
func (DividendAdjustmentTransaction) MarshalEasyJSON ¶
func (v DividendAdjustmentTransaction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (DividendAdjustmentTransaction) MarshalJSON ¶
func (v DividendAdjustmentTransaction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*DividendAdjustmentTransaction) UnmarshalEasyJSON ¶
func (v *DividendAdjustmentTransaction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*DividendAdjustmentTransaction) UnmarshalJSON ¶
func (v *DividendAdjustmentTransaction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type DynamicOrderState ¶
type DynamicOrderState struct { // The Order’s ID ID OrderID `json:"id"` // The Order’s calculated trailing stop value. TrailingStopValue PriceValue `json:"trailingStopValue"` // The distance between the Trailing Stop Loss Order’s trailingStopValue and // the current Market Price. This represents the distance (in price units) // of the Order from a triggering price. If the distance could not be // determined, this value will not be set. TriggerDistance PriceValue `json:"triggerDistance"` // True if an exact trigger distance could be calculated. If false, it means // the provided trigger distance is a best estimate. If the distance could // not be determined, this value will not be set. IsTriggerDistanceExact bool `json:"isTriggerDistanceExact"` }
The dynamic state of an Order. This is only relevant to TrailingStopLoss Orders, as no other Order type has dynamic state.
func (DynamicOrderState) MarshalEasyJSON ¶
func (v DynamicOrderState) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (DynamicOrderState) MarshalJSON ¶
func (v DynamicOrderState) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*DynamicOrderState) UnmarshalEasyJSON ¶
func (v *DynamicOrderState) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*DynamicOrderState) UnmarshalJSON ¶
func (v *DynamicOrderState) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type FinancingDayOfWeek ¶
type FinancingDayOfWeek struct { // The day of the week to charge the financing. DayOfWeek DayOfWeek `json:"dayOfWeek"` // The number of days worth of financing to be charged on dayOfWeek. DaysCharged int64 `json:"daysCharged"` }
A FinancingDayOfWeek message defines a day of the week when financing charges are debited or credited.
func (FinancingDayOfWeek) MarshalEasyJSON ¶
func (v FinancingDayOfWeek) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (FinancingDayOfWeek) MarshalJSON ¶
func (v FinancingDayOfWeek) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*FinancingDayOfWeek) UnmarshalEasyJSON ¶
func (v *FinancingDayOfWeek) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*FinancingDayOfWeek) UnmarshalJSON ¶
func (v *FinancingDayOfWeek) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type FixedPriceOrder ¶
type FixedPriceOrder struct { Order // The type of the Order. Always set to “FIXED_PRICE” for Fixed Price Orders. Type OrderType `json:"type"` // The Fixed Price Order’s Instrument. Instrument InstrumentName `json:"instrument"` // The quantity requested to be filled by the Fixed Price Order. A positive number // of units results in a long Order, and a negative number of units results in a short // Order. Units DecimalNumber `json:"units"` // The price specified for the Fixed Price Order. This price is the exact price that // the Fixed Price Order will be filled at. Price PriceValue `json:"price"` // Specification of how Positions in the Account are modified when the Order is filled. PositionFill OrderPositionFill `json:"positionFill"` // The state that the trade resulting from the Fixed Price Order should be set to. TradeState string `json:"tradeState"` // TakeProfitDetails specifies the details of a Take Profit Order to be created on // behalf of a client. This may happen when an Order is filled that opens a Trade requiring // a Take Profit, or when a Trade’s dependent Take Profit Order is modified directly // through the Trade. TakeProfitOnFill *TakeProfitDetails `json:"takeProfitOnFill"` // StopLossDetails specifies the details of a Stop Loss Order to be created on behalf // of a client. This may happen when an Order is filled that opens a Trade requiring // a Stop Loss, or when a Trade’s dependent Stop Loss Order is modified directly through // the Trade. StopLossOnFill *StopLossDetails `json:"stopLossOnFill"` // GuaranteedStopLossDetails specifies the details of a Guaranteed Stop Loss Order // to be created on behalf of a client. This may happen when an Order is filled that // opens a Trade requiring a Guaranteed Stop Loss, or when a Trade’s dependent Guaranteed // Stop Loss Order is modified directly through the Trade. GuaranteedStopLossOnFill *GuaranteedStopLossDetails `json:"guaranteedStopLossOnFill"` // TrailingStopLossDetails specifies the details of a Trailing Stop Loss Order to be // created on behalf of a client. This may happen when an Order is filled that opens // a Trade requiring a Trailing Stop Loss, or when a Trade’s dependent Trailing Stop // Loss Order is modified directly through the Trade. TrailingStopLossOnFill *TrailingStopLossDetails `json:"trailingStopLossOnFill"` // Client Extensions to add to the Trade created when the Order is filled (if such // a Trade is created). Do not set, modify, or delete tradeClientExtensions if your // account is associated with MT4. TradeClientExtensions *ClientExtensions `json:"tradeClientExtensions"` // ID of the Transaction that filled this Order (only provided when the Order’s state // is FILLED) FillingTransactionID TransactionID `json:"fillingTransactionID"` // Date/time when the Order was filled (only provided when the Order’s state is FILLED) FilledTime DateTime `json:"filledTime"` // Trade ID of Trade opened when the Order was filled (only provided when the Order’s // state is FILLED and a Trade was opened as a result of the fill) TradeOpenedID TradeID `json:"tradeOpenedID"` // Trade ID of Trade reduced when the Order was filled (only provided when the Order’s // state is FILLED and a Trade was reduced as a result of the fill) TradeReducedID TradeID `json:"tradeReducedID"` // Trade IDs of Trades closed when the Order was filled (only provided when the Order’s // state is FILLED and one or more Trades were closed as a result of the fill) TradeClosedIDs []TradeID `json:"tradeClosedIDs"` // ID of the Transaction that cancelled the Order (only provided when the Order’s // state is CANCELLED) CancellingTransactionID TransactionID `json:"cancellingTransactionID"` // Date/time when the Order was cancelled (only provided when the state of the Order // is CANCELLED) CancelledTime DateTime `json:"cancelledTime"` }
A FixedPriceOrder is an order that is filled immediately upon creation using a fixed price.
func (FixedPriceOrder) MarshalEasyJSON ¶
func (v FixedPriceOrder) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (FixedPriceOrder) MarshalJSON ¶
func (v FixedPriceOrder) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*FixedPriceOrder) UnmarshalEasyJSON ¶
func (v *FixedPriceOrder) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*FixedPriceOrder) UnmarshalJSON ¶
func (v *FixedPriceOrder) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type FixedPriceOrderReason ¶
type FixedPriceOrderReason string
The reason that the Fixed Price Order was created
const ( // The Fixed Price Order was created as part of a platform account migration FixedPriceOrderReason_PLATFORM_ACCOUNT_MIGRATION FixedPriceOrderReason = "PLATFORM_ACCOUNT_MIGRATION" // The Fixed Price Order was created to close a Trade as part of division account migration FixedPriceOrderReason_TRADE_CLOSE_DIVISION_ACCOUNT_MIGRATION FixedPriceOrderReason = "TRADE_CLOSE_DIVISION_ACCOUNT_MIGRATION" // The Fixed Price Order was created to close a Trade administratively FixedPriceOrderReason_TRADE_CLOSE_ADMINISTRATIVE_ACTION FixedPriceOrderReason = "TRADE_CLOSE_ADMINISTRATIVE_ACTION" )
type FixedPriceOrderTransaction ¶
type FixedPriceOrderTransaction struct { Transaction // The Type of the Transaction. Always set to “FIXED_PRICE_ORDER” in a FixedPriceOrderTransaction. Type TransactionType `json:"type"` // The Fixed Price Order’s Instrument. Instrument InstrumentName `json:"instrument"` // The quantity requested to be filled by the Fixed Price Order. A positive number // of units results in a long Order, and a negative number of units results in a short // Order. Units DecimalNumber `json:"units"` // The price specified for the Fixed Price Order. This price is the exact price that // the Fixed Price Order will be filled at. Price PriceValue `json:"price"` // Specification of how Positions in the Account are modified when the Order is filled. PositionFill OrderPositionFill `json:"positionFill"` // The state that the trade resulting from the Fixed Price Order should be set to. TradeState string `json:"tradeState"` // The reason that the Fixed Price Order was created Reason FixedPriceOrderReason `json:"reason"` // The client extensions for the Fixed Price Order. ClientExtensions *ClientExtensions `json:"clientExtensions"` // The specification of the Take Profit Order that should be created for a Trade opened // when the Order is filled (if such a Trade is created). TakeProfitOnFill *TakeProfitDetails `json:"takeProfitOnFill"` // The specification of the Stop Loss Order that should be created for a Trade opened // when the Order is filled (if such a Trade is created). StopLossOnFill *StopLossDetails `json:"stopLossOnFill"` // The specification of the Trailing Stop Loss Order that should be created for a Trade // that is opened when the Order is filled (if such a Trade is created). TrailingStopLossOnFill *TrailingStopLossDetails `json:"trailingStopLossOnFill"` // The specification of the Guaranteed Stop Loss Order that should be created for a // Trade that is opened when the Order is filled (if such a Trade is created). GuaranteedStopLossOnFill *GuaranteedStopLossDetails `json:"guaranteedStopLossOnFill"` // Client Extensions to add to the Trade created when the Order is filled (if such // a Trade is created). Do not set, modify, delete tradeClientExtensions if your account // is associated with MT4. TradeClientExtensions *ClientExtensions `json:"tradeClientExtensions"` }
A FixedPriceOrderTransaction represents the creation of a Fixed Price Order in the user’s account. A Fixed Price Order is an Order that is filled immediately at a specified price.
func (FixedPriceOrderTransaction) MarshalEasyJSON ¶
func (v FixedPriceOrderTransaction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (FixedPriceOrderTransaction) MarshalJSON ¶
func (v FixedPriceOrderTransaction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*FixedPriceOrderTransaction) UnmarshalEasyJSON ¶
func (v *FixedPriceOrderTransaction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*FixedPriceOrderTransaction) UnmarshalJSON ¶
func (v *FixedPriceOrderTransaction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type FundingReason ¶
type FundingReason string
The reason that an Account is being funded.
const ( // The client has initiated a funds transfer FundingReason_CLIENT_FUNDING FundingReason = "CLIENT_FUNDING" // Funds are being transferred between two Accounts FundingReason_ACCOUNT_TRANSFER FundingReason = "ACCOUNT_TRANSFER" // Funds are being transferred as part of a Division migration FundingReason_DIVISION_MIGRATION FundingReason = "DIVISION_MIGRATION" // Funds are being transferred as part of a Site migration FundingReason_SITE_MIGRATION FundingReason = "SITE_MIGRATION" // Funds are being transferred as part of an Account adjustment FundingReason_ADJUSTMENT FundingReason = "ADJUSTMENT" )
type GuaranteedStopLossDetails ¶
type GuaranteedStopLossDetails struct { // The price that the Guaranteed Stop Loss Order will be triggered at. Only // one of the price and distance fields may be specified. Price PriceValue `json:"price"` // Specifies the distance (in price units) from the Trade’s open price to // use as the Guaranteed Stop Loss Order price. Only one of the distance and // price fields may be specified. Distance DecimalNumber `json:"distance"` // The time in force for the created Guaranteed Stop Loss Order. This may only be GTC, GTD or GFD. TimeInForce TimeInForce `json:"timeInForce"` // The date when the Guaranteed Stop Loss Order will be cancelled on if timeInForce is GTD. GtdTime DateTime `json:"gtdTime"` // The Client Extensions to add to the Guaranteed Stop Loss Order when created. ClientExtensions *ClientExtensions `json:"clientExtensions"` }
GuaranteedStopLossDetails specifies the details of a Guaranteed Stop Loss Order to be created on behalf of a client. This may happen when an Order is filled that opens a Trade requiring a Guaranteed Stop Loss, or when a Trade’s dependent Guaranteed Stop Loss Order is modified directly through the Trade.
func (GuaranteedStopLossDetails) MarshalEasyJSON ¶
func (v GuaranteedStopLossDetails) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (GuaranteedStopLossDetails) MarshalJSON ¶
func (v GuaranteedStopLossDetails) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*GuaranteedStopLossDetails) UnmarshalEasyJSON ¶
func (v *GuaranteedStopLossDetails) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*GuaranteedStopLossDetails) UnmarshalJSON ¶
func (v *GuaranteedStopLossDetails) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type GuaranteedStopLossOrder ¶
type GuaranteedStopLossOrder struct { Order // The type of the Order. Always set to “GUARANTEED_STOP_LOSS” for Guaranteed Stop // Loss Orders. Type OrderType `json:"type"` // The premium that will be charged if the Guaranteed Stop Loss Order is filled at // the guaranteed price. It is in price units and is charged for each unit of the Trade. GuaranteedExecutionPremium DecimalNumber `json:"guaranteedExecutionPremium"` // The ID of the Trade to close when the price threshold is breached. TradeID TradeID `json:"tradeID"` // The client ID of the Trade to be closed when the price threshold is breached. ClientTradeID ClientID `json:"clientTradeID"` // The price threshold specified for the Guaranteed Stop Loss Order. The associated // Trade will be closed at this price. Price PriceValue `json:"price"` // Specifies the distance (in price units) from the Account’s current price to use // as the Guaranteed Stop Loss Order price. If the Trade is short the Instrument’s // bid price is used, and for long Trades the ask is used. Distance DecimalNumber `json:"distance"` // The time-in-force requested for the GuaranteedStopLoss Order. Restricted to “GTC”, // “GFD” and “GTD” for GuaranteedStopLoss Orders. TimeInForce TimeInForce `json:"timeInForce"` // The date/time when the GuaranteedStopLoss Order will be cancelled if its timeInForce // is “GTD”. GtdTime DateTime `json:"gtdTime"` // Specification of which price component should be used when determining if an Order // should be triggered and filled. This allows Orders to be triggered based on the bid, // ask, mid, default (ask for buy, bid for sell) or inverse (ask for sell, bid for buy) // price depending on the desired behaviour. Orders are always filled using their default // price component. This feature is only provided through the REST API. Clients who // choose to specify a non-default trigger condition will not see it reflected in any // of OANDA’s proprietary or partner trading platforms, their transaction history // or their account statements. OANDA platforms always assume that an Order’s trigger // condition is set to the default value when indicating the distance from an Order’s // trigger price, and will always provide the default trigger condition when creating // or modifying an Order. A special restriction applies when creating a Guaranteed Stop // Loss Order. In this case the TriggerCondition value must either be “DEFAULT”, // or the “natural” trigger side “DEFAULT” results in. So for a Guaranteed Stop // Loss Order for a long trade valid values are “DEFAULT” and “BID”, and for // short trades “DEFAULT” and “ASK” are valid. TriggerCondition OrderTriggerCondition `json:"triggerCondition"` // ID of the Transaction that filled this Order (only provided when the Order’s state // is FILLED) FillingTransactionID TransactionID `json:"fillingTransactionID"` // Date/time when the Order was filled (only provided when the Order’s state is FILLED) FilledTime DateTime `json:"filledTime"` // Trade ID of Trade opened when the Order was filled (only provided when the Order’s // state is FILLED and a Trade was opened as a result of the fill) TradeOpenedID TradeID `json:"tradeOpenedID"` // Trade ID of Trade reduced when the Order was filled (only provided when the Order’s // state is FILLED and a Trade was reduced as a result of the fill) TradeReducedID TradeID `json:"tradeReducedID"` // Trade IDs of Trades closed when the Order was filled (only provided when the Order’s // state is FILLED and one or more Trades were closed as a result of the fill) TradeClosedIDs []TradeID `json:"tradeClosedIDs"` // ID of the Transaction that cancelled the Order (only provided when the Order’s // state is CANCELLED) CancellingTransactionID TransactionID `json:"cancellingTransactionID"` // Date/time when the Order was cancelled (only provided when the state of the Order // is CANCELLED) CancelledTime DateTime `json:"cancelledTime"` // The ID of the Order that was replaced by this Order (only provided if this Order // was created as part of a cancel/replace). ReplacesOrderID OrderID `json:"replacesOrderID"` // The ID of the Order that replaced this Order (only provided if this Order was cancelled // as part of a cancel/replace). ReplacedByOrderID OrderID `json:"replacedByOrderID"` }
A GuaranteedStopLossOrder is an order that is linked to an open Trade and created with a price threshold which is guaranteed against slippage that may occur as the market crosses the price set for that order. The Order will be filled (closing the Trade) by the first price that is equal to or worse than the threshold. The price level specified for the GuaranteedStopLossOrder must be at least the configured minimum distance (in price units) away from the entry price for the traded instrument. A GuaranteedStopLossOrder cannot be used to open a new Position.
func (GuaranteedStopLossOrder) MarshalEasyJSON ¶
func (v GuaranteedStopLossOrder) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (GuaranteedStopLossOrder) MarshalJSON ¶
func (v GuaranteedStopLossOrder) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*GuaranteedStopLossOrder) UnmarshalEasyJSON ¶
func (v *GuaranteedStopLossOrder) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*GuaranteedStopLossOrder) UnmarshalJSON ¶
func (v *GuaranteedStopLossOrder) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type GuaranteedStopLossOrderEntryData ¶
type GuaranteedStopLossOrderEntryData struct { // The minimum distance allowed between the Trade’s fill price and the // configured price for guaranteed Stop Loss Orders created for this // instrument. Specified in price units. MinimumDistance DecimalNumber `json:"minimumDistance"` // The amount that is charged to the account if a guaranteed Stop Loss Order // is triggered and filled. The value is in price units and is charged for // each unit of the Trade. Premium DecimalNumber `json:"premium"` // The guaranteed Stop Loss Order level restriction for this instrument. LevelRestriction GuaranteedStopLossOrderLevelRestriction `json:"levelRestriction"` }
Details required by clients creating a Guaranteed Stop Loss Order
func (GuaranteedStopLossOrderEntryData) MarshalEasyJSON ¶
func (v GuaranteedStopLossOrderEntryData) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (GuaranteedStopLossOrderEntryData) MarshalJSON ¶
func (v GuaranteedStopLossOrderEntryData) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*GuaranteedStopLossOrderEntryData) UnmarshalEasyJSON ¶
func (v *GuaranteedStopLossOrderEntryData) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*GuaranteedStopLossOrderEntryData) UnmarshalJSON ¶
func (v *GuaranteedStopLossOrderEntryData) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type GuaranteedStopLossOrderLevelRestriction ¶
type GuaranteedStopLossOrderLevelRestriction struct { // Applies to Trades with a guaranteed Stop Loss Order attached for the // specified Instrument. This is the total allowed Trade volume that can // exist within the priceRange based on the trigger prices of the guaranteed // Stop Loss Orders. Volume DecimalNumber `json:"volume"` // The price range the volume applies to. This value is in price units. PriceRange DecimalNumber `json:"priceRange"` }
A GuaranteedStopLossOrderLevelRestriction represents the total position size that can exist within a given price window for Trades with guaranteed Stop Loss Orders attached for a specific Instrument.
func (GuaranteedStopLossOrderLevelRestriction) MarshalEasyJSON ¶
func (v GuaranteedStopLossOrderLevelRestriction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (GuaranteedStopLossOrderLevelRestriction) MarshalJSON ¶
func (v GuaranteedStopLossOrderLevelRestriction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*GuaranteedStopLossOrderLevelRestriction) UnmarshalEasyJSON ¶
func (v *GuaranteedStopLossOrderLevelRestriction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*GuaranteedStopLossOrderLevelRestriction) UnmarshalJSON ¶
func (v *GuaranteedStopLossOrderLevelRestriction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type GuaranteedStopLossOrderMode ¶
type GuaranteedStopLossOrderMode string
The overall behaviour of the Account regarding guaranteed Stop Loss Orders.
const ( // The Account is not permitted to create guaranteed Stop Loss Orders. GuaranteedStopLossOrderMode_DISABLED GuaranteedStopLossOrderMode = "DISABLED" // The Account is able, but not required to have guaranteed Stop Loss Orders for open Trades. GuaranteedStopLossOrderMode_ALLOWED GuaranteedStopLossOrderMode = "ALLOWED" // The Account is required to have guaranteed Stop Loss Orders for all open Trades. GuaranteedStopLossOrderMode_REQUIRED GuaranteedStopLossOrderMode = "REQUIRED" )
type GuaranteedStopLossOrderModeForInstrument ¶
type GuaranteedStopLossOrderModeForInstrument string
The overall behaviour of the Account regarding Guaranteed Stop Loss Orders for a specific Instrument.
type GuaranteedStopLossOrderMutability ¶
type GuaranteedStopLossOrderMutability string
For Accounts that support guaranteed Stop Loss Orders, describes the actions that can be be performed on guaranteed Stop Loss Orders.
const ( // Once a guaranteed Stop Loss Order has been created it cannot be replaced or cancelled. GuaranteedStopLossOrderMutability_FIXED GuaranteedStopLossOrderMutability = "FIXED" // An existing guaranteed Stop Loss Order can only be replaced, not cancelled. GuaranteedStopLossOrderMutability_REPLACEABLE GuaranteedStopLossOrderMutability = "REPLACEABLE" // Once a guaranteed Stop Loss Order has been created it can be either replaced or cancelled. GuaranteedStopLossOrderMutability_CANCELABLE GuaranteedStopLossOrderMutability = "CANCELABLE" // An existing guaranteed Stop Loss Order can only be replaced to widen // the gap from the current price, not cancelled. GuaranteedStopLossOrderMutability_PRICE_WIDEN_ONLY GuaranteedStopLossOrderMutability = "PRICE_WIDEN_ONLY" )
type GuaranteedStopLossOrderParameters ¶
type GuaranteedStopLossOrderParameters struct { // The current guaranteed Stop Loss Order mutability setting of the Account when market is open. MutabilityMarketOpen GuaranteedStopLossOrderMutability `json:"mutabilityMarketOpen"` // The current guaranteed Stop Loss Order mutability setting of the Account when market is halted. MutabilityMarketHalted GuaranteedStopLossOrderMutability `json:"mutabilityMarketHalted"` }
The current mutability and hedging settings related to guaranteed Stop Loss orders.
func (GuaranteedStopLossOrderParameters) MarshalEasyJSON ¶
func (v GuaranteedStopLossOrderParameters) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (GuaranteedStopLossOrderParameters) MarshalJSON ¶
func (v GuaranteedStopLossOrderParameters) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*GuaranteedStopLossOrderParameters) UnmarshalEasyJSON ¶
func (v *GuaranteedStopLossOrderParameters) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*GuaranteedStopLossOrderParameters) UnmarshalJSON ¶
func (v *GuaranteedStopLossOrderParameters) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type GuaranteedStopLossOrderReason ¶
type GuaranteedStopLossOrderReason string
The reason that the Guaranteed Stop Loss Order was initiated
type GuaranteedStopLossOrderRejectTransaction ¶
type GuaranteedStopLossOrderRejectTransaction struct { Transaction // The Type of the Transaction. Always set to “GUARANTEED_STOP_LOSS_ORDER_REJECT” // in a GuaranteedStopLossOrderRejectTransaction. Type TransactionType `json:"type"` // The ID of the Trade to close when the price threshold is breached. TradeID TradeID `json:"tradeID"` // The client ID of the Trade to be closed when the price threshold is breached. ClientTradeID ClientID `json:"clientTradeID"` // The price threshold specified for the Guaranteed Stop Loss Order. The associated // Trade will be closed at this price. Price PriceValue `json:"price"` // Specifies the distance (in price units) from the Account’s current price to use // as the Guaranteed Stop Loss Order price. If the Trade is short the Instrument’s // bid price is used, and for long Trades the ask is used. Distance DecimalNumber `json:"distance"` // The time-in-force requested for the GuaranteedStopLoss Order. Restricted to “GTC”, // “GFD” and “GTD” for GuaranteedStopLoss Orders. TimeInForce TimeInForce `json:"timeInForce"` // The date/time when the GuaranteedStopLoss Order will be cancelled if its timeInForce // is “GTD”. GtdTime DateTime `json:"gtdTime"` // Specification of which price component should be used when determining if an Order // should be triggered and filled. This allows Orders to be triggered based on the bid, // ask, mid, default (ask for buy, bid for sell) or inverse (ask for sell, bid for buy) // price depending on the desired behaviour. Orders are always filled using their default // price component. This feature is only provided through the REST API. Clients who // choose to specify a non-default trigger condition will not see it reflected in any // of OANDA’s proprietary or partner trading platforms, their transaction history // or their account statements. OANDA platforms always assume that an Order’s trigger // condition is set to the default value when indicating the distance from an Order’s // trigger price, and will always provide the default trigger condition when creating // or modifying an Order. A special restriction applies when creating a Guaranteed Stop // Loss Order. In this case the TriggerCondition value must either be “DEFAULT”, // or the “natural” trigger side “DEFAULT” results in. So for a Guaranteed Stop // Loss Order for a long trade valid values are “DEFAULT” and “BID”, and for // short trades “DEFAULT” and “ASK” are valid. TriggerCondition OrderTriggerCondition `json:"triggerCondition"` // The reason that the Guaranteed Stop Loss Order was initiated Reason GuaranteedStopLossOrderReason `json:"reason"` // Client Extensions to add to the Order (only provided if the Order is being created // with client extensions). ClientExtensions *ClientExtensions `json:"clientExtensions"` // The ID of the OrderFill Transaction that caused this Order to be created (only provided // if this Order was created automatically when another Order was filled). OrderFillTransactionID TransactionID `json:"orderFillTransactionID"` // The ID of the Order that this Order was intended to replace (only provided if this // Order was intended to replace an existing Order). IntendedReplacesOrderID OrderID `json:"intendedReplacesOrderID"` // The reason that the Reject Transaction was created RejectReason TransactionRejectReason `json:"rejectReason"` }
A GuaranteedStopLossOrderRejectTransaction represents the rejection of the creation of a GuaranteedStopLoss Order.
func (GuaranteedStopLossOrderRejectTransaction) MarshalEasyJSON ¶
func (v GuaranteedStopLossOrderRejectTransaction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (GuaranteedStopLossOrderRejectTransaction) MarshalJSON ¶
func (v GuaranteedStopLossOrderRejectTransaction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*GuaranteedStopLossOrderRejectTransaction) UnmarshalEasyJSON ¶
func (v *GuaranteedStopLossOrderRejectTransaction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*GuaranteedStopLossOrderRejectTransaction) UnmarshalJSON ¶
func (v *GuaranteedStopLossOrderRejectTransaction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type GuaranteedStopLossOrderRequest ¶
type GuaranteedStopLossOrderRequest struct { BaseOrderRequest // The type of the Order to Create. Must be set to “GUARANTEED_STOP_LOSS” when // creating a Guaranteed Stop Loss Order. Type OrderType `json:"type"` // The ID of the Trade to close when the price threshold is breached. TradeID TradeID `json:"tradeID"` // The client ID of the Trade to be closed when the price threshold is breached. ClientTradeID ClientID `json:"clientTradeID"` // The price threshold specified for the Guaranteed Stop Loss Order. The associated // Trade will be closed at this price. Price PriceValue `json:"price"` // Specifies the distance (in price units) from the Account’s current price to use // as the Guaranteed Stop Loss Order price. If the Trade is short the Instrument’s // bid price is used, and for long Trades the ask is used. Distance DecimalNumber `json:"distance"` // The time-in-force requested for the GuaranteedStopLoss Order. Restricted to “GTC”, // “GFD” and “GTD” for GuaranteedStopLoss Orders. TimeInForce TimeInForce `json:"timeInForce"` // The date/time when the GuaranteedStopLoss Order will be cancelled if its timeInForce // is “GTD”. GtdTime DateTime `json:"gtdTime"` // Specification of which price component should be used when determining if an Order // should be triggered and filled. This allows Orders to be triggered based on the bid, // ask, mid, default (ask for buy, bid for sell) or inverse (ask for sell, bid for buy) // price depending on the desired behaviour. Orders are always filled using their default // price component. This feature is only provided through the REST API. Clients who // choose to specify a non-default trigger condition will not see it reflected in any // of OANDA’s proprietary or partner trading platforms, their transaction history // or their account statements. OANDA platforms always assume that an Order’s trigger // condition is set to the default value when indicating the distance from an Order’s // trigger price, and will always provide the default trigger condition when creating // or modifying an Order. A special restriction applies when creating a Guaranteed Stop // Loss Order. In this case the TriggerCondition value must either be “DEFAULT”, // or the “natural” trigger side “DEFAULT” results in. So for a Guaranteed Stop // Loss Order for a long trade valid values are “DEFAULT” and “BID”, and for // short trades “DEFAULT” and “ASK” are valid. TriggerCondition OrderTriggerCondition `json:"triggerCondition"` // The client extensions to add to the Order. Do not set, modify, or delete clientExtensions // if your account is associated with MT4. ClientExtensions *ClientExtensions `json:"clientExtensions"` }
A GuaranteedStopLossOrderRequest specifies the parameters that may be set when creating a Guaranteed Stop Loss Order. Only one of the price and distance fields may be specified.
func (GuaranteedStopLossOrderRequest) MarshalEasyJSON ¶
func (v GuaranteedStopLossOrderRequest) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (GuaranteedStopLossOrderRequest) MarshalJSON ¶
func (v GuaranteedStopLossOrderRequest) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*GuaranteedStopLossOrderRequest) UnmarshalEasyJSON ¶
func (v *GuaranteedStopLossOrderRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*GuaranteedStopLossOrderRequest) UnmarshalJSON ¶
func (v *GuaranteedStopLossOrderRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type GuaranteedStopLossOrderTransaction ¶
type GuaranteedStopLossOrderTransaction struct { Transaction // The Type of the Transaction. Always set to “GUARANTEED_STOP_LOSS_ORDER” in a // GuaranteedStopLossOrderTransaction. Type TransactionType `json:"type"` // The ID of the Trade to close when the price threshold is breached. TradeID TradeID `json:"tradeID"` // The client ID of the Trade to be closed when the price threshold is breached. ClientTradeID ClientID `json:"clientTradeID"` // The price threshold specified for the Guaranteed Stop Loss Order. The associated // Trade will be closed at this price. Price PriceValue `json:"price"` // Specifies the distance (in price units) from the Account’s current price to use // as the Guaranteed Stop Loss Order price. If the Trade is short the Instrument’s // bid price is used, and for long Trades the ask is used. Distance DecimalNumber `json:"distance"` // The time-in-force requested for the GuaranteedStopLoss Order. Restricted to “GTC”, // “GFD” and “GTD” for GuaranteedStopLoss Orders. TimeInForce TimeInForce `json:"timeInForce"` // The date/time when the GuaranteedStopLoss Order will be cancelled if its timeInForce // is “GTD”. GtdTime DateTime `json:"gtdTime"` // Specification of which price component should be used when determining if an Order // should be triggered and filled. This allows Orders to be triggered based on the bid, // ask, mid, default (ask for buy, bid for sell) or inverse (ask for sell, bid for buy) // price depending on the desired behaviour. Orders are always filled using their default // price component. This feature is only provided through the REST API. Clients who // choose to specify a non-default trigger condition will not see it reflected in any // of OANDA’s proprietary or partner trading platforms, their transaction history // or their account statements. OANDA platforms always assume that an Order’s trigger // condition is set to the default value when indicating the distance from an Order’s // trigger price, and will always provide the default trigger condition when creating // or modifying an Order. A special restriction applies when creating a Guaranteed Stop // Loss Order. In this case the TriggerCondition value must either be “DEFAULT”, // or the “natural” trigger side “DEFAULT” results in. So for a Guaranteed Stop // Loss Order for a long trade valid values are “DEFAULT” and “BID”, and for // short trades “DEFAULT” and “ASK” are valid. TriggerCondition OrderTriggerCondition `json:"triggerCondition"` // The fee that will be charged if the Guaranteed Stop Loss Order is filled at the // guaranteed price. The value is determined at Order creation time. It is in price // units and is charged for each unit of the Trade. GuaranteedExecutionPremium DecimalNumber `json:"guaranteedExecutionPremium"` // The reason that the Guaranteed Stop Loss Order was initiated Reason GuaranteedStopLossOrderReason `json:"reason"` // Client Extensions to add to the Order (only provided if the Order is being created // with client extensions). ClientExtensions *ClientExtensions `json:"clientExtensions"` // The ID of the OrderFill Transaction that caused this Order to be created (only provided // if this Order was created automatically when another Order was filled). OrderFillTransactionID TransactionID `json:"orderFillTransactionID"` // The ID of the Order that this Order replaces (only provided if this Order replaces // an existing Order). ReplacesOrderID OrderID `json:"replacesOrderID"` // The ID of the Transaction that cancels the replaced Order (only provided if this // Order replaces an existing Order). CancellingTransactionID TransactionID `json:"cancellingTransactionID"` }
A GuaranteedStopLossOrderTransaction represents the creation of a GuaranteedStopLoss Order in the user’s Account.
func (GuaranteedStopLossOrderTransaction) MarshalEasyJSON ¶
func (v GuaranteedStopLossOrderTransaction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (GuaranteedStopLossOrderTransaction) MarshalJSON ¶
func (v GuaranteedStopLossOrderTransaction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*GuaranteedStopLossOrderTransaction) UnmarshalEasyJSON ¶
func (v *GuaranteedStopLossOrderTransaction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*GuaranteedStopLossOrderTransaction) UnmarshalJSON ¶
func (v *GuaranteedStopLossOrderTransaction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type HomeConversionFactors ¶
type HomeConversionFactors struct { // The ConversionFactor in effect for the Account for converting any gains // realized in Instrument quote units into units of the Account’s home currency. GainQuoteHome ConversionFactor `json:"gainQuoteHome"` // The ConversionFactor in effect for the Account for converting any losses // realized in Instrument quote units into units of the Account’s home currency. LossQuoteHome ConversionFactor `json:"lossQuoteHome"` // The ConversionFactor in effect for the Account for converting any gains // realized in Instrument base units into units of the Account’s home currency. GainBaseHome ConversionFactor `json:"gainBaseHome"` // The ConversionFactor in effect for the Account for converting any losses // realized in Instrument base units into units of the Account’s home currency. LossBaseHome ConversionFactor `json:"lossBaseHome"` }
A HomeConversionFactors message contains information used to convert amounts, from an Instrument’s base or quote currency, to the home currency of an Account.
func (HomeConversionFactors) MarshalEasyJSON ¶
func (v HomeConversionFactors) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (HomeConversionFactors) MarshalJSON ¶
func (v HomeConversionFactors) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*HomeConversionFactors) UnmarshalEasyJSON ¶
func (v *HomeConversionFactors) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*HomeConversionFactors) UnmarshalJSON ¶
func (v *HomeConversionFactors) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type HomeConversions ¶
type HomeConversions struct { // The currency to be converted into the home currency. Currency Currency `json:"currency"` // The factor used to convert any gains for an Account in the specified // currency into the Account’s home currency. This would include positive // realized P/L and positive financing amounts. Conversion is performed by // multiplying the positive P/L by the conversion factor. AccountGain DecimalNumber `json:"accountGain"` // The factor used to convert any losses for an Account in the specified // currency into the Account’s home currency. This would include negative // realized P/L and negative financing amounts. Conversion is performed by // multiplying the positive P/L by the conversion factor. AccountLoss DecimalNumber `json:"accountLoss"` // The factor used to convert a Position or Trade Value in the specified // currency into the Account’s home currency. Conversion is performed by // multiplying the Position or Trade Value by the conversion factor. PositionValue DecimalNumber `json:"positionValue"` }
HomeConversions represents the factors to use to convert quantities of a given currency into the Account’s home currency. The conversion factor depends on the scenario the conversion is required for.
func (HomeConversions) MarshalEasyJSON ¶
func (v HomeConversions) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (HomeConversions) MarshalJSON ¶
func (v HomeConversions) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*HomeConversions) UnmarshalEasyJSON ¶
func (v *HomeConversions) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*HomeConversions) UnmarshalJSON ¶
func (v *HomeConversions) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type Instrument ¶
type Instrument struct { // The name of the Instrument Name InstrumentName `json:"name"` // The type of the Instrument Type InstrumentType `json:"type"` // The display name of the Instrument DisplayName string `json:"displayName"` // The location of the “pip” for this instrument. The decimal position of // the pip in this Instrument’s price can be found at 10 ^ pipLocation (e.g. // -4 pipLocation results in a decimal pip position of 10 ^ -4 = 0.0001). PipLocation int64 `json:"pipLocation"` // The number of decimal places that should be used to display prices for // this instrument. (e.g. a displayPrecision of 5 would result in a price of // “1” being displayed as “1.00000”) DisplayPrecision int64 `json:"displayPrecision"` // The amount of decimal places that may be provided when specifying the // number of units traded for this instrument. TradeUnitsPrecision int64 `json:"tradeUnitsPrecision"` // The smallest number of units allowed to be traded for this instrument. MinimumTradeSize DecimalNumber `json:"minimumTradeSize"` // The maximum trailing stop distance allowed for a trailing stop loss // created for this instrument. Specified in price units. MaximumTrailingStopDistance DecimalNumber `json:"maximumTrailingStopDistance"` // The minimum distance allowed between the Trade’s fill price and the // configured price for guaranteed Stop Loss Orders created for this // instrument. Specified in price units. MinimumGuaranteedStopLossDistance DecimalNumber `json:"minimumGuaranteedStopLossDistance"` // The minimum trailing stop distance allowed for a trailing stop loss // created for this instrument. Specified in price units. MinimumTrailingStopDistance DecimalNumber `json:"minimumTrailingStopDistance"` // The maximum position size allowed for this instrument. Specified in units. MaximumPositionSize DecimalNumber `json:"maximumPositionSize"` // The maximum units allowed for an Order placed for this instrument. // Specified in units. MaximumOrderUnits DecimalNumber `json:"maximumOrderUnits"` // The margin rate for this instrument. MarginRate DecimalNumber `json:"marginRate"` // The commission structure for this instrument. Commission *InstrumentCommission `json:"commission"` // The current Guaranteed Stop Loss Order mode of the Account for this Instrument. GuaranteedStopLossOrderMode GuaranteedStopLossOrderModeForInstrument `json:"guaranteedStopLossOrderMode"` // The amount that is charged to the account if a guaranteed Stop Loss Order // is triggered and filled. The value is in price units and is charged for // each unit of the Trade. This field will only be present if the Account’s // guaranteedStopLossOrderMode for this Instrument is not ‘DISABLED’. GuaranteedStopLossOrderExecutionPremium DecimalNumber `json:"guaranteedStopLossOrderExecutionPremium"` // The guaranteed Stop Loss Order level restriction for this instrument. // This field will only be present if the Account’s // guaranteedStopLossOrderMode for this Instrument is not ‘DISABLED’. GuaranteedStopLossOrderLevelRestriction *GuaranteedStopLossOrderLevelRestriction `json:"guaranteedStopLossOrderLevelRestriction"` // Financing data for this instrument. Financing *InstrumentFinancing `json:"financing"` // The tags associated with this instrument. Tags []Tag `json:"tags"` }
func (Instrument) MarshalEasyJSON ¶
func (v Instrument) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (Instrument) MarshalJSON ¶
func (v Instrument) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*Instrument) UnmarshalEasyJSON ¶
func (v *Instrument) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Instrument) UnmarshalJSON ¶
func (v *Instrument) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type InstrumentCandlesRequest ¶
type InstrumentCandlesRequest struct { // Name of the Instrument. // [required] Instrument InstrumentName `json:"instrument"` // The Price component(s) to get candlestick data for. // [default=M] Price PricingComponent `json:"price"` // The granularity of the candlesticks to fetch. // [default=S5] Granularity CandlestickGranularity `json:"granularity"` // The number of candlesticks to return in the response. Count should // not be specified if both the start and end parameters are provided, // as the time range combined with the granularity will determine the // number of candlesticks to return. [default=500, maximum=5000] Count int `json:"count"` // The start of the time range to fetch candlesticks for. From DateTime `json:"from"` // The end of the time range to fetch candlesticks for. To DateTime `json:"to"` // A flag that controls whether the candlestick is “smoothed” or not. // A smoothed candlestick uses the previous candle’s close price as its // open price, while an un-smoothed candlestick uses the first price from // its time range as its open price. // [default=False] Smooth bool `json:"smooth"` // A flag that controls whether the candlestick that is covered by the from // time should be included in the results. This flag enables clients to use // the timestamp of the last completed candlestick received to poll for future // candlesticks but avoid receiving the previous candlestick repeatedly. // [default=True] IncludeFirst bool `json:"includeFirst"` // The hour of the day (in the specified timezone) to use for granularities // that have daily alignments. // [default=17, minimum=0, maximum=23] DailyAlignment int `json:"dailyAlignment"` // The timezone to use for the dailyAlignment parameter. Candlesticks with daily // alignment will be aligned to the dailyAlignment hour within the alignmentTimezone. // Note that the returned times will still be represented in UTC. // [default=America/New_York] AlignmentTimezone string `json:"alignmentTimezone"` // The day of the week used for granularities that have weekly alignment. // [default=Friday] WeeklyAlignment WeeklyAlignment `json:"weeklyAlignment"` }
func NewInstrumentCandlesRequest ¶
func NewInstrumentCandlesRequest(instrument InstrumentName, from time.Time) *InstrumentCandlesRequest
func (*InstrumentCandlesRequest) AppendQuery ¶
func (s *InstrumentCandlesRequest) AppendQuery(b *bytebufferpool.ByteBuffer) string
func (InstrumentCandlesRequest) MarshalEasyJSON ¶
func (v InstrumentCandlesRequest) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (InstrumentCandlesRequest) MarshalJSON ¶
func (v InstrumentCandlesRequest) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*InstrumentCandlesRequest) UnmarshalEasyJSON ¶
func (v *InstrumentCandlesRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*InstrumentCandlesRequest) UnmarshalJSON ¶
func (v *InstrumentCandlesRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
func (*InstrumentCandlesRequest) WithAlignmentTimezone ¶
func (s *InstrumentCandlesRequest) WithAlignmentTimezone(timezone string) *InstrumentCandlesRequest
The timezone to use for the dailyAlignment parameter. Candlesticks with daily alignment will be aligned to the dailyAlignment hour within the alignmentTimezone. Note that the returned times will still be represented in UTC. [default=America/New_York]
func (*InstrumentCandlesRequest) WithCount ¶
func (s *InstrumentCandlesRequest) WithCount(count int) *InstrumentCandlesRequest
The number of candlesticks to return in the response. Count should not be specified if both the start and end parameters are provided, as the time range combined with the granularity will determine the number of candlesticks to return. [default=500, maximum=5000]
func (*InstrumentCandlesRequest) WithDailyAlignment ¶
func (s *InstrumentCandlesRequest) WithDailyAlignment(dailyAlignment int) *InstrumentCandlesRequest
The hour of the day (in the specified timezone) to use for granularities that have daily alignments. [default=17, minimum=0, maximum=23]
func (*InstrumentCandlesRequest) WithFrom ¶
func (s *InstrumentCandlesRequest) WithFrom(from time.Time) *InstrumentCandlesRequest
The start of the time range to fetch candlesticks for.
func (*InstrumentCandlesRequest) WithGranularity ¶
func (s *InstrumentCandlesRequest) WithGranularity(granularity CandlestickGranularity) *InstrumentCandlesRequest
The granularity of the candlesticks to fetch. [default=S5]
func (*InstrumentCandlesRequest) WithIncludeFirst ¶
func (s *InstrumentCandlesRequest) WithIncludeFirst(v bool) *InstrumentCandlesRequest
A flag that controls whether the candlestick that is covered by the from time should be included in the results. This flag enables clients to use the timestamp of the last completed candlestick received to poll for future candlesticks but avoid receiving the previous candlestick repeatedly. [default=True]
func (*InstrumentCandlesRequest) WithInstrument ¶
func (s *InstrumentCandlesRequest) WithInstrument(instrument InstrumentName) *InstrumentCandlesRequest
Name of the Instrument. [required]
func (*InstrumentCandlesRequest) WithPrice ¶
func (s *InstrumentCandlesRequest) WithPrice(price PricingComponent) *InstrumentCandlesRequest
The Price component(s) to get candlestick data for. [default=M]
func (*InstrumentCandlesRequest) WithRange ¶
func (s *InstrumentCandlesRequest) WithRange(from, to time.Time) *InstrumentCandlesRequest
The start of the time range to fetch candlesticks for. The end of the time range to fetch candlesticks for.
func (*InstrumentCandlesRequest) WithSmooth ¶
func (s *InstrumentCandlesRequest) WithSmooth(v bool) *InstrumentCandlesRequest
A flag that controls whether the candlestick is “smoothed” or not. A smoothed candlestick uses the previous candle’s close price as its open price, while an un-smoothed candlestick uses the first price from its time range as its open price. [default=False]
func (*InstrumentCandlesRequest) WithTo ¶
func (s *InstrumentCandlesRequest) WithTo(to time.Time) *InstrumentCandlesRequest
The end of the time range to fetch candlesticks for.
func (*InstrumentCandlesRequest) WithWeeklyAlignment ¶
func (s *InstrumentCandlesRequest) WithWeeklyAlignment(alignment WeeklyAlignment) *InstrumentCandlesRequest
The day of the week used for granularities that have weekly alignment. [default=Friday]
type InstrumentCommission ¶
type InstrumentCommission struct { // The commission amount (in the Account’s home currency) charged per // unitsTraded of the instrument Commission DecimalNumber `json:"commission"` // The number of units traded that the commission amount is based on. UnitsTraded DecimalNumber `json:"unitsTraded"` // The minimum commission amount (in the Account’s home currency) that is // charged when an Order is filled for this instrument. MinimumCommission DecimalNumber `json:"minimumCommission"` }
InstrumentCommission represents an instrument-specific commission
func (InstrumentCommission) MarshalEasyJSON ¶
func (v InstrumentCommission) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (InstrumentCommission) MarshalJSON ¶
func (v InstrumentCommission) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*InstrumentCommission) UnmarshalEasyJSON ¶
func (v *InstrumentCommission) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*InstrumentCommission) UnmarshalJSON ¶
func (v *InstrumentCommission) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type InstrumentFinancing ¶
type InstrumentFinancing struct { // The financing rate to be used for a long position for the instrument. The // value is in decimal rather than percentage points, i.e. 5% is represented // as 0.05. LongRate DecimalNumber `json:"longRate"` // The financing rate to be used for a short position for the instrument. // The value is in decimal rather than percentage points, i.e. 5% is // represented as 0.05. ShortRate DecimalNumber `json:"shortRate"` // The days of the week to debit or credit financing charges; the exact time // of day at which to charge the financing is set in the // DivisionTradingGroup for the client’s account. FinancingDaysOfWeek []FinancingDayOfWeek `json:"financingDaysOfWeek"` }
Financing data for the instrument.
func (InstrumentFinancing) MarshalEasyJSON ¶
func (v InstrumentFinancing) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (InstrumentFinancing) MarshalJSON ¶
func (v InstrumentFinancing) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*InstrumentFinancing) UnmarshalEasyJSON ¶
func (v *InstrumentFinancing) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*InstrumentFinancing) UnmarshalJSON ¶
func (v *InstrumentFinancing) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type InstrumentName ¶
type InstrumentName string
A string containing the base currency and quote currency delimited by a “_”.
type LimitOrder ¶
type LimitOrder struct { Order // The type of the Order. Always set to “LIMIT” for Limit Orders. Type OrderType `json:"type"` // The Limit Order’s Instrument. Instrument InstrumentName `json:"instrument"` // The quantity requested to be filled by the Limit Order. A positive number of units // results in a long Order, and a negative number of units results in a short Order. Units DecimalNumber `json:"units"` // The price threshold specified for the Limit Order. The Limit Order will only be // filled by a market price that is equal to or better than this price. Price PriceValue `json:"price"` // The time-in-force requested for the Limit Order. TimeInForce TimeInForce `json:"timeInForce"` // The date/time when the Limit Order will be cancelled if its timeInForce is “GTD”. GtdTime DateTime `json:"gtdTime"` // Specification of how Positions in the Account are modified when the Order is filled. PositionFill OrderPositionFill `json:"positionFill"` // Specification of which price component should be used when determining if an Order // should be triggered and filled. This allows Orders to be triggered based on the bid, // ask, mid, default (ask for buy, bid for sell) or inverse (ask for sell, bid for buy) // price depending on the desired behaviour. Orders are always filled using their default // price component. This feature is only provided through the REST API. Clients who // choose to specify a non-default trigger condition will not see it reflected in any // of OANDA’s proprietary or partner trading platforms, their transaction history // or their account statements. OANDA platforms always assume that an Order’s trigger // condition is set to the default value when indicating the distance from an Order’s // trigger price, and will always provide the default trigger condition when creating // or modifying an Order. A special restriction applies when creating a Guaranteed Stop // Loss Order. In this case the TriggerCondition value must either be “DEFAULT”, // or the “natural” trigger side “DEFAULT” results in. So for a Guaranteed Stop // Loss Order for a long trade valid values are “DEFAULT” and “BID”, and for // short trades “DEFAULT” and “ASK” are valid. TriggerCondition OrderTriggerCondition `json:"triggerCondition"` // TakeProfitDetails specifies the details of a Take Profit Order to be created on // behalf of a client. This may happen when an Order is filled that opens a Trade requiring // a Take Profit, or when a Trade’s dependent Take Profit Order is modified directly // through the Trade. TakeProfitOnFill *TakeProfitDetails `json:"takeProfitOnFill"` // StopLossDetails specifies the details of a Stop Loss Order to be created on behalf // of a client. This may happen when an Order is filled that opens a Trade requiring // a Stop Loss, or when a Trade’s dependent Stop Loss Order is modified directly through // the Trade. StopLossOnFill *StopLossDetails `json:"stopLossOnFill"` // GuaranteedStopLossDetails specifies the details of a Guaranteed Stop Loss Order // to be created on behalf of a client. This may happen when an Order is filled that // opens a Trade requiring a Guaranteed Stop Loss, or when a Trade’s dependent Guaranteed // Stop Loss Order is modified directly through the Trade. GuaranteedStopLossOnFill *GuaranteedStopLossDetails `json:"guaranteedStopLossOnFill"` // TrailingStopLossDetails specifies the details of a Trailing Stop Loss Order to be // created on behalf of a client. This may happen when an Order is filled that opens // a Trade requiring a Trailing Stop Loss, or when a Trade’s dependent Trailing Stop // Loss Order is modified directly through the Trade. TrailingStopLossOnFill *TrailingStopLossDetails `json:"trailingStopLossOnFill"` // Client Extensions to add to the Trade created when the Order is filled (if such // a Trade is created). Do not set, modify, or delete tradeClientExtensions if your // account is associated with MT4. TradeClientExtensions *ClientExtensions `json:"tradeClientExtensions"` // ID of the Transaction that filled this Order (only provided when the Order’s state // is FILLED) FillingTransactionID TransactionID `json:"fillingTransactionID"` // Date/time when the Order was filled (only provided when the Order’s state is FILLED) FilledTime DateTime `json:"filledTime"` // Trade ID of Trade opened when the Order was filled (only provided when the Order’s // state is FILLED and a Trade was opened as a result of the fill) TradeOpenedID TradeID `json:"tradeOpenedID"` // Trade ID of Trade reduced when the Order was filled (only provided when the Order’s // state is FILLED and a Trade was reduced as a result of the fill) TradeReducedID TradeID `json:"tradeReducedID"` // Trade IDs of Trades closed when the Order was filled (only provided when the Order’s // state is FILLED and one or more Trades were closed as a result of the fill) TradeClosedIDs []TradeID `json:"tradeClosedIDs"` // ID of the Transaction that cancelled the Order (only provided when the Order’s // state is CANCELLED) CancellingTransactionID TransactionID `json:"cancellingTransactionID"` // Date/time when the Order was cancelled (only provided when the state of the Order // is CANCELLED) CancelledTime DateTime `json:"cancelledTime"` // The ID of the Order that was replaced by this Order (only provided if this Order // was created as part of a cancel/replace). ReplacesOrderID OrderID `json:"replacesOrderID"` // The ID of the Order that replaced this Order (only provided if this Order was cancelled // as part of a cancel/replace). ReplacedByOrderID OrderID `json:"replacedByOrderID"` }
A LimitOrder is an order that is created with a price threshold, and will only be filled by a price that is equal to or better than the threshold.
func (LimitOrder) MarshalEasyJSON ¶
func (v LimitOrder) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (LimitOrder) MarshalJSON ¶
func (v LimitOrder) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*LimitOrder) UnmarshalEasyJSON ¶
func (v *LimitOrder) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*LimitOrder) UnmarshalJSON ¶
func (v *LimitOrder) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type LimitOrderReason ¶
type LimitOrderReason string
The reason that the Limit Order was initiated
const ( // The Limit Order was initiated at the request of a client LimitOrderReason_CLIENT_ORDER LimitOrderReason = "CLIENT_ORDER" // The Limit Order was initiated as a replacement for an existing Order LimitOrderReason_REPLACEMENT LimitOrderReason = "REPLACEMENT" )
const ( // The Stop Order was initiated at the request of a client StopOrderReason_CLIENT_ORDER LimitOrderReason = "CLIENT_ORDER" // The Stop Order was initiated as a replacement for an existing Order StopOrderReason_REPLACEMENT LimitOrderReason = "REPLACEMENT" )
const ( // The Market-if-touched Order was initiated at the request of a client MarketIfTouchedOrderReason_CLIENT_ORDER LimitOrderReason = "CLIENT_ORDER" // The Market-if-touched Order was initiated as a replacement for an existing Order MarketIfTouchedOrderReason_REPLACEMENT LimitOrderReason = "REPLACEMENT" )
const ( // The Take Profit Order was initiated at the request of a client TakeProfitOrderReason_CLIENT_ORDER LimitOrderReason = "CLIENT_ORDER" // The Take Profit Order was initiated as a replacement for an existing Order TakeProfitOrderReason_REPLACEMENT LimitOrderReason = "REPLACEMENT" // The Take Profit Order was initiated automatically when an Order was filled that opened a new // Trade requiring a Take Profit Order. TakeProfitOrderReason_ON_FILL LimitOrderReason = "ON_FILL" )
const ( // The Stop Loss Order was initiated at the request of a client StopLossOrderReason_CLIENT_ORDER LimitOrderReason = "CLIENT_ORDER" // The Stop Loss Order was initiated as a replacement for an existing Order StopLossOrderReason_REPLACEMENT LimitOrderReason = "REPLACEMENT" // The Stop Loss Order was initiated automatically when an Order was filled that opened a new // Trade requiring a Stop Loss Order. StopLossOrderReason_ON_FILL LimitOrderReason = "ON_FILL" )
const ( // The Guaranteed Stop Loss Order was initiated at the request of a client GuaranteedStopLossOrderReason_CLIENT_ORDER LimitOrderReason = "CLIENT_ORDER" // The Guaranteed Stop Loss Order was initiated as a replacement for an existing Order GuaranteedStopLossOrderReason_REPLACEMENT LimitOrderReason = "REPLACEMENT" // The Guaranteed Stop Loss Order was initiated automatically when an Order was filled that opened a new // Trade requiring a Guaranteed Stop Loss Order. GuaranteedStopLossOrderReason_ON_FILL LimitOrderReason = "ON_FILL" )
const ( // The Trailing Stop Loss Order was initiated at the request of a client TrailingStopLossOrderReason_CLIENT_ORDER LimitOrderReason = "CLIENT_ORDER" // The Trailing Stop Loss Order was initiated as a replacement for an existing Order TrailingStopLossOrderReason_REPLACEMENT LimitOrderReason = "REPLACEMENT" // The Trailing Stop Loss Order was initiated automatically when an Order was filled that opened a new // Trade requiring a Trailing Stop Loss Order. TrailingStopLossOrderReason_ON_FILL LimitOrderReason = "ON_FILL" )
type LimitOrderRejectTransaction ¶
type LimitOrderRejectTransaction struct { Transaction // The Type of the Transaction. Always set to “LIMIT_ORDER_REJECT” in a LimitOrderRejectTransaction. Type TransactionType `json:"type"` // The Limit Order’s Instrument. Instrument InstrumentName `json:"instrument"` // The quantity requested to be filled by the Limit Order. A positive number of units // results in a long Order, and a negative number of units results in a short Order. Units DecimalNumber `json:"units"` // The price threshold specified for the Limit Order. The Limit Order will only be // filled by a market price that is equal to or better than this price. Price PriceValue `json:"price"` // The time-in-force requested for the Limit Order. TimeInForce TimeInForce `json:"timeInForce"` // The date/time when the Limit Order will be cancelled if its timeInForce is “GTD”. GtdTime DateTime `json:"gtdTime"` // Specification of how Positions in the Account are modified when the Order is filled. PositionFill OrderPositionFill `json:"positionFill"` // Specification of which price component should be used when determining if an Order // should be triggered and filled. This allows Orders to be triggered based on the bid, // ask, mid, default (ask for buy, bid for sell) or inverse (ask for sell, bid for buy) // price depending on the desired behaviour. Orders are always filled using their default // price component. This feature is only provided through the REST API. Clients who // choose to specify a non-default trigger condition will not see it reflected in any // of OANDA’s proprietary or partner trading platforms, their transaction history // or their account statements. OANDA platforms always assume that an Order’s trigger // condition is set to the default value when indicating the distance from an Order’s // trigger price, and will always provide the default trigger condition when creating // or modifying an Order. A special restriction applies when creating a Guaranteed Stop // Loss Order. In this case the TriggerCondition value must either be “DEFAULT”, // or the “natural” trigger side “DEFAULT” results in. So for a Guaranteed Stop // Loss Order for a long trade valid values are “DEFAULT” and “BID”, and for // short trades “DEFAULT” and “ASK” are valid. TriggerCondition OrderTriggerCondition `json:"triggerCondition"` // The reason that the Limit Order was initiated Reason LimitOrderReason `json:"reason"` // Client Extensions to add to the Order (only provided if the Order is being created // with client extensions). ClientExtensions *ClientExtensions `json:"clientExtensions"` // The specification of the Take Profit Order that should be created for a Trade opened // when the Order is filled (if such a Trade is created). TakeProfitOnFill *TakeProfitDetails `json:"takeProfitOnFill"` // The specification of the Stop Loss Order that should be created for a Trade opened // when the Order is filled (if such a Trade is created). StopLossOnFill *StopLossDetails `json:"stopLossOnFill"` // The specification of the Trailing Stop Loss Order that should be created for a Trade // that is opened when the Order is filled (if such a Trade is created). TrailingStopLossOnFill *TrailingStopLossDetails `json:"trailingStopLossOnFill"` // The specification of the Guaranteed Stop Loss Order that should be created for a // Trade that is opened when the Order is filled (if such a Trade is created). GuaranteedStopLossOnFill *GuaranteedStopLossDetails `json:"guaranteedStopLossOnFill"` // Client Extensions to add to the Trade created when the Order is filled (if such // a Trade is created). Do not set, modify, delete tradeClientExtensions if your account // is associated with MT4. TradeClientExtensions *ClientExtensions `json:"tradeClientExtensions"` // The ID of the Order that this Order was intended to replace (only provided if this // Order was intended to replace an existing Order). IntendedReplacesOrderID OrderID `json:"intendedReplacesOrderID"` // The reason that the Reject Transaction was created RejectReason TransactionRejectReason `json:"rejectReason"` }
A LimitOrderRejectTransaction represents the rejection of the creation of a Limit Order.
func (LimitOrderRejectTransaction) MarshalEasyJSON ¶
func (v LimitOrderRejectTransaction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (LimitOrderRejectTransaction) MarshalJSON ¶
func (v LimitOrderRejectTransaction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*LimitOrderRejectTransaction) UnmarshalEasyJSON ¶
func (v *LimitOrderRejectTransaction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*LimitOrderRejectTransaction) UnmarshalJSON ¶
func (v *LimitOrderRejectTransaction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type LimitOrderRequest ¶
type LimitOrderRequest struct { BaseOrderRequest // The type of the Order to Create. Must be set to “LIMIT” when creating a Market // Order. Type OrderType `json:"type"` // The Limit Order’s Instrument. Instrument InstrumentName `json:"instrument"` // The quantity requested to be filled by the Limit Order. A positive number of units // results in a long Order, and a negative number of units results in a short Order. Units DecimalNumber `json:"units"` // The price threshold specified for the Limit Order. The Limit Order will only be // filled by a market price that is equal to or better than this price. Price PriceValue `json:"price"` // The time-in-force requested for the Limit Order. TimeInForce TimeInForce `json:"timeInForce"` // The date/time when the Limit Order will be cancelled if its timeInForce is “GTD”. GtdTime DateTime `json:"gtdTime"` // Specification of how Positions in the Account are modified when the Order is filled. PositionFill OrderPositionFill `json:"positionFill"` // Specification of which price component should be used when determining if an Order // should be triggered and filled. This allows Orders to be triggered based on the bid, // ask, mid, default (ask for buy, bid for sell) or inverse (ask for sell, bid for buy) // price depending on the desired behaviour. Orders are always filled using their default // price component. This feature is only provided through the REST API. Clients who // choose to specify a non-default trigger condition will not see it reflected in any // of OANDA’s proprietary or partner trading platforms, their transaction history // or their account statements. OANDA platforms always assume that an Order’s trigger // condition is set to the default value when indicating the distance from an Order’s // trigger price, and will always provide the default trigger condition when creating // or modifying an Order. A special restriction applies when creating a Guaranteed Stop // Loss Order. In this case the TriggerCondition value must either be “DEFAULT”, // or the “natural” trigger side “DEFAULT” results in. So for a Guaranteed Stop // Loss Order for a long trade valid values are “DEFAULT” and “BID”, and for // short trades “DEFAULT” and “ASK” are valid. TriggerCondition OrderTriggerCondition `json:"triggerCondition"` // The client extensions to add to the Order. Do not set, modify, or delete clientExtensions // if your account is associated with MT4. ClientExtensions *ClientExtensions `json:"clientExtensions"` // TakeProfitDetails specifies the details of a Take Profit Order to be created on // behalf of a client. This may happen when an Order is filled that opens a Trade requiring // a Take Profit, or when a Trade’s dependent Take Profit Order is modified directly // through the Trade. TakeProfitOnFill *TakeProfitDetails `json:"takeProfitOnFill"` // StopLossDetails specifies the details of a Stop Loss Order to be created on behalf // of a client. This may happen when an Order is filled that opens a Trade requiring // a Stop Loss, or when a Trade’s dependent Stop Loss Order is modified directly through // the Trade. StopLossOnFill *StopLossDetails `json:"stopLossOnFill"` // GuaranteedStopLossDetails specifies the details of a Guaranteed Stop Loss Order // to be created on behalf of a client. This may happen when an Order is filled that // opens a Trade requiring a Guaranteed Stop Loss, or when a Trade’s dependent Guaranteed // Stop Loss Order is modified directly through the Trade. GuaranteedStopLossOnFill *GuaranteedStopLossDetails `json:"guaranteedStopLossOnFill"` // TrailingStopLossDetails specifies the details of a Trailing Stop Loss Order to be // created on behalf of a client. This may happen when an Order is filled that opens // a Trade requiring a Trailing Stop Loss, or when a Trade’s dependent Trailing Stop // Loss Order is modified directly through the Trade. TrailingStopLossOnFill *TrailingStopLossDetails `json:"trailingStopLossOnFill"` // Client Extensions to add to the Trade created when the Order is filled (if such // a Trade is created). Do not set, modify, or delete tradeClientExtensions if your // account is associated with MT4. TradeClientExtensions *ClientExtensions `json:"tradeClientExtensions"` }
A LimitOrderRequest specifies the parameters that may be set when creating a Limit Order.
func (LimitOrderRequest) MarshalEasyJSON ¶
func (v LimitOrderRequest) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (LimitOrderRequest) MarshalJSON ¶
func (v LimitOrderRequest) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*LimitOrderRequest) UnmarshalEasyJSON ¶
func (v *LimitOrderRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*LimitOrderRequest) UnmarshalJSON ¶
func (v *LimitOrderRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type LimitOrderTransaction ¶
type LimitOrderTransaction struct { Transaction // The Type of the Transaction. Always set to “LIMIT_ORDER” in a LimitOrderTransaction. Type TransactionType `json:"type"` // The Limit Order’s Instrument. Instrument InstrumentName `json:"instrument"` // The quantity requested to be filled by the Limit Order. A positive number of units // results in a long Order, and a negative number of units results in a short Order. Units DecimalNumber `json:"units"` // The price threshold specified for the Limit Order. The Limit Order will only be // filled by a market price that is equal to or better than this price. Price PriceValue `json:"price"` // The time-in-force requested for the Limit Order. TimeInForce TimeInForce `json:"timeInForce"` // The date/time when the Limit Order will be cancelled if its timeInForce is “GTD”. GtdTime DateTime `json:"gtdTime"` // Specification of how Positions in the Account are modified when the Order is filled. PositionFill OrderPositionFill `json:"positionFill"` // Specification of which price component should be used when determining if an Order // should be triggered and filled. This allows Orders to be triggered based on the bid, // ask, mid, default (ask for buy, bid for sell) or inverse (ask for sell, bid for buy) // price depending on the desired behaviour. Orders are always filled using their default // price component. This feature is only provided through the REST API. Clients who // choose to specify a non-default trigger condition will not see it reflected in any // of OANDA’s proprietary or partner trading platforms, their transaction history // or their account statements. OANDA platforms always assume that an Order’s trigger // condition is set to the default value when indicating the distance from an Order’s // trigger price, and will always provide the default trigger condition when creating // or modifying an Order. A special restriction applies when creating a Guaranteed Stop // Loss Order. In this case the TriggerCondition value must either be “DEFAULT”, // or the “natural” trigger side “DEFAULT” results in. So for a Guaranteed Stop // Loss Order for a long trade valid values are “DEFAULT” and “BID”, and for // short trades “DEFAULT” and “ASK” are valid. TriggerCondition OrderTriggerCondition `json:"triggerCondition"` // The reason that the Limit Order was initiated Reason LimitOrderReason `json:"reason"` // Client Extensions to add to the Order (only provided if the Order is being created // with client extensions). ClientExtensions *ClientExtensions `json:"clientExtensions"` // The specification of the Take Profit Order that should be created for a Trade opened // when the Order is filled (if such a Trade is created). TakeProfitOnFill *TakeProfitDetails `json:"takeProfitOnFill"` // The specification of the Stop Loss Order that should be created for a Trade opened // when the Order is filled (if such a Trade is created). StopLossOnFill *StopLossDetails `json:"stopLossOnFill"` // The specification of the Trailing Stop Loss Order that should be created for a Trade // that is opened when the Order is filled (if such a Trade is created). TrailingStopLossOnFill *TrailingStopLossDetails `json:"trailingStopLossOnFill"` // The specification of the Guaranteed Stop Loss Order that should be created for a // Trade that is opened when the Order is filled (if such a Trade is created). GuaranteedStopLossOnFill *GuaranteedStopLossDetails `json:"guaranteedStopLossOnFill"` // Client Extensions to add to the Trade created when the Order is filled (if such // a Trade is created). Do not set, modify, delete tradeClientExtensions if your account // is associated with MT4. TradeClientExtensions *ClientExtensions `json:"tradeClientExtensions"` // The ID of the Order that this Order replaces (only provided if this Order replaces // an existing Order). ReplacesOrderID OrderID `json:"replacesOrderID"` // The ID of the Transaction that cancels the replaced Order (only provided if this // Order replaces an existing Order). CancellingTransactionID TransactionID `json:"cancellingTransactionID"` }
A LimitOrderTransaction represents the creation of a Limit Order in the user’s Account.
func (LimitOrderTransaction) MarshalEasyJSON ¶
func (v LimitOrderTransaction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (LimitOrderTransaction) MarshalJSON ¶
func (v LimitOrderTransaction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*LimitOrderTransaction) UnmarshalEasyJSON ¶
func (v *LimitOrderTransaction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*LimitOrderTransaction) UnmarshalJSON ¶
func (v *LimitOrderTransaction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type LiquidityRegenerationSchedule ¶
type LiquidityRegenerationSchedule struct {
Steps []*LiquidityRegenerationScheduleStep `json:"steps"`
}
A LiquidityRegenerationSchedule indicates how liquidity that is used when filling an Order for an instrument is regenerated following the fill. A liquidity regeneration schedule will be in effect until the timestamp of its final step, but may be replaced by a schedule created for an Order of the same instrument that is filled while it is still in effect.
func (LiquidityRegenerationSchedule) MarshalEasyJSON ¶
func (v LiquidityRegenerationSchedule) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (LiquidityRegenerationSchedule) MarshalJSON ¶
func (v LiquidityRegenerationSchedule) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*LiquidityRegenerationSchedule) UnmarshalEasyJSON ¶
func (v *LiquidityRegenerationSchedule) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*LiquidityRegenerationSchedule) UnmarshalJSON ¶
func (v *LiquidityRegenerationSchedule) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type LiquidityRegenerationScheduleStep ¶
type LiquidityRegenerationScheduleStep struct { // The timestamp of the schedule step. Timestamp DateTime `json:"timestamp"` // The amount of bid liquidity used at this step in the schedule. BidLiquidityUsed DecimalNumber `json:"bidLiquidityUsed"` // The amount of ask liquidity used at this step in the schedule. AskLiquidityUsed DecimalNumber `json:"askLiquidityUsed"` }
A liquidity regeneration schedule Step indicates the amount of bid and ask liquidity that is used by the Account at a certain time. These amounts will only change at the timestamp of the following step.
func (LiquidityRegenerationScheduleStep) MarshalEasyJSON ¶
func (v LiquidityRegenerationScheduleStep) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (LiquidityRegenerationScheduleStep) MarshalJSON ¶
func (v LiquidityRegenerationScheduleStep) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*LiquidityRegenerationScheduleStep) UnmarshalEasyJSON ¶
func (v *LiquidityRegenerationScheduleStep) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*LiquidityRegenerationScheduleStep) UnmarshalJSON ¶
func (v *LiquidityRegenerationScheduleStep) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type MarginCallEnterTransaction ¶
type MarginCallEnterTransaction struct { Transaction // The Type of the Transaction. Always set to “MARGIN_CALL_ENTER” for an MarginCallEnterTransaction. Type TransactionType `json:"type"` }
A MarginCallEnterTransaction is created when an Account enters the margin call state.
func (MarginCallEnterTransaction) MarshalEasyJSON ¶
func (v MarginCallEnterTransaction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (MarginCallEnterTransaction) MarshalJSON ¶
func (v MarginCallEnterTransaction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*MarginCallEnterTransaction) UnmarshalEasyJSON ¶
func (v *MarginCallEnterTransaction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*MarginCallEnterTransaction) UnmarshalJSON ¶
func (v *MarginCallEnterTransaction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type MarginCallExitTransaction ¶
type MarginCallExitTransaction struct { Transaction // The Type of the Transaction. Always set to “MARGIN_CALL_EXIT” for an MarginCallExitTransaction. Type TransactionType `json:"type"` }
A MarginCallExitTransaction is created when an Account leaves the margin call state.
func (MarginCallExitTransaction) MarshalEasyJSON ¶
func (v MarginCallExitTransaction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (MarginCallExitTransaction) MarshalJSON ¶
func (v MarginCallExitTransaction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*MarginCallExitTransaction) UnmarshalEasyJSON ¶
func (v *MarginCallExitTransaction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*MarginCallExitTransaction) UnmarshalJSON ¶
func (v *MarginCallExitTransaction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type MarginCallExtendTransaction ¶
type MarginCallExtendTransaction struct { Transaction // The Type of the Transaction. Always set to “MARGIN_CALL_EXTEND” for an MarginCallExtendTransaction. Type TransactionType `json:"type"` // The number of the extensions to the Account’s current margin call that have been // applied. This value will be set to 1 for the first MarginCallExtend Transaction ExtensionNumber int64 `json:"extensionNumber"` }
A MarginCallExtendTransaction is created when the margin call state for an Account has been extended.
func (MarginCallExtendTransaction) MarshalEasyJSON ¶
func (v MarginCallExtendTransaction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (MarginCallExtendTransaction) MarshalJSON ¶
func (v MarginCallExtendTransaction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*MarginCallExtendTransaction) UnmarshalEasyJSON ¶
func (v *MarginCallExtendTransaction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*MarginCallExtendTransaction) UnmarshalJSON ¶
func (v *MarginCallExtendTransaction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type MarketIfTouchedOrder ¶
type MarketIfTouchedOrder struct { Order // The type of the Order. Always set to “MARKET_IF_TOUCHED” for Market If Touched // Orders. Type OrderType `json:"type"` // The MarketIfTouched Order’s Instrument. Instrument InstrumentName `json:"instrument"` // The quantity requested to be filled by the MarketIfTouched Order. A positive number // of units results in a long Order, and a negative number of units results in a short // Order. Units DecimalNumber `json:"units"` // The price threshold specified for the MarketIfTouched Order. The MarketIfTouched // Order will only be filled by a market price that crosses this price from the direction // of the market price at the time when the Order was created (the initialMarketPrice). // Depending on the value of the Order’s price and initialMarketPrice, the MarketIfTouchedOrder // will behave like a Limit or a Stop Order. Price PriceValue `json:"price"` // The worst market price that may be used to fill this MarketIfTouched Order. PriceBound PriceValue `json:"priceBound"` // The time-in-force requested for the MarketIfTouched Order. Restricted to “GTC”, // “GFD” and “GTD” for MarketIfTouched Orders. TimeInForce TimeInForce `json:"timeInForce"` // The date/time when the MarketIfTouched Order will be cancelled if its timeInForce // is “GTD”. GtdTime DateTime `json:"gtdTime"` // Specification of how Positions in the Account are modified when the Order is filled. PositionFill OrderPositionFill `json:"positionFill"` // Specification of which price component should be used when determining if an Order // should be triggered and filled. This allows Orders to be triggered based on the bid, // ask, mid, default (ask for buy, bid for sell) or inverse (ask for sell, bid for buy) // price depending on the desired behaviour. Orders are always filled using their default // price component. This feature is only provided through the REST API. Clients who // choose to specify a non-default trigger condition will not see it reflected in any // of OANDA’s proprietary or partner trading platforms, their transaction history // or their account statements. OANDA platforms always assume that an Order’s trigger // condition is set to the default value when indicating the distance from an Order’s // trigger price, and will always provide the default trigger condition when creating // or modifying an Order. A special restriction applies when creating a Guaranteed Stop // Loss Order. In this case the TriggerCondition value must either be “DEFAULT”, // or the “natural” trigger side “DEFAULT” results in. So for a Guaranteed Stop // Loss Order for a long trade valid values are “DEFAULT” and “BID”, and for // short trades “DEFAULT” and “ASK” are valid. TriggerCondition OrderTriggerCondition `json:"triggerCondition"` // The Market price at the time when the MarketIfTouched Order was created. InitialMarketPrice PriceValue `json:"initialMarketPrice"` // TakeProfitDetails specifies the details of a Take Profit Order to be created on // behalf of a client. This may happen when an Order is filled that opens a Trade requiring // a Take Profit, or when a Trade’s dependent Take Profit Order is modified directly // through the Trade. TakeProfitOnFill *TakeProfitDetails `json:"takeProfitOnFill"` // StopLossDetails specifies the details of a Stop Loss Order to be created on behalf // of a client. This may happen when an Order is filled that opens a Trade requiring // a Stop Loss, or when a Trade’s dependent Stop Loss Order is modified directly through // the Trade. StopLossOnFill *StopLossDetails `json:"stopLossOnFill"` // GuaranteedStopLossDetails specifies the details of a Guaranteed Stop Loss Order // to be created on behalf of a client. This may happen when an Order is filled that // opens a Trade requiring a Guaranteed Stop Loss, or when a Trade’s dependent Guaranteed // Stop Loss Order is modified directly through the Trade. GuaranteedStopLossOnFill *GuaranteedStopLossDetails `json:"guaranteedStopLossOnFill"` // TrailingStopLossDetails specifies the details of a Trailing Stop Loss Order to be // created on behalf of a client. This may happen when an Order is filled that opens // a Trade requiring a Trailing Stop Loss, or when a Trade’s dependent Trailing Stop // Loss Order is modified directly through the Trade. TrailingStopLossOnFill *TrailingStopLossDetails `json:"trailingStopLossOnFill"` // Client Extensions to add to the Trade created when the Order is filled (if such // a Trade is created). Do not set, modify, or delete tradeClientExtensions if your // account is associated with MT4. TradeClientExtensions *ClientExtensions `json:"tradeClientExtensions"` // ID of the Transaction that filled this Order (only provided when the Order’s state // is FILLED) FillingTransactionID TransactionID `json:"fillingTransactionID"` // Date/time when the Order was filled (only provided when the Order’s state is FILLED) FilledTime DateTime `json:"filledTime"` // Trade ID of Trade opened when the Order was filled (only provided when the Order’s // state is FILLED and a Trade was opened as a result of the fill) TradeOpenedID TradeID `json:"tradeOpenedID"` // Trade ID of Trade reduced when the Order was filled (only provided when the Order’s // state is FILLED and a Trade was reduced as a result of the fill) TradeReducedID TradeID `json:"tradeReducedID"` // Trade IDs of Trades closed when the Order was filled (only provided when the Order’s // state is FILLED and one or more Trades were closed as a result of the fill) TradeClosedIDs []TradeID `json:"tradeClosedIDs"` // ID of the Transaction that cancelled the Order (only provided when the Order’s // state is CANCELLED) CancellingTransactionID TransactionID `json:"cancellingTransactionID"` // Date/time when the Order was cancelled (only provided when the state of the Order // is CANCELLED) CancelledTime DateTime `json:"cancelledTime"` // The ID of the Order that was replaced by this Order (only provided if this Order // was created as part of a cancel/replace). ReplacesOrderID OrderID `json:"replacesOrderID"` // The ID of the Order that replaced this Order (only provided if this Order was cancelled // as part of a cancel/replace). ReplacedByOrderID OrderID `json:"replacedByOrderID"` }
A MarketIfTouchedOrder is an order that is created with a price threshold, and will only be filled by a market price that is touches or crosses the threshold.
func (MarketIfTouchedOrder) MarshalEasyJSON ¶
func (v MarketIfTouchedOrder) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (MarketIfTouchedOrder) MarshalJSON ¶
func (v MarketIfTouchedOrder) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*MarketIfTouchedOrder) UnmarshalEasyJSON ¶
func (v *MarketIfTouchedOrder) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*MarketIfTouchedOrder) UnmarshalJSON ¶
func (v *MarketIfTouchedOrder) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type MarketIfTouchedOrderReason ¶
type MarketIfTouchedOrderReason string
The reason that the Market-if-touched Order was initiated
type MarketIfTouchedOrderRejectTransaction ¶
type MarketIfTouchedOrderRejectTransaction struct { Transaction // The Type of the Transaction. Always set to “MARKET_IF_TOUCHED_ORDER_REJECT” // in a MarketIfTouchedOrderRejectTransaction. Type TransactionType `json:"type"` // The MarketIfTouched Order’s Instrument. Instrument InstrumentName `json:"instrument"` // The quantity requested to be filled by the MarketIfTouched Order. A positive number // of units results in a long Order, and a negative number of units results in a short // Order. Units DecimalNumber `json:"units"` // The price threshold specified for the MarketIfTouched Order. The MarketIfTouched // Order will only be filled by a market price that crosses this price from the direction // of the market price at the time when the Order was created (the initialMarketPrice). // Depending on the value of the Order’s price and initialMarketPrice, the MarketIfTouchedOrder // will behave like a Limit or a Stop Order. Price PriceValue `json:"price"` // The worst market price that may be used to fill this MarketIfTouched Order. PriceBound PriceValue `json:"priceBound"` // The time-in-force requested for the MarketIfTouched Order. Restricted to “GTC”, // “GFD” and “GTD” for MarketIfTouched Orders. TimeInForce TimeInForce `json:"timeInForce"` // The date/time when the MarketIfTouched Order will be cancelled if its timeInForce // is “GTD”. GtdTime DateTime `json:"gtdTime"` // Specification of how Positions in the Account are modified when the Order is filled. PositionFill OrderPositionFill `json:"positionFill"` // Specification of which price component should be used when determining if an Order // should be triggered and filled. This allows Orders to be triggered based on the bid, // ask, mid, default (ask for buy, bid for sell) or inverse (ask for sell, bid for buy) // price depending on the desired behaviour. Orders are always filled using their default // price component. This feature is only provided through the REST API. Clients who // choose to specify a non-default trigger condition will not see it reflected in any // of OANDA’s proprietary or partner trading platforms, their transaction history // or their account statements. OANDA platforms always assume that an Order’s trigger // condition is set to the default value when indicating the distance from an Order’s // trigger price, and will always provide the default trigger condition when creating // or modifying an Order. A special restriction applies when creating a Guaranteed Stop // Loss Order. In this case the TriggerCondition value must either be “DEFAULT”, // or the “natural” trigger side “DEFAULT” results in. So for a Guaranteed Stop // Loss Order for a long trade valid values are “DEFAULT” and “BID”, and for // short trades “DEFAULT” and “ASK” are valid. TriggerCondition OrderTriggerCondition `json:"triggerCondition"` // The reason that the Market-if-touched Order was initiated Reason MarketIfTouchedOrderReason `json:"reason"` // Client Extensions to add to the Order (only provided if the Order is being created // with client extensions). ClientExtensions *ClientExtensions `json:"clientExtensions"` // The specification of the Take Profit Order that should be created for a Trade opened // when the Order is filled (if such a Trade is created). TakeProfitOnFill *TakeProfitDetails `json:"takeProfitOnFill"` // The specification of the Stop Loss Order that should be created for a Trade opened // when the Order is filled (if such a Trade is created). StopLossOnFill *StopLossDetails `json:"stopLossOnFill"` // The specification of the Trailing Stop Loss Order that should be created for a Trade // that is opened when the Order is filled (if such a Trade is created). TrailingStopLossOnFill *TrailingStopLossDetails `json:"trailingStopLossOnFill"` // The specification of the Guaranteed Stop Loss Order that should be created for a // Trade that is opened when the Order is filled (if such a Trade is created). GuaranteedStopLossOnFill *GuaranteedStopLossDetails `json:"guaranteedStopLossOnFill"` // Client Extensions to add to the Trade created when the Order is filled (if such // a Trade is created). Do not set, modify, delete tradeClientExtensions if your account // is associated with MT4. TradeClientExtensions *ClientExtensions `json:"tradeClientExtensions"` // The ID of the Order that this Order was intended to replace (only provided if this // Order was intended to replace an existing Order). IntendedReplacesOrderID OrderID `json:"intendedReplacesOrderID"` // The reason that the Reject Transaction was created RejectReason TransactionRejectReason `json:"rejectReason"` }
A MarketIfTouchedOrderRejectTransaction represents the rejection of the creation of a MarketIfTouched Order.
func (MarketIfTouchedOrderRejectTransaction) MarshalEasyJSON ¶
func (v MarketIfTouchedOrderRejectTransaction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (MarketIfTouchedOrderRejectTransaction) MarshalJSON ¶
func (v MarketIfTouchedOrderRejectTransaction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*MarketIfTouchedOrderRejectTransaction) UnmarshalEasyJSON ¶
func (v *MarketIfTouchedOrderRejectTransaction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*MarketIfTouchedOrderRejectTransaction) UnmarshalJSON ¶
func (v *MarketIfTouchedOrderRejectTransaction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type MarketIfTouchedOrderRequest ¶
type MarketIfTouchedOrderRequest struct { BaseOrderRequest // The type of the Order to Create. Must be set to “MARKET_IF_TOUCHED” when creating // a Market If Touched Order. Type OrderType `json:"type"` // The MarketIfTouched Order’s Instrument. Instrument InstrumentName `json:"instrument"` // The quantity requested to be filled by the MarketIfTouched Order. A positive number // of units results in a long Order, and a negative number of units results in a short // Order. Units DecimalNumber `json:"units"` // The price threshold specified for the MarketIfTouched Order. The MarketIfTouched // Order will only be filled by a market price that crosses this price from the direction // of the market price at the time when the Order was created (the initialMarketPrice). // Depending on the value of the Order’s price and initialMarketPrice, the MarketIfTouchedOrder // will behave like a Limit or a Stop Order. Price PriceValue `json:"price"` // The worst market price that may be used to fill this MarketIfTouched Order. PriceBound PriceValue `json:"priceBound"` // The time-in-force requested for the MarketIfTouched Order. Restricted to “GTC”, // “GFD” and “GTD” for MarketIfTouched Orders. TimeInForce TimeInForce `json:"timeInForce"` // The date/time when the MarketIfTouched Order will be cancelled if its timeInForce // is “GTD”. GtdTime DateTime `json:"gtdTime"` // Specification of how Positions in the Account are modified when the Order is filled. PositionFill OrderPositionFill `json:"positionFill"` // Specification of which price component should be used when determining if an Order // should be triggered and filled. This allows Orders to be triggered based on the bid, // ask, mid, default (ask for buy, bid for sell) or inverse (ask for sell, bid for buy) // price depending on the desired behaviour. Orders are always filled using their default // price component. This feature is only provided through the REST API. Clients who // choose to specify a non-default trigger condition will not see it reflected in any // of OANDA’s proprietary or partner trading platforms, their transaction history // or their account statements. OANDA platforms always assume that an Order’s trigger // condition is set to the default value when indicating the distance from an Order’s // trigger price, and will always provide the default trigger condition when creating // or modifying an Order. A special restriction applies when creating a Guaranteed Stop // Loss Order. In this case the TriggerCondition value must either be “DEFAULT”, // or the “natural” trigger side “DEFAULT” results in. So for a Guaranteed Stop // Loss Order for a long trade valid values are “DEFAULT” and “BID”, and for // short trades “DEFAULT” and “ASK” are valid. TriggerCondition OrderTriggerCondition `json:"triggerCondition"` // The client extensions to add to the Order. Do not set, modify, or delete clientExtensions // if your account is associated with MT4. ClientExtensions *ClientExtensions `json:"clientExtensions"` // TakeProfitDetails specifies the details of a Take Profit Order to be created on // behalf of a client. This may happen when an Order is filled that opens a Trade requiring // a Take Profit, or when a Trade’s dependent Take Profit Order is modified directly // through the Trade. TakeProfitOnFill *TakeProfitDetails `json:"takeProfitOnFill"` // StopLossDetails specifies the details of a Stop Loss Order to be created on behalf // of a client. This may happen when an Order is filled that opens a Trade requiring // a Stop Loss, or when a Trade’s dependent Stop Loss Order is modified directly through // the Trade. StopLossOnFill *StopLossDetails `json:"stopLossOnFill"` // GuaranteedStopLossDetails specifies the details of a Guaranteed Stop Loss Order // to be created on behalf of a client. This may happen when an Order is filled that // opens a Trade requiring a Guaranteed Stop Loss, or when a Trade’s dependent Guaranteed // Stop Loss Order is modified directly through the Trade. GuaranteedStopLossOnFill *GuaranteedStopLossDetails `json:"guaranteedStopLossOnFill"` // TrailingStopLossDetails specifies the details of a Trailing Stop Loss Order to be // created on behalf of a client. This may happen when an Order is filled that opens // a Trade requiring a Trailing Stop Loss, or when a Trade’s dependent Trailing Stop // Loss Order is modified directly through the Trade. TrailingStopLossOnFill *TrailingStopLossDetails `json:"trailingStopLossOnFill"` // Client Extensions to add to the Trade created when the Order is filled (if such // a Trade is created). Do not set, modify, or delete tradeClientExtensions if your // account is associated with MT4. TradeClientExtensions *ClientExtensions `json:"tradeClientExtensions"` }
A MarketIfTouchedOrderRequest specifies the parameters that may be set when creating a Market-if-Touched Order.
func (MarketIfTouchedOrderRequest) MarshalEasyJSON ¶
func (v MarketIfTouchedOrderRequest) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (MarketIfTouchedOrderRequest) MarshalJSON ¶
func (v MarketIfTouchedOrderRequest) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*MarketIfTouchedOrderRequest) UnmarshalEasyJSON ¶
func (v *MarketIfTouchedOrderRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*MarketIfTouchedOrderRequest) UnmarshalJSON ¶
func (v *MarketIfTouchedOrderRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type MarketIfTouchedOrderTransaction ¶
type MarketIfTouchedOrderTransaction struct { Transaction // The Type of the Transaction. Always set to “MARKET_IF_TOUCHED_ORDER” in a MarketIfTouchedOrderTransaction. Type TransactionType `json:"type"` // The MarketIfTouched Order’s Instrument. Instrument InstrumentName `json:"instrument"` // The quantity requested to be filled by the MarketIfTouched Order. A positive number // of units results in a long Order, and a negative number of units results in a short // Order. Units DecimalNumber `json:"units"` // The price threshold specified for the MarketIfTouched Order. The MarketIfTouched // Order will only be filled by a market price that crosses this price from the direction // of the market price at the time when the Order was created (the initialMarketPrice). // Depending on the value of the Order’s price and initialMarketPrice, the MarketIfTouchedOrder // will behave like a Limit or a Stop Order. Price PriceValue `json:"price"` // The worst market price that may be used to fill this MarketIfTouched Order. PriceBound PriceValue `json:"priceBound"` // The time-in-force requested for the MarketIfTouched Order. Restricted to “GTC”, // “GFD” and “GTD” for MarketIfTouched Orders. TimeInForce TimeInForce `json:"timeInForce"` // The date/time when the MarketIfTouched Order will be cancelled if its timeInForce // is “GTD”. GtdTime DateTime `json:"gtdTime"` // Specification of how Positions in the Account are modified when the Order is filled. PositionFill OrderPositionFill `json:"positionFill"` // Specification of which price component should be used when determining if an Order // should be triggered and filled. This allows Orders to be triggered based on the bid, // ask, mid, default (ask for buy, bid for sell) or inverse (ask for sell, bid for buy) // price depending on the desired behaviour. Orders are always filled using their default // price component. This feature is only provided through the REST API. Clients who // choose to specify a non-default trigger condition will not see it reflected in any // of OANDA’s proprietary or partner trading platforms, their transaction history // or their account statements. OANDA platforms always assume that an Order’s trigger // condition is set to the default value when indicating the distance from an Order’s // trigger price, and will always provide the default trigger condition when creating // or modifying an Order. A special restriction applies when creating a Guaranteed Stop // Loss Order. In this case the TriggerCondition value must either be “DEFAULT”, // or the “natural” trigger side “DEFAULT” results in. So for a Guaranteed Stop // Loss Order for a long trade valid values are “DEFAULT” and “BID”, and for // short trades “DEFAULT” and “ASK” are valid. TriggerCondition OrderTriggerCondition `json:"triggerCondition"` // The reason that the Market-if-touched Order was initiated Reason MarketIfTouchedOrderReason `json:"reason"` // Client Extensions to add to the Order (only provided if the Order is being created // with client extensions). ClientExtensions *ClientExtensions `json:"clientExtensions"` // The specification of the Take Profit Order that should be created for a Trade opened // when the Order is filled (if such a Trade is created). TakeProfitOnFill *TakeProfitDetails `json:"takeProfitOnFill"` // The specification of the Stop Loss Order that should be created for a Trade opened // when the Order is filled (if such a Trade is created). StopLossOnFill *StopLossDetails `json:"stopLossOnFill"` // The specification of the Trailing Stop Loss Order that should be created for a Trade // that is opened when the Order is filled (if such a Trade is created). TrailingStopLossOnFill *TrailingStopLossDetails `json:"trailingStopLossOnFill"` // The specification of the Guaranteed Stop Loss Order that should be created for a // Trade that is opened when the Order is filled (if such a Trade is created). GuaranteedStopLossOnFill *GuaranteedStopLossDetails `json:"guaranteedStopLossOnFill"` // Client Extensions to add to the Trade created when the Order is filled (if such // a Trade is created). Do not set, modify, delete tradeClientExtensions if your account // is associated with MT4. TradeClientExtensions *ClientExtensions `json:"tradeClientExtensions"` // The ID of the Order that this Order replaces (only provided if this Order replaces // an existing Order). ReplacesOrderID OrderID `json:"replacesOrderID"` // The ID of the Transaction that cancels the replaced Order (only provided if this // Order replaces an existing Order). CancellingTransactionID TransactionID `json:"cancellingTransactionID"` }
A MarketIfTouchedOrderTransaction represents the creation of a MarketIfTouched Order in the user’s Account.
func (MarketIfTouchedOrderTransaction) MarshalEasyJSON ¶
func (v MarketIfTouchedOrderTransaction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (MarketIfTouchedOrderTransaction) MarshalJSON ¶
func (v MarketIfTouchedOrderTransaction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*MarketIfTouchedOrderTransaction) UnmarshalEasyJSON ¶
func (v *MarketIfTouchedOrderTransaction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*MarketIfTouchedOrderTransaction) UnmarshalJSON ¶
func (v *MarketIfTouchedOrderTransaction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type MarketOrder ¶
type MarketOrder struct { Order // The type of the Order. Always set to “MARKET” for Market Orders. Type OrderType `json:"type"` // The Market Order’s Instrument. Instrument InstrumentName `json:"instrument"` // The quantity requested to be filled by the Market Order. A positive number of units // results in a long Order, and a negative number of units results in a short Order. Units DecimalNumber `json:"units"` // The time-in-force requested for the Market Order. Restricted to FOK or IOC for a // MarketOrder. TimeInForce TimeInForce `json:"timeInForce"` // The worst price that the client is willing to have the Market Order filled at. PriceBound PriceValue `json:"priceBound"` // Specification of how Positions in the Account are modified when the Order is filled. PositionFill OrderPositionFill `json:"positionFill"` // Details of the Trade requested to be closed, only provided when the Market Order // is being used to explicitly close a Trade. TradeClose *MarketOrderTradeClose `json:"tradeClose"` // Details of the long Position requested to be closed out, only provided when a Market // Order is being used to explicitly closeout a long Position. LongPositionCloseout *MarketOrderPositionCloseout `json:"longPositionCloseout"` // Details of the short Position requested to be closed out, only provided when a Market // Order is being used to explicitly closeout a short Position. ShortPositionCloseout *MarketOrderPositionCloseout `json:"shortPositionCloseout"` // Details of the Margin Closeout that this Market Order was created for MarginCloseout *MarketOrderMarginCloseout `json:"marginCloseout"` // Details of the delayed Trade close that this Market Order was created for DelayedTradeClose *MarketOrderDelayedTradeClose `json:"delayedTradeClose"` // TakeProfitDetails specifies the details of a Take Profit Order to be created on // behalf of a client. This may happen when an Order is filled that opens a Trade requiring // a Take Profit, or when a Trade’s dependent Take Profit Order is modified directly // through the Trade. TakeProfitOnFill *TakeProfitDetails `json:"takeProfitOnFill"` // StopLossDetails specifies the details of a Stop Loss Order to be created on behalf // of a client. This may happen when an Order is filled that opens a Trade requiring // a Stop Loss, or when a Trade’s dependent Stop Loss Order is modified directly through // the Trade. StopLossOnFill *StopLossDetails `json:"stopLossOnFill"` // GuaranteedStopLossDetails specifies the details of a Guaranteed Stop Loss Order // to be created on behalf of a client. This may happen when an Order is filled that // opens a Trade requiring a Guaranteed Stop Loss, or when a Trade’s dependent Guaranteed // Stop Loss Order is modified directly through the Trade. GuaranteedStopLossOnFill *GuaranteedStopLossDetails `json:"guaranteedStopLossOnFill"` // TrailingStopLossDetails specifies the details of a Trailing Stop Loss Order to be // created on behalf of a client. This may happen when an Order is filled that opens // a Trade requiring a Trailing Stop Loss, or when a Trade’s dependent Trailing Stop // Loss Order is modified directly through the Trade. TrailingStopLossOnFill *TrailingStopLossDetails `json:"trailingStopLossOnFill"` // Client Extensions to add to the Trade created when the Order is filled (if such // a Trade is created). Do not set, modify, or delete tradeClientExtensions if your // account is associated with MT4. TradeClientExtensions *ClientExtensions `json:"tradeClientExtensions"` // ID of the Transaction that filled this Order (only provided when the Order’s state // is FILLED) FillingTransactionID TransactionID `json:"fillingTransactionID"` // Date/time when the Order was filled (only provided when the Order’s state is FILLED) FilledTime DateTime `json:"filledTime"` // Trade ID of Trade opened when the Order was filled (only provided when the Order’s // state is FILLED and a Trade was opened as a result of the fill) TradeOpenedID TradeID `json:"tradeOpenedID"` // Trade ID of Trade reduced when the Order was filled (only provided when the Order’s // state is FILLED and a Trade was reduced as a result of the fill) TradeReducedID TradeID `json:"tradeReducedID"` // Trade IDs of Trades closed when the Order was filled (only provided when the Order’s // state is FILLED and one or more Trades were closed as a result of the fill) TradeClosedIDs []TradeID `json:"tradeClosedIDs"` // ID of the Transaction that cancelled the Order (only provided when the Order’s // state is CANCELLED) CancellingTransactionID TransactionID `json:"cancellingTransactionID"` // Date/time when the Order was cancelled (only provided when the state of the Order // is CANCELLED) CancelledTime DateTime `json:"cancelledTime"` }
A MarketOrder is an order that is filled immediately upon creation using the current market price.
func (MarketOrder) MarshalEasyJSON ¶
func (v MarketOrder) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (MarketOrder) MarshalJSON ¶
func (v MarketOrder) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*MarketOrder) UnmarshalEasyJSON ¶
func (v *MarketOrder) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*MarketOrder) UnmarshalJSON ¶
func (v *MarketOrder) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type MarketOrderDelayedTradeClose ¶
type MarketOrderDelayedTradeClose struct { // The ID of the Trade being closed TradeID TradeID `json:"tradeId"` // The client ID of the Trade being closed ClientTradeID TradeID `json:"clientTradeId"` // The Transaction ID of the DelayedTradeClosure transaction to which this // Delayed Trade Close belongs to SourceTransactionID TransactionID `json:"sourceTransactionID"` }
Details for the Market Order extensions specific to a Market Order placed with the intent of fully closing a specific open trade that should have already been closed but wasn’t due to halted market conditions
func (MarketOrderDelayedTradeClose) MarshalEasyJSON ¶
func (v MarketOrderDelayedTradeClose) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (MarketOrderDelayedTradeClose) MarshalJSON ¶
func (v MarketOrderDelayedTradeClose) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*MarketOrderDelayedTradeClose) UnmarshalEasyJSON ¶
func (v *MarketOrderDelayedTradeClose) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*MarketOrderDelayedTradeClose) UnmarshalJSON ¶
func (v *MarketOrderDelayedTradeClose) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type MarketOrderMarginCloseout ¶
type MarketOrderMarginCloseout struct {
Reason MarketOrderMarginCloseoutReason `json:"reason"`
}
Details for the Market Order extensions specific to a Market Order placed that is part of a Market Order Margin Closeout in a client’s account
func (MarketOrderMarginCloseout) MarshalEasyJSON ¶
func (v MarketOrderMarginCloseout) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (MarketOrderMarginCloseout) MarshalJSON ¶
func (v MarketOrderMarginCloseout) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*MarketOrderMarginCloseout) UnmarshalEasyJSON ¶
func (v *MarketOrderMarginCloseout) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*MarketOrderMarginCloseout) UnmarshalJSON ¶
func (v *MarketOrderMarginCloseout) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type MarketOrderMarginCloseoutReason ¶
type MarketOrderMarginCloseoutReason string
The reason that the Market Order was created to perform a margin closeout
const ( // Trade closures resulted from violating OANDA’s margin policy MarketOrderMarginCloseoutReason_MARGIN_CHECK_VIOLATION MarketOrderMarginCloseoutReason = "MARGIN_CHECK_VIOLATION" // Trade closures came from a margin closeout event resulting from regulatory conditions placed on the Account’s margin call MarketOrderMarginCloseoutReason_REGULATORY_MARGIN_CALL_VIOLATION MarketOrderMarginCloseoutReason = "REGULATORY_MARGIN_CALL_VIOLATION" // Trade closures resulted from violating the margin policy imposed by regulatory requirements MarketOrderMarginCloseoutReason_REGULATORY_MARGIN_CHECK_VIOLATION MarketOrderMarginCloseoutReason = "REGULATORY_MARGIN_CHECK_VIOLATION" )
type MarketOrderPositionCloseout ¶
type MarketOrderPositionCloseout struct { // The instrument of the Position being closed out. Instrument InstrumentName `json:"instrument"` // Indication of how much of the Position to close. Either “ALL”, or a // DecimalNumber reflection a partial close of the Trade. The DecimalNumber // must always be positive, and represent a number that doesn’t exceed the // absolute size of the Position. Units string `json:"units"` }
A MarketOrderPositionCloseout specifies the extensions to a Market Order when it has been created to closeout a specific Position.
func (MarketOrderPositionCloseout) MarshalEasyJSON ¶
func (v MarketOrderPositionCloseout) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (MarketOrderPositionCloseout) MarshalJSON ¶
func (v MarketOrderPositionCloseout) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*MarketOrderPositionCloseout) UnmarshalEasyJSON ¶
func (v *MarketOrderPositionCloseout) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*MarketOrderPositionCloseout) UnmarshalJSON ¶
func (v *MarketOrderPositionCloseout) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type MarketOrderReason ¶
type MarketOrderReason string
The reason that the Market Order was created
const ( // The Market Order was created at the request of a client MarketOrderReason_CLIENT_ORDER MarketOrderReason = "CLIENT_ORDER" // The Market Order was created to close a Trade at the request of a client MarketOrderReason_TRADE_CLOSE MarketOrderReason = "TRADE_CLOSE" // The Market Order was created to close a Position at the request of a client MarketOrderReason_POSITION_CLOSEOUT MarketOrderReason = "POSITION_CLOSEOUT" // The Market Order was created as part of a Margin Closeout MarketOrderReason_MARGIN_CLOSEOUT MarketOrderReason = "MARGIN_CLOSEOUT" // The Market Order was created to close a trade marked for delayed closure MarketOrderReason_DELAYED_TRADE_CLOSE MarketOrderReason = "DELAYED_TRADE_CLOSE" )
type MarketOrderRejectTransaction ¶
type MarketOrderRejectTransaction struct { Transaction // The Type of the Transaction. Always set to “MARKET_ORDER_REJECT” in a MarketOrderRejectTransaction. Type TransactionType `json:"type"` // The Market Order’s Instrument. Instrument InstrumentName `json:"instrument"` // The quantity requested to be filled by the Market Order. A positive number of units // results in a long Order, and a negative number of units results in a short Order. Units DecimalNumber `json:"units"` // The time-in-force requested for the Market Order. Restricted to FOK or IOC for a // MarketOrder. TimeInForce TimeInForce `json:"timeInForce"` // The worst price that the client is willing to have the Market Order filled at. PriceBound PriceValue `json:"priceBound"` // Specification of how Positions in the Account are modified when the Order is filled. PositionFill OrderPositionFill `json:"positionFill"` // Details of the Trade requested to be closed, only provided when the Market Order // is being used to explicitly close a Trade. TradeClose *MarketOrderTradeClose `json:"tradeClose"` // Details of the long Position requested to be closed out, only provided when a Market // Order is being used to explicitly closeout a long Position. LongPositionCloseout *MarketOrderPositionCloseout `json:"longPositionCloseout"` // Details of the short Position requested to be closed out, only provided when a Market // Order is being used to explicitly closeout a short Position. ShortPositionCloseout *MarketOrderPositionCloseout `json:"shortPositionCloseout"` // Details of the Margin Closeout that this Market Order was created for MarginCloseout *MarketOrderMarginCloseout `json:"marginCloseout"` // Details of the delayed Trade close that this Market Order was created for DelayedTradeClose *MarketOrderDelayedTradeClose `json:"delayedTradeClose"` // The reason that the Market Order was created Reason MarketOrderReason `json:"reason"` // Client Extensions to add to the Order (only provided if the Order is being created // with client extensions). ClientExtensions *ClientExtensions `json:"clientExtensions"` // The specification of the Take Profit Order that should be created for a Trade opened // when the Order is filled (if such a Trade is created). TakeProfitOnFill *TakeProfitDetails `json:"takeProfitOnFill"` // The specification of the Stop Loss Order that should be created for a Trade opened // when the Order is filled (if such a Trade is created). StopLossOnFill *StopLossDetails `json:"stopLossOnFill"` // The specification of the Trailing Stop Loss Order that should be created for a Trade // that is opened when the Order is filled (if such a Trade is created). TrailingStopLossOnFill *TrailingStopLossDetails `json:"trailingStopLossOnFill"` // The specification of the Guaranteed Stop Loss Order that should be created for a // Trade that is opened when the Order is filled (if such a Trade is created). GuaranteedStopLossOnFill *GuaranteedStopLossDetails `json:"guaranteedStopLossOnFill"` // Client Extensions to add to the Trade created when the Order is filled (if such // a Trade is created). Do not set, modify, delete tradeClientExtensions if your account // is associated with MT4. TradeClientExtensions *ClientExtensions `json:"tradeClientExtensions"` // The reason that the Reject Transaction was created RejectReason TransactionRejectReason `json:"rejectReason"` }
A MarketOrderRejectTransaction represents the rejection of the creation of a Market Order.
func (MarketOrderRejectTransaction) MarshalEasyJSON ¶
func (v MarketOrderRejectTransaction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (MarketOrderRejectTransaction) MarshalJSON ¶
func (v MarketOrderRejectTransaction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*MarketOrderRejectTransaction) UnmarshalEasyJSON ¶
func (v *MarketOrderRejectTransaction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*MarketOrderRejectTransaction) UnmarshalJSON ¶
func (v *MarketOrderRejectTransaction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type MarketOrderRequest ¶
type MarketOrderRequest struct { BaseOrderRequest // The type of the Order to Create. Must be set to “MARKET” when creating a Market // Order. Type OrderType `json:"type"` // The Market Order’s Instrument. Instrument InstrumentName `json:"instrument"` // The quantity requested to be filled by the Market Order. A positive number of units // results in a long Order, and a negative number of units results in a short Order. Units DecimalNumber `json:"units"` // The time-in-force requested for the Market Order. Restricted to FOK or IOC for a // MarketOrder. TimeInForce TimeInForce `json:"timeInForce"` // The worst price that the client is willing to have the Market Order filled at. PriceBound PriceValue `json:"priceBound"` // Specification of how Positions in the Account are modified when the Order is filled. PositionFill OrderPositionFill `json:"positionFill"` // The client extensions to add to the Order. Do not set, modify, or delete clientExtensions // if your account is associated with MT4. ClientExtensions *ClientExtensions `json:"clientExtensions"` // TakeProfitDetails specifies the details of a Take Profit Order to be created on // behalf of a client. This may happen when an Order is filled that opens a Trade requiring // a Take Profit, or when a Trade’s dependent Take Profit Order is modified directly // through the Trade. TakeProfitOnFill *TakeProfitDetails `json:"takeProfitOnFill"` // StopLossDetails specifies the details of a Stop Loss Order to be created on behalf // of a client. This may happen when an Order is filled that opens a Trade requiring // a Stop Loss, or when a Trade’s dependent Stop Loss Order is modified directly through // the Trade. StopLossOnFill *StopLossDetails `json:"stopLossOnFill"` // GuaranteedStopLossDetails specifies the details of a Guaranteed Stop Loss Order // to be created on behalf of a client. This may happen when an Order is filled that // opens a Trade requiring a Guaranteed Stop Loss, or when a Trade’s dependent Guaranteed // Stop Loss Order is modified directly through the Trade. GuaranteedStopLossOnFill *GuaranteedStopLossDetails `json:"guaranteedStopLossOnFill"` // TrailingStopLossDetails specifies the details of a Trailing Stop Loss Order to be // created on behalf of a client. This may happen when an Order is filled that opens // a Trade requiring a Trailing Stop Loss, or when a Trade’s dependent Trailing Stop // Loss Order is modified directly through the Trade. TrailingStopLossOnFill *TrailingStopLossDetails `json:"trailingStopLossOnFill"` // Client Extensions to add to the Trade created when the Order is filled (if such // a Trade is created). Do not set, modify, or delete tradeClientExtensions if your // account is associated with MT4. TradeClientExtensions *ClientExtensions `json:"tradeClientExtensions"` }
A MarketOrderRequest specifies the parameters that may be set when creating a Market Order.
func (MarketOrderRequest) MarshalEasyJSON ¶
func (v MarketOrderRequest) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (MarketOrderRequest) MarshalJSON ¶
func (v MarketOrderRequest) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*MarketOrderRequest) UnmarshalEasyJSON ¶
func (v *MarketOrderRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*MarketOrderRequest) UnmarshalJSON ¶
func (v *MarketOrderRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type MarketOrderTradeClose ¶
type MarketOrderTradeClose struct { // The ID of the Trade requested to be closed TradeID TradeID `json:"tradeId"` // The client ID of the Trade requested to be closed ClientTradeID string `json:"clientTradeId"` // Indication of how much of the Trade to close. Either “ALL”, or a // DecimalNumber reflection a partial close of the Trade. Units string `json:"units"` }
A MarketOrderTradeClose specifies the extensions to a Market Order that has been created specifically to close a Trade.
func (MarketOrderTradeClose) MarshalEasyJSON ¶
func (v MarketOrderTradeClose) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (MarketOrderTradeClose) MarshalJSON ¶
func (v MarketOrderTradeClose) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*MarketOrderTradeClose) UnmarshalEasyJSON ¶
func (v *MarketOrderTradeClose) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*MarketOrderTradeClose) UnmarshalJSON ¶
func (v *MarketOrderTradeClose) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type MarketOrderTransaction ¶
type MarketOrderTransaction struct { Transaction // The Type of the Transaction. Always set to “MARKET_ORDER” in a MarketOrderTransaction. Type TransactionType `json:"type"` // The Market Order’s Instrument. Instrument InstrumentName `json:"instrument"` // The quantity requested to be filled by the Market Order. A positive number of units // results in a long Order, and a negative number of units results in a short Order. Units DecimalNumber `json:"units"` // The time-in-force requested for the Market Order. Restricted to FOK or IOC for a // MarketOrder. TimeInForce TimeInForce `json:"timeInForce"` // The worst price that the client is willing to have the Market Order filled at. PriceBound PriceValue `json:"priceBound"` // Specification of how Positions in the Account are modified when the Order is filled. PositionFill OrderPositionFill `json:"positionFill"` // Details of the Trade requested to be closed, only provided when the Market Order // is being used to explicitly close a Trade. TradeClose *MarketOrderTradeClose `json:"tradeClose"` // Details of the long Position requested to be closed out, only provided when a Market // Order is being used to explicitly closeout a long Position. LongPositionCloseout *MarketOrderPositionCloseout `json:"longPositionCloseout"` // Details of the short Position requested to be closed out, only provided when a Market // Order is being used to explicitly closeout a short Position. ShortPositionCloseout *MarketOrderPositionCloseout `json:"shortPositionCloseout"` // Details of the Margin Closeout that this Market Order was created for MarginCloseout *MarketOrderMarginCloseout `json:"marginCloseout"` // Details of the delayed Trade close that this Market Order was created for DelayedTradeClose *MarketOrderDelayedTradeClose `json:"delayedTradeClose"` // The reason that the Market Order was created Reason MarketOrderReason `json:"reason"` // Client Extensions to add to the Order (only provided if the Order is being created // with client extensions). ClientExtensions *ClientExtensions `json:"clientExtensions"` // The specification of the Take Profit Order that should be created for a Trade opened // when the Order is filled (if such a Trade is created). TakeProfitOnFill *TakeProfitDetails `json:"takeProfitOnFill"` // The specification of the Stop Loss Order that should be created for a Trade opened // when the Order is filled (if such a Trade is created). StopLossOnFill *StopLossDetails `json:"stopLossOnFill"` // The specification of the Trailing Stop Loss Order that should be created for a Trade // that is opened when the Order is filled (if such a Trade is created). TrailingStopLossOnFill *TrailingStopLossDetails `json:"trailingStopLossOnFill"` // The specification of the Guaranteed Stop Loss Order that should be created for a // Trade that is opened when the Order is filled (if such a Trade is created). GuaranteedStopLossOnFill *GuaranteedStopLossDetails `json:"guaranteedStopLossOnFill"` // Client Extensions to add to the Trade created when the Order is filled (if such // a Trade is created). Do not set, modify, delete tradeClientExtensions if your account // is associated with MT4. TradeClientExtensions *ClientExtensions `json:"tradeClientExtensions"` }
A MarketOrderTransaction represents the creation of a Market Order in the user’s account. A Market Order is an Order that is filled immediately at the current market price. Market Orders can be specialized when they are created to accomplish a specific task: to close a Trade, to closeout a Position or to participate in in a Margin closeout.
func (MarketOrderTransaction) MarshalEasyJSON ¶
func (v MarketOrderTransaction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (MarketOrderTransaction) MarshalJSON ¶
func (v MarketOrderTransaction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*MarketOrderTransaction) UnmarshalEasyJSON ¶
func (v *MarketOrderTransaction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*MarketOrderTransaction) UnmarshalJSON ¶
func (v *MarketOrderTransaction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type Message ¶
type Message interface { easyjson.MarshalerUnmarshaler json.Marshaler json.Unmarshaler }
type OpenTradeDividendAdjustment ¶
type OpenTradeDividendAdjustment struct { // The ID of the Trade for which the dividend adjustment is to be paid or collected. TradeID TradeID `json:"tradeId"` // The dividend adjustment amount to pay or collect for the Trade. DividendAdjustment AccountUnits `json:"dividendAdjustment"` // The dividend adjustment amount to pay or collect for the Trade, in the Instrument’s quote currency. QuoteDividendAdjustment DecimalNumber `json:"quoteDividendAdjustment"` }
Used to pay or collect a dividend adjustment amount for an open Trade within the Account.
func (OpenTradeDividendAdjustment) MarshalEasyJSON ¶
func (v OpenTradeDividendAdjustment) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (OpenTradeDividendAdjustment) MarshalJSON ¶
func (v OpenTradeDividendAdjustment) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*OpenTradeDividendAdjustment) UnmarshalEasyJSON ¶
func (v *OpenTradeDividendAdjustment) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*OpenTradeDividendAdjustment) UnmarshalJSON ¶
func (v *OpenTradeDividendAdjustment) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type OpenTradeFinancing ¶
type OpenTradeFinancing struct { // The ID of the Trade that financing is being paid/collected for. TradeID TradeID `json:"tradeID"` // The amount of financing paid/collected for the Trade. Financing AccountUnits `json:"financing"` // The amount of financing paid/collected in the Instrument’s base currency for the Trade. BaseFinancing DecimalNumber `json:"baseFinancing"` // The amount of financing paid/collected in the Instrument’s quote currency for the Trade. QuoteFinancing DecimalNumber `json:"quoteFinancing"` // The financing rate in effect for the instrument used to calculate the the // amount of financing paid/collected for the Trade. This field will only be // set if the AccountFinancingMode at the time of the daily financing is // DAILY_INSTRUMENT or SECOND_BY_SECOND_INSTRUMENT. The value is in decimal // rather than percentage points, e.g. 5% is represented as 0.05. FinancingRate DecimalNumber `json:"financingRate"` }
OpenTradeFinancing is used to pay/collect daily financing charge for an open Trade within an Account
func (OpenTradeFinancing) MarshalEasyJSON ¶
func (v OpenTradeFinancing) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (OpenTradeFinancing) MarshalJSON ¶
func (v OpenTradeFinancing) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*OpenTradeFinancing) UnmarshalEasyJSON ¶
func (v *OpenTradeFinancing) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*OpenTradeFinancing) UnmarshalJSON ¶
func (v *OpenTradeFinancing) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type Order ¶
type Order struct { // The Order’s identifier, unique within the Order’s Account. Id OrderID `json:"id"` // The time when the Order was created. CreateTime DateTime `json:"createTime"` // The current state of the Order. State OrderState `json:"state"` // The client extensions of the Order. Do not set, modify, or delete clientExtensions // if your account is associated with MT4. ClientExtensions *ClientExtensions `json:"clientExtensions"` }
The base Order definition specifies the properties that are common to all Orders.
func (Order) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Order) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Order) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Order) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type OrderBook ¶
type OrderBook struct { // The order book’s instrument. Instrument InstrumentName `json:"instrument"` // The time when the order book snapshot was created. Time DateTime `json:"time"` // The price (midpoint) for the order book’s instrument at the time of the // order book snapshot Price PriceValue `json:"price"` // The price width for each bucket. Each bucket covers the price range from // the bucket’s price to the bucket’s price + bucketWidth. BucketWidth PriceValue `json:"bucketWidth"` // The partitioned order book, divided into buckets using a default bucket // width. These buckets are only provided for price ranges which actually // contain order or position data. Buckets []*OrderBookBucket `json:"buckets"` }
The representation of an instrument’s order book at a point in time
func (OrderBook) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (OrderBook) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*OrderBook) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*OrderBook) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type OrderBookBucket ¶
type OrderBookBucket struct { // The lowest price (inclusive) covered by the bucket. The bucket covers the // price range from the price to price + the order book’s bucketWidth. Price PriceValue `json:"price"` // The percentage of the total number of orders represented by the long // orders found in this bucket. LongCountPercent DecimalNumber `json:"longCountPercent"` // The percentage of the total number of orders represented by the short // orders found in this bucket. ShortCountPercent DecimalNumber `json:"shortCountPercent"` }
The order book data for a partition of the instrument’s prices.
func (OrderBookBucket) MarshalEasyJSON ¶
func (v OrderBookBucket) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (OrderBookBucket) MarshalJSON ¶
func (v OrderBookBucket) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*OrderBookBucket) UnmarshalEasyJSON ¶
func (v *OrderBookBucket) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*OrderBookBucket) UnmarshalJSON ¶
func (v *OrderBookBucket) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type OrderBookResponse ¶
type OrderBookResponse struct {
OrderBook *OrderBook `json:"orderBook"`
}
func (OrderBookResponse) MarshalEasyJSON ¶
func (v OrderBookResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (OrderBookResponse) MarshalJSON ¶
func (v OrderBookResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*OrderBookResponse) UnmarshalEasyJSON ¶
func (v *OrderBookResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*OrderBookResponse) UnmarshalJSON ¶
func (v *OrderBookResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type OrderCancelReason ¶
type OrderCancelReason string
The reason that an Order was cancelled.
const ( // The Order was cancelled because at the time of filling, an unexpected internal server // error occurred. OrderCancelReason_INTERNAL_SERVER_ERROR OrderCancelReason = "INTERNAL_SERVER_ERROR" // The Order was cancelled because at the time of filling the account was locked. OrderCancelReason_ACCOUNT_LOCKED OrderCancelReason = "ACCOUNT_LOCKED" // The order was to be filled, however the account is configured to not allow new positions // to be created. OrderCancelReason_ACCOUNT_NEW_POSITIONS_LOCKED OrderCancelReason = "ACCOUNT_NEW_POSITIONS_LOCKED" // Filling the Order wasn’t possible because it required the creation of a dependent // Order and the Account is locked for Order creation. OrderCancelReason_ACCOUNT_ORDER_CREATION_LOCKED OrderCancelReason = "ACCOUNT_ORDER_CREATION_LOCKED" // Filling the Order was not possible because the Account is locked for filling Orders. OrderCancelReason_ACCOUNT_ORDER_FILL_LOCKED OrderCancelReason = "ACCOUNT_ORDER_FILL_LOCKED" // The Order was cancelled explicitly at the request of the client. OrderCancelReason_CLIENT_REQUEST OrderCancelReason = "CLIENT_REQUEST" // The Order cancelled because it is being migrated to another account. OrderCancelReason_MIGRATION OrderCancelReason = "MIGRATION" // Filling the Order wasn’t possible because the Order’s instrument was halted. OrderCancelReason_MARKET_HALTED OrderCancelReason = "MARKET_HALTED" // The Order is linked to an open Trade that was closed. OrderCancelReason_LINKED_TRADE_CLOSED OrderCancelReason = "LINKED_TRADE_CLOSED" // The time in force specified for this order has passed. OrderCancelReason_TIME_IN_FORCE_EXPIRED OrderCancelReason = "TIME_IN_FORCE_EXPIRED" // Filling the Order wasn’t possible because the Account had insufficient margin. OrderCancelReason_INSUFFICIENT_MARGIN OrderCancelReason = "INSUFFICIENT_MARGIN" // Filling the Order would have resulted in a a FIFO violation. OrderCancelReason_FIFO_VIOLATION OrderCancelReason = "FIFO_VIOLATION" // Filling the Order would have violated the Order’s price bound. OrderCancelReason_BOUNDS_VIOLATION OrderCancelReason = "BOUNDS_VIOLATION" // The Order was cancelled for replacement at the request of the client. OrderCancelReason_CLIENT_REQUEST_REPLACED OrderCancelReason = "CLIENT_REQUEST_REPLACED" // The Order was cancelled for replacement with an adjusted fillPrice to accommodate // for the price movement caused by a dividendAdjustment. OrderCancelReason_DIVIDEND_ADJUSTMENT_REPLACED OrderCancelReason = "DIVIDEND_ADJUSTMENT_REPLACED" // Filling the Order wasn’t possible because enough liquidity available. OrderCancelReason_INSUFFICIENT_LIQUIDITY OrderCancelReason = "INSUFFICIENT_LIQUIDITY" // Filling the Order would have resulted in the creation of a Take Profit Order with // a GTD time in the past. OrderCancelReason_TAKE_PROFIT_ON_FILL_GTD_TIMESTAMP_IN_PAST OrderCancelReason = "TAKE_PROFIT_ON_FILL_GTD_TIMESTAMP_IN_PAST" // Filling the Order would result in the creation of a Take Profit Order that would // have been filled immediately, closing the new Trade at a loss. OrderCancelReason_TAKE_PROFIT_ON_FILL_LOSS OrderCancelReason = "TAKE_PROFIT_ON_FILL_LOSS" // Filling the Order would result in the creation of a Take Profit Loss Order that would // close the new Trade at a loss when filled. OrderCancelReason_LOSING_TAKE_PROFIT OrderCancelReason = "LOSING_TAKE_PROFIT" // Filling the Order would have resulted in the creation of a Stop Loss Order with a // GTD time in the past. OrderCancelReason_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST OrderCancelReason = "STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST" // Filling the Order would result in the creation of a Stop Loss Order that would have // been filled immediately, closing the new Trade at a loss. OrderCancelReason_STOP_LOSS_ON_FILL_LOSS OrderCancelReason = "STOP_LOSS_ON_FILL_LOSS" // Filling the Order would result in the creation of a Stop Loss Order whose price would // be zero or negative due to the specified distance. OrderCancelReason_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED OrderCancelReason = "STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED" // Filling the Order would not result in the creation of Stop Loss Order, however the // Account’s configuration requires that all Trades have a Stop Loss Order attached // to them. OrderCancelReason_STOP_LOSS_ON_FILL_REQUIRED OrderCancelReason = "STOP_LOSS_ON_FILL_REQUIRED" // Filling the Order would not result in the creation of a guaranteed Stop Loss Order, // however the Account’s configuration requires that all Trades have a guaranteed // Stop Loss Order attached to them. OrderCancelReason_STOP_LOSS_ON_FILL_GUARANTEED_REQUIRED OrderCancelReason = "STOP_LOSS_ON_FILL_GUARANTEED_REQUIRED" // Filling the Order would result in the creation of a guaranteed Stop Loss Order, however // the Account’s configuration does not allow guaranteed Stop Loss Orders. OrderCancelReason_STOP_LOSS_ON_FILL_GUARANTEED_NOT_ALLOWED OrderCancelReason = "STOP_LOSS_ON_FILL_GUARANTEED_NOT_ALLOWED" // Filling the Order would result in the creation of a guaranteed Stop Loss Order with // a distance smaller than the configured minimum distance. OrderCancelReason_STOP_LOSS_ON_FILL_GUARANTEED_MINIMUM_DISTANCE_NOT_MET OrderCancelReason = "STOP_LOSS_ON_FILL_GUARANTEED_MINIMUM_DISTANCE_NOT_MET" // Filling the Order would result in the creation of a guaranteed Stop Loss Order with // trigger price and number of units that that violates the account’s guaranteed Stop // Loss Order level restriction. OrderCancelReason_STOP_LOSS_ON_FILL_GUARANTEED_LEVEL_RESTRICTION_EXCEEDED OrderCancelReason = "STOP_LOSS_ON_FILL_GUARANTEED_LEVEL_RESTRICTION_EXCEEDED" // Filling the Order would result in the creation of a guaranteed Stop Loss Order for // a hedged Trade, however the Account’s configuration does not allow guaranteed Stop // Loss Orders for hedged Trades/Positions. OrderCancelReason_STOP_LOSS_ON_FILL_GUARANTEED_HEDGING_NOT_ALLOWED OrderCancelReason = "STOP_LOSS_ON_FILL_GUARANTEED_HEDGING_NOT_ALLOWED" // Filling the Order would result in the creation of a Stop Loss Order whose TimeInForce // value is invalid. A likely cause would be if the Account requires guaranteed stop // loss orders and the TimeInForce value were not GTC. OrderCancelReason_STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID OrderCancelReason = "STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID" // Filling the Order would result in the creation of a Stop Loss Order whose TriggerCondition // value is invalid. A likely cause would be if the stop loss order is guaranteed and // the TimeInForce is not TRIGGER_DEFAULT or TRIGGER_BID for a long trade, or not TRIGGER_DEFAULT // or TRIGGER_ASK for a short trade. OrderCancelReason_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID OrderCancelReason = "STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID" // Filling the Order would have resulted in the creation of a Guaranteed Stop Loss Order // with a GTD time in the past. OrderCancelReason_GUARANTEED_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST OrderCancelReason = "GUARANTEED_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST" // Filling the Order would result in the creation of a Guaranteed Stop Loss Order that // would have been filled immediately, closing the new Trade at a loss. OrderCancelReason_GUARANTEED_STOP_LOSS_ON_FILL_LOSS OrderCancelReason = "GUARANTEED_STOP_LOSS_ON_FILL_LOSS" // Filling the Order would result in the creation of a Guaranteed Stop Loss Order whose // price would be zero or negative due to the specified distance. OrderCancelReason_GUARANTEED_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED OrderCancelReason = "GUARANTEED_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED" // Filling the Order would not result in the creation of a Guaranteed Stop Loss Order, // however the Account’s configuration requires that all Trades have a Guaranteed // Stop Loss Order attached to them. OrderCancelReason_GUARANTEED_STOP_LOSS_ON_FILL_REQUIRED OrderCancelReason = "GUARANTEED_STOP_LOSS_ON_FILL_REQUIRED" // Filling the Order would result in the creation of a Guaranteed Stop Loss Order, however // the Account’s configuration does not allow Guaranteed Stop Loss Orders. OrderCancelReason_GUARANTEED_STOP_LOSS_ON_FILL_NOT_ALLOWED OrderCancelReason = "GUARANTEED_STOP_LOSS_ON_FILL_NOT_ALLOWED" // Filling the Order would result in the creation of a Guaranteed Stop Loss Order with // a distance smaller than the configured minimum distance. OrderCancelReason_GUARANTEED_STOP_LOSS_ON_FILL_MINIMUM_DISTANCE_NOT_MET OrderCancelReason = "GUARANTEED_STOP_LOSS_ON_FILL_MINIMUM_DISTANCE_NOT_MET" // Filling the Order would result in the creation of a Guaranteed Stop Loss Order with // trigger number of units that violates the account’s Guaranteed Stop Loss Order // level restriction volume. OrderCancelReason_GUARANTEED_STOP_LOSS_ON_FILL_LEVEL_RESTRICTION_VOLUME_EXCEEDED OrderCancelReason = "GUARANTEED_STOP_LOSS_ON_FILL_LEVEL_RESTRICTION_VOLUME_EXCEEDED" // Filling the Order would result in the creation of a Guaranteed Stop Loss Order with // trigger price that violates the account’s Guaranteed Stop Loss Order level restriction // price range. OrderCancelReason_GUARANTEED_STOP_LOSS_ON_FILL_LEVEL_RESTRICTION_PRICE_RANGE_EXCEEDED OrderCancelReason = "GUARANTEED_STOP_LOSS_ON_FILL_LEVEL_RESTRICTION_PRICE_RANGE_EXCEEDED" // Filling the Order would result in the creation of a Guaranteed Stop Loss Order for // a hedged Trade, however the Account’s configuration does not allow Guaranteed Stop // Loss Orders for hedged Trades/Positions. OrderCancelReason_GUARANTEED_STOP_LOSS_ON_FILL_HEDGING_NOT_ALLOWED OrderCancelReason = "GUARANTEED_STOP_LOSS_ON_FILL_HEDGING_NOT_ALLOWED" // Filling the Order would result in the creation of a Guaranteed Stop Loss Order whose // TimeInForce value is invalid. A likely cause would be if the Account requires guaranteed // stop loss orders and the TimeInForce value were not GTC. OrderCancelReason_GUARANTEED_STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID OrderCancelReason = "GUARANTEED_STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID" // Filling the Order would result in the creation of a Guaranteed Stop Loss Order whose // TriggerCondition value is invalid. A likely cause would be the TimeInForce is not // TRIGGER_DEFAULT or TRIGGER_BID for a long trade, or not TRIGGER_DEFAULT or TRIGGER_ASK // for a short trade. OrderCancelReason_GUARANTEED_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID OrderCancelReason = "GUARANTEED_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID" // Filling the Order would result in the creation of a Take Profit Order whose price // would be zero or negative due to the specified distance. OrderCancelReason_TAKE_PROFIT_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED OrderCancelReason = "TAKE_PROFIT_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED" // Filling the Order would have resulted in the creation of a Trailing Stop Loss Order // with a GTD time in the past. OrderCancelReason_TRAILING_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST OrderCancelReason = "TRAILING_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST" // Filling the Order would result in the creation of a new Open Trade with a client // Trade ID already in use. OrderCancelReason_CLIENT_TRADE_ID_ALREADY_EXISTS OrderCancelReason = "CLIENT_TRADE_ID_ALREADY_EXISTS" // Closing out a position wasn’t fully possible. OrderCancelReason_POSITION_CLOSEOUT_FAILED OrderCancelReason = "POSITION_CLOSEOUT_FAILED" // Filling the Order would cause the maximum open trades allowed for the Account to // be exceeded. OrderCancelReason_OPEN_TRADES_ALLOWED_EXCEEDED OrderCancelReason = "OPEN_TRADES_ALLOWED_EXCEEDED" // Filling the Order would have resulted in exceeding the number of pending Orders allowed // for the Account. OrderCancelReason_PENDING_ORDERS_ALLOWED_EXCEEDED OrderCancelReason = "PENDING_ORDERS_ALLOWED_EXCEEDED" // Filling the Order would have resulted in the creation of a Take Profit Order with // a client Order ID that is already in use. OrderCancelReason_TAKE_PROFIT_ON_FILL_CLIENT_ORDER_ID_ALREADY_EXISTS OrderCancelReason = "TAKE_PROFIT_ON_FILL_CLIENT_ORDER_ID_ALREADY_EXISTS" // Filling the Order would have resulted in the creation of a Stop Loss Order with a // client Order ID that is already in use. OrderCancelReason_STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_ALREADY_EXISTS OrderCancelReason = "STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_ALREADY_EXISTS" // Filling the Order would have resulted in the creation of a Guaranteed Stop Loss Order // with a client Order ID that is already in use. OrderCancelReason_GUARANTEED_STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_ALREADY_EXISTS OrderCancelReason = "GUARANTEED_STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_ALREADY_EXISTS" // Filling the Order would have resulted in the creation of a Trailing Stop Loss Order // with a client Order ID that is already in use. OrderCancelReason_TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_ALREADY_EXISTS OrderCancelReason = "TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_ALREADY_EXISTS" // Filling the Order would have resulted in the Account’s maximum position size limit // being exceeded for the Order’s instrument. OrderCancelReason_POSITION_SIZE_EXCEEDED OrderCancelReason = "POSITION_SIZE_EXCEEDED" // Filling the Order would result in the creation of a Trade, however there already // exists an opposing (hedged) Trade that has a guaranteed Stop Loss Order attached // to it. Guaranteed Stop Loss Orders cannot be combined with hedged positions. OrderCancelReason_HEDGING_GSLO_VIOLATION OrderCancelReason = "HEDGING_GSLO_VIOLATION" // Filling the order would cause the maximum position value allowed for the account // to be exceeded. The Order has been cancelled as a result. OrderCancelReason_ACCOUNT_POSITION_VALUE_LIMIT_EXCEEDED OrderCancelReason = "ACCOUNT_POSITION_VALUE_LIMIT_EXCEEDED" // Filling the order would require the creation of a short trade, however the instrument // is configured such that orders being filled using bid prices can only reduce existing // positions. New short positions cannot be created, but existing long positions may // be reduced or closed. OrderCancelReason_INSTRUMENT_BID_REDUCE_ONLY OrderCancelReason = "INSTRUMENT_BID_REDUCE_ONLY" // Filling the order would require the creation of a long trade, however the instrument // is configured such that orders being filled using ask prices can only reduce existing // positions. New long positions cannot be created, but existing short positions may // be reduced or closed. OrderCancelReason_INSTRUMENT_ASK_REDUCE_ONLY OrderCancelReason = "INSTRUMENT_ASK_REDUCE_ONLY" // Filling the order would require using the bid, however the instrument is configured // such that the bids are halted, and so no short orders may be filled. OrderCancelReason_INSTRUMENT_BID_HALTED OrderCancelReason = "INSTRUMENT_BID_HALTED" // Filling the order would require using the ask, however the instrument is configured // such that the asks are halted, and so no long orders may be filled. OrderCancelReason_INSTRUMENT_ASK_HALTED OrderCancelReason = "INSTRUMENT_ASK_HALTED" // Filling the Order would result in the creation of a Guaranteed Stop Loss Order (GSLO). // Since the trade is long the GSLO would be short, however the bid side is currently // halted. GSLOs cannot be created in this situation. OrderCancelReason_STOP_LOSS_ON_FILL_GUARANTEED_BID_HALTED OrderCancelReason = "STOP_LOSS_ON_FILL_GUARANTEED_BID_HALTED" // Filling the Order would result in the creation of a Guaranteed Stop Loss Order (GSLO). // Since the trade is short the GSLO would be long, however the ask side is currently // halted. GSLOs cannot be created in this situation. OrderCancelReason_STOP_LOSS_ON_FILL_GUARANTEED_ASK_HALTED OrderCancelReason = "STOP_LOSS_ON_FILL_GUARANTEED_ASK_HALTED" // Filling the Order would result in the creation of a Guaranteed Stop Loss Order (GSLO). // Since the trade is long the GSLO would be short, however the bid side is currently // halted. GSLOs cannot be created in this situation. OrderCancelReason_GUARANTEED_STOP_LOSS_ON_FILL_BID_HALTED OrderCancelReason = "GUARANTEED_STOP_LOSS_ON_FILL_BID_HALTED" // Filling the Order would result in the creation of a Guaranteed Stop Loss Order (GSLO). // Since the trade is short the GSLO would be long, however the ask side is currently // halted. GSLOs cannot be created in this situation. OrderCancelReason_GUARANTEED_STOP_LOSS_ON_FILL_ASK_HALTED OrderCancelReason = "GUARANTEED_STOP_LOSS_ON_FILL_ASK_HALTED" // Filling the Order would have resulted in a new Trade that violates the FIFO violation // safeguard constraints. OrderCancelReason_FIFO_VIOLATION_SAFEGUARD_VIOLATION OrderCancelReason = "FIFO_VIOLATION_SAFEGUARD_VIOLATION" // Filling the Order would have reduced an existing Trade such that the reduced Trade // violates the FIFO violation safeguard constraints. OrderCancelReason_FIFO_VIOLATION_SAFEGUARD_PARTIAL_CLOSE_VIOLATION OrderCancelReason = "FIFO_VIOLATION_SAFEGUARD_PARTIAL_CLOSE_VIOLATION" // The Orders on fill would be in violation of the risk management Order mutual exclusivity // configuration specifying that only one risk management Order can be attached to a // Trade. OrderCancelReason_ORDERS_ON_FILL_RMO_MUTUAL_EXCLUSIVITY_MUTUALLY_EXCLUSIVE_VIOLATION OrderCancelReason = "ORDERS_ON_FILL_RMO_MUTUAL_EXCLUSIVITY_MUTUALLY_EXCLUSIVE_VIOLATION" )
type OrderCancelRejectTransaction ¶
type OrderCancelRejectTransaction struct { Transaction // The Type of the Transaction. Always set to “ORDER_CANCEL_REJECT” for an OrderCancelRejectTransaction. Type TransactionType `json:"type"` // The ID of the Order intended to be cancelled OrderID OrderID `json:"orderID"` // The client ID of the Order intended to be cancelled (only provided if the Order // has a client Order ID). ClientOrderID OrderID `json:"clientOrderID"` // The reason that the Reject Transaction was created RejectReason TransactionRejectReason `json:"rejectReason"` }
An OrderCancelRejectTransaction represents the rejection of the cancellation of an Order in the client’s Account.
func (OrderCancelRejectTransaction) MarshalEasyJSON ¶
func (v OrderCancelRejectTransaction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (OrderCancelRejectTransaction) MarshalJSON ¶
func (v OrderCancelRejectTransaction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*OrderCancelRejectTransaction) UnmarshalEasyJSON ¶
func (v *OrderCancelRejectTransaction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*OrderCancelRejectTransaction) UnmarshalJSON ¶
func (v *OrderCancelRejectTransaction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type OrderCancelTransaction ¶
type OrderCancelTransaction struct { Transaction // The Type of the Transaction. Always set to “ORDER_CANCEL” for an OrderCancelTransaction. Type TransactionType `json:"type"` // The ID of the Order cancelled OrderID OrderID `json:"orderID"` // The client ID of the Order cancelled (only provided if the Order has a client Order // ID). ClientOrderID OrderID `json:"clientOrderID"` // The reason that the Order was cancelled. Reason OrderCancelReason `json:"reason"` // The ID of the Order that replaced this Order (only provided if this Order was cancelled // for replacement). ReplacedByOrderID OrderID `json:"replacedByOrderID"` }
An OrderCancelTransaction represents the cancellation of an Order in the client’s Account.
func (OrderCancelTransaction) MarshalEasyJSON ¶
func (v OrderCancelTransaction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (OrderCancelTransaction) MarshalJSON ¶
func (v OrderCancelTransaction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*OrderCancelTransaction) UnmarshalEasyJSON ¶
func (v *OrderCancelTransaction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*OrderCancelTransaction) UnmarshalJSON ¶
func (v *OrderCancelTransaction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type OrderClientExtensionsError ¶
type OrderClientExtensionsError struct { // The Transaction that rejected the modification of the Client Extensions // for the Order OrderClientExtensionsModifyRejectTransaction *OrderClientExtensionsModifyRejectTransaction `json:"orderClientExtensionsModifyRejectTransaction"` // The IDs of all Transactions that were created while satisfying the // request. RelatedTransactionIDs []TransactionID `json:"relatedTransactionIDs"` // The ID of the most recent Transaction created for the Account LastTransactionID TransactionID `json:"lastTransactionID"` // The code of the error that has occurred. This field may not be returned // for some errors. ErrorCode string `json:"errorCode"` // The human-readable description of the error that has occurred. ErrorMessage string `json:"errorMessage"` }
func (OrderClientExtensionsError) MarshalEasyJSON ¶
func (v OrderClientExtensionsError) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (OrderClientExtensionsError) MarshalJSON ¶
func (v OrderClientExtensionsError) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*OrderClientExtensionsError) UnmarshalEasyJSON ¶
func (v *OrderClientExtensionsError) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*OrderClientExtensionsError) UnmarshalJSON ¶
func (v *OrderClientExtensionsError) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type OrderClientExtensionsModifyRejectTransaction ¶
type OrderClientExtensionsModifyRejectTransaction struct { Transaction // The Type of the Transaction. Always set to “ORDER_CLIENT_EXTENSIONS_MODIFY_REJECT” // for a OrderClientExtensionsModifyRejectTransaction. Type TransactionType `json:"type"` // The ID of the Order who’s client extensions are to be modified. OrderID OrderID `json:"orderID"` // The original Client ID of the Order who’s client extensions are to be modified. ClientOrderID ClientID `json:"clientOrderID"` // The new Client Extensions for the Order. ClientExtensionsModify *ClientExtensions `json:"clientExtensionsModify"` // The new Client Extensions for the Order’s Trade on fill. TradeClientExtensionsModify *ClientExtensions `json:"tradeClientExtensionsModify"` // The reason that the Reject Transaction was created RejectReason TransactionRejectReason `json:"rejectReason"` }
A OrderClientExtensionsModifyRejectTransaction represents the rejection of the modification of an Order’s Client Extensions.
func (OrderClientExtensionsModifyRejectTransaction) MarshalEasyJSON ¶
func (v OrderClientExtensionsModifyRejectTransaction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (OrderClientExtensionsModifyRejectTransaction) MarshalJSON ¶
func (v OrderClientExtensionsModifyRejectTransaction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*OrderClientExtensionsModifyRejectTransaction) UnmarshalEasyJSON ¶
func (v *OrderClientExtensionsModifyRejectTransaction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*OrderClientExtensionsModifyRejectTransaction) UnmarshalJSON ¶
func (v *OrderClientExtensionsModifyRejectTransaction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type OrderClientExtensionsModifyTransaction ¶
type OrderClientExtensionsModifyTransaction struct { Transaction // The Type of the Transaction. Always set to “ORDER_CLIENT_EXTENSIONS_MODIFY” // for a OrderClientExtensionsModifyTransaction. Type TransactionType `json:"type"` // The ID of the Order who’s client extensions are to be modified. OrderID OrderID `json:"orderID"` // The original Client ID of the Order who’s client extensions are to be modified. ClientOrderID ClientID `json:"clientOrderID"` // The new Client Extensions for the Order. ClientExtensionsModify *ClientExtensions `json:"clientExtensionsModify"` // The new Client Extensions for the Order’s Trade on fill. TradeClientExtensionsModify *ClientExtensions `json:"tradeClientExtensionsModify"` }
A OrderClientExtensionsModifyTransaction represents the modification of an Order’s Client Extensions.
func (OrderClientExtensionsModifyTransaction) MarshalEasyJSON ¶
func (v OrderClientExtensionsModifyTransaction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (OrderClientExtensionsModifyTransaction) MarshalJSON ¶
func (v OrderClientExtensionsModifyTransaction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*OrderClientExtensionsModifyTransaction) UnmarshalEasyJSON ¶
func (v *OrderClientExtensionsModifyTransaction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*OrderClientExtensionsModifyTransaction) UnmarshalJSON ¶
func (v *OrderClientExtensionsModifyTransaction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type OrderClientExtensionsRequest ¶
type OrderClientExtensionsRequest struct { // The Client Extensions to update for the Order. Do not set, modify, or // delete clientExtensions if your account is associated with MT4. ClientExtensions *ClientExtensions `json:"clientExtensions"` // The Client Extensions to update for the Trade created when the Order is // filled. Do not set, modify, or delete clientExtensions if your account is // associated with MT4. TradeClientExtensions *ClientExtensions `json:"tradeClientExtensions"` }
func (OrderClientExtensionsRequest) MarshalEasyJSON ¶
func (v OrderClientExtensionsRequest) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (OrderClientExtensionsRequest) MarshalJSON ¶
func (v OrderClientExtensionsRequest) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*OrderClientExtensionsRequest) UnmarshalEasyJSON ¶
func (v *OrderClientExtensionsRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*OrderClientExtensionsRequest) UnmarshalJSON ¶
func (v *OrderClientExtensionsRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type OrderClientExtensionsResponse ¶
type OrderClientExtensionsResponse struct { // The Transaction that modified the Client Extensions for the Order OrderClientExtensionsModifyTransaction *OrderClientExtensionsModifyTransaction `json:"orderClientExtensionsModifyTransaction"` // The IDs of all Transactions that were created while satisfying the // request. RelatedTransactionIDs []TransactionID `json:"relatedTransactionIDs"` // The ID of the most recent Transaction created for the Account LastTransactionID TransactionID `json:"lastTransactionID"` }
func (OrderClientExtensionsResponse) MarshalEasyJSON ¶
func (v OrderClientExtensionsResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (OrderClientExtensionsResponse) MarshalJSON ¶
func (v OrderClientExtensionsResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*OrderClientExtensionsResponse) UnmarshalEasyJSON ¶
func (v *OrderClientExtensionsResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*OrderClientExtensionsResponse) UnmarshalJSON ¶
func (v *OrderClientExtensionsResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type OrderFillReason ¶
type OrderFillReason string
The reason that an Order was filled
const ( // The Order filled was a Limit Order OrderFillReason_LIMIT_ORDER OrderFillReason = "LIMIT_ORDER" // The Order filled was a Stop Order OrderFillReason_STOP_ORDER OrderFillReason = "STOP_ORDER" // The Order filled was a Market-if-touched Order OrderFillReason_MARKET_IF_TOUCHED_ORDER OrderFillReason = "MARKET_IF_TOUCHED_ORDER" // The Order filled was a Take Profit Order OrderFillReason_TAKE_PROFIT_ORDER OrderFillReason = "TAKE_PROFIT_ORDER" // The Order filled was a Stop Loss Order OrderFillReason_STOP_LOSS_ORDER OrderFillReason = "STOP_LOSS_ORDER" // The Order filled was a Guaranteed Stop Loss Order OrderFillReason_GUARANTEED_STOP_LOSS_ORDER OrderFillReason = "GUARANTEED_STOP_LOSS_ORDER" // The Order filled was a Trailing Stop Loss Order OrderFillReason_TRAILING_STOP_LOSS_ORDER OrderFillReason = "TRAILING_STOP_LOSS_ORDER" // The Order filled was a Market Order OrderFillReason_MARKET_ORDER OrderFillReason = "MARKET_ORDER" // The Order filled was a Market Order used to explicitly close a Trade OrderFillReason_MARKET_ORDER_TRADE_CLOSE OrderFillReason = "MARKET_ORDER_TRADE_CLOSE" // The Order filled was a Market Order used to explicitly close a Position OrderFillReason_MARKET_ORDER_POSITION_CLOSEOUT OrderFillReason = "MARKET_ORDER_POSITION_CLOSEOUT" // The Order filled was a Market Order used for a Margin Closeout OrderFillReason_MARKET_ORDER_MARGIN_CLOSEOUT OrderFillReason = "MARKET_ORDER_MARGIN_CLOSEOUT" // The Order filled was a Market Order used for a delayed Trade close OrderFillReason_MARKET_ORDER_DELAYED_TRADE_CLOSE OrderFillReason = "MARKET_ORDER_DELAYED_TRADE_CLOSE" // The Order filled was a Fixed Price Order OrderFillReason_FIXED_PRICE_ORDER OrderFillReason = "FIXED_PRICE_ORDER" // The Order filled was a Fixed Price Order created as part of a platform account migration OrderFillReason_FIXED_PRICE_ORDER_PLATFORM_ACCOUNT_MIGRATION OrderFillReason = "FIXED_PRICE_ORDER_PLATFORM_ACCOUNT_MIGRATION" // The Order filled was a Fixed Price Order created to close a Trade as part of division account migration OrderFillReason_FIXED_PRICE_ORDER_DIVISION_ACCOUNT_MIGRATION OrderFillReason = "FIXED_PRICE_ORDER_DIVISION_ACCOUNT_MIGRATION" // The Order filled was a Fixed Price Order created to close a Trade administratively OrderFillReason_FIXED_PRICE_ORDER_ADMINISTRATIVE_ACTION OrderFillReason = "FIXED_PRICE_ORDER_ADMINISTRATIVE_ACTION" )
type OrderFillTransaction ¶
type OrderFillTransaction struct { Transaction // The Type of the Transaction. Always set to “ORDER_FILL” for an OrderFillTransaction. Type TransactionType `json:"type"` // The ID of the Order filled. OrderID OrderID `json:"orderID"` // The client Order ID of the Order filled (only provided if the client has assigned // one). ClientOrderID ClientID `json:"clientOrderID"` // The name of the filled Order’s instrument. Instrument InstrumentName `json:"instrument"` // The number of units filled by the OrderFill. Units DecimalNumber `json:"units"` // This is the conversion factor in effect for the Account at the time of the OrderFill // for converting any gains realized in Instrument quote units into units of the Account’s // home currency. Deprecated: Will be removed in a future API update. GainQuoteHomeConversionFactor DecimalNumber `json:"gainQuoteHomeConversionFactor"` // This is the conversion factor in effect for the Account at the time of the OrderFill // for converting any losses realized in Instrument quote units into units of the Account’s // home currency. Deprecated: Will be removed in a future API update. LossQuoteHomeConversionFactor DecimalNumber `json:"lossQuoteHomeConversionFactor"` // The HomeConversionFactors in effect at the time of the OrderFill. HomeConversionFactors *HomeConversionFactors `json:"homeConversionFactors"` // This field is now deprecated and should no longer be used. The individual tradesClosed, // tradeReduced and tradeOpened fields contain the exact/official price each unit was // filled at. Deprecated: Will be removed in a future API update. Price PriceValue `json:"price"` // The price that all of the units of the OrderFill should have been filled at, in // the absence of guaranteed price execution. This factors in the Account’s current // ClientPrice, used liquidity and the units of the OrderFill only. If no Trades were // closed with their price clamped for guaranteed stop loss enforcement, then this value // will match the price fields of each Trade opened, closed, and reduced, and they will // all be the exact same. FullVWAP PriceValue `json:"fullVWAP"` // The price in effect for the account at the time of the Order fill. FullPrice ClientPrice `json:"fullPrice"` // The reason that an Order was filled Reason OrderFillReason `json:"reason"` // The profit or loss incurred when the Order was filled. Pl AccountUnits `json:"pl"` // The profit or loss incurred when the Order was filled, in the Instrument’s quote // currency. QuotePL DecimalNumber `json:"quotePL"` // The financing paid or collected when the Order was filled. Financing AccountUnits `json:"financing"` // The financing paid or collected when the Order was filled, in the Instrument’s // base currency. BaseFinancing DecimalNumber `json:"baseFinancing"` // The financing paid or collected when the Order was filled, in the Instrument’s // quote currency. QuoteFinancing DecimalNumber `json:"quoteFinancing"` // The commission charged in the Account’s home currency as a result of filling the // Order. The commission is always represented as a positive quantity of the Account’s // home currency, however it reduces the balance in the Account. Commission AccountUnits `json:"commission"` // The total guaranteed execution fees charged for all Trades opened, closed or reduced // with guaranteed Stop Loss Orders. GuaranteedExecutionFee AccountUnits `json:"guaranteedExecutionFee"` // The total guaranteed execution fees charged for all Trades opened, closed or reduced // with guaranteed Stop Loss Orders, expressed in the Instrument’s quote currency. QuoteGuaranteedExecutionFee DecimalNumber `json:"quoteGuaranteedExecutionFee"` // The Account’s balance after the Order was filled. AccountBalance AccountUnits `json:"accountBalance"` // The Trade that was opened when the Order was filled (only provided if filling the // Order resulted in a new Trade). TradeOpened *TradeOpen `json:"tradeOpened"` // The Trades that were closed when the Order was filled (only provided if filling // the Order resulted in a closing open Trades). TradesClosed []*TradeReduce `json:"tradesClosed"` // The Trade that was reduced when the Order was filled (only provided if filling the // Order resulted in reducing an open Trade). TradeReduced *TradeReduce `json:"tradeReduced"` // The half spread cost for the OrderFill, which is the sum of the halfSpreadCost values // in the tradeOpened, tradesClosed and tradeReduced fields. This can be a positive // or negative value and is represented in the home currency of the Account. HalfSpreadCost AccountUnits `json:"halfSpreadCost"` }
An OrderFillTransaction represents the filling of an Order in the client’s Account.
func (OrderFillTransaction) MarshalEasyJSON ¶
func (v OrderFillTransaction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (OrderFillTransaction) MarshalJSON ¶
func (v OrderFillTransaction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*OrderFillTransaction) UnmarshalEasyJSON ¶
func (v *OrderFillTransaction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*OrderFillTransaction) UnmarshalJSON ¶
func (v *OrderFillTransaction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type OrderID ¶
type OrderID string
The Order’s identifier, unique within the Order’s Account. The string representation of the OANDA-assigned OrderID. OANDA-assigned OrderIDs are positive integers, and are derived from the TransactionID of the Transaction that created the Order.
type OrderIdentifier ¶
type OrderIdentifier struct { // The OANDA-assigned Order ID OrderID OrderID `json:"orderID"` // The client-provided client Order ID ClientOrderID ClientID `json:"clientOrderID"` }
An OrderIdentifier is used to refer to an Order, and contains both the OrderID and the ClientOrderID.
func (OrderIdentifier) MarshalEasyJSON ¶
func (v OrderIdentifier) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (OrderIdentifier) MarshalJSON ¶
func (v OrderIdentifier) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*OrderIdentifier) UnmarshalEasyJSON ¶
func (v *OrderIdentifier) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*OrderIdentifier) UnmarshalJSON ¶
func (v *OrderIdentifier) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type OrderParser ¶
type OrderParser struct { CancelledTime DateTime `json:"cancelledTime"` CancellingTransactionID string `json:"cancellingTransactionID"` ClientExtensions *ClientExtensions `json:"clientExtensions"` ClientTradeID string `json:"clientTradeID"` CreateTime DateTime `json:"createTime"` DelayedTradeClose *MarketOrderDelayedTradeClose `json:"delayedTradeClose"` Distance DecimalNumber `json:"distance"` FilledTime DateTime `json:"filledTime"` FillingTransactionID string `json:"fillingTransactionID"` GtdTime DateTime `json:"gtdTime"` Guaranteed bool `json:"guaranteed"` GuaranteedExecutionPremium DecimalNumber `json:"guaranteedExecutionPremium"` GuaranteedStopLossOnFill *GuaranteedStopLossDetails `json:"guaranteedStopLossOnFill"` Id string `json:"id"` InitialMarketPrice PriceValue `json:"initialMarketPrice"` Instrument InstrumentName `json:"instrument"` LongPositionCloseout *MarketOrderPositionCloseout `json:"longPositionCloseout"` MarginCloseout *MarketOrderMarginCloseout `json:"marginCloseout"` PositionFill OrderPositionFill `json:"positionFill"` Price PriceValue `json:"price"` PriceBound PriceValue `json:"priceBound"` ReplacedByOrderID string `json:"replacedByOrderID"` ReplacesOrderID string `json:"replacesOrderID"` ShortPositionCloseout *MarketOrderPositionCloseout `json:"shortPositionCloseout"` State OrderState `json:"state"` StopLossOnFill *StopLossDetails `json:"stopLossOnFill"` TakeProfitOnFill *TakeProfitDetails `json:"takeProfitOnFill"` TimeInForce TimeInForce `json:"timeInForce"` TradeClientExtensions *ClientExtensions `json:"tradeClientExtensions"` TradeClose *MarketOrderTradeClose `json:"tradeClose"` TradeClosedIDs []TradeID `json:"tradeClosedIDs"` TradeID string `json:"tradeID"` TradeOpenedID string `json:"tradeOpenedID"` TradeReducedID string `json:"tradeReducedID"` TradeState string `json:"tradeState"` TrailingStopLossOnFill *TrailingStopLossDetails `json:"trailingStopLossOnFill"` TrailingStopValue PriceValue `json:"trailingStopValue"` TriggerCondition string `json:"triggerCondition"` Type string `json:"type"` Units DecimalNumber `json:"units"` }
func (OrderParser) MarshalEasyJSON ¶
func (v OrderParser) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (OrderParser) MarshalJSON ¶
func (v OrderParser) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*OrderParser) Parse ¶
func (p *OrderParser) Parse() interface{}
Example
r := parser.Parse() switch v := r.(type) { case *MarketOrder: case *FixedPriceOrder: case *LimitOrder: case *StopOrder: case *MarketIfTouchedOrder: case *TakeProfitOrder: case *StopLossOrder: case *GuaranteedStopLossOrder: case *TrailingStopLossOrder: }
func (*OrderParser) UnmarshalEasyJSON ¶
func (v *OrderParser) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*OrderParser) UnmarshalJSON ¶
func (v *OrderParser) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type OrderPositionFill ¶
type OrderPositionFill string
Specification of how Positions in the Account are modified when the Order is filled.
const ( // When the Order is filled, only allow Positions to be opened or extended. OrderPositionFill_OPEN_ONLY OrderPositionFill = "OPEN_ONLY" // When the Order is filled, always fully reduce an existing Position before opening a new Position. OrderPositionFill_REDUCE_FIRST OrderPositionFill = "REDUCE_FIRST" // When the Order is filled, only reduce an existing Position. OrderPositionFill_REDUCE_ONLY OrderPositionFill = "REDUCE_ONLY" // When the Order is filled, use REDUCE_FIRST behaviour for non-client hedging Accounts, // and OPEN_ONLY behaviour for client hedging Accounts. OrderPositionFill_DEFAULT OrderPositionFill = "DEFAULT" )
type OrderRequest ¶
type OrderRequest interface { }
type OrderRequestParser ¶
type OrderRequestParser struct { ClientExtensions *ClientExtensions `json:"clientExtensions"` ClientTradeID string `json:"clientTradeID"` Distance DecimalNumber `json:"distance"` GtdTime DateTime `json:"gtdTime"` Guaranteed bool `json:"guaranteed"` GuaranteedStopLossOnFill *GuaranteedStopLossDetails `json:"guaranteedStopLossOnFill"` Instrument InstrumentName `json:"instrument"` PositionFill OrderPositionFill `json:"positionFill"` Price PriceValue `json:"price"` PriceBound PriceValue `json:"priceBound"` StopLossOnFill *StopLossDetails `json:"stopLossOnFill"` TakeProfitOnFill *TakeProfitDetails `json:"takeProfitOnFill"` TimeInForce TimeInForce `json:"timeInForce"` TradeClientExtensions *ClientExtensions `json:"tradeClientExtensions"` TradeID string `json:"tradeID"` TrailingStopLossOnFill *TrailingStopLossDetails `json:"trailingStopLossOnFill"` TriggerCondition string `json:"triggerCondition"` Type string `json:"type"` Units DecimalNumber `json:"units"` }
func (OrderRequestParser) MarshalEasyJSON ¶
func (v OrderRequestParser) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (OrderRequestParser) MarshalJSON ¶
func (v OrderRequestParser) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*OrderRequestParser) Parse ¶
func (p *OrderRequestParser) Parse() interface{}
Example
r := parser.Parse() switch v := r.(type) { case *MarketOrderRequest: case *LimitOrderRequest: case *StopOrderRequest: case *MarketIfTouchedOrderRequest: case *TakeProfitOrderRequest: case *StopLossOrderRequest: case *GuaranteedStopLossOrderRequest: case *TrailingStopLossOrderRequest: }
func (*OrderRequestParser) UnmarshalEasyJSON ¶
func (v *OrderRequestParser) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*OrderRequestParser) UnmarshalJSON ¶
func (v *OrderRequestParser) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type OrderSpecifier ¶
type OrderSpecifier string
The specification of an Order as referred to by clients Either the Order’s OANDA-assigned OrderID or the Order’s client-provided ClientID prefixed by the “@” symbol
func (OrderSpecifier) ClientID ¶
func (o OrderSpecifier) ClientID() ClientID
func (OrderSpecifier) IsClient ¶
func (o OrderSpecifier) IsClient() bool
func (OrderSpecifier) OrderID ¶
func (o OrderSpecifier) OrderID() OrderID
type OrderState ¶
type OrderState string
The current state of the Order.
const ( OrderState_PENDING OrderState = "PENDING" // The Order is currently pending execution OrderState_FILLED OrderState = "FILLED" // The Order has been filled OrderState_TRIGGERED OrderState = "TRIGGERED" // The Order has been triggered OrderState_CANCELLED OrderState = "CANCELLED" // The Order has been cancelled )
type OrderStateFilter ¶
type OrderStateFilter string
The state to filter the requested Orders by.
const ( OrderStateFilter_PENDING OrderStateFilter = "PENDING" // The Orders that are currently pending execution OrderStateFilter_FILLED OrderStateFilter = "FILLED" // The Orders that have been filled OrderStateFilter_TRIGGERED OrderStateFilter = "TRIGGERED" // The Orders that have been triggered OrderStateFilter_CANCELLED OrderStateFilter = "CANCELLED" // The Orders that have been cancelled OrderStateFilter_ALL OrderStateFilter = "ALL" // The Orders that are in any of the possible states )
type OrderTriggerCondition ¶
type OrderTriggerCondition string
Specification of which price component should be used when determining if an Order should be triggered and filled. This allows Orders to be triggered based on the bid, ask, mid, default (ask for buy, bid for sell) or inverse (ask for sell, bid for buy) price depending on the desired behaviour. Orders are always filled using their default price component. This feature is only provided through the REST API. Clients who choose to specify a non-default trigger condition will not see it reflected in any of OANDA’s proprietary or partner trading platforms, their transaction history or their account statements. OANDA platforms always assume that an Order’s trigger condition is set to the default value when indicating the distance from an Order’s trigger price, and will always provide the default trigger condition when creating or modifying an Order. A special restriction applies when creating a Guaranteed Stop Loss Order. In this case the TriggerCondition value must either be “DEFAULT”, or the “natural” trigger side “DEFAULT” results in. So for a Guaranteed Stop Loss Order for a long trade valid values are “DEFAULT” and “BID”, and for short trades “DEFAULT” and “ASK” are valid.
const ( // Trigger an Order the “natural” way: compare its price to the ask for long Orders and bid for short Orders. OrderTriggerCondition_DEFAULT OrderTriggerCondition = "DEFAULT" // Trigger an Order the opposite of the “natural” way: compare its price the bid for long Orders and ask // for short Orders. OrderTriggerCondition_INVERSE OrderTriggerCondition = "INVERSE" // Trigger an Order by comparing its price to the bid regardless of whether it is long or short. OrderTriggerCondition_BID OrderTriggerCondition = "BID" // Trigger an Order by comparing its price to the ask regardless of whether it is long or short. OrderTriggerCondition_ASK OrderTriggerCondition = "ASK" // Trigger an Order by comparing its price to the midpoint regardless of whether it is long or short. OrderTriggerCondition_MID OrderTriggerCondition = "MID" )
type OrderType ¶
type OrderType string
The type of the Order.
const ( OrderType_MARKET OrderType = "MARKET" // Market Order OrderType_LIMIT OrderType = "LIMIT" // Limit Order OrderType_STOP OrderType = "STOP" // Stop Order OrderType_MARKET_IF_TOUCHED OrderType = "MARKET_IF_TOUCHED" // Market-if-touched Order OrderType_TAKE_PROFIT OrderType = "TAKE_PROFIT" // Take Profit Order OrderType_STOP_LOSS OrderType = "STOP_LOSS" // Stop Loss Order OrderType_GUARANTEED_STOP_LOSS OrderType = "GUARANTEED_STOP_LOSS" // Guaranteed Stop Loss Order OrderType_TRAILING_STOP_LOSS OrderType = "TRAILING_STOP_LOSS" // Trailing Stop Loss Order OrderType_FIXED_PRICE OrderType = "FIXED_PRICE" // Fixed Price Order )
const ( CancellableOrderType_LIMIT OrderType = "LIMIT" // Limit Order CancellableOrderType_STOP OrderType = "STOP" // Stop Order CancellableOrderType_MARKET_IF_TOUCHED OrderType = "MARKET_IF_TOUCHED" // Market-if-touched Order CancellableOrderType_TAKE_PROFIT OrderType = "TAKE_PROFIT" // Take Profit Order CancellableOrderType_STOP_LOSS OrderType = "STOP_LOSS" // Stop Loss Order CancellableOrderType_GUARANTEED_STOP_LOSS OrderType = "GUARANTEED_STOP_LOSS" // Guaranteed Stop Loss Order CancellableOrderType_TRAILING_STOP_LOSS OrderType = "TRAILING_STOP_LOSS" // Trailing Stop Loss Order )
type OrdersRequest ¶
type OrdersRequest struct { // List of Order IDs to retrieve IDs []OrderID `json:"ids"` // The state to filter the requested Orders by // [default=PENDING] State OrderStateFilter `json:"state"` // The instrument to filter the requested orders by Instrument InstrumentName `json:"instrument"` // The maximum number of Orders to return // [default=50, maximum=500] Count int `json:"count"` // The maximum Order ID to return. If not provided the most // recent Orders in the Account are returned BeforeID OrderID `json:"beforeID"` }
func NewOrdersRequest ¶
func NewOrdersRequest() *OrdersRequest
func (*OrdersRequest) AppendQuery ¶
func (g *OrdersRequest) AppendQuery(b *bytebufferpool.ByteBuffer)
func (OrdersRequest) MarshalEasyJSON ¶
func (v OrdersRequest) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (OrdersRequest) MarshalJSON ¶
func (v OrdersRequest) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*OrdersRequest) UnmarshalEasyJSON ¶
func (v *OrdersRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*OrdersRequest) UnmarshalJSON ¶
func (v *OrdersRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
func (*OrdersRequest) WithBeforeID ¶
func (g *OrdersRequest) WithBeforeID(beforeID OrderID) *OrdersRequest
The maximum Order ID to return. If not provided the most recent Orders in the Account are returned
func (*OrdersRequest) WithCount ¶
func (g *OrdersRequest) WithCount(count int) *OrdersRequest
The maximum number of Orders to return [default=50, maximum=500]
func (*OrdersRequest) WithIDs ¶
func (g *OrdersRequest) WithIDs(ids ...OrderID) *OrdersRequest
List of Order IDs to retrieve
func (*OrdersRequest) WithInstrument ¶
func (g *OrdersRequest) WithInstrument(instrument InstrumentName) *OrdersRequest
The instrument to filter the requested orders by
func (*OrdersRequest) WithState ¶
func (g *OrdersRequest) WithState(state OrderStateFilter) *OrdersRequest
The state to filter the requested Orders by [default=PENDING]
type OrdersResponse ¶
type OrdersResponse struct { // The list of pending Order details Orders []*Order `json:"orders"` // The ID of the most recent Transaction created for the Account LastTransactionID TransactionID `json:"lastTransactionID"` }
func (OrdersResponse) MarshalEasyJSON ¶
func (v OrdersResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (OrdersResponse) MarshalJSON ¶
func (v OrdersResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*OrdersResponse) UnmarshalEasyJSON ¶
func (v *OrdersResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*OrdersResponse) UnmarshalJSON ¶
func (v *OrdersResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type Position ¶
type Position struct { // The Position’s Instrument. Instrument InstrumentName `json:"instrument"` // Profit/loss realized by the Position over the lifetime of the Account. Pl AccountUnits `json:"pl"` // The unrealized profit/loss of all open Trades that contribute to this Position. UnrealizedPL AccountUnits `json:"unrealizedPL"` // Margin currently used by the Position. MarginUsed AccountUnits `json:"marginUsed"` // Profit/loss realized by the Position since the Account’s resettablePL was last // reset by the client. ResettablePL AccountUnits `json:"resettablePL"` // The total amount of financing paid/collected for this instrument over the lifetime // of the Account. Financing AccountUnits `json:"financing"` // The total amount of commission paid for this instrument over the lifetime of the // Account. Commission AccountUnits `json:"commission"` // The total amount of dividend adjustment paid for this instrument over the lifetime // of the Account. DividendAdjustment AccountUnits `json:"dividendAdjustment"` // The total amount of fees charged over the lifetime of the Account for the execution // of guaranteed Stop Loss Orders for this instrument. GuaranteedExecutionFees AccountUnits `json:"guaranteedExecutionFees"` // The details of the long side of the Position. Long *PositionSide `json:"long"` // The details of the short side of the Position. Short *PositionSide `json:"short"` }
The specification of a Position within an Account.
func (Position) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Position) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Position) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Position) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type PositionAggregationMode ¶
type PositionAggregationMode string
The way that position values for an Account are calculated and aggregated.
const ( // The Position value or margin for each side (long and short) of the Position are // computed independently and added together. PositionAggretationMode_ABSOLUTE_SUM PositionAggregationMode = "ABSOLUTE_SUM" // The Position value or margin for each side (long and short) of the Position are computed independently. // The Position value or margin chosen is the maximal absolute value of the two. PositionAggretationMode_MAXIMAL_SIDE PositionAggregationMode = "MAXIMAL_SIDE" // The units for each side (long and short) of the Position are netted together and the resulting value // (long or short) is used to compute the Position value or margin. PositionAggretationMode_NET_SUM PositionAggregationMode = "NET_SUM" )
type PositionBook ¶
type PositionBook struct { // The position book’s instrument. Instrument InstrumentName `json:"instrument"` // The time when the position book snapshot was created. Time DateTime `json:"time"` // The price (midpoint) for the position book’s instrument at the time of the // position book snapshot Price PriceValue `json:"price"` // The price width for each bucket. Each bucket covers the price range from // the bucket’s price to the bucket’s price + bucketWidth. BucketWidth PriceValue `json:"bucketWidth"` // The partitioned position book, divided into buckets using a default bucket // width. These buckets are only provided for price ranges which actually // contain order or position data. Buckets []*OrderBookBucket `json:"buckets"` }
The representation of an instrument’s position book at a point in time
func (PositionBook) MarshalEasyJSON ¶
func (v PositionBook) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (PositionBook) MarshalJSON ¶
func (v PositionBook) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*PositionBook) UnmarshalEasyJSON ¶
func (v *PositionBook) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*PositionBook) UnmarshalJSON ¶
func (v *PositionBook) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type PositionBookBucket ¶
type PositionBookBucket struct { // The lowest price (inclusive) covered by the bucket. The bucket covers the // price range from the price to price + the position book’s bucketWidth. Price PriceValue `json:"price"` // The percentage of the total number of positions represented by the long // orders found in this bucket. LongCountPercent DecimalNumber `json:"longCountPercent"` // The percentage of the total number of positions represented by the short // orders found in this bucket. ShortCountPercent DecimalNumber `json:"shortCountPercent"` }
The position book data for a partition of the instrument’s prices.
func (PositionBookBucket) MarshalEasyJSON ¶
func (v PositionBookBucket) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (PositionBookBucket) MarshalJSON ¶
func (v PositionBookBucket) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*PositionBookBucket) UnmarshalEasyJSON ¶
func (v *PositionBookBucket) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*PositionBookBucket) UnmarshalJSON ¶
func (v *PositionBookBucket) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type PositionBookResponse ¶
type PositionBookResponse struct {
PositionBook *PositionBook `json:"positionBook"`
}
func (PositionBookResponse) MarshalEasyJSON ¶
func (v PositionBookResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (PositionBookResponse) MarshalJSON ¶
func (v PositionBookResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*PositionBookResponse) UnmarshalEasyJSON ¶
func (v *PositionBookResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*PositionBookResponse) UnmarshalJSON ¶
func (v *PositionBookResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type PositionCloseError ¶
type PositionCloseError struct { // The Transaction created that rejects the creation of a MarketOrder to close the // long Position. LongOrderRejectTransaction *MarketOrderRejectTransaction `json:"longOrderRejectTransaction"` // The Transaction created that rejects the creation of a MarketOrder to close the // short Position. ShortOrderRejectTransaction *MarketOrderRejectTransaction `json:"shortOrderRejectTransaction"` // The IDs of all Transactions that were created while satisfying the request. RelatedTransactionIDs []TransactionID `json:"relatedTransactionIDs"` // The ID of the most recent Transaction created for the Account LastTransactionID TransactionID `json:"lastTransactionID"` // The code of the error that has occurred. This field may not be returned for some // errors. ErrorCode string `json:"errorCode"` // The human-readable description of the error that has occurred. ErrorMessage string `json:"errorMessage"` }
func (PositionCloseError) MarshalEasyJSON ¶
func (v PositionCloseError) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (PositionCloseError) MarshalJSON ¶
func (v PositionCloseError) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*PositionCloseError) UnmarshalEasyJSON ¶
func (v *PositionCloseError) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*PositionCloseError) UnmarshalJSON ¶
func (v *PositionCloseError) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type PositionCloseRequest ¶
type PositionCloseRequest struct { // Indication of how much of the long Position to closeout. Either the string “ALL”, // the string “NONE”, or a DecimalNumber representing how many units of the long // position to close using a PositionCloseout MarketOrder. The units specified must // always be positive. LongUnits string `json:"longUnits"` // The client extensions to add to the MarketOrder used to close the long position. LongClientExtensions *ClientExtensions `json:"longClientExtensions"` // Indication of how much of the short Position to closeout. Either the string “ALL”, // the string “NONE”, or a DecimalNumber representing how many units of the short // position to close using a PositionCloseout MarketOrder. The units specified must // always be positive. ShortUnits string `json:"shortUnits"` // The client extensions to add to the MarketOrder used to close the short position. ShortClientExtensions *ClientExtensions `json:"shortClientExtensions"` }
func (PositionCloseRequest) MarshalEasyJSON ¶
func (v PositionCloseRequest) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (PositionCloseRequest) MarshalJSON ¶
func (v PositionCloseRequest) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*PositionCloseRequest) UnmarshalEasyJSON ¶
func (v *PositionCloseRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*PositionCloseRequest) UnmarshalJSON ¶
func (v *PositionCloseRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type PositionCloseResponse ¶
type PositionCloseResponse struct { // The MarketOrderTransaction created to close the long Position. LongOrderCreateTransaction *MarketOrderTransaction `json:"longOrderCreateTransaction"` // OrderFill Transaction that closes the long Position LongOrderFillTransaction *OrderFillTransaction `json:"longOrderFillTransaction"` // OrderCancel Transaction that cancels the MarketOrder created to close the long Position LongOrderCancelTransaction *OrderCancelTransaction `json:"longOrderCancelTransaction"` // The MarketOrderTransaction created to close the short Position. ShortOrderCreateTransaction *MarketOrderTransaction `json:"shortOrderCreateTransaction"` // OrderFill Transaction that closes the short Position ShortOrderFillTransaction *OrderFillTransaction `json:"shortOrderFillTransaction"` // OrderCancel Transaction that cancels the MarketOrder created to close the short // Position ShortOrderCancelTransaction *OrderCancelTransaction `json:"shortOrderCancelTransaction"` // The IDs of all Transactions that were created while satisfying the request. RelatedTransactionIDs []TransactionID `json:"relatedTransactionIDs"` // The ID of the most recent Transaction created for the Account LastTransactionID TransactionID `json:"lastTransactionID"` }
func (PositionCloseResponse) MarshalEasyJSON ¶
func (v PositionCloseResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (PositionCloseResponse) MarshalJSON ¶
func (v PositionCloseResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*PositionCloseResponse) UnmarshalEasyJSON ¶
func (v *PositionCloseResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*PositionCloseResponse) UnmarshalJSON ¶
func (v *PositionCloseResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type PositionFinancing ¶
type PositionFinancing struct { // The instrument of the Position that financing is being paid/collected for. Instrument InstrumentName `json:"instrument"` // The amount of financing paid/collected for the Position. Financing AccountUnits `json:"financing"` // The amount of base financing paid/collected for the Position. BaseFinancing DecimalNumber `json:"baseFinancing"` // The amount of quote financing paid/collected for the Position. QuoteFinancing DecimalNumber `json:"quoteFinancing"` // The HomeConversionFactors in effect for the Position’s Instrument at the // time of the DailyFinancing. HomeConversionFactors *HomeConversionFactors `json:"homeConversionFactors"` // The financing paid/collected for each open Trade within the Position. OpenTradeFinancings []*OpenTradeFinancing `json:"openTradeFinancings"` // The account financing mode at the time of the daily financing. AccountFinancingMode AccountFinancingMode `json:"accountFinancingMode"` }
PositionFinancing is used to pay/collect daily financing charge for a Position within an Account
func (PositionFinancing) MarshalEasyJSON ¶
func (v PositionFinancing) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (PositionFinancing) MarshalJSON ¶
func (v PositionFinancing) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*PositionFinancing) UnmarshalEasyJSON ¶
func (v *PositionFinancing) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*PositionFinancing) UnmarshalJSON ¶
func (v *PositionFinancing) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type PositionResponse ¶
type PositionResponse struct { Position *Position `json:"position"` // The ID of the most recent Transaction created for the Account LastTransactionID TransactionID `json:"lastTransactionID"` }
The requested Position.
func (PositionResponse) MarshalEasyJSON ¶
func (v PositionResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (PositionResponse) MarshalJSON ¶
func (v PositionResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*PositionResponse) UnmarshalEasyJSON ¶
func (v *PositionResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*PositionResponse) UnmarshalJSON ¶
func (v *PositionResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type PositionSide ¶
type PositionSide struct { // Number of units in the position (negative value indicates short position, positive // indicates long position). Units DecimalNumber `json:"units"` // Volume-weighted average of the underlying Trade open prices for the Position. AveragePrice PriceValue `json:"averagePrice"` // List of the open Trade IDs which contribute to the open Position. TradeIDs []TradeID `json:"tradeIDs"` // Profit/loss realized by the PositionSide over the lifetime of the Account. Pl AccountUnits `json:"pl"` // The unrealized profit/loss of all open Trades that contribute to this PositionSide. UnrealizedPL AccountUnits `json:"unrealizedPL"` // Profit/loss realized by the PositionSide since the Account’s resettablePL was // last reset by the client. ResettablePL AccountUnits `json:"resettablePL"` // The total amount of financing paid/collected for this PositionSide over the lifetime // of the Account. Financing AccountUnits `json:"financing"` // The total amount of dividend adjustment paid for the PositionSide over the lifetime // of the Account. DividendAdjustment AccountUnits `json:"dividendAdjustment"` // The total amount of fees charged over the lifetime of the Account for the execution // of guaranteed Stop Loss Orders attached to Trades for this PositionSide. GuaranteedExecutionFees AccountUnits `json:"guaranteedExecutionFees"` }
The representation of a Position for a single direction (long or short).
func (PositionSide) MarshalEasyJSON ¶
func (v PositionSide) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (PositionSide) MarshalJSON ¶
func (v PositionSide) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*PositionSide) UnmarshalEasyJSON ¶
func (v *PositionSide) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*PositionSide) UnmarshalJSON ¶
func (v *PositionSide) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type PositionsResponse ¶
type PositionsResponse struct { // The list of Account Positions. Positions []*Position `json:"positions"` // The ID of the most recent Transaction created for the Account LastTransactionID TransactionID `json:"lastTransactionID"` }
func (PositionsResponse) MarshalEasyJSON ¶
func (v PositionsResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (PositionsResponse) MarshalJSON ¶
func (v PositionsResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*PositionsResponse) UnmarshalEasyJSON ¶
func (v *PositionsResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*PositionsResponse) UnmarshalJSON ¶
func (v *PositionsResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type PriceBucket ¶
type PriceBucket struct { // The Price offered by the PriceBucket Price PriceValue `json:"price"` // The amount of liquidity offered by the PriceBucket Liquidity int64 `json:"liquidity"` }
A PriceBucket represents a price available for an amount of liquidity
func (PriceBucket) MarshalEasyJSON ¶
func (v PriceBucket) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (PriceBucket) MarshalJSON ¶
func (v PriceBucket) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*PriceBucket) UnmarshalEasyJSON ¶
func (v *PriceBucket) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*PriceBucket) UnmarshalJSON ¶
func (v *PriceBucket) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type PriceValue ¶
type PriceValue DecimalNumber
The string representation of a Price for a Bucket. A decimal number encodes as a string. The amount of precision provided depends on the Instrument.
func (PriceValue) AsFloat64 ¶
func (d PriceValue) AsFloat64(or float64) float64
type PricingCandlesRequest ¶
type PricingCandlesRequest struct { // The Price component(s) to get candlestick data for. // [default=M] Price PricingComponent `json:"price"` // The granularity of the candlesticks to fetch. // [default=S5] Granularity CandlestickGranularity `json:"granularity"` // The number of candlesticks to return in the response. Count should // not be specified if both the start and end parameters are provided, // as the time range combined with the granularity will determine the // number of candlesticks to return. [default=500, maximum=5000] Count int `json:"count"` // The start of the time range to fetch candlesticks for. From DateTime `json:"from"` // The end of the time range to fetch candlesticks for. To DateTime `json:"to"` // A flag that controls whether the candlestick is “smoothed” or not. // A smoothed candlestick uses the previous candle’s close price as its // open price, while an un-smoothed candlestick uses the first price from // its time range as its open price. // [default=False] Smooth bool `json:"smooth"` // A flag that controls whether the candlestick that is covered by the from // time should be included in the results. This flag enables clients to use // the timestamp of the last completed candlestick received to poll for future // candlesticks but avoid receiving the previous candlestick repeatedly. // [default=True] IncludeFirst bool `json:"includeFirst"` // The hour of the day (in the specified timezone) to use for granularities // that have daily alignments. // [default=17, minimum=0, maximum=23] DailyAlignment int `json:"dailyAlignment"` // The timezone to use for the dailyAlignment parameter. Candlesticks with daily // alignment will be aligned to the dailyAlignment hour within the alignmentTimezone. // Note that the returned times will still be represented in UTC. // [default=America/New_York] AlignmentTimezone string `json:"alignmentTimezone"` // The day of the week used for granularities that have weekly alignment. // [default=Friday] WeeklyAlignment WeeklyAlignment `json:"weeklyAlignment"` // The number of units used to calculate the volume-weighted average bid and ask // prices in the returned candles. // [default=1] Units DecimalNumber `json:"units"` }
func NewAccountInstrumentCandlesRequest ¶
func NewAccountInstrumentCandlesRequest(instrument InstrumentName, from time.Time) *PricingCandlesRequest
func (*PricingCandlesRequest) AppendQuery ¶
func (s *PricingCandlesRequest) AppendQuery(b *bytebufferpool.ByteBuffer) string
func (PricingCandlesRequest) MarshalEasyJSON ¶
func (v PricingCandlesRequest) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (PricingCandlesRequest) MarshalJSON ¶
func (v PricingCandlesRequest) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*PricingCandlesRequest) UnmarshalEasyJSON ¶
func (v *PricingCandlesRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*PricingCandlesRequest) UnmarshalJSON ¶
func (v *PricingCandlesRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
func (*PricingCandlesRequest) WithAlignmentTimezone ¶
func (s *PricingCandlesRequest) WithAlignmentTimezone(timezone string) *PricingCandlesRequest
The timezone to use for the dailyAlignment parameter. Candlesticks with daily alignment will be aligned to the dailyAlignment hour within the alignmentTimezone. Note that the returned times will still be represented in UTC. [default=America/New_York]
func (*PricingCandlesRequest) WithCount ¶
func (s *PricingCandlesRequest) WithCount(count int) *PricingCandlesRequest
The number of candlesticks to return in the response. Count should not be specified if both the start and end parameters are provided, as the time range combined with the granularity will determine the number of candlesticks to return. [default=500, maximum=5000]
func (*PricingCandlesRequest) WithDailyAlignment ¶
func (s *PricingCandlesRequest) WithDailyAlignment(dailyAlignment int) *PricingCandlesRequest
The hour of the day (in the specified timezone) to use for granularities that have daily alignments. [default=17, minimum=0, maximum=23]
func (*PricingCandlesRequest) WithFrom ¶
func (s *PricingCandlesRequest) WithFrom(from time.Time) *PricingCandlesRequest
The start of the time range to fetch candlesticks for.
func (*PricingCandlesRequest) WithGranularity ¶
func (s *PricingCandlesRequest) WithGranularity(granularity CandlestickGranularity) *PricingCandlesRequest
The granularity of the candlesticks to fetch. [default=S5]
func (*PricingCandlesRequest) WithIncludeFirst ¶
func (s *PricingCandlesRequest) WithIncludeFirst(includeFirst bool) *PricingCandlesRequest
A flag that controls whether the candlestick that is covered by the from time should be included in the results. This flag enables clients to use the timestamp of the last completed candlestick received to poll for future candlesticks but avoid receiving the previous candlestick repeatedly. [default=True]
func (*PricingCandlesRequest) WithPrice ¶
func (s *PricingCandlesRequest) WithPrice(price PricingComponent) *PricingCandlesRequest
The Price component(s) to get candlestick data for. [default=M]
func (*PricingCandlesRequest) WithRange ¶
func (s *PricingCandlesRequest) WithRange(from, to time.Time) *PricingCandlesRequest
The start of the time range to fetch candlesticks for. The end of the time range to fetch candlesticks for.
func (*PricingCandlesRequest) WithSmooth ¶
func (s *PricingCandlesRequest) WithSmooth(v bool) *PricingCandlesRequest
A flag that controls whether the candlestick is “smoothed” or not. A smoothed candlestick uses the previous candle’s close price as its open price, while an un-smoothed candlestick uses the first price from its time range as its open price. [default=False]
func (*PricingCandlesRequest) WithTo ¶
func (s *PricingCandlesRequest) WithTo(to time.Time) *PricingCandlesRequest
The end of the time range to fetch candlesticks for.
func (*PricingCandlesRequest) WithUnits ¶
func (s *PricingCandlesRequest) WithUnits(units DecimalNumber) *PricingCandlesRequest
The number of units used to calculate the volume-weighted average bid and ask prices in the returned candles. [default=1]
func (*PricingCandlesRequest) WithWeeklyAlignment ¶
func (s *PricingCandlesRequest) WithWeeklyAlignment(alignment WeeklyAlignment) *PricingCandlesRequest
The day of the week used for granularities that have weekly alignment. [default=Friday]
type PricingCandlesResponse ¶
type PricingCandlesResponse struct { // The instrument whose Prices are represented by the candlesticks. Instrument InstrumentName `json:"instrument"` // The granularity of the candlesticks provided. Granularity CandlestickGranularity `json:"granularity"` // The list of candlesticks that satisfy the request. Candles []*Candlestick `json:"candles"` }
func (PricingCandlesResponse) MarshalEasyJSON ¶
func (v PricingCandlesResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (PricingCandlesResponse) MarshalJSON ¶
func (v PricingCandlesResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*PricingCandlesResponse) UnmarshalEasyJSON ¶
func (v *PricingCandlesResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*PricingCandlesResponse) UnmarshalJSON ¶
func (v *PricingCandlesResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type PricingComponent ¶
type PricingComponent string
The Price component(s) to get candlestick data for.
const ( PricingComponent_BID PricingComponent = "B" // Bid candles PricingComponent_ASK PricingComponent = "A" // Ask candles PricingComponent_MID PricingComponent = "M" // Midpoint candles PricingComponent_BID_ASK PricingComponent = "BA" // Bid/Ask candles PricingComponent_BID_ASK_MID PricingComponent = "BAM" // Bid/Ask/Midpoint candles )
type PricingHeartbeat ¶
type PricingHeartbeat struct { // The string “HEARTBEAT” Type string `json:"type"` // The date/time when the PricingHeartbeat was created. Time DateTime `json:"time"` }
A PricingHeartbeat object is injected into the Pricing stream to ensure that the HTTP connection remains active.
func (PricingHeartbeat) MarshalEasyJSON ¶
func (v PricingHeartbeat) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (PricingHeartbeat) MarshalJSON ¶
func (v PricingHeartbeat) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*PricingHeartbeat) UnmarshalEasyJSON ¶
func (v *PricingHeartbeat) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*PricingHeartbeat) UnmarshalJSON ¶
func (v *PricingHeartbeat) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type PricingRequest ¶
type PricingRequest struct { // List of Instruments to get pricing for. // [required] Instruments []InstrumentName `json:"instruments"` // Date/Time filter to apply to the response. Only prices and home conversions // (if requested) with a time later than this filter (i.e. the price has changed // after the since time) will be provided, and are filtered independently. Since DateTime `json:"since"` // Flag that enables the inclusion of the unitsAvailable field in the returned // Price objects. // [default=True] // Deprecated: Will be removed in a future API update. IncludeUnitsAvailable bool `json:"includeUnitsAvailable"` // Flag that enables the inclusion of the homeConversions field in the returned response. // An entry will be returned for each currency in the set of all base and quote currencies // present in the requested instruments list. // [default=False] IncludeHomeConversions bool `json:"includeHomeConversions"` }
func NewPricingRequest ¶
func NewPricingRequest() *PricingRequest
func (*PricingRequest) AppendQuery ¶
func (p *PricingRequest) AppendQuery(b *bytebufferpool.ByteBuffer)
func (PricingRequest) MarshalEasyJSON ¶
func (v PricingRequest) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (PricingRequest) MarshalJSON ¶
func (v PricingRequest) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*PricingRequest) UnmarshalEasyJSON ¶
func (v *PricingRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*PricingRequest) UnmarshalJSON ¶
func (v *PricingRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
func (*PricingRequest) WithIncludeHomeConversions ¶
func (p *PricingRequest) WithIncludeHomeConversions(includeHomeConversions bool) *PricingRequest
Flag that enables the inclusion of the homeConversions field in the returned response. An entry will be returned for each currency in the set of all base and quote currencies present in the requested instruments list. [default=False]
func (*PricingRequest) WithInstruments ¶
func (p *PricingRequest) WithInstruments(instruments ...InstrumentName) *PricingRequest
List of Instruments to get pricing for. [required]
func (*PricingRequest) WithSince ¶
func (p *PricingRequest) WithSince(since time.Time) *PricingRequest
Date/Time filter to apply to the response. Only prices and home conversions (if requested) with a time later than this filter (i.e. the price has changed after the since time) will be provided, and are filtered independently.
type PricingResponse ¶
type PricingResponse struct { // The list of Price objects requested. Prices []*ClientPrice `json:"prices"` // The list of home currency conversion factors requested. This field will // only be present if includeHomeConversions was set to true in the request. HomeConversions []*HomeConversions `json:"homeConversions"` // The DateTime value to use for the “since” parameter in the next poll request. Time DateTime `json:"time"` }
func (PricingResponse) MarshalEasyJSON ¶
func (v PricingResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (PricingResponse) MarshalJSON ¶
func (v PricingResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*PricingResponse) UnmarshalEasyJSON ¶
func (v *PricingResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*PricingResponse) UnmarshalJSON ¶
func (v *PricingResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type PricingStreamRequest ¶
type PricingStreamRequest struct { // List of Instruments to stream Prices for. // [required] Instruments []InstrumentName `json:"instruments"` // Flag that enables/disables the sending of a pricing snapshot when // initially connecting to the stream. // [default=True] Snapshot bool `json:"snapshot"` // Flag that enables the inclusion of the homeConversions field in the // returned response. An entry will be returned for each currency in // the set of all base and quote currencies present in the requested // instruments list. // [default=False] IncludeHomeConversions bool `json:"includeHomeConversions"` }
func NewPricingStreamRequest ¶
func NewPricingStreamRequest(instruments ...InstrumentName) *PricingStreamRequest
func (*PricingStreamRequest) AppendQuery ¶
func (p *PricingStreamRequest) AppendQuery(url *bytebufferpool.ByteBuffer)
func (PricingStreamRequest) MarshalEasyJSON ¶
func (v PricingStreamRequest) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (PricingStreamRequest) MarshalJSON ¶
func (v PricingStreamRequest) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*PricingStreamRequest) UnmarshalEasyJSON ¶
func (v *PricingStreamRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*PricingStreamRequest) UnmarshalJSON ¶
func (v *PricingStreamRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
func (*PricingStreamRequest) WithIncludeHomeConversions ¶
func (p *PricingStreamRequest) WithIncludeHomeConversions(includeHomeConversions bool) *PricingStreamRequest
Flag that enables the inclusion of the homeConversions field in the returned response. An entry will be returned for each currency in the set of all base and quote currencies present in the requested instruments list. [default=False]
func (*PricingStreamRequest) WithInstruments ¶
func (p *PricingStreamRequest) WithInstruments(instruments ...InstrumentName) *PricingStreamRequest
List of Instruments to stream Prices for. [required]
func (*PricingStreamRequest) WithSnapshot ¶
func (p *PricingStreamRequest) WithSnapshot(snapshot bool) *PricingStreamRequest
Flag that enables/disables the sending of a pricing snapshot when initially connecting to the stream. [default=True]
type QuoteHomeConversionFactors ¶
type QuoteHomeConversionFactors struct { // The factor used to convert a positive amount of the Price’s Instrument’s // quote currency into a positive amount of the Account’s home currency. // Conversion is performed by multiplying the quote units by the conversion // factor. PositiveUnits DecimalNumber `json:"positiveUnits"` // The factor used to convert a negative amount of the Price’s Instrument’s // quote currency into a negative amount of the Account’s home currency. // Conversion is performed by multiplying the quote units by the conversion // factor. NegativeUnits DecimalNumber `json:"negativeUnits"` }
QuoteHomeConversionFactors represents the factors that can be used used to convert quantities of a Price’s Instrument’s quote currency into the Account’s home currency.
func (QuoteHomeConversionFactors) MarshalEasyJSON ¶
func (v QuoteHomeConversionFactors) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (QuoteHomeConversionFactors) MarshalJSON ¶
func (v QuoteHomeConversionFactors) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*QuoteHomeConversionFactors) UnmarshalEasyJSON ¶
func (v *QuoteHomeConversionFactors) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*QuoteHomeConversionFactors) UnmarshalJSON ¶
func (v *QuoteHomeConversionFactors) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type ReopenTransaction ¶
type ReopenTransaction struct { Transaction // The Type of the Transaction. Always set to “REOPEN” in a ReopenTransaction. Type TransactionType `json:"type"` }
A ReopenTransaction represents the re-opening of a closed Account.
func (ReopenTransaction) MarshalEasyJSON ¶
func (v ReopenTransaction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (ReopenTransaction) MarshalJSON ¶
func (v ReopenTransaction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*ReopenTransaction) UnmarshalEasyJSON ¶
func (v *ReopenTransaction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*ReopenTransaction) UnmarshalJSON ¶
func (v *ReopenTransaction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type ResetResettablePLTransaction ¶
type ResetResettablePLTransaction struct { Transaction // The Type of the Transaction. Always set to “RESET_RESETTABLE_PL” for a ResetResettablePLTransaction. Type TransactionType `json:"type"` }
A ResetResettablePLTransaction represents the resetting of the Account’s resettable PL counters.
func (ResetResettablePLTransaction) MarshalEasyJSON ¶
func (v ResetResettablePLTransaction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (ResetResettablePLTransaction) MarshalJSON ¶
func (v ResetResettablePLTransaction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*ResetResettablePLTransaction) UnmarshalEasyJSON ¶
func (v *ResetResettablePLTransaction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*ResetResettablePLTransaction) UnmarshalJSON ¶
func (v *ResetResettablePLTransaction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type StopLossDetails ¶
type StopLossDetails struct { // The price that the Stop Loss Order will be triggered at. Only one of the // price and distance fields may be specified. Price PriceValue `json:"price"` // Specifies the distance (in price units) from the Trade’s open price to // use as the Stop Loss Order price. Only one of the distance and price // fields may be specified. Distance DecimalNumber `json:"distance"` // The time in force for the created Stop Loss Order. This may only be GTC, GTD or GFD. TimeInForce TimeInForce `json:"timeInForce"` // The date when the Stop Loss Order will be cancelled on if timeInForce is GTD. GtdTime DateTime `json:"gtdTime"` // The Client Extensions to add to the Stop Loss Order when created. ClientExtensions *ClientExtensions `json:"clientExtensions"` }
StopLossDetails specifies the details of a Stop Loss Order to be created on behalf of a client. This may happen when an Order is filled that opens a Trade requiring a Stop Loss, or when a Trade’s dependent Stop Loss Order is modified directly through the Trade.
func (StopLossDetails) MarshalEasyJSON ¶
func (v StopLossDetails) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (StopLossDetails) MarshalJSON ¶
func (v StopLossDetails) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*StopLossDetails) UnmarshalEasyJSON ¶
func (v *StopLossDetails) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*StopLossDetails) UnmarshalJSON ¶
func (v *StopLossDetails) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type StopLossOrder ¶
type StopLossOrder struct { Order // The type of the Order. Always set to “STOP_LOSS” for Stop Loss Orders. Type OrderType `json:"type"` // The premium that will be charged if the Stop Loss Order is guaranteed and the Order // is filled at the guaranteed price. It is in price units and is charged for each unit // of the Trade. Deprecated: Will be removed in a future API update. GuaranteedExecutionPremium DecimalNumber `json:"guaranteedExecutionPremium"` // The ID of the Trade to close when the price threshold is breached. TradeID TradeID `json:"tradeID"` // The client ID of the Trade to be closed when the price threshold is breached. ClientTradeID ClientID `json:"clientTradeID"` // The price threshold specified for the Stop Loss Order. The associated Trade will // be closed by a market price that is equal to or worse than this threshold. Price PriceValue `json:"price"` // Specifies the distance (in price units) from the Account’s current price to use // as the Stop Loss Order price. If the Trade is short the Instrument’s bid price // is used, and for long Trades the ask is used. Distance DecimalNumber `json:"distance"` // The time-in-force requested for the StopLoss Order. Restricted to “GTC”, “GFD” // and “GTD” for StopLoss Orders. TimeInForce TimeInForce `json:"timeInForce"` // The date/time when the StopLoss Order will be cancelled if its timeInForce is “GTD”. GtdTime DateTime `json:"gtdTime"` // Specification of which price component should be used when determining if an Order // should be triggered and filled. This allows Orders to be triggered based on the bid, // ask, mid, default (ask for buy, bid for sell) or inverse (ask for sell, bid for buy) // price depending on the desired behaviour. Orders are always filled using their default // price component. This feature is only provided through the REST API. Clients who // choose to specify a non-default trigger condition will not see it reflected in any // of OANDA’s proprietary or partner trading platforms, their transaction history // or their account statements. OANDA platforms always assume that an Order’s trigger // condition is set to the default value when indicating the distance from an Order’s // trigger price, and will always provide the default trigger condition when creating // or modifying an Order. A special restriction applies when creating a Guaranteed Stop // Loss Order. In this case the TriggerCondition value must either be “DEFAULT”, // or the “natural” trigger side “DEFAULT” results in. So for a Guaranteed Stop // Loss Order for a long trade valid values are “DEFAULT” and “BID”, and for // short trades “DEFAULT” and “ASK” are valid. TriggerCondition OrderTriggerCondition `json:"triggerCondition"` // Flag indicating that the Stop Loss Order is guaranteed. The default value depends // on the GuaranteedStopLossOrderMode of the account, if it is REQUIRED, the default // will be true, for DISABLED or ENABLED the default is false. Deprecated: Will be // removed in a future API update. Guaranteed bool `json:"guaranteed"` // ID of the Transaction that filled this Order (only provided when the Order’s state // is FILLED) FillingTransactionID TransactionID `json:"fillingTransactionID"` // Date/time when the Order was filled (only provided when the Order’s state is FILLED) FilledTime DateTime `json:"filledTime"` // Trade ID of Trade opened when the Order was filled (only provided when the Order’s // state is FILLED and a Trade was opened as a result of the fill) TradeOpenedID TradeID `json:"tradeOpenedID"` // Trade ID of Trade reduced when the Order was filled (only provided when the Order’s // state is FILLED and a Trade was reduced as a result of the fill) TradeReducedID TradeID `json:"tradeReducedID"` // Trade IDs of Trades closed when the Order was filled (only provided when the Order’s // state is FILLED and one or more Trades were closed as a result of the fill) TradeClosedIDs []TradeID `json:"tradeClosedIDs"` // ID of the Transaction that cancelled the Order (only provided when the Order’s // state is CANCELLED) CancellingTransactionID TransactionID `json:"cancellingTransactionID"` // Date/time when the Order was cancelled (only provided when the state of the Order // is CANCELLED) CancelledTime DateTime `json:"cancelledTime"` // The ID of the Order that was replaced by this Order (only provided if this Order // was created as part of a cancel/replace). ReplacesOrderID OrderID `json:"replacesOrderID"` // The ID of the Order that replaced this Order (only provided if this Order was cancelled // as part of a cancel/replace). ReplacedByOrderID OrderID `json:"replacedByOrderID"` }
A StopLossOrder is an order that is linked to an open Trade and created with a price threshold. The Order will be filled (closing the Trade) by the first price that is equal to or worse than the threshold. A StopLossOrder cannot be used to open a new Position.
func (StopLossOrder) MarshalEasyJSON ¶
func (v StopLossOrder) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (StopLossOrder) MarshalJSON ¶
func (v StopLossOrder) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*StopLossOrder) UnmarshalEasyJSON ¶
func (v *StopLossOrder) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*StopLossOrder) UnmarshalJSON ¶
func (v *StopLossOrder) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type StopLossOrderReason ¶
type StopLossOrderReason string
The reason that the Stop Loss Order was initiated
type StopLossOrderRejectTransaction ¶
type StopLossOrderRejectTransaction struct { Transaction // The Type of the Transaction. Always set to “STOP_LOSS_ORDER_REJECT” in a StopLossOrderRejectTransaction. Type TransactionType `json:"type"` // The ID of the Trade to close when the price threshold is breached. TradeID TradeID `json:"tradeID"` // The client ID of the Trade to be closed when the price threshold is breached. ClientTradeID ClientID `json:"clientTradeID"` // The price threshold specified for the Stop Loss Order. The associated Trade will // be closed by a market price that is equal to or worse than this threshold. Price PriceValue `json:"price"` // Specifies the distance (in price units) from the Account’s current price to use // as the Stop Loss Order price. If the Trade is short the Instrument’s bid price // is used, and for long Trades the ask is used. Distance DecimalNumber `json:"distance"` // The time-in-force requested for the StopLoss Order. Restricted to “GTC”, “GFD” // and “GTD” for StopLoss Orders. TimeInForce TimeInForce `json:"timeInForce"` // The date/time when the StopLoss Order will be cancelled if its timeInForce is “GTD”. GtdTime DateTime `json:"gtdTime"` // Specification of which price component should be used when determining if an Order // should be triggered and filled. This allows Orders to be triggered based on the bid, // ask, mid, default (ask for buy, bid for sell) or inverse (ask for sell, bid for buy) // price depending on the desired behaviour. Orders are always filled using their default // price component. This feature is only provided through the REST API. Clients who // choose to specify a non-default trigger condition will not see it reflected in any // of OANDA’s proprietary or partner trading platforms, their transaction history // or their account statements. OANDA platforms always assume that an Order’s trigger // condition is set to the default value when indicating the distance from an Order’s // trigger price, and will always provide the default trigger condition when creating // or modifying an Order. A special restriction applies when creating a Guaranteed Stop // Loss Order. In this case the TriggerCondition value must either be “DEFAULT”, // or the “natural” trigger side “DEFAULT” results in. So for a Guaranteed Stop // Loss Order for a long trade valid values are “DEFAULT” and “BID”, and for // short trades “DEFAULT” and “ASK” are valid. TriggerCondition OrderTriggerCondition `json:"triggerCondition"` // Flag indicating that the Stop Loss Order is guaranteed. The default value depends // on the GuaranteedStopLossOrderMode of the account, if it is REQUIRED, the default // will be true, for DISABLED or ENABLED the default is false. Deprecated: Will be // removed in a future API update. Guaranteed bool `json:"guaranteed"` // The reason that the Stop Loss Order was initiated Reason StopLossOrderReason `json:"reason"` // Client Extensions to add to the Order (only provided if the Order is being created // with client extensions). ClientExtensions *ClientExtensions `json:"clientExtensions"` // The ID of the OrderFill Transaction that caused this Order to be created (only provided // if this Order was created automatically when another Order was filled). OrderFillTransactionID TransactionID `json:"orderFillTransactionID"` // The ID of the Order that this Order was intended to replace (only provided if this // Order was intended to replace an existing Order). IntendedReplacesOrderID OrderID `json:"intendedReplacesOrderID"` // The reason that the Reject Transaction was created RejectReason TransactionRejectReason `json:"rejectReason"` }
A StopLossOrderRejectTransaction represents the rejection of the creation of a StopLoss Order.
func (StopLossOrderRejectTransaction) MarshalEasyJSON ¶
func (v StopLossOrderRejectTransaction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (StopLossOrderRejectTransaction) MarshalJSON ¶
func (v StopLossOrderRejectTransaction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*StopLossOrderRejectTransaction) UnmarshalEasyJSON ¶
func (v *StopLossOrderRejectTransaction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*StopLossOrderRejectTransaction) UnmarshalJSON ¶
func (v *StopLossOrderRejectTransaction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type StopLossOrderRequest ¶
type StopLossOrderRequest struct { BaseOrderRequest // The type of the Order to Create. Must be set to “STOP_LOSS” when creating a // Stop Loss Order. Type OrderType `json:"type"` // The ID of the Trade to close when the price threshold is breached. TradeID TradeID `json:"tradeID"` // The client ID of the Trade to be closed when the price threshold is breached. ClientTradeID ClientID `json:"clientTradeID"` // The price threshold specified for the Stop Loss Order. The associated Trade will // be closed by a market price that is equal to or worse than this threshold. Price PriceValue `json:"price"` // Specifies the distance (in price units) from the Account’s current price to use // as the Stop Loss Order price. If the Trade is short the Instrument’s bid price // is used, and for long Trades the ask is used. Distance DecimalNumber `json:"distance"` // The time-in-force requested for the StopLoss Order. Restricted to “GTC”, “GFD” // and “GTD” for StopLoss Orders. TimeInForce TimeInForce `json:"timeInForce"` // The date/time when the StopLoss Order will be cancelled if its timeInForce is “GTD”. GtdTime DateTime `json:"gtdTime"` // Specification of which price component should be used when determining if an Order // should be triggered and filled. This allows Orders to be triggered based on the bid, // ask, mid, default (ask for buy, bid for sell) or inverse (ask for sell, bid for buy) // price depending on the desired behaviour. Orders are always filled using their default // price component. This feature is only provided through the REST API. Clients who // choose to specify a non-default trigger condition will not see it reflected in any // of OANDA’s proprietary or partner trading platforms, their transaction history // or their account statements. OANDA platforms always assume that an Order’s trigger // condition is set to the default value when indicating the distance from an Order’s // trigger price, and will always provide the default trigger condition when creating // or modifying an Order. A special restriction applies when creating a Guaranteed Stop // Loss Order. In this case the TriggerCondition value must either be “DEFAULT”, // or the “natural” trigger side “DEFAULT” results in. So for a Guaranteed Stop // Loss Order for a long trade valid values are “DEFAULT” and “BID”, and for // short trades “DEFAULT” and “ASK” are valid. TriggerCondition OrderTriggerCondition `json:"triggerCondition"` // Flag indicating that the Stop Loss Order is guaranteed. The default value depends // on the GuaranteedStopLossOrderMode of the account, if it is REQUIRED, the default // will be true, for DISABLED or ENABLED the default is false. Deprecated: Will be // removed in a future API update. Guaranteed bool `json:"guaranteed"` // The client extensions to add to the Order. Do not set, modify, or delete clientExtensions // if your account is associated with MT4. ClientExtensions *ClientExtensions `json:"clientExtensions"` }
A StopLossOrderRequest specifies the parameters that may be set when creating a Stop Loss Order. Only one of the price and distance fields may be specified.
func (StopLossOrderRequest) MarshalEasyJSON ¶
func (v StopLossOrderRequest) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (StopLossOrderRequest) MarshalJSON ¶
func (v StopLossOrderRequest) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*StopLossOrderRequest) UnmarshalEasyJSON ¶
func (v *StopLossOrderRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*StopLossOrderRequest) UnmarshalJSON ¶
func (v *StopLossOrderRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type StopLossOrderTransaction ¶
type StopLossOrderTransaction struct { Transaction // The Type of the Transaction. Always set to “STOP_LOSS_ORDER” in a StopLossOrderTransaction. Type TransactionType `json:"type"` // The ID of the Trade to close when the price threshold is breached. TradeID TradeID `json:"tradeID"` // The client ID of the Trade to be closed when the price threshold is breached. ClientTradeID ClientID `json:"clientTradeID"` // The price threshold specified for the Stop Loss Order. The associated Trade will // be closed by a market price that is equal to or worse than this threshold. Price PriceValue `json:"price"` // Specifies the distance (in price units) from the Account’s current price to use // as the Stop Loss Order price. If the Trade is short the Instrument’s bid price // is used, and for long Trades the ask is used. Distance DecimalNumber `json:"distance"` // The time-in-force requested for the StopLoss Order. Restricted to “GTC”, “GFD” // and “GTD” for StopLoss Orders. TimeInForce TimeInForce `json:"timeInForce"` // The date/time when the StopLoss Order will be cancelled if its timeInForce is “GTD”. GtdTime DateTime `json:"gtdTime"` // Specification of which price component should be used when determining if an Order // should be triggered and filled. This allows Orders to be triggered based on the bid, // ask, mid, default (ask for buy, bid for sell) or inverse (ask for sell, bid for buy) // price depending on the desired behaviour. Orders are always filled using their default // price component. This feature is only provided through the REST API. Clients who // choose to specify a non-default trigger condition will not see it reflected in any // of OANDA’s proprietary or partner trading platforms, their transaction history // or their account statements. OANDA platforms always assume that an Order’s trigger // condition is set to the default value when indicating the distance from an Order’s // trigger price, and will always provide the default trigger condition when creating // or modifying an Order. A special restriction applies when creating a Guaranteed Stop // Loss Order. In this case the TriggerCondition value must either be “DEFAULT”, // or the “natural” trigger side “DEFAULT” results in. So for a Guaranteed Stop // Loss Order for a long trade valid values are “DEFAULT” and “BID”, and for // short trades “DEFAULT” and “ASK” are valid. TriggerCondition OrderTriggerCondition `json:"triggerCondition"` // Flag indicating that the Stop Loss Order is guaranteed. The default value depends // on the GuaranteedStopLossOrderMode of the account, if it is REQUIRED, the default // will be true, for DISABLED or ENABLED the default is false. Deprecated: Will be // removed in a future API update. Guaranteed bool `json:"guaranteed"` // The fee that will be charged if the Stop Loss Order is guaranteed and the Order // is filled at the guaranteed price. The value is determined at Order creation time. // It is in price units and is charged for each unit of the Trade. Deprecated: Will // be removed in a future API update. GuaranteedExecutionPremium DecimalNumber `json:"guaranteedExecutionPremium"` // The reason that the Stop Loss Order was initiated Reason StopLossOrderReason `json:"reason"` // Client Extensions to add to the Order (only provided if the Order is being created // with client extensions). ClientExtensions *ClientExtensions `json:"clientExtensions"` // The ID of the OrderFill Transaction that caused this Order to be created (only provided // if this Order was created automatically when another Order was filled). OrderFillTransactionID TransactionID `json:"orderFillTransactionID"` // The ID of the Order that this Order replaces (only provided if this Order replaces // an existing Order). ReplacesOrderID OrderID `json:"replacesOrderID"` // The ID of the Transaction that cancels the replaced Order (only provided if this // Order replaces an existing Order). CancellingTransactionID TransactionID `json:"cancellingTransactionID"` }
A StopLossOrderTransaction represents the creation of a StopLoss Order in the user’s Account.
func (StopLossOrderTransaction) MarshalEasyJSON ¶
func (v StopLossOrderTransaction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (StopLossOrderTransaction) MarshalJSON ¶
func (v StopLossOrderTransaction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*StopLossOrderTransaction) UnmarshalEasyJSON ¶
func (v *StopLossOrderTransaction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*StopLossOrderTransaction) UnmarshalJSON ¶
func (v *StopLossOrderTransaction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type StopOrder ¶
type StopOrder struct { Order // The type of the Order. Always set to “STOP” for Stop Orders. Type OrderType `json:"type"` // The Stop Order’s Instrument. Instrument InstrumentName `json:"instrument"` // The quantity requested to be filled by the Stop Order. A positive number of units // results in a long Order, and a negative number of units results in a short Order. Units DecimalNumber `json:"units"` // The price threshold specified for the Stop Order. The Stop Order will only be filled // by a market price that is equal to or worse than this price. Price PriceValue `json:"price"` // The worst market price that may be used to fill this Stop Order. If the market gaps // and crosses through both the price and the priceBound, the Stop Order will be cancelled // instead of being filled. PriceBound PriceValue `json:"priceBound"` // The time-in-force requested for the Stop Order. TimeInForce TimeInForce `json:"timeInForce"` // The date/time when the Stop Order will be cancelled if its timeInForce is “GTD”. GtdTime DateTime `json:"gtdTime"` // Specification of how Positions in the Account are modified when the Order is filled. PositionFill OrderPositionFill `json:"positionFill"` // Specification of which price component should be used when determining if an Order // should be triggered and filled. This allows Orders to be triggered based on the bid, // ask, mid, default (ask for buy, bid for sell) or inverse (ask for sell, bid for buy) // price depending on the desired behaviour. Orders are always filled using their default // price component. This feature is only provided through the REST API. Clients who // choose to specify a non-default trigger condition will not see it reflected in any // of OANDA’s proprietary or partner trading platforms, their transaction history // or their account statements. OANDA platforms always assume that an Order’s trigger // condition is set to the default value when indicating the distance from an Order’s // trigger price, and will always provide the default trigger condition when creating // or modifying an Order. A special restriction applies when creating a Guaranteed Stop // Loss Order. In this case the TriggerCondition value must either be “DEFAULT”, // or the “natural” trigger side “DEFAULT” results in. So for a Guaranteed Stop // Loss Order for a long trade valid values are “DEFAULT” and “BID”, and for // short trades “DEFAULT” and “ASK” are valid. TriggerCondition OrderTriggerCondition `json:"triggerCondition"` // TakeProfitDetails specifies the details of a Take Profit Order to be created on // behalf of a client. This may happen when an Order is filled that opens a Trade requiring // a Take Profit, or when a Trade’s dependent Take Profit Order is modified directly // through the Trade. TakeProfitOnFill *TakeProfitDetails `json:"takeProfitOnFill"` // StopLossDetails specifies the details of a Stop Loss Order to be created on behalf // of a client. This may happen when an Order is filled that opens a Trade requiring // a Stop Loss, or when a Trade’s dependent Stop Loss Order is modified directly through // the Trade. StopLossOnFill *StopLossDetails `json:"stopLossOnFill"` // GuaranteedStopLossDetails specifies the details of a Guaranteed Stop Loss Order // to be created on behalf of a client. This may happen when an Order is filled that // opens a Trade requiring a Guaranteed Stop Loss, or when a Trade’s dependent Guaranteed // Stop Loss Order is modified directly through the Trade. GuaranteedStopLossOnFill *GuaranteedStopLossDetails `json:"guaranteedStopLossOnFill"` // TrailingStopLossDetails specifies the details of a Trailing Stop Loss Order to be // created on behalf of a client. This may happen when an Order is filled that opens // a Trade requiring a Trailing Stop Loss, or when a Trade’s dependent Trailing Stop // Loss Order is modified directly through the Trade. TrailingStopLossOnFill *TrailingStopLossDetails `json:"trailingStopLossOnFill"` // Client Extensions to add to the Trade created when the Order is filled (if such // a Trade is created). Do not set, modify, or delete tradeClientExtensions if your // account is associated with MT4. TradeClientExtensions *ClientExtensions `json:"tradeClientExtensions"` // ID of the Transaction that filled this Order (only provided when the Order’s state // is FILLED) FillingTransactionID TransactionID `json:"fillingTransactionID"` // Date/time when the Order was filled (only provided when the Order’s state is FILLED) FilledTime DateTime `json:"filledTime"` // Trade ID of Trade opened when the Order was filled (only provided when the Order’s // state is FILLED and a Trade was opened as a result of the fill) TradeOpenedID TradeID `json:"tradeOpenedID"` // Trade ID of Trade reduced when the Order was filled (only provided when the Order’s // state is FILLED and a Trade was reduced as a result of the fill) TradeReducedID TradeID `json:"tradeReducedID"` // Trade IDs of Trades closed when the Order was filled (only provided when the Order’s // state is FILLED and one or more Trades were closed as a result of the fill) TradeClosedIDs []TradeID `json:"tradeClosedIDs"` // ID of the Transaction that cancelled the Order (only provided when the Order’s // state is CANCELLED) CancellingTransactionID TransactionID `json:"cancellingTransactionID"` // Date/time when the Order was cancelled (only provided when the state of the Order // is CANCELLED) CancelledTime DateTime `json:"cancelledTime"` // The ID of the Order that was replaced by this Order (only provided if this Order // was created as part of a cancel/replace). ReplacesOrderID OrderID `json:"replacesOrderID"` // The ID of the Order that replaced this Order (only provided if this Order was cancelled // as part of a cancel/replace). ReplacedByOrderID OrderID `json:"replacedByOrderID"` }
A StopOrder is an order that is created with a price threshold, and will only be filled by a price that is equal to or worse than the threshold.
func (StopOrder) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (StopOrder) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*StopOrder) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*StopOrder) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type StopOrderRejectTransaction ¶
type StopOrderRejectTransaction struct { Transaction // The Type of the Transaction. Always set to “STOP_ORDER_REJECT” in a StopOrderRejectTransaction. Type TransactionType `json:"type"` // The Stop Order’s Instrument. Instrument InstrumentName `json:"instrument"` // The quantity requested to be filled by the Stop Order. A positive number of units // results in a long Order, and a negative number of units results in a short Order. Units DecimalNumber `json:"units"` // The price threshold specified for the Stop Order. The Stop Order will only be filled // by a market price that is equal to or worse than this price. Price PriceValue `json:"price"` // The worst market price that may be used to fill this Stop Order. If the market gaps // and crosses through both the price and the priceBound, the Stop Order will be cancelled // instead of being filled. PriceBound PriceValue `json:"priceBound"` // The time-in-force requested for the Stop Order. TimeInForce TimeInForce `json:"timeInForce"` // The date/time when the Stop Order will be cancelled if its timeInForce is “GTD”. GtdTime DateTime `json:"gtdTime"` // Specification of how Positions in the Account are modified when the Order is filled. PositionFill OrderPositionFill `json:"positionFill"` // Specification of which price component should be used when determining if an Order // should be triggered and filled. This allows Orders to be triggered based on the bid, // ask, mid, default (ask for buy, bid for sell) or inverse (ask for sell, bid for buy) // price depending on the desired behaviour. Orders are always filled using their default // price component. This feature is only provided through the REST API. Clients who // choose to specify a non-default trigger condition will not see it reflected in any // of OANDA’s proprietary or partner trading platforms, their transaction history // or their account statements. OANDA platforms always assume that an Order’s trigger // condition is set to the default value when indicating the distance from an Order’s // trigger price, and will always provide the default trigger condition when creating // or modifying an Order. A special restriction applies when creating a Guaranteed Stop // Loss Order. In this case the TriggerCondition value must either be “DEFAULT”, // or the “natural” trigger side “DEFAULT” results in. So for a Guaranteed Stop // Loss Order for a long trade valid values are “DEFAULT” and “BID”, and for // short trades “DEFAULT” and “ASK” are valid. TriggerCondition OrderTriggerCondition `json:"triggerCondition"` // The reason that the Stop Order was initiated Reason StopOrderReason `json:"reason"` // Client Extensions to add to the Order (only provided if the Order is being created // with client extensions). ClientExtensions *ClientExtensions `json:"clientExtensions"` // The specification of the Take Profit Order that should be created for a Trade opened // when the Order is filled (if such a Trade is created). TakeProfitOnFill *TakeProfitDetails `json:"takeProfitOnFill"` // The specification of the Stop Loss Order that should be created for a Trade opened // when the Order is filled (if such a Trade is created). StopLossOnFill *StopLossDetails `json:"stopLossOnFill"` // The specification of the Trailing Stop Loss Order that should be created for a Trade // that is opened when the Order is filled (if such a Trade is created). TrailingStopLossOnFill *TrailingStopLossDetails `json:"trailingStopLossOnFill"` // The specification of the Guaranteed Stop Loss Order that should be created for a // Trade that is opened when the Order is filled (if such a Trade is created). GuaranteedStopLossOnFill *GuaranteedStopLossDetails `json:"guaranteedStopLossOnFill"` // Client Extensions to add to the Trade created when the Order is filled (if such // a Trade is created). Do not set, modify, delete tradeClientExtensions if your account // is associated with MT4. TradeClientExtensions *ClientExtensions `json:"tradeClientExtensions"` // The ID of the Order that this Order was intended to replace (only provided if this // Order was intended to replace an existing Order). IntendedReplacesOrderID OrderID `json:"intendedReplacesOrderID"` // The reason that the Reject Transaction was created RejectReason TransactionRejectReason `json:"rejectReason"` }
A StopOrderRejectTransaction represents the rejection of the creation of a Stop Order.
func (StopOrderRejectTransaction) MarshalEasyJSON ¶
func (v StopOrderRejectTransaction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (StopOrderRejectTransaction) MarshalJSON ¶
func (v StopOrderRejectTransaction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*StopOrderRejectTransaction) UnmarshalEasyJSON ¶
func (v *StopOrderRejectTransaction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*StopOrderRejectTransaction) UnmarshalJSON ¶
func (v *StopOrderRejectTransaction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type StopOrderRequest ¶
type StopOrderRequest struct { BaseOrderRequest // The type of the Order to Create. Must be set to “STOP” when creating a Stop // Order. Type OrderType `json:"type"` // The Stop Order’s Instrument. Instrument InstrumentName `json:"instrument"` // The quantity requested to be filled by the Stop Order. A positive number of units // results in a long Order, and a negative number of units results in a short Order. Units DecimalNumber `json:"units"` // The price threshold specified for the Stop Order. The Stop Order will only be filled // by a market price that is equal to or worse than this price. Price PriceValue `json:"price"` // The worst market price that may be used to fill this Stop Order. If the market gaps // and crosses through both the price and the priceBound, the Stop Order will be cancelled // instead of being filled. PriceBound PriceValue `json:"priceBound"` // The time-in-force requested for the Stop Order. TimeInForce TimeInForce `json:"timeInForce"` // The date/time when the Stop Order will be cancelled if its timeInForce is “GTD”. GtdTime DateTime `json:"gtdTime"` // Specification of how Positions in the Account are modified when the Order is filled. PositionFill OrderPositionFill `json:"positionFill"` // Specification of which price component should be used when determining if an Order // should be triggered and filled. This allows Orders to be triggered based on the bid, // ask, mid, default (ask for buy, bid for sell) or inverse (ask for sell, bid for buy) // price depending on the desired behaviour. Orders are always filled using their default // price component. This feature is only provided through the REST API. Clients who // choose to specify a non-default trigger condition will not see it reflected in any // of OANDA’s proprietary or partner trading platforms, their transaction history // or their account statements. OANDA platforms always assume that an Order’s trigger // condition is set to the default value when indicating the distance from an Order’s // trigger price, and will always provide the default trigger condition when creating // or modifying an Order. A special restriction applies when creating a Guaranteed Stop // Loss Order. In this case the TriggerCondition value must either be “DEFAULT”, // or the “natural” trigger side “DEFAULT” results in. So for a Guaranteed Stop // Loss Order for a long trade valid values are “DEFAULT” and “BID”, and for // short trades “DEFAULT” and “ASK” are valid. TriggerCondition OrderTriggerCondition `json:"triggerCondition"` // The client extensions to add to the Order. Do not set, modify, or delete clientExtensions // if your account is associated with MT4. ClientExtensions *ClientExtensions `json:"clientExtensions"` // TakeProfitDetails specifies the details of a Take Profit Order to be created on // behalf of a client. This may happen when an Order is filled that opens a Trade requiring // a Take Profit, or when a Trade’s dependent Take Profit Order is modified directly // through the Trade. TakeProfitOnFill *TakeProfitDetails `json:"takeProfitOnFill"` // StopLossDetails specifies the details of a Stop Loss Order to be created on behalf // of a client. This may happen when an Order is filled that opens a Trade requiring // a Stop Loss, or when a Trade’s dependent Stop Loss Order is modified directly through // the Trade. StopLossOnFill *StopLossDetails `json:"stopLossOnFill"` // GuaranteedStopLossDetails specifies the details of a Guaranteed Stop Loss Order // to be created on behalf of a client. This may happen when an Order is filled that // opens a Trade requiring a Guaranteed Stop Loss, or when a Trade’s dependent Guaranteed // Stop Loss Order is modified directly through the Trade. GuaranteedStopLossOnFill *GuaranteedStopLossDetails `json:"guaranteedStopLossOnFill"` // TrailingStopLossDetails specifies the details of a Trailing Stop Loss Order to be // created on behalf of a client. This may happen when an Order is filled that opens // a Trade requiring a Trailing Stop Loss, or when a Trade’s dependent Trailing Stop // Loss Order is modified directly through the Trade. TrailingStopLossOnFill *TrailingStopLossDetails `json:"trailingStopLossOnFill"` // Client Extensions to add to the Trade created when the Order is filled (if such // a Trade is created). Do not set, modify, or delete tradeClientExtensions if your // account is associated with MT4. TradeClientExtensions *ClientExtensions `json:"tradeClientExtensions"` }
A StopOrderRequest specifies the parameters that may be set when creating a Stop Order.
func (StopOrderRequest) MarshalEasyJSON ¶
func (v StopOrderRequest) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (StopOrderRequest) MarshalJSON ¶
func (v StopOrderRequest) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*StopOrderRequest) UnmarshalEasyJSON ¶
func (v *StopOrderRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*StopOrderRequest) UnmarshalJSON ¶
func (v *StopOrderRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type StopOrderTransaction ¶
type StopOrderTransaction struct { Transaction // The Type of the Transaction. Always set to “STOP_ORDER” in a StopOrderTransaction. Type TransactionType `json:"type"` // The Stop Order’s Instrument. Instrument InstrumentName `json:"instrument"` // The quantity requested to be filled by the Stop Order. A positive number of units // results in a long Order, and a negative number of units results in a short Order. Units DecimalNumber `json:"units"` // The price threshold specified for the Stop Order. The Stop Order will only be filled // by a market price that is equal to or worse than this price. Price PriceValue `json:"price"` // The worst market price that may be used to fill this Stop Order. If the market gaps // and crosses through both the price and the priceBound, the Stop Order will be cancelled // instead of being filled. PriceBound PriceValue `json:"priceBound"` // The time-in-force requested for the Stop Order. TimeInForce TimeInForce `json:"timeInForce"` // The date/time when the Stop Order will be cancelled if its timeInForce is “GTD”. GtdTime DateTime `json:"gtdTime"` // Specification of how Positions in the Account are modified when the Order is filled. PositionFill OrderPositionFill `json:"positionFill"` // Specification of which price component should be used when determining if an Order // should be triggered and filled. This allows Orders to be triggered based on the bid, // ask, mid, default (ask for buy, bid for sell) or inverse (ask for sell, bid for buy) // price depending on the desired behaviour. Orders are always filled using their default // price component. This feature is only provided through the REST API. Clients who // choose to specify a non-default trigger condition will not see it reflected in any // of OANDA’s proprietary or partner trading platforms, their transaction history // or their account statements. OANDA platforms always assume that an Order’s trigger // condition is set to the default value when indicating the distance from an Order’s // trigger price, and will always provide the default trigger condition when creating // or modifying an Order. A special restriction applies when creating a Guaranteed Stop // Loss Order. In this case the TriggerCondition value must either be “DEFAULT”, // or the “natural” trigger side “DEFAULT” results in. So for a Guaranteed Stop // Loss Order for a long trade valid values are “DEFAULT” and “BID”, and for // short trades “DEFAULT” and “ASK” are valid. TriggerCondition OrderTriggerCondition `json:"triggerCondition"` // The reason that the Stop Order was initiated Reason StopOrderReason `json:"reason"` // Client Extensions to add to the Order (only provided if the Order is being created // with client extensions). ClientExtensions *ClientExtensions `json:"clientExtensions"` // The specification of the Take Profit Order that should be created for a Trade opened // when the Order is filled (if such a Trade is created). TakeProfitOnFill *TakeProfitDetails `json:"takeProfitOnFill"` // The specification of the Stop Loss Order that should be created for a Trade opened // when the Order is filled (if such a Trade is created). StopLossOnFill *StopLossDetails `json:"stopLossOnFill"` // The specification of the Trailing Stop Loss Order that should be created for a Trade // that is opened when the Order is filled (if such a Trade is created). TrailingStopLossOnFill *TrailingStopLossDetails `json:"trailingStopLossOnFill"` // The specification of the Guaranteed Stop Loss Order that should be created for a // Trade that is opened when the Order is filled (if such a Trade is created). GuaranteedStopLossOnFill *GuaranteedStopLossDetails `json:"guaranteedStopLossOnFill"` // Client Extensions to add to the Trade created when the Order is filled (if such // a Trade is created). Do not set, modify, delete tradeClientExtensions if your account // is associated with MT4. TradeClientExtensions *ClientExtensions `json:"tradeClientExtensions"` // The ID of the Order that this Order replaces (only provided if this Order replaces // an existing Order). ReplacesOrderID OrderID `json:"replacesOrderID"` // The ID of the Transaction that cancels the replaced Order (only provided if this // Order replaces an existing Order). CancellingTransactionID TransactionID `json:"cancellingTransactionID"` }
A StopOrderTransaction represents the creation of a Stop Order in the user’s Account.
func (StopOrderTransaction) MarshalEasyJSON ¶
func (v StopOrderTransaction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (StopOrderTransaction) MarshalJSON ¶
func (v StopOrderTransaction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*StopOrderTransaction) UnmarshalEasyJSON ¶
func (v *StopOrderTransaction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*StopOrderTransaction) UnmarshalJSON ¶
func (v *StopOrderTransaction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type StreamClientPrice ¶
type StreamClientPrice struct { Instrument []byte Time time.Time Bids []StreamPriceBucket Asks []StreamPriceBucket CloseoutBid float64 CloseoutAsk float64 Tradeable bool IsHeartbeat bool // contains filtered or unexported fields }
func (*StreamClientPrice) UnmarshalJSON ¶
func (out *StreamClientPrice) UnmarshalJSON(b []byte)
type StreamPriceBucket ¶
type StreamPriceBucket struct { // The Price offered by the PriceBucket Price float64 // The amount of liquidity offered by the PriceBucket Liquidity int64 }
func (*StreamPriceBucket) UnmarshalEasyJSON ¶
func (out *StreamPriceBucket) UnmarshalEasyJSON(in *jlexer.Lexer)
type Tag ¶
type Tag struct { Type string `json:"type"` // The type of the tag. Name string `json:"name"` // The name of the tag. }
A tag associated with an entity.
func (Tag) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Tag) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Tag) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Tag) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type TakeProfitDetails ¶
type TakeProfitDetails struct { // The price that the Take Profit Order will be triggered at. Only one of // the price and distance fields may be specified. Price PriceValue `json:"price"` // The time in force for the created Take Profit Order. This may only be GTC, GTD or GFD. TimeInForce TimeInForce `json:"timeInForce"` // The date when the Take Profit Order will be cancelled on if timeInForce is GTD. GtdTime DateTime `json:"gtdTime"` // The Client Extensions to add to the Take Profit Order when created. ClientExtensions *ClientExtensions `json:"clientExtensions"` }
TakeProfitDetails specifies the details of a Take Profit Order to be created on behalf of a client. This may happen when an Order is filled that opens a Trade requiring a Take Profit, or when a Trade’s dependent Take Profit Order is modified directly through the Trade.
func (TakeProfitDetails) MarshalEasyJSON ¶
func (v TakeProfitDetails) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (TakeProfitDetails) MarshalJSON ¶
func (v TakeProfitDetails) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*TakeProfitDetails) UnmarshalEasyJSON ¶
func (v *TakeProfitDetails) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*TakeProfitDetails) UnmarshalJSON ¶
func (v *TakeProfitDetails) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type TakeProfitOrder ¶
type TakeProfitOrder struct { Order // The type of the Order. Always set to “TAKE_PROFIT” for Take Profit Orders. Type OrderType `json:"type"` // The ID of the Trade to close when the price threshold is breached. TradeID TradeID `json:"tradeID"` // The client ID of the Trade to be closed when the price threshold is breached. ClientTradeID ClientID `json:"clientTradeID"` // The price threshold specified for the TakeProfit Order. The associated Trade will // be closed by a market price that is equal to or better than this threshold. Price PriceValue `json:"price"` // The time-in-force requested for the TakeProfit Order. Restricted to “GTC”, “GFD” // and “GTD” for TakeProfit Orders. TimeInForce TimeInForce `json:"timeInForce"` // The date/time when the TakeProfit Order will be cancelled if its timeInForce is // “GTD”. GtdTime DateTime `json:"gtdTime"` // Specification of which price component should be used when determining if an Order // should be triggered and filled. This allows Orders to be triggered based on the bid, // ask, mid, default (ask for buy, bid for sell) or inverse (ask for sell, bid for buy) // price depending on the desired behaviour. Orders are always filled using their default // price component. This feature is only provided through the REST API. Clients who // choose to specify a non-default trigger condition will not see it reflected in any // of OANDA’s proprietary or partner trading platforms, their transaction history // or their account statements. OANDA platforms always assume that an Order’s trigger // condition is set to the default value when indicating the distance from an Order’s // trigger price, and will always provide the default trigger condition when creating // or modifying an Order. A special restriction applies when creating a Guaranteed Stop // Loss Order. In this case the TriggerCondition value must either be “DEFAULT”, // or the “natural” trigger side “DEFAULT” results in. So for a Guaranteed Stop // Loss Order for a long trade valid values are “DEFAULT” and “BID”, and for // short trades “DEFAULT” and “ASK” are valid. TriggerCondition OrderTriggerCondition `json:"triggerCondition"` // ID of the Transaction that filled this Order (only provided when the Order’s state // is FILLED) FillingTransactionID TransactionID `json:"fillingTransactionID"` // Date/time when the Order was filled (only provided when the Order’s state is FILLED) FilledTime DateTime `json:"filledTime"` // Trade ID of Trade opened when the Order was filled (only provided when the Order’s // state is FILLED and a Trade was opened as a result of the fill) TradeOpenedID TradeID `json:"tradeOpenedID"` // Trade ID of Trade reduced when the Order was filled (only provided when the Order’s // state is FILLED and a Trade was reduced as a result of the fill) TradeReducedID TradeID `json:"tradeReducedID"` // Trade IDs of Trades closed when the Order was filled (only provided when the Order’s // state is FILLED and one or more Trades were closed as a result of the fill) TradeClosedIDs []TradeID `json:"tradeClosedIDs"` // ID of the Transaction that cancelled the Order (only provided when the Order’s // state is CANCELLED) CancellingTransactionID TransactionID `json:"cancellingTransactionID"` // Date/time when the Order was cancelled (only provided when the state of the Order // is CANCELLED) CancelledTime DateTime `json:"cancelledTime"` // The ID of the Order that was replaced by this Order (only provided if this Order // was created as part of a cancel/replace). ReplacesOrderID OrderID `json:"replacesOrderID"` // The ID of the Order that replaced this Order (only provided if this Order was cancelled // as part of a cancel/replace). ReplacedByOrderID OrderID `json:"replacedByOrderID"` }
A TakeProfitOrder is an order that is linked to an open Trade and created with a price threshold. The Order will be filled (closing the Trade) by the first price that is equal to or better than the threshold. A TakeProfitOrder cannot be used to open a new Position.
func (TakeProfitOrder) MarshalEasyJSON ¶
func (v TakeProfitOrder) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (TakeProfitOrder) MarshalJSON ¶
func (v TakeProfitOrder) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*TakeProfitOrder) UnmarshalEasyJSON ¶
func (v *TakeProfitOrder) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*TakeProfitOrder) UnmarshalJSON ¶
func (v *TakeProfitOrder) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type TakeProfitOrderReason ¶
type TakeProfitOrderReason string
The reason that the Take Profit Order was initiated
type TakeProfitOrderRejectTransaction ¶
type TakeProfitOrderRejectTransaction struct { Transaction // The Type of the Transaction. Always set to “TAKE_PROFIT_ORDER_REJECT” in a TakeProfitOrderRejectTransaction. Type TransactionType `json:"type"` // The ID of the Trade to close when the price threshold is breached. TradeID TradeID `json:"tradeID"` // The client ID of the Trade to be closed when the price threshold is breached. ClientTradeID ClientID `json:"clientTradeID"` // The price threshold specified for the TakeProfit Order. The associated Trade will // be closed by a market price that is equal to or better than this threshold. Price PriceValue `json:"price"` // The time-in-force requested for the TakeProfit Order. Restricted to “GTC”, “GFD” // and “GTD” for TakeProfit Orders. TimeInForce TimeInForce `json:"timeInForce"` // The date/time when the TakeProfit Order will be cancelled if its timeInForce is // “GTD”. GtdTime DateTime `json:"gtdTime"` // Specification of which price component should be used when determining if an Order // should be triggered and filled. This allows Orders to be triggered based on the bid, // ask, mid, default (ask for buy, bid for sell) or inverse (ask for sell, bid for buy) // price depending on the desired behaviour. Orders are always filled using their default // price component. This feature is only provided through the REST API. Clients who // choose to specify a non-default trigger condition will not see it reflected in any // of OANDA’s proprietary or partner trading platforms, their transaction history // or their account statements. OANDA platforms always assume that an Order’s trigger // condition is set to the default value when indicating the distance from an Order’s // trigger price, and will always provide the default trigger condition when creating // or modifying an Order. A special restriction applies when creating a Guaranteed Stop // Loss Order. In this case the TriggerCondition value must either be “DEFAULT”, // or the “natural” trigger side “DEFAULT” results in. So for a Guaranteed Stop // Loss Order for a long trade valid values are “DEFAULT” and “BID”, and for // short trades “DEFAULT” and “ASK” are valid. TriggerCondition OrderTriggerCondition `json:"triggerCondition"` // The reason that the Take Profit Order was initiated Reason TakeProfitOrderReason `json:"reason"` // Client Extensions to add to the Order (only provided if the Order is being created // with client extensions). ClientExtensions *ClientExtensions `json:"clientExtensions"` // The ID of the OrderFill Transaction that caused this Order to be created (only provided // if this Order was created automatically when another Order was filled). OrderFillTransactionID TransactionID `json:"orderFillTransactionID"` // The ID of the Order that this Order was intended to replace (only provided if this // Order was intended to replace an existing Order). IntendedReplacesOrderID OrderID `json:"intendedReplacesOrderID"` // The reason that the Reject Transaction was created RejectReason TransactionRejectReason `json:"rejectReason"` }
A TakeProfitOrderRejectTransaction represents the rejection of the creation of a TakeProfit Order.
func (TakeProfitOrderRejectTransaction) MarshalEasyJSON ¶
func (v TakeProfitOrderRejectTransaction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (TakeProfitOrderRejectTransaction) MarshalJSON ¶
func (v TakeProfitOrderRejectTransaction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*TakeProfitOrderRejectTransaction) UnmarshalEasyJSON ¶
func (v *TakeProfitOrderRejectTransaction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*TakeProfitOrderRejectTransaction) UnmarshalJSON ¶
func (v *TakeProfitOrderRejectTransaction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type TakeProfitOrderRequest ¶
type TakeProfitOrderRequest struct { BaseOrderRequest // The type of the Order to Create. Must be set to “TAKE_PROFIT” when creating // a Take Profit Order. Type OrderType `json:"type"` // The ID of the Trade to close when the price threshold is breached. TradeID TradeID `json:"tradeID"` // The client ID of the Trade to be closed when the price threshold is breached. ClientTradeID ClientID `json:"clientTradeID"` // The price threshold specified for the TakeProfit Order. The associated Trade will // be closed by a market price that is equal to or better than this threshold. Price PriceValue `json:"price"` // The time-in-force requested for the TakeProfit Order. Restricted to “GTC”, “GFD” // and “GTD” for TakeProfit Orders. TimeInForce TimeInForce `json:"timeInForce"` // The date/time when the TakeProfit Order will be cancelled if its timeInForce is // “GTD”. GtdTime DateTime `json:"gtdTime"` // Specification of which price component should be used when determining if an Order // should be triggered and filled. This allows Orders to be triggered based on the bid, // ask, mid, default (ask for buy, bid for sell) or inverse (ask for sell, bid for buy) // price depending on the desired behaviour. Orders are always filled using their default // price component. This feature is only provided through the REST API. Clients who // choose to specify a non-default trigger condition will not see it reflected in any // of OANDA’s proprietary or partner trading platforms, their transaction history // or their account statements. OANDA platforms always assume that an Order’s trigger // condition is set to the default value when indicating the distance from an Order’s // trigger price, and will always provide the default trigger condition when creating // or modifying an Order. A special restriction applies when creating a Guaranteed Stop // Loss Order. In this case the TriggerCondition value must either be “DEFAULT”, // or the “natural” trigger side “DEFAULT” results in. So for a Guaranteed Stop // Loss Order for a long trade valid values are “DEFAULT” and “BID”, and for // short trades “DEFAULT” and “ASK” are valid. TriggerCondition OrderTriggerCondition `json:"triggerCondition"` // The client extensions to add to the Order. Do not set, modify, or delete clientExtensions // if your account is associated with MT4. ClientExtensions *ClientExtensions `json:"clientExtensions"` }
A TakeProfitOrderRequest specifies the parameters that may be set when creating a Take Profit Order.
func (TakeProfitOrderRequest) MarshalEasyJSON ¶
func (v TakeProfitOrderRequest) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (TakeProfitOrderRequest) MarshalJSON ¶
func (v TakeProfitOrderRequest) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*TakeProfitOrderRequest) UnmarshalEasyJSON ¶
func (v *TakeProfitOrderRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*TakeProfitOrderRequest) UnmarshalJSON ¶
func (v *TakeProfitOrderRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type TakeProfitOrderTransaction ¶
type TakeProfitOrderTransaction struct { Transaction // The Type of the Transaction. Always set to “TAKE_PROFIT_ORDER” in a TakeProfitOrderTransaction. Type TransactionType `json:"type"` // The ID of the Trade to close when the price threshold is breached. TradeID TradeID `json:"tradeID"` // The client ID of the Trade to be closed when the price threshold is breached. ClientTradeID ClientID `json:"clientTradeID"` // The price threshold specified for the TakeProfit Order. The associated Trade will // be closed by a market price that is equal to or better than this threshold. Price PriceValue `json:"price"` // The time-in-force requested for the TakeProfit Order. Restricted to “GTC”, “GFD” // and “GTD” for TakeProfit Orders. TimeInForce TimeInForce `json:"timeInForce"` // The date/time when the TakeProfit Order will be cancelled if its timeInForce is // “GTD”. GtdTime DateTime `json:"gtdTime"` // Specification of which price component should be used when determining if an Order // should be triggered and filled. This allows Orders to be triggered based on the bid, // ask, mid, default (ask for buy, bid for sell) or inverse (ask for sell, bid for buy) // price depending on the desired behaviour. Orders are always filled using their default // price component. This feature is only provided through the REST API. Clients who // choose to specify a non-default trigger condition will not see it reflected in any // of OANDA’s proprietary or partner trading platforms, their transaction history // or their account statements. OANDA platforms always assume that an Order’s trigger // condition is set to the default value when indicating the distance from an Order’s // trigger price, and will always provide the default trigger condition when creating // or modifying an Order. A special restriction applies when creating a Guaranteed Stop // Loss Order. In this case the TriggerCondition value must either be “DEFAULT”, // or the “natural” trigger side “DEFAULT” results in. So for a Guaranteed Stop // Loss Order for a long trade valid values are “DEFAULT” and “BID”, and for // short trades “DEFAULT” and “ASK” are valid. TriggerCondition OrderTriggerCondition `json:"triggerCondition"` // The reason that the Take Profit Order was initiated Reason TakeProfitOrderReason `json:"reason"` // Client Extensions to add to the Order (only provided if the Order is being created // with client extensions). ClientExtensions *ClientExtensions `json:"clientExtensions"` // The ID of the OrderFill Transaction that caused this Order to be created (only provided // if this Order was created automatically when another Order was filled). OrderFillTransactionID TransactionID `json:"orderFillTransactionID"` // The ID of the Order that this Order replaces (only provided if this Order replaces // an existing Order). ReplacesOrderID OrderID `json:"replacesOrderID"` // The ID of the Transaction that cancels the replaced Order (only provided if this // Order replaces an existing Order). CancellingTransactionID TransactionID `json:"cancellingTransactionID"` }
A TakeProfitOrderTransaction represents the creation of a TakeProfit Order in the user’s Account.
func (TakeProfitOrderTransaction) MarshalEasyJSON ¶
func (v TakeProfitOrderTransaction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (TakeProfitOrderTransaction) MarshalJSON ¶
func (v TakeProfitOrderTransaction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*TakeProfitOrderTransaction) UnmarshalEasyJSON ¶
func (v *TakeProfitOrderTransaction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*TakeProfitOrderTransaction) UnmarshalJSON ¶
func (v *TakeProfitOrderTransaction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type TimeInForce ¶
type TimeInForce string
The time-in-force of an Order. TimeInForce describes how long an Order should remain pending before being automatically cancelled by the execution system.
const ( // The Order is “Good unTil Cancelled” TimeInForce_GTC TimeInForce = "GTC" // The Order is “Good unTil Date” and will be cancelled at the provided time TimeInForce_GTD TimeInForce = "GTD" // The Order is “Good For Day” and will be cancelled at 5pm New York time TimeInForce_GFD TimeInForce = "GFD" // The Order must be immediately “Filled Or Killed” TimeInForce_FOK TimeInForce = "FOK" // The Order must be “Immediately partially filled Or Cancelled” TimeInForce_IOC TimeInForce = "IOC" )
type Trade ¶
type Trade struct { // The Trade’s identifier, unique within the Trade’s Account. Id TradeID `json:"id"` // The Trade’s Instrument. Instrument InstrumentName `json:"instrument"` // The execution price of the Trade. Price PriceValue `json:"price"` // The date/time when the Trade was opened. OpenTime DateTime `json:"openTime"` // The current state of the Trade. State TradeState `json:"state"` // The initial size of the Trade. Negative values indicate a short Trade, and positive // values indicate a long Trade. InitialUnits DecimalNumber `json:"initialUnits"` // The margin required at the time the Trade was created. Note, this is the ‘pure’ // margin required, it is not the ‘effective’ margin used that factors in the trade // risk if a GSLO is attached to the trade. InitialMarginRequired AccountUnits `json:"initialMarginRequired"` // The number of units currently open for the Trade. This value is reduced to 0.0 as // the Trade is closed. CurrentUnits DecimalNumber `json:"currentUnits"` // The total profit/loss realized on the closed portion of the Trade. RealizedPL AccountUnits `json:"realizedPL"` // The unrealized profit/loss on the open portion of the Trade. UnrealizedPL AccountUnits `json:"unrealizedPL"` // Margin currently used by the Trade. MarginUsed AccountUnits `json:"marginUsed"` // The average closing price of the Trade. Only present if the Trade has been closed // or reduced at least once. AverageClosePrice PriceValue `json:"averageClosePrice"` // The IDs of the Transactions that have closed portions of this Trade. ClosingTransactionIDs []TransactionID `json:"closingTransactionIDs"` // The financing paid/collected for this Trade. Financing AccountUnits `json:"financing"` // The dividend adjustment paid for this Trade. DividendAdjustment AccountUnits `json:"dividendAdjustment"` // The date/time when the Trade was fully closed. Only provided for Trades whose state // is CLOSED. CloseTime DateTime `json:"closeTime"` // The client extensions of the Trade. ClientExtensions *ClientExtensions `json:"clientExtensions"` // Full representation of the Trade’s Take Profit Order, only provided if such an // Order exists. TakeProfitOrder *TakeProfitOrder `json:"takeProfitOrder"` // Full representation of the Trade’s Stop Loss Order, only provided if such an Order // exists. StopLossOrder *StopLossOrder `json:"stopLossOrder"` // Full representation of the Trade’s Trailing Stop Loss Order, only provided if // such an Order exists. TrailingStopLossOrder *TrailingStopLossOrder `json:"trailingStopLossOrder"` }
The specification of a Trade within an Account. This includes the full representation of the Trade’s dependent Orders in addition to the IDs of those Orders.
func (Trade) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Trade) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Trade) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Trade) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type TradeClientExtensionsError ¶
type TradeClientExtensionsError struct { // The Transaction that rejects the modification of the Trade’s Client Extensions. TradeClientExtensionsModifyRejectTransaction *TradeClientExtensionsModifyRejectTransaction `json:"tradeClientExtensionsModifyRejectTransaction"` // The ID of the most recent Transaction created for the Account LastTransactionID TransactionID `json:"lastTransactionID"` // The IDs of all Transactions that were created while satisfying the request. RelatedTransactionIDs []TransactionID `json:"relatedTransactionIDs"` // The code of the error that has occurred. This field may not be returned // for some errors. ErrorCode string `json:"errorCode"` // The human-readable description of the error that has occurred. ErrorMessage string `json:"errorMessage"` }
func (TradeClientExtensionsError) MarshalEasyJSON ¶
func (v TradeClientExtensionsError) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (TradeClientExtensionsError) MarshalJSON ¶
func (v TradeClientExtensionsError) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*TradeClientExtensionsError) UnmarshalEasyJSON ¶
func (v *TradeClientExtensionsError) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*TradeClientExtensionsError) UnmarshalJSON ¶
func (v *TradeClientExtensionsError) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type TradeClientExtensionsModifyRejectTransaction ¶
type TradeClientExtensionsModifyRejectTransaction struct { Transaction // The Type of the Transaction. Always set to “TRADE_CLIENT_EXTENSIONS_MODIFY_REJECT” // for a TradeClientExtensionsModifyRejectTransaction. Type TransactionType `json:"type"` // The ID of the Trade who’s client extensions are to be modified. TradeID TradeID `json:"tradeID"` // The original Client ID of the Trade who’s client extensions are to be modified. ClientTradeID ClientID `json:"clientTradeID"` // The new Client Extensions for the Trade. TradeClientExtensionsModify *ClientExtensions `json:"tradeClientExtensionsModify"` // The reason that the Reject Transaction was created RejectReason TransactionRejectReason `json:"rejectReason"` }
A TradeClientExtensionsModifyRejectTransaction represents the rejection of the modification of a Trade’s Client Extensions.
func (TradeClientExtensionsModifyRejectTransaction) MarshalEasyJSON ¶
func (v TradeClientExtensionsModifyRejectTransaction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (TradeClientExtensionsModifyRejectTransaction) MarshalJSON ¶
func (v TradeClientExtensionsModifyRejectTransaction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*TradeClientExtensionsModifyRejectTransaction) UnmarshalEasyJSON ¶
func (v *TradeClientExtensionsModifyRejectTransaction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*TradeClientExtensionsModifyRejectTransaction) UnmarshalJSON ¶
func (v *TradeClientExtensionsModifyRejectTransaction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type TradeClientExtensionsModifyTransaction ¶
type TradeClientExtensionsModifyTransaction struct { Transaction // The Type of the Transaction. Always set to “TRADE_CLIENT_EXTENSIONS_MODIFY” // for a TradeClientExtensionsModifyTransaction. Type TransactionType `json:"type"` // The ID of the Trade who’s client extensions are to be modified. TradeID TradeID `json:"tradeID"` // The original Client ID of the Trade who’s client extensions are to be modified. ClientTradeID ClientID `json:"clientTradeID"` // The new Client Extensions for the Trade. TradeClientExtensionsModify *ClientExtensions `json:"tradeClientExtensionsModify"` }
A TradeClientExtensionsModifyTransaction represents the modification of a Trade’s Client Extensions.
func (TradeClientExtensionsModifyTransaction) MarshalEasyJSON ¶
func (v TradeClientExtensionsModifyTransaction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (TradeClientExtensionsModifyTransaction) MarshalJSON ¶
func (v TradeClientExtensionsModifyTransaction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*TradeClientExtensionsModifyTransaction) UnmarshalEasyJSON ¶
func (v *TradeClientExtensionsModifyTransaction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*TradeClientExtensionsModifyTransaction) UnmarshalJSON ¶
func (v *TradeClientExtensionsModifyTransaction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type TradeClientExtensionsRequest ¶
type TradeClientExtensionsRequest struct { // The Client Extensions to update the Trade with. Do not add, update, or // delete the Client Extensions if your account is associated with MT4. ClientExtensions *ClientExtensions `json:"clientExtensions"` }
func (TradeClientExtensionsRequest) MarshalEasyJSON ¶
func (v TradeClientExtensionsRequest) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (TradeClientExtensionsRequest) MarshalJSON ¶
func (v TradeClientExtensionsRequest) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*TradeClientExtensionsRequest) UnmarshalEasyJSON ¶
func (v *TradeClientExtensionsRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*TradeClientExtensionsRequest) UnmarshalJSON ¶
func (v *TradeClientExtensionsRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type TradeClientExtensionsResponse ¶
type TradeClientExtensionsResponse struct { // The Transaction that updates the Trade’s Client Extensions. TradeClientExtensionsModifyTransaction *TradeClientExtensionsModifyTransaction `json:"tradeClientExtensionsModifyTransaction"` // The IDs of all Transactions that were created while satisfying the request. RelatedTransactionIDs []TransactionID `json:"relatedTransactionIDs"` // The ID of the most recent Transaction created for the Account LastTransactionID TransactionID `json:"lastTransactionID"` }
func (TradeClientExtensionsResponse) MarshalEasyJSON ¶
func (v TradeClientExtensionsResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (TradeClientExtensionsResponse) MarshalJSON ¶
func (v TradeClientExtensionsResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*TradeClientExtensionsResponse) UnmarshalEasyJSON ¶
func (v *TradeClientExtensionsResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*TradeClientExtensionsResponse) UnmarshalJSON ¶
func (v *TradeClientExtensionsResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type TradeCloseError ¶
type TradeCloseError struct { // The MarketOrderReject Transaction that rejects the creation of the Trade-closing MarketOrder. OrderRejectTransaction *MarketOrderRejectTransaction `json:"orderRejectTransaction"` // The ID of the most recent Transaction created for the Account LastTransactionID TransactionID `json:"lastTransactionID"` // The IDs of all Transactions that were created while satisfying the request. RelatedTransactionIDs []TransactionID `json:"relatedTransactionIDs"` // The code of the error that has occurred. This field may not be returned // for some errors. ErrorCode string `json:"errorCode"` // The human-readable description of the error that has occurred. ErrorMessage string `json:"errorMessage"` }
func (TradeCloseError) MarshalEasyJSON ¶
func (v TradeCloseError) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (TradeCloseError) MarshalJSON ¶
func (v TradeCloseError) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*TradeCloseError) UnmarshalEasyJSON ¶
func (v *TradeCloseError) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*TradeCloseError) UnmarshalJSON ¶
func (v *TradeCloseError) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type TradeCloseResponse ¶
type TradeCloseResponse struct { // The MarketOrder Transaction created to close the Trade. OrderCreateTransaction *MarketOrderTransaction `json:"orderCreateTransaction"` // The OrderFill Transaction that fills the Trade-closing MarketOrder and // closes the Trade. OrderFillTransaction *OrderFillTransaction `json:"orderFillTransaction"` // The OrderCancel Transaction that immediately cancelled the Trade-closing MarketOrder. OrderCancelTransaction *OrderCancelTransaction `json:"orderCancelTransaction"` // The IDs of all Transactions that were created while satisfying the request. RelatedTransactionIDs []TransactionID `json:"relatedTransactionIDs"` // The ID of the most recent Transaction created for the Account LastTransactionID TransactionID `json:"lastTransactionID"` }
func (TradeCloseResponse) MarshalEasyJSON ¶
func (v TradeCloseResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (TradeCloseResponse) MarshalJSON ¶
func (v TradeCloseResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*TradeCloseResponse) UnmarshalEasyJSON ¶
func (v *TradeCloseResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*TradeCloseResponse) UnmarshalJSON ¶
func (v *TradeCloseResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type TradeModifyError ¶
type TradeModifyError struct { // An OrderCancelRejectTransaction represents the rejection of the cancellation of // an Order in the client’s Account. TakeProfitOrderCancelRejectTransaction *OrderCancelRejectTransaction `json:"takeProfitOrderCancelRejectTransaction"` // A TakeProfitOrderRejectTransaction represents the rejection of the creation of a // TakeProfit Order. TakeProfitOrderRejectTransaction *TakeProfitOrderRejectTransaction `json:"takeProfitOrderRejectTransaction"` // An OrderCancelRejectTransaction represents the rejection of the cancellation of // an Order in the client’s Account. StopLossOrderCancelRejectTransaction *OrderCancelRejectTransaction `json:"stopLossOrderCancelRejectTransaction"` // A StopLossOrderRejectTransaction represents the rejection of the creation of a StopLoss // Order. StopLossOrderRejectTransaction *StopLossOrderRejectTransaction `json:"stopLossOrderRejectTransaction"` // An OrderCancelRejectTransaction represents the rejection of the cancellation of // an Order in the client’s Account. TrailingStopLossOrderCancelRejectTransaction *OrderCancelRejectTransaction `json:"trailingStopLossOrderCancelRejectTransaction"` // A TrailingStopLossOrderRejectTransaction represents the rejection of the creation // of a TrailingStopLoss Order. TrailingStopLossOrderRejectTransaction *TrailingStopLossOrderRejectTransaction `json:"trailingStopLossOrderRejectTransaction"` // An OrderCancelRejectTransaction represents the rejection of the cancellation of // an Order in the client’s Account. GuaranteedStopLossOrderCancelRejectTransaction *OrderCancelRejectTransaction `json:"guaranteedStopLossOrderCancelRejectTransaction"` // A GuaranteedStopLossOrderRejectTransaction represents the rejection of the creation // of a GuaranteedStopLoss Order. GuaranteedStopLossOrderRejectTransaction *GuaranteedStopLossOrderRejectTransaction `json:"guaranteedStopLossOrderRejectTransaction"` // The code of the error that has occurred. This field may not be returned for some // errors. ErrorCode string `json:"errorCode"` // The human-readable description of the error that has occurred. ErrorMessage string `json:"errorMessage"` }
func (TradeModifyError) MarshalEasyJSON ¶
func (v TradeModifyError) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (TradeModifyError) MarshalJSON ¶
func (v TradeModifyError) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*TradeModifyError) UnmarshalEasyJSON ¶
func (v *TradeModifyError) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*TradeModifyError) UnmarshalJSON ¶
func (v *TradeModifyError) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type TradeModifyRequest ¶
type TradeModifyRequest struct { // The specification of the Take Profit to create/modify/cancel. If // takeProfit is set to null, the Take Profit Order will be cancelled if it // exists. If takeProfit is not provided, the existing Take Profit Order // will not be modified. If a sub-field of takeProfit is not specified, that // field will be set to a default value on create, and be inherited by the // replacing order on modify. TakeProfit *TakeProfitDetails `json:"takeProfit"` // The specification of the Stop Loss to create/modify/cancel. If stopLoss // is set to null, the Stop Loss Order will be cancelled if it exists. If // stopLoss is not provided, the existing Stop Loss Order will not be // modified. If a sub-field of stopLoss is not specified, that field will be // set to a default value on create, and be inherited by the replacing order // on modify. StopLoss *StopLossDetails `json:"stopLoss"` // The specification of the Trailing Stop Loss to create/modify/cancel. If // trailingStopLoss is set to null, the Trailing Stop Loss Order will be // cancelled if it exists. If trailingStopLoss is not provided, the existing // Trailing Stop Loss Order will not be modified. If a sub-field of // trailingStopLoss is not specified, that field will be set to a default // value on create, and be inherited by the replacing order on modify. TrailingStopLoss *TrailingStopLossDetails `json:"trailingStopLoss"` // The specification of the Guaranteed Stop Loss to create/modify/cancel. If // guaranteedStopLoss is set to null, the Guaranteed Stop Loss Order will be // cancelled if it exists. If guaranteedStopLoss is not provided, the // existing Guaranteed Stop Loss Order will not be modified. If a sub-field // of guaranteedStopLoss is not specified, that field will be set to a // default value on create, and be inherited by the replacing order on // modify. GuaranteedStopLoss *GuaranteedStopLossDetails `json:"guaranteedStopLoss"` }
func (TradeModifyRequest) MarshalEasyJSON ¶
func (v TradeModifyRequest) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (TradeModifyRequest) MarshalJSON ¶
func (v TradeModifyRequest) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*TradeModifyRequest) UnmarshalEasyJSON ¶
func (v *TradeModifyRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*TradeModifyRequest) UnmarshalJSON ¶
func (v *TradeModifyRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type TradeModifyResponse ¶
type TradeModifyResponse struct { // The Transaction created that cancels the Trade’s existing Take Profit Order. TakeProfitOrderCancelTransaction *OrderCancelTransaction `json:"takeProfitOrderCancelTransaction"` // The Transaction created that creates a new Take Profit Order for the Trade. TakeProfitOrderTransaction *TakeProfitOrderTransaction `json:"takeProfitOrderTransaction"` // The Transaction created that immediately fills the Trade’s new Take Profit Order. // Only provided if the new Take Profit Order was immediately filled. TakeProfitOrderFillTransaction *OrderFillTransaction `json:"takeProfitOrderFillTransaction"` // The Transaction created that immediately cancels the Trade’s new Take Profit Order. // Only provided if the new Take Profit Order was immediately cancelled. TakeProfitOrderCreatedCancelTransaction *OrderCancelTransaction `json:"takeProfitOrderCreatedCancelTransaction"` // The Transaction created that cancels the Trade’s existing Stop Loss Order. StopLossOrderCancelTransaction *OrderCancelTransaction `json:"stopLossOrderCancelTransaction"` // The Transaction created that creates a new Stop Loss Order for the Trade. StopLossOrderTransaction *StopLossOrderTransaction `json:"stopLossOrderTransaction"` // The Transaction created that immediately fills the Trade’s new Stop Order. Only // provided if the new Stop Loss Order was immediately filled. StopLossOrderFillTransaction *OrderFillTransaction `json:"stopLossOrderFillTransaction"` // The Transaction created that immediately cancels the Trade’s new Stop Loss Order. // Only provided if the new Stop Loss Order was immediately cancelled. StopLossOrderCreatedCancelTransaction *OrderCancelTransaction `json:"stopLossOrderCreatedCancelTransaction"` // The Transaction created that cancels the Trade’s existing Trailing Stop Loss Order. TrailingStopLossOrderCancelTransaction *OrderCancelTransaction `json:"trailingStopLossOrderCancelTransaction"` // The Transaction created that creates a new Trailing Stop Loss Order for the Trade. TrailingStopLossOrderTransaction *TrailingStopLossOrderTransaction `json:"trailingStopLossOrderTransaction"` // The Transaction created that cancels the Trade’s existing Guaranteed Stop Loss // Order. GuaranteedStopLossOrderCancelTransaction *OrderCancelTransaction `json:"guaranteedStopLossOrderCancelTransaction"` // The Transaction created that creates a new Guaranteed Stop Loss Order for the Trade. GuaranteedStopLossOrderTransaction *GuaranteedStopLossOrderTransaction `json:"guaranteedStopLossOrderTransaction"` // The IDs of all Transactions that were created while satisfying the request. RelatedTransactionIDs []TransactionID `json:"relatedTransactionIDs"` // The ID of the most recent Transaction created for the Account LastTransactionID TransactionID `json:"lastTransactionID"` }
func (TradeModifyResponse) MarshalEasyJSON ¶
func (v TradeModifyResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (TradeModifyResponse) MarshalJSON ¶
func (v TradeModifyResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*TradeModifyResponse) UnmarshalEasyJSON ¶
func (v *TradeModifyResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*TradeModifyResponse) UnmarshalJSON ¶
func (v *TradeModifyResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type TradeOpen ¶
type TradeOpen struct { // The ID of the Trade that was opened TradeID TradeID `json:"tradeID"` // The number of units opened by the Trade Units DecimalNumber `json:"units"` // The average price that the units were opened at. Price PriceValue `json:"price"` // This is the fee charged for opening the trade if it has a guaranteed Stop // Loss Order attached to it. GuaranteedExecutionFee AccountUnits `json:"guaranteedExecutionFee"` // This is the fee charged for opening the trade if it has a guaranteed Stop // Loss Order attached to it, expressed in the Instrument’s quote currency. QuoteGuaranteedExecutionFee DecimalNumber `json:"quoteGuaranteedExecutionFee"` // The client extensions for the newly opened Trade ClientExtensions *ClientExtensions `json:"clientExtensions"` // The half spread cost for the trade open. This can be a positive or // negative value and is represented in the home currency of the Account. HalfSpreadCost AccountUnits `json:"halfSpreadCost"` // The margin required at the time the Trade was created. Note, this is the // ‘pure’ margin required, it is not the ‘effective’ margin used that // factors in the trade risk if a GSLO is attached to the trade. InitialMarginRequired AccountUnits `json:"initialMarginRequired"` }
A TradeOpen object represents a Trade for an instrument that was opened in an Account. It is found embedded in Transactions that affect the position of an instrument in the Account, specifically the OrderFill Transaction.
func (TradeOpen) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (TradeOpen) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*TradeOpen) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*TradeOpen) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type TradePL ¶
type TradePL string
The classification of TradePLs
const ( // An open Trade currently has a positive (profitable) unrealized P/L, or a // closed Trade realized a positive amount of P/L. TradePL_POSITIVE TradePL = "POSITIVE" // An open Trade currently has a negative (losing) unrealized P/L, or a // closed Trade realized a negative amount of P/L. TradePL_NEGATIVE TradePL = "NEGATIVE" // An open Trade currently has unrealized P/L of zero (neither profitable nor losing), or a // closed Trade realized a P/L amount of zero. TradePL_ZERO TradePL = "ZERO" )
type TradeReduce ¶
type TradeReduce struct { // The ID of the Trade that was reduced or closed TradeID TradeID `json:"tradeID"` // The number of units that the Trade was reduced by Units DecimalNumber `json:"units"` // The average price that the units were closed at. This price may be // clamped for guaranteed Stop Loss Orders. Price PriceValue `json:"price"` // The PL realized when reducing the Trade RealizedPL AccountUnits `json:"realizedPL"` // The financing paid/collected when reducing the Trade Financing AccountUnits `json:"financing"` // The base financing paid/collected when reducing the Trade BaseFinancing DecimalNumber `json:"baseFinancing"` // The quote financing paid/collected when reducing the Trade QuoteFinancing DecimalNumber `json:"quoteFinancing"` // The financing rate in effect for the instrument used to calculate the // amount of financing paid/collected when reducing the Trade. This field // will only be set if the AccountFinancingMode at the time of the order // fill is SECOND_BY_SECOND_INSTRUMENT. The value is in decimal rather than // percentage points, e.g. 5% is represented as 0.05. FinancingRate DecimalNumber `json:"financingRate"` // This is the fee that is charged for closing the Trade if it has a // guaranteed Stop Loss Order attached to it. GuaranteedExecutionFee AccountUnits `json:"guaranteedExecutionFee"` // This is the fee that is charged for closing the Trade if it has a // guaranteed Stop Loss Order attached to it, expressed in the Instrument’s // quote currency. QuoteGuaranteedExecutionFee DecimalNumber `json:"quoteGuaranteedExecutionFee"` // HalfSpreadCost AccountUnits `json:"halfSpreadCost"` }
A TradeReduce object represents a Trade for an instrument that was reduced (either partially or fully) in an Account. It is found embedded in Transactions that affect the position of an instrument in the account, specifically the OrderFill Transaction.
func (TradeReduce) MarshalEasyJSON ¶
func (v TradeReduce) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (TradeReduce) MarshalJSON ¶
func (v TradeReduce) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*TradeReduce) UnmarshalEasyJSON ¶
func (v *TradeReduce) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*TradeReduce) UnmarshalJSON ¶
func (v *TradeReduce) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type TradeResponse ¶
type TradeResponse struct { // The details of the requested trade Trade *Trade `json:"trade"` // The ID of the most recent Transaction created for the Account LastTransactionID TransactionID `json:"lastTransactionID"` }
func (TradeResponse) MarshalEasyJSON ¶
func (v TradeResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (TradeResponse) MarshalJSON ¶
func (v TradeResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*TradeResponse) UnmarshalEasyJSON ¶
func (v *TradeResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*TradeResponse) UnmarshalJSON ¶
func (v *TradeResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type TradeSpecifier ¶
type TradeSpecifier string
The identification of a Trade as referred to by clients Either the Trade’s OANDA-assigned TradeID or the Trade’s client-provided ClientID prefixed by the “@” symbol
type TradeState ¶
type TradeState string
The current state of the Trade
const ( // The Trade is currently open TradeState_OPEN TradeState = "OPEN" // The Trade has been fully closed TradeState_CLOSED TradeState = "CLOSED" // The Trade will be closed as soon as the trade’s instrument becomes tradeable TradeState_CLOSE_WHEN_TRADEABLE TradeState = "CLOSE_WHEN_TRADEABLE" )
type TradeStateFilter ¶
type TradeStateFilter string
The state to filter the Trades by
const ( // The Trades that are currently open TradeStateFilter_OPEN TradeStateFilter = "OPEN" // The Trades that have been fully closed TradeStateFilter_CLOSED TradeStateFilter = "CLOSED" // The Trades that will be closed as soon as the trades’ instrument becomes tradeable TradeStateFilter_CLOSE_WHEN_TRADEABLE TradeStateFilter = "CLOSE_WHEN_TRADEABLE" // The Trades that are in any of the possible states listed above. TradeStateFilter_ALL TradeStateFilter = "ALL" )
type TradeSummary ¶
type TradeSummary struct { // The Trade’s identifier, unique within the Trade’s Account. Id TradeID `json:"id"` // The Trade’s Instrument. Instrument InstrumentName `json:"instrument"` // The execution price of the Trade. Price PriceValue `json:"price"` // The date/time when the Trade was opened. OpenTime DateTime `json:"openTime"` // The current state of the Trade. State TradeState `json:"state"` // The initial size of the Trade. Negative values indicate a short Trade, and positive // values indicate a long Trade. InitialUnits DecimalNumber `json:"initialUnits"` // The margin required at the time the Trade was created. Note, this is the ‘pure’ // margin required, it is not the ‘effective’ margin used that factors in the trade // risk if a GSLO is attached to the trade. InitialMarginRequired AccountUnits `json:"initialMarginRequired"` // The number of units currently open for the Trade. This value is reduced to 0.0 as // the Trade is closed. CurrentUnits DecimalNumber `json:"currentUnits"` // The total profit/loss realized on the closed portion of the Trade. RealizedPL AccountUnits `json:"realizedPL"` // The unrealized profit/loss on the open portion of the Trade. UnrealizedPL AccountUnits `json:"unrealizedPL"` // Margin currently used by the Trade. MarginUsed AccountUnits `json:"marginUsed"` // The average closing price of the Trade. Only present if the Trade has been closed // or reduced at least once. AverageClosePrice PriceValue `json:"averageClosePrice"` // The IDs of the Transactions that have closed portions of this Trade. ClosingTransactionIDs []TransactionID `json:"closingTransactionIDs"` // The financing paid/collected for this Trade. Financing AccountUnits `json:"financing"` // The dividend adjustment paid for this Trade. DividendAdjustment AccountUnits `json:"dividendAdjustment"` // The date/time when the Trade was fully closed. Only provided for Trades whose state // is CLOSED. CloseTime DateTime `json:"closeTime"` // The client extensions of the Trade. ClientExtensions *ClientExtensions `json:"clientExtensions"` // ID of the Trade’s Take Profit Order, only provided if such an Order exists. TakeProfitOrderID OrderID `json:"takeProfitOrderID"` // ID of the Trade’s Stop Loss Order, only provided if such an Order exists. StopLossOrderID OrderID `json:"stopLossOrderID"` // ID of the Trade’s Guaranteed Stop Loss Order, only provided if such an Order exists. GuaranteedStopLossOrderID OrderID `json:"guaranteedStopLossOrderID"` // ID of the Trade’s Trailing Stop Loss Order, only provided if such an Order exists. TrailingStopLossOrderID OrderID `json:"trailingStopLossOrderID"` }
The summary of a Trade within an Account. This representation does not provide the full details of the Trade’s dependent Orders.
func (TradeSummary) MarshalEasyJSON ¶
func (v TradeSummary) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (TradeSummary) MarshalJSON ¶
func (v TradeSummary) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*TradeSummary) UnmarshalEasyJSON ¶
func (v *TradeSummary) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*TradeSummary) UnmarshalJSON ¶
func (v *TradeSummary) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type TradesRequest ¶
type TradesRequest struct { // List of Trade IDs to retrieve. IDs []TradeID `json:"ids"` // The state to filter the requested Trades by. // [default=OPEN] State TradeStateFilter `json:"state"` // The instrument to filter the requested Trades by. Instrument InstrumentName `json:"instrument"` // The maximum number of Trades to return. [default=50, maximum=500] Count int `json:"count"` // The maximum Trade ID to return. If not provided the most recent // Trades in the Account are returned. BeforeID TradeID `json:"beforeID"` }
func (*TradesRequest) AppendQuery ¶
func (g *TradesRequest) AppendQuery(b *bytebufferpool.ByteBuffer)
func (TradesRequest) MarshalEasyJSON ¶
func (v TradesRequest) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (TradesRequest) MarshalJSON ¶
func (v TradesRequest) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*TradesRequest) UnmarshalEasyJSON ¶
func (v *TradesRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*TradesRequest) UnmarshalJSON ¶
func (v *TradesRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type TradesResponse ¶
type TradesResponse struct { // The list of Trade detail objects Trades []*Trade `json:"trades"` // The ID of the most recent Transaction created for the Account LastTransactionID TransactionID `json:"lastTransactionID"` }
func (TradesResponse) MarshalEasyJSON ¶
func (v TradesResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (TradesResponse) MarshalJSON ¶
func (v TradesResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*TradesResponse) UnmarshalEasyJSON ¶
func (v *TradesResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*TradesResponse) UnmarshalJSON ¶
func (v *TradesResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type TrailingStopLossDetails ¶
type TrailingStopLossDetails struct { // The distance (in price units) from the Trade’s fill price that the // Trailing Stop Loss Order will be triggered at. Distance DecimalNumber `json:"distance"` // The time in force for the created Trailing Stop Loss Order. This may only be GTC, GTD or GFD. TimeInForce TimeInForce `json:"timeInForce"` // The date when the Trailing Stop Loss Order will be cancelled on if timeInForce is GTD. GtdTime DateTime `json:"gtdTime"` // The Client Extensions to add to the Trailing Stop Loss Order when created. ClientExtensions *ClientExtensions `json:"clientExtensions"` }
TrailingStopLossDetails specifies the details of a Trailing Stop Loss Order to be created on behalf of a client. This may happen when an Order is filled that opens a Trade requiring a Trailing Stop Loss, or when a Trade’s dependent Trailing Stop Loss Order is modified directly through the Trade.
func (TrailingStopLossDetails) MarshalEasyJSON ¶
func (v TrailingStopLossDetails) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (TrailingStopLossDetails) MarshalJSON ¶
func (v TrailingStopLossDetails) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*TrailingStopLossDetails) UnmarshalEasyJSON ¶
func (v *TrailingStopLossDetails) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*TrailingStopLossDetails) UnmarshalJSON ¶
func (v *TrailingStopLossDetails) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type TrailingStopLossOrder ¶
type TrailingStopLossOrder struct { Order // The type of the Order. Always set to “TRAILING_STOP_LOSS” for Trailing Stop // Loss Orders. Type OrderType `json:"type"` // The ID of the Trade to close when the price threshold is breached. TradeID TradeID `json:"tradeID"` // The client ID of the Trade to be closed when the price threshold is breached. ClientTradeID ClientID `json:"clientTradeID"` // The price distance (in price units) specified for the TrailingStopLoss Order. Distance DecimalNumber `json:"distance"` // The time-in-force requested for the TrailingStopLoss Order. Restricted to “GTC”, // “GFD” and “GTD” for TrailingStopLoss Orders. TimeInForce TimeInForce `json:"timeInForce"` // The date/time when the StopLoss Order will be cancelled if its timeInForce is “GTD”. GtdTime DateTime `json:"gtdTime"` // Specification of which price component should be used when determining if an Order // should be triggered and filled. This allows Orders to be triggered based on the bid, // ask, mid, default (ask for buy, bid for sell) or inverse (ask for sell, bid for buy) // price depending on the desired behaviour. Orders are always filled using their default // price component. This feature is only provided through the REST API. Clients who // choose to specify a non-default trigger condition will not see it reflected in any // of OANDA’s proprietary or partner trading platforms, their transaction history // or their account statements. OANDA platforms always assume that an Order’s trigger // condition is set to the default value when indicating the distance from an Order’s // trigger price, and will always provide the default trigger condition when creating // or modifying an Order. A special restriction applies when creating a Guaranteed Stop // Loss Order. In this case the TriggerCondition value must either be “DEFAULT”, // or the “natural” trigger side “DEFAULT” results in. So for a Guaranteed Stop // Loss Order for a long trade valid values are “DEFAULT” and “BID”, and for // short trades “DEFAULT” and “ASK” are valid. TriggerCondition OrderTriggerCondition `json:"triggerCondition"` // The trigger price for the Trailing Stop Loss Order. The trailing stop value will // trail (follow) the market price by the TSL order’s configured “distance” as // the market price moves in the winning direction. If the market price moves to a level // that is equal to or worse than the trailing stop value, the order will be filled // and the Trade will be closed. TrailingStopValue PriceValue `json:"trailingStopValue"` // ID of the Transaction that filled this Order (only provided when the Order’s state // is FILLED) FillingTransactionID TransactionID `json:"fillingTransactionID"` // Date/time when the Order was filled (only provided when the Order’s state is FILLED) FilledTime DateTime `json:"filledTime"` // Trade ID of Trade opened when the Order was filled (only provided when the Order’s // state is FILLED and a Trade was opened as a result of the fill) TradeOpenedID TradeID `json:"tradeOpenedID"` // Trade ID of Trade reduced when the Order was filled (only provided when the Order’s // state is FILLED and a Trade was reduced as a result of the fill) TradeReducedID TradeID `json:"tradeReducedID"` // Trade IDs of Trades closed when the Order was filled (only provided when the Order’s // state is FILLED and one or more Trades were closed as a result of the fill) TradeClosedIDs []TradeID `json:"tradeClosedIDs"` // ID of the Transaction that cancelled the Order (only provided when the Order’s // state is CANCELLED) CancellingTransactionID TransactionID `json:"cancellingTransactionID"` // Date/time when the Order was cancelled (only provided when the state of the Order // is CANCELLED) CancelledTime DateTime `json:"cancelledTime"` // The ID of the Order that was replaced by this Order (only provided if this Order // was created as part of a cancel/replace). ReplacesOrderID OrderID `json:"replacesOrderID"` // The ID of the Order that replaced this Order (only provided if this Order was cancelled // as part of a cancel/replace). ReplacedByOrderID OrderID `json:"replacedByOrderID"` }
A TrailingStopLossOrder is an order that is linked to an open Trade and created with a price distance. The price distance is used to calculate a trailing stop value for the order that is in the losing direction from the market price at the time of the order’s creation. The trailing stop value will follow the market price as it moves in the winning direction, and the order will filled (closing the Trade) by the first price that is equal to or worse than the trailing stop value. A TrailingStopLossOrder cannot be used to open a new Position.
func (TrailingStopLossOrder) MarshalEasyJSON ¶
func (v TrailingStopLossOrder) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (TrailingStopLossOrder) MarshalJSON ¶
func (v TrailingStopLossOrder) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*TrailingStopLossOrder) UnmarshalEasyJSON ¶
func (v *TrailingStopLossOrder) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*TrailingStopLossOrder) UnmarshalJSON ¶
func (v *TrailingStopLossOrder) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type TrailingStopLossOrderReason ¶
type TrailingStopLossOrderReason string
The reason that the Trailing Stop Loss Order was initiated
type TrailingStopLossOrderRejectTransaction ¶
type TrailingStopLossOrderRejectTransaction struct { Transaction // The Type of the Transaction. Always set to “TRAILING_STOP_LOSS_ORDER_REJECT” // in a TrailingStopLossOrderRejectTransaction. Type TransactionType `json:"type"` // The ID of the Trade to close when the price threshold is breached. TradeID TradeID `json:"tradeID"` // The client ID of the Trade to be closed when the price threshold is breached. ClientTradeID ClientID `json:"clientTradeID"` // The price distance (in price units) specified for the TrailingStopLoss Order. Distance DecimalNumber `json:"distance"` // The time-in-force requested for the TrailingStopLoss Order. Restricted to “GTC”, // “GFD” and “GTD” for TrailingStopLoss Orders. TimeInForce TimeInForce `json:"timeInForce"` // The date/time when the StopLoss Order will be cancelled if its timeInForce is “GTD”. GtdTime DateTime `json:"gtdTime"` // Specification of which price component should be used when determining if an Order // should be triggered and filled. This allows Orders to be triggered based on the bid, // ask, mid, default (ask for buy, bid for sell) or inverse (ask for sell, bid for buy) // price depending on the desired behaviour. Orders are always filled using their default // price component. This feature is only provided through the REST API. Clients who // choose to specify a non-default trigger condition will not see it reflected in any // of OANDA’s proprietary or partner trading platforms, their transaction history // or their account statements. OANDA platforms always assume that an Order’s trigger // condition is set to the default value when indicating the distance from an Order’s // trigger price, and will always provide the default trigger condition when creating // or modifying an Order. A special restriction applies when creating a Guaranteed Stop // Loss Order. In this case the TriggerCondition value must either be “DEFAULT”, // or the “natural” trigger side “DEFAULT” results in. So for a Guaranteed Stop // Loss Order for a long trade valid values are “DEFAULT” and “BID”, and for // short trades “DEFAULT” and “ASK” are valid. TriggerCondition OrderTriggerCondition `json:"triggerCondition"` // The reason that the Trailing Stop Loss Order was initiated Reason TrailingStopLossOrderReason `json:"reason"` // Client Extensions to add to the Order (only provided if the Order is being created // with client extensions). ClientExtensions *ClientExtensions `json:"clientExtensions"` // The ID of the OrderFill Transaction that caused this Order to be created (only provided // if this Order was created automatically when another Order was filled). OrderFillTransactionID TransactionID `json:"orderFillTransactionID"` // The ID of the Order that this Order was intended to replace (only provided if this // Order was intended to replace an existing Order). IntendedReplacesOrderID OrderID `json:"intendedReplacesOrderID"` // The reason that the Reject Transaction was created RejectReason TransactionRejectReason `json:"rejectReason"` }
A TrailingStopLossOrderRejectTransaction represents the rejection of the creation of a TrailingStopLoss Order.
func (TrailingStopLossOrderRejectTransaction) MarshalEasyJSON ¶
func (v TrailingStopLossOrderRejectTransaction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (TrailingStopLossOrderRejectTransaction) MarshalJSON ¶
func (v TrailingStopLossOrderRejectTransaction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*TrailingStopLossOrderRejectTransaction) UnmarshalEasyJSON ¶
func (v *TrailingStopLossOrderRejectTransaction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*TrailingStopLossOrderRejectTransaction) UnmarshalJSON ¶
func (v *TrailingStopLossOrderRejectTransaction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type TrailingStopLossOrderRequest ¶
type TrailingStopLossOrderRequest struct { BaseOrderRequest // The type of the Order to Create. Must be set to “TRAILING_STOP_LOSS” when creating // a Trailing Stop Loss Order. Type OrderType `json:"type"` // The ID of the Trade to close when the price threshold is breached. TradeID TradeID `json:"tradeID"` // The client ID of the Trade to be closed when the price threshold is breached. ClientTradeID ClientID `json:"clientTradeID"` // The price distance (in price units) specified for the TrailingStopLoss Order. Distance DecimalNumber `json:"distance"` // The time-in-force requested for the TrailingStopLoss Order. Restricted to “GTC”, // “GFD” and “GTD” for TrailingStopLoss Orders. TimeInForce TimeInForce `json:"timeInForce"` // The date/time when the StopLoss Order will be cancelled if its timeInForce is “GTD”. GtdTime DateTime `json:"gtdTime"` // Specification of which price component should be used when determining if an Order // should be triggered and filled. This allows Orders to be triggered based on the bid, // ask, mid, default (ask for buy, bid for sell) or inverse (ask for sell, bid for buy) // price depending on the desired behaviour. Orders are always filled using their default // price component. This feature is only provided through the REST API. Clients who // choose to specify a non-default trigger condition will not see it reflected in any // of OANDA’s proprietary or partner trading platforms, their transaction history // or their account statements. OANDA platforms always assume that an Order’s trigger // condition is set to the default value when indicating the distance from an Order’s // trigger price, and will always provide the default trigger condition when creating // or modifying an Order. A special restriction applies when creating a Guaranteed Stop // Loss Order. In this case the TriggerCondition value must either be “DEFAULT”, // or the “natural” trigger side “DEFAULT” results in. So for a Guaranteed Stop // Loss Order for a long trade valid values are “DEFAULT” and “BID”, and for // short trades “DEFAULT” and “ASK” are valid. TriggerCondition OrderTriggerCondition `json:"triggerCondition"` // The client extensions to add to the Order. Do not set, modify, or delete clientExtensions // if your account is associated with MT4. ClientExtensions *ClientExtensions `json:"clientExtensions"` }
A TrailingStopLossOrderRequest specifies the parameters that may be set when creating a Trailing Stop Loss Order.
func (TrailingStopLossOrderRequest) MarshalEasyJSON ¶
func (v TrailingStopLossOrderRequest) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (TrailingStopLossOrderRequest) MarshalJSON ¶
func (v TrailingStopLossOrderRequest) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*TrailingStopLossOrderRequest) UnmarshalEasyJSON ¶
func (v *TrailingStopLossOrderRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*TrailingStopLossOrderRequest) UnmarshalJSON ¶
func (v *TrailingStopLossOrderRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type TrailingStopLossOrderTransaction ¶
type TrailingStopLossOrderTransaction struct { Transaction // The Type of the Transaction. Always set to “TRAILING_STOP_LOSS_ORDER” in a TrailingStopLossOrderTransaction. Type TransactionType `json:"type"` // The ID of the Trade to close when the price threshold is breached. TradeID TradeID `json:"tradeID"` // The client ID of the Trade to be closed when the price threshold is breached. ClientTradeID ClientID `json:"clientTradeID"` // The price distance (in price units) specified for the TrailingStopLoss Order. Distance DecimalNumber `json:"distance"` // The time-in-force requested for the TrailingStopLoss Order. Restricted to “GTC”, // “GFD” and “GTD” for TrailingStopLoss Orders. TimeInForce TimeInForce `json:"timeInForce"` // The date/time when the StopLoss Order will be cancelled if its timeInForce is “GTD”. GtdTime DateTime `json:"gtdTime"` // Specification of which price component should be used when determining if an Order // should be triggered and filled. This allows Orders to be triggered based on the bid, // ask, mid, default (ask for buy, bid for sell) or inverse (ask for sell, bid for buy) // price depending on the desired behaviour. Orders are always filled using their default // price component. This feature is only provided through the REST API. Clients who // choose to specify a non-default trigger condition will not see it reflected in any // of OANDA’s proprietary or partner trading platforms, their transaction history // or their account statements. OANDA platforms always assume that an Order’s trigger // condition is set to the default value when indicating the distance from an Order’s // trigger price, and will always provide the default trigger condition when creating // or modifying an Order. A special restriction applies when creating a Guaranteed Stop // Loss Order. In this case the TriggerCondition value must either be “DEFAULT”, // or the “natural” trigger side “DEFAULT” results in. So for a Guaranteed Stop // Loss Order for a long trade valid values are “DEFAULT” and “BID”, and for // short trades “DEFAULT” and “ASK” are valid. TriggerCondition OrderTriggerCondition `json:"triggerCondition"` // The reason that the Trailing Stop Loss Order was initiated Reason TrailingStopLossOrderReason `json:"reason"` // Client Extensions to add to the Order (only provided if the Order is being created // with client extensions). ClientExtensions *ClientExtensions `json:"clientExtensions"` // The ID of the OrderFill Transaction that caused this Order to be created (only provided // if this Order was created automatically when another Order was filled). OrderFillTransactionID TransactionID `json:"orderFillTransactionID"` // The ID of the Order that this Order replaces (only provided if this Order replaces // an existing Order). ReplacesOrderID OrderID `json:"replacesOrderID"` // The ID of the Transaction that cancels the replaced Order (only provided if this // Order replaces an existing Order). CancellingTransactionID TransactionID `json:"cancellingTransactionID"` }
A TrailingStopLossOrderTransaction represents the creation of a TrailingStopLoss Order in the user’s Account.
func (TrailingStopLossOrderTransaction) MarshalEasyJSON ¶
func (v TrailingStopLossOrderTransaction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (TrailingStopLossOrderTransaction) MarshalJSON ¶
func (v TrailingStopLossOrderTransaction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*TrailingStopLossOrderTransaction) UnmarshalEasyJSON ¶
func (v *TrailingStopLossOrderTransaction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*TrailingStopLossOrderTransaction) UnmarshalJSON ¶
func (v *TrailingStopLossOrderTransaction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type Transaction ¶
type Transaction struct { // The Transaction’s Identifier. Id TransactionID `json:"id"` // The date/time when the Transaction was created. Time DateTime `json:"time"` // The ID of the user that initiated the creation of the Transaction. UserID int64 `json:"userID"` // The ID of the Account the Transaction was created for. AccountID AccountID `json:"accountID"` // The ID of the “batch” that the Transaction belongs to. Transactions in the same // batch are applied to the Account simultaneously. BatchID TransactionID `json:"batchID"` // The Request ID of the request which generated the transaction. RequestID RequestID `json:"requestID"` }
The base Transaction specification. Specifies properties that are common between all Transaction.
func (*Transaction) Get ¶
func (t *Transaction) Get() *Transaction
func (Transaction) MarshalEasyJSON ¶
func (v Transaction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (Transaction) MarshalJSON ¶
func (v Transaction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*Transaction) UnmarshalEasyJSON ¶
func (v *Transaction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Transaction) UnmarshalJSON ¶
func (v *Transaction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type TransactionFilter ¶
type TransactionFilter string
A filter that can be used when fetching Transactions
const ( // Order-related Transactions. These are the Transactions that create, cancel, fill // or trigger Orders TransactionFilter_ORDER TransactionFilter = "ORDER" // Funding-related Transactions TransactionFilter_FUNDING TransactionFilter = "FUNDING" // Administrative Transactions TransactionFilter_ADMIN TransactionFilter = "ADMIN" // Account Create Transaction TransactionFilter_CREATE TransactionFilter = "CREATE" // Account Close Transaction TransactionFilter_CLOSE TransactionFilter = "CLOSE" // Account Reopen Transaction TransactionFilter_REOPEN TransactionFilter = "REOPEN" // Client Configuration Transaction TransactionFilter_CLIENT_CONFIGURE TransactionFilter = "CLIENT_CONFIGURE" // Client Configuration Reject Transaction TransactionFilter_CLIENT_CONFIGURE_REJECT TransactionFilter = "CLIENT_CONFIGURE_REJECT" // Transfer Funds Transaction TransactionFilter_TRANSFER_FUNDS TransactionFilter = "TRANSFER_FUNDS" // Transfer Funds Reject Transaction TransactionFilter_TRANSFER_FUNDS_REJECT TransactionFilter = "TRANSFER_FUNDS_REJECT" // Market Order Transaction TransactionFilter_MARKET_ORDER TransactionFilter = "MARKET_ORDER" // Market Order Reject Transaction TransactionFilter_MARKET_ORDER_REJECT TransactionFilter = "MARKET_ORDER_REJECT" // Limit Order Transaction TransactionFilter_LIMIT_ORDER TransactionFilter = "LIMIT_ORDER" // Limit Order Reject Transaction TransactionFilter_LIMIT_ORDER_REJECT TransactionFilter = "LIMIT_ORDER_REJECT" // Stop Order Transaction TransactionFilter_STOP_ORDER TransactionFilter = "STOP_ORDER" // Stop Order Reject Transaction TransactionFilter_STOP_ORDER_REJECT TransactionFilter = "STOP_ORDER_REJECT" // Market if Touched Order Transaction TransactionFilter_MARKET_IF_TOUCHED_ORDER TransactionFilter = "MARKET_IF_TOUCHED_ORDER" // Market if Touched Order Reject Transaction TransactionFilter_MARKET_IF_TOUCHED_ORDER_REJECT TransactionFilter = "MARKET_IF_TOUCHED_ORDER_REJECT" // Take Profit Order Transaction TransactionFilter_TAKE_PROFIT_ORDER TransactionFilter = "TAKE_PROFIT_ORDER" // Take Profit Order Reject Transaction TransactionFilter_TAKE_PROFIT_ORDER_REJECT TransactionFilter = "TAKE_PROFIT_ORDER_REJECT" // Stop Loss Order Transaction TransactionFilter_STOP_LOSS_ORDER TransactionFilter = "STOP_LOSS_ORDER" // Stop Loss Order Reject Transaction TransactionFilter_STOP_LOSS_ORDER_REJECT TransactionFilter = "STOP_LOSS_ORDER_REJECT" // Guaranteed Stop Loss Order Transaction TransactionFilter_GUARANTEED_STOP_LOSS_ORDER TransactionFilter = "GUARANTEED_STOP_LOSS_ORDER" // Guaranteed Stop Loss Order Reject Transaction TransactionFilter_GUARANTEED_STOP_LOSS_ORDER_REJECT TransactionFilter = "GUARANTEED_STOP_LOSS_ORDER_REJECT" // Trailing Stop Loss Order Transaction TransactionFilter_TRAILING_STOP_LOSS_ORDER TransactionFilter = "TRAILING_STOP_LOSS_ORDER" // Trailing Stop Loss Order Reject Transaction TransactionFilter_TRAILING_STOP_LOSS_ORDER_REJECT TransactionFilter = "TRAILING_STOP_LOSS_ORDER_REJECT" // One Cancels All Order Transaction TransactionFilter_ONE_CANCELS_ALL_ORDER TransactionFilter = "ONE_CANCELS_ALL_ORDER" // One Cancels All Order Reject Transaction TransactionFilter_ONE_CANCELS_ALL_ORDER_REJECT TransactionFilter = "ONE_CANCELS_ALL_ORDER_REJECT" // One Cancels All Order Trigger Transaction TransactionFilter_ONE_CANCELS_ALL_ORDER_TRIGGERED TransactionFilter = "ONE_CANCELS_ALL_ORDER_TRIGGERED" // Order Fill Transaction TransactionFilter_ORDER_FILL TransactionFilter = "ORDER_FILL" // Order Cancel Transaction TransactionFilter_ORDER_CANCEL TransactionFilter = "ORDER_CANCEL" // Order Cancel Reject Transaction TransactionFilter_ORDER_CANCEL_REJECT TransactionFilter = "ORDER_CANCEL_REJECT" // Order Client Extensions Modify Transaction TransactionFilter_ORDER_CLIENT_EXTENSIONS_MODIFY TransactionFilter = "ORDER_CLIENT_EXTENSIONS_MODIFY" // Order Client Extensions Modify Reject Transaction TransactionFilter_ORDER_CLIENT_EXTENSIONS_MODIFY_REJECT TransactionFilter = "ORDER_CLIENT_EXTENSIONS_MODIFY_REJECT" // Trade Client Extensions Modify Transaction TransactionFilter_TRADE_CLIENT_EXTENSIONS_MODIFY TransactionFilter = "TRADE_CLIENT_EXTENSIONS_MODIFY" // Trade Client Extensions Modify Reject Transaction TransactionFilter_TRADE_CLIENT_EXTENSIONS_MODIFY_REJECT TransactionFilter = "TRADE_CLIENT_EXTENSIONS_MODIFY_REJECT" // Margin Call Enter Transaction TransactionFilter_MARGIN_CALL_ENTER TransactionFilter = "MARGIN_CALL_ENTER" // Margin Call Extend Transaction TransactionFilter_MARGIN_CALL_EXTEND TransactionFilter = "MARGIN_CALL_EXTEND" // Margin Call Exit Transaction TransactionFilter_MARGIN_CALL_EXIT TransactionFilter = "MARGIN_CALL_EXIT" // Delayed Trade Closure Transaction TransactionFilter_DELAYED_TRADE_CLOSURE TransactionFilter = "DELAYED_TRADE_CLOSURE" // Daily Financing Transaction TransactionFilter_DAILY_FINANCING TransactionFilter = "DAILY_FINANCING" // Reset Resettable PL Transaction TransactionFilter_RESET_RESETTABLE_PL TransactionFilter = "RESET_RESETTABLE_PL" )
type TransactionHeartbeat ¶
type TransactionHeartbeat struct { // The string “HEARTBEAT” Type string `json:"type"` // The ID of the most recent Transaction created for the Account LastTransactionID TransactionID `json:"lastTransactionID"` // The date/time when the TransactionHeartbeat was created Time DateTime `json:"time"` }
func (TransactionHeartbeat) MarshalEasyJSON ¶
func (v TransactionHeartbeat) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (TransactionHeartbeat) MarshalJSON ¶
func (v TransactionHeartbeat) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*TransactionHeartbeat) UnmarshalEasyJSON ¶
func (v *TransactionHeartbeat) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*TransactionHeartbeat) UnmarshalJSON ¶
func (v *TransactionHeartbeat) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type TransactionID ¶
type TransactionID string
The unique Transaction identifier within each Account. String representation of the numerical OANDA-assigned TransactionID
type TransactionMessage ¶
type TransactionMessage interface { Message Get() *Transaction }
type TransactionParser ¶
type TransactionParser struct { AccountBalance AccountUnits `json:"accountBalance"` AccountFinancingMode AccountFinancingMode `json:"accountFinancingMode"` AccountID string `json:"accountID"` AccountNumber int64 `json:"accountNumber"` AccountUserID int64 `json:"accountUserID"` Alias string `json:"alias"` Amount AccountUnits `json:"amount"` BaseFinancing DecimalNumber `json:"baseFinancing"` BatchID string `json:"batchID"` CancellingTransactionID string `json:"cancellingTransactionID"` ClientExtensions *ClientExtensions `json:"clientExtensions"` ClientExtensionsModify *ClientExtensions `json:"clientExtensionsModify"` ClientOrderID string `json:"clientOrderID"` ClientTradeID string `json:"clientTradeID"` Comment string `json:"comment"` Commission AccountUnits `json:"commission"` DelayedTradeClose *MarketOrderDelayedTradeClose `json:"delayedTradeClose"` Distance DecimalNumber `json:"distance"` DividendAdjustment AccountUnits `json:"dividendAdjustment"` DivisionID int64 `json:"divisionID"` ExtensionNumber int64 `json:"extensionNumber"` Financing AccountUnits `json:"financing"` FullPrice ClientPrice `json:"fullPrice"` FullVWAP PriceValue `json:"fullVWAP"` FundingReason string `json:"fundingReason"` GainQuoteHomeConversionFactor DecimalNumber `json:"gainQuoteHomeConversionFactor"` GtdTime DateTime `json:"gtdTime"` Guaranteed bool `json:"guaranteed"` GuaranteedExecutionFee AccountUnits `json:"guaranteedExecutionFee"` GuaranteedExecutionPremium DecimalNumber `json:"guaranteedExecutionPremium"` GuaranteedStopLossOnFill *GuaranteedStopLossDetails `json:"guaranteedStopLossOnFill"` HalfSpreadCost AccountUnits `json:"halfSpreadCost"` HomeConversionFactors *HomeConversionFactors `json:"homeConversionFactors"` HomeCurrency Currency `json:"homeCurrency"` Id string `json:"id"` Instrument InstrumentName `json:"instrument"` IntendedReplacesOrderID string `json:"intendedReplacesOrderID"` LastTransactionID TransactionID `json:"lastTransactionID"` LongPositionCloseout *MarketOrderPositionCloseout `json:"longPositionCloseout"` LossQuoteHomeConversionFactor DecimalNumber `json:"lossQuoteHomeConversionFactor"` MarginCloseout *MarketOrderMarginCloseout `json:"marginCloseout"` MarginRate DecimalNumber `json:"marginRate"` OpenTradeDividendAdjustments []*OpenTradeDividendAdjustment `json:"openTradeDividendAdjustments"` OrderFillTransactionID string `json:"orderFillTransactionID"` OrderID string `json:"orderID"` Pl AccountUnits `json:"pl"` PositionFill OrderPositionFill `json:"positionFill"` PositionFinancings []*PositionFinancing `json:"positionFinancings"` Price PriceValue `json:"price"` PriceBound PriceValue `json:"priceBound"` QuoteDividendAdjustment DecimalNumber `json:"quoteDividendAdjustment"` QuoteFinancing DecimalNumber `json:"quoteFinancing"` QuoteGuaranteedExecutionFee DecimalNumber `json:"quoteGuaranteedExecutionFee"` QuotePL DecimalNumber `json:"quotePL"` Reason string `json:"reason"` RejectReason string `json:"rejectReason"` ReplacedByOrderID string `json:"replacedByOrderID"` ReplacesOrderID string `json:"replacesOrderID"` RequestID string `json:"requestID"` ShortPositionCloseout *MarketOrderPositionCloseout `json:"shortPositionCloseout"` SiteID int64 `json:"siteID"` StopLossOnFill *StopLossDetails `json:"stopLossOnFill"` TakeProfitOnFill *TakeProfitDetails `json:"takeProfitOnFill"` Time DateTime `json:"time"` TimeInForce TimeInForce `json:"timeInForce"` TradeClientExtensions *ClientExtensions `json:"tradeClientExtensions"` TradeClientExtensionsModify *ClientExtensions `json:"tradeClientExtensionsModify"` TradeClose *MarketOrderTradeClose `json:"tradeClose"` TradeID string `json:"tradeID"` TradeIDs string `json:"tradeIDs"` TradeOpened *TradeOpen `json:"tradeOpened"` TradeReduced *TradeReduce `json:"tradeReduced"` TradeState string `json:"tradeState"` TradesClosed []*TradeReduce `json:"tradesClosed"` TrailingStopLossOnFill *TrailingStopLossDetails `json:"trailingStopLossOnFill"` TriggerCondition string `json:"triggerCondition"` Type string `json:"type"` Units DecimalNumber `json:"units"` UserID int64 `json:"userID"` }
func (*TransactionParser) Get ¶
func (p *TransactionParser) Get() *Transaction
func (TransactionParser) MarshalEasyJSON ¶
func (v TransactionParser) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (TransactionParser) MarshalJSON ¶
func (v TransactionParser) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*TransactionParser) Parse ¶
func (p *TransactionParser) Parse() TransactionMessage
Example
r := parser.Parse() switch v := r.(type) { case *TransactionHeartbeat: case *CreateTransaction: case *CloseTransaction: case *ReopenTransaction: case *ClientConfigureTransaction: case *ClientConfigureRejectTransaction: case *TransferFundsTransaction: case *TransferFundsRejectTransaction: case *MarketOrderTransaction: case *MarketOrderRejectTransaction: case *FixedPriceOrderTransaction: case *LimitOrderTransaction: case *LimitOrderRejectTransaction: case *StopOrderTransaction: case *StopOrderRejectTransaction: case *MarketIfTouchedOrderTransaction: case *MarketIfTouchedOrderRejectTransaction: case *TakeProfitOrderTransaction: case *TakeProfitOrderRejectTransaction: case *StopLossOrderTransaction: case *StopLossOrderRejectTransaction: case *GuaranteedStopLossOrderTransaction: case *GuaranteedStopLossOrderRejectTransaction: case *TrailingStopLossOrderTransaction: case *TrailingStopLossOrderRejectTransaction: case *OrderFillTransaction: case *OrderCancelTransaction: case *OrderCancelRejectTransaction: case *OrderClientExtensionsModifyTransaction: case *OrderClientExtensionsModifyRejectTransaction: case *TradeClientExtensionsModifyTransaction: case *TradeClientExtensionsModifyRejectTransaction: case *MarginCallEnterTransaction: case *MarginCallExtendTransaction: case *MarginCallExitTransaction: case *DelayedTradeClosureTransaction: case *DailyFinancingTransaction: case *DividendAdjustmentTransaction: case *ResetResettablePLTransaction: }
func (*TransactionParser) UnmarshalEasyJSON ¶
func (v *TransactionParser) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*TransactionParser) UnmarshalJSON ¶
func (v *TransactionParser) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type TransactionRejectReason ¶
type TransactionRejectReason string
The reason that a Transaction was rejected.
const ( // An unexpected internal server error has occurred TransactionRejectReason_INTERNAL_SERVER_ERROR TransactionRejectReason = "INTERNAL_SERVER_ERROR" // The system was unable to determine the current price for the Order’s instrument TransactionRejectReason_INSTRUMENT_PRICE_UNKNOWN TransactionRejectReason = "INSTRUMENT_PRICE_UNKNOWN" // The Account is not active TransactionRejectReason_ACCOUNT_NOT_ACTIVE TransactionRejectReason = "ACCOUNT_NOT_ACTIVE" // The Account is locked TransactionRejectReason_ACCOUNT_LOCKED TransactionRejectReason = "ACCOUNT_LOCKED" // The Account is locked for Order creation TransactionRejectReason_ACCOUNT_ORDER_CREATION_LOCKED TransactionRejectReason = "ACCOUNT_ORDER_CREATION_LOCKED" // The Account is locked for configuration TransactionRejectReason_ACCOUNT_CONFIGURATION_LOCKED TransactionRejectReason = "ACCOUNT_CONFIGURATION_LOCKED" // The Account is locked for deposits TransactionRejectReason_ACCOUNT_DEPOSIT_LOCKED TransactionRejectReason = "ACCOUNT_DEPOSIT_LOCKED" // The Account is locked for withdrawals TransactionRejectReason_ACCOUNT_WITHDRAWAL_LOCKED TransactionRejectReason = "ACCOUNT_WITHDRAWAL_LOCKED" // The Account is locked for Order cancellation TransactionRejectReason_ACCOUNT_ORDER_CANCEL_LOCKED TransactionRejectReason = "ACCOUNT_ORDER_CANCEL_LOCKED" // The instrument specified is not tradeable by the Account TransactionRejectReason_INSTRUMENT_NOT_TRADEABLE TransactionRejectReason = "INSTRUMENT_NOT_TRADEABLE" // Creating the Order would result in the maximum number of allowed pending Orders being // exceeded TransactionRejectReason_PENDING_ORDERS_ALLOWED_EXCEEDED TransactionRejectReason = "PENDING_ORDERS_ALLOWED_EXCEEDED" // Neither the Order ID nor client Order ID are specified TransactionRejectReason_ORDER_ID_UNSPECIFIED TransactionRejectReason = "ORDER_ID_UNSPECIFIED" // The Order specified does not exist TransactionRejectReason_ORDER_DOESNT_EXIST TransactionRejectReason = "ORDER_DOESNT_EXIST" // The Order ID and client Order ID specified do not identify the same Order TransactionRejectReason_ORDER_IDENTIFIER_INCONSISTENCY TransactionRejectReason = "ORDER_IDENTIFIER_INCONSISTENCY" // Neither the Trade ID nor client Trade ID are specified TransactionRejectReason_TRADE_ID_UNSPECIFIED TransactionRejectReason = "TRADE_ID_UNSPECIFIED" // The Trade specified does not exist TransactionRejectReason_TRADE_DOESNT_EXIST TransactionRejectReason = "TRADE_DOESNT_EXIST" // The Trade ID and client Trade ID specified do not identify the same Trade TransactionRejectReason_TRADE_IDENTIFIER_INCONSISTENCY TransactionRejectReason = "TRADE_IDENTIFIER_INCONSISTENCY" // The Account had insufficient margin to perform the action specified. One possible // reason for this is due to the creation or modification of a guaranteed StopLoss Order. TransactionRejectReason_INSUFFICIENT_MARGIN TransactionRejectReason = "INSUFFICIENT_MARGIN" // Order instrument has not been specified TransactionRejectReason_INSTRUMENT_MISSING TransactionRejectReason = "INSTRUMENT_MISSING" // The instrument specified is unknown TransactionRejectReason_INSTRUMENT_UNKNOWN TransactionRejectReason = "INSTRUMENT_UNKNOWN" // Order units have not been not specified TransactionRejectReason_UNITS_MISSING TransactionRejectReason = "UNITS_MISSING" // Order units specified are invalid TransactionRejectReason_UNITS_INVALID TransactionRejectReason = "UNITS_INVALID" // The units specified contain more precision than is allowed for the Order’s instrument TransactionRejectReason_UNITS_PRECISION_EXCEEDED TransactionRejectReason = "UNITS_PRECISION_EXCEEDED" // The units specified exceeds the maximum number of units allowed TransactionRejectReason_UNITS_LIMIT_EXCEEDED TransactionRejectReason = "UNITS_LIMIT_EXCEEDED" // The units specified is less than the minimum number of units required TransactionRejectReason_UNITS_MINIMUM_NOT_MET TransactionRejectReason = "UNITS_MINIMUM_NOT_MET" // The price has not been specified TransactionRejectReason_PRICE_MISSING TransactionRejectReason = "PRICE_MISSING" // The price specified is invalid TransactionRejectReason_PRICE_INVALID TransactionRejectReason = "PRICE_INVALID" // The price specified contains more precision than is allowed for the instrument TransactionRejectReason_PRICE_PRECISION_EXCEEDED TransactionRejectReason = "PRICE_PRECISION_EXCEEDED" // The price distance has not been specified TransactionRejectReason_PRICE_DISTANCE_MISSING TransactionRejectReason = "PRICE_DISTANCE_MISSING" // The price distance specified is invalid TransactionRejectReason_PRICE_DISTANCE_INVALID TransactionRejectReason = "PRICE_DISTANCE_INVALID" // The price distance specified contains more precision than is allowed for the instrument TransactionRejectReason_PRICE_DISTANCE_PRECISION_EXCEEDED TransactionRejectReason = "PRICE_DISTANCE_PRECISION_EXCEEDED" // The price distance exceeds that maximum allowed amount TransactionRejectReason_PRICE_DISTANCE_MAXIMUM_EXCEEDED TransactionRejectReason = "PRICE_DISTANCE_MAXIMUM_EXCEEDED" // The price distance does not meet the minimum allowed amount TransactionRejectReason_PRICE_DISTANCE_MINIMUM_NOT_MET TransactionRejectReason = "PRICE_DISTANCE_MINIMUM_NOT_MET" // The TimeInForce field has not been specified TransactionRejectReason_TIME_IN_FORCE_MISSING TransactionRejectReason = "TIME_IN_FORCE_MISSING" // The TimeInForce specified is invalid TransactionRejectReason_TIME_IN_FORCE_INVALID TransactionRejectReason = "TIME_IN_FORCE_INVALID" // The TimeInForce is GTD but no GTD timestamp is provided TransactionRejectReason_TIME_IN_FORCE_GTD_TIMESTAMP_MISSING TransactionRejectReason = "TIME_IN_FORCE_GTD_TIMESTAMP_MISSING" // The TimeInForce is GTD but the GTD timestamp is in the past TransactionRejectReason_TIME_IN_FORCE_GTD_TIMESTAMP_IN_PAST TransactionRejectReason = "TIME_IN_FORCE_GTD_TIMESTAMP_IN_PAST" // The price bound specified is invalid TransactionRejectReason_PRICE_BOUND_INVALID TransactionRejectReason = "PRICE_BOUND_INVALID" // The price bound specified contains more precision than is allowed for the Order’s // instrument TransactionRejectReason_PRICE_BOUND_PRECISION_EXCEEDED TransactionRejectReason = "PRICE_BOUND_PRECISION_EXCEEDED" // Multiple Orders on fill share the same client Order ID TransactionRejectReason_ORDERS_ON_FILL_DUPLICATE_CLIENT_ORDER_IDS TransactionRejectReason = "ORDERS_ON_FILL_DUPLICATE_CLIENT_ORDER_IDS" // The Order does not support Trade on fill client extensions because it cannot create // a new Trade TransactionRejectReason_TRADE_ON_FILL_CLIENT_EXTENSIONS_NOT_SUPPORTED TransactionRejectReason = "TRADE_ON_FILL_CLIENT_EXTENSIONS_NOT_SUPPORTED" // The client Order ID specified is invalid TransactionRejectReason_CLIENT_ORDER_ID_INVALID TransactionRejectReason = "CLIENT_ORDER_ID_INVALID" // The client Order ID specified is already assigned to another pending Order TransactionRejectReason_CLIENT_ORDER_ID_ALREADY_EXISTS TransactionRejectReason = "CLIENT_ORDER_ID_ALREADY_EXISTS" // The client Order tag specified is invalid TransactionRejectReason_CLIENT_ORDER_TAG_INVALID TransactionRejectReason = "CLIENT_ORDER_TAG_INVALID" // The client Order comment specified is invalid TransactionRejectReason_CLIENT_ORDER_COMMENT_INVALID TransactionRejectReason = "CLIENT_ORDER_COMMENT_INVALID" // The client Trade ID specified is invalid TransactionRejectReason_CLIENT_TRADE_ID_INVALID TransactionRejectReason = "CLIENT_TRADE_ID_INVALID" // The client Trade ID specified is already assigned to another open Trade TransactionRejectReason_CLIENT_TRADE_ID_ALREADY_EXISTS TransactionRejectReason = "CLIENT_TRADE_ID_ALREADY_EXISTS" // The client Trade tag specified is invalid TransactionRejectReason_CLIENT_TRADE_TAG_INVALID TransactionRejectReason = "CLIENT_TRADE_TAG_INVALID" // The client Trade comment is invalid TransactionRejectReason_CLIENT_TRADE_COMMENT_INVALID TransactionRejectReason = "CLIENT_TRADE_COMMENT_INVALID" // The OrderFillPositionAction field has not been specified TransactionRejectReason_ORDER_FILL_POSITION_ACTION_MISSING TransactionRejectReason = "ORDER_FILL_POSITION_ACTION_MISSING" // The OrderFillPositionAction specified is invalid TransactionRejectReason_ORDER_FILL_POSITION_ACTION_INVALID TransactionRejectReason = "ORDER_FILL_POSITION_ACTION_INVALID" // The TriggerCondition field has not been specified TransactionRejectReason_TRIGGER_CONDITION_MISSING TransactionRejectReason = "TRIGGER_CONDITION_MISSING" // The TriggerCondition specified is invalid TransactionRejectReason_TRIGGER_CONDITION_INVALID TransactionRejectReason = "TRIGGER_CONDITION_INVALID" // The OrderFillPositionAction field has not been specified TransactionRejectReason_ORDER_PARTIAL_FILL_OPTION_MISSING TransactionRejectReason = "ORDER_PARTIAL_FILL_OPTION_MISSING" // The OrderFillPositionAction specified is invalid. TransactionRejectReason_ORDER_PARTIAL_FILL_OPTION_INVALID TransactionRejectReason = "ORDER_PARTIAL_FILL_OPTION_INVALID" // When attempting to reissue an order (currently only a MarketIfTouched) that was immediately // partially filled, it is not possible to create a correct pending Order. TransactionRejectReason_INVALID_REISSUE_IMMEDIATE_PARTIAL_FILL TransactionRejectReason = "INVALID_REISSUE_IMMEDIATE_PARTIAL_FILL" // The Orders on fill would be in violation of the risk management Order mutual exclusivity // configuration specifying that only one risk management Order can be attached to a // Trade. TransactionRejectReason_ORDERS_ON_FILL_RMO_MUTUAL_EXCLUSIVITY_MUTUALLY_EXCLUSIVE_VIOLATION TransactionRejectReason = "ORDERS_ON_FILL_RMO_MUTUAL_EXCLUSIVITY_MUTUALLY_EXCLUSIVE_VIOLATION" // The Orders on fill would be in violation of the risk management Order mutual exclusivity // configuration specifying that if a GSLO is already attached to a Trade, no other // risk management Order can be attached to a Trade. TransactionRejectReason_ORDERS_ON_FILL_RMO_MUTUAL_EXCLUSIVITY_GSLO_EXCLUDES_OTHERS_VIOLATION TransactionRejectReason = "ORDERS_ON_FILL_RMO_MUTUAL_EXCLUSIVITY_GSLO_EXCLUDES_OTHERS_VIOLATION" // A Take Profit Order for the specified Trade already exists TransactionRejectReason_TAKE_PROFIT_ORDER_ALREADY_EXISTS TransactionRejectReason = "TAKE_PROFIT_ORDER_ALREADY_EXISTS" // The Take Profit Order would cause the associated Trade to be in violation of the // FIFO violation safeguard constraints. TransactionRejectReason_TAKE_PROFIT_ORDER_WOULD_VIOLATE_FIFO_VIOLATION_SAFEGUARD TransactionRejectReason = "TAKE_PROFIT_ORDER_WOULD_VIOLATE_FIFO_VIOLATION_SAFEGUARD" // The Take Profit on fill specified does not provide a price TransactionRejectReason_TAKE_PROFIT_ON_FILL_PRICE_MISSING TransactionRejectReason = "TAKE_PROFIT_ON_FILL_PRICE_MISSING" // The Take Profit on fill specified contains an invalid price TransactionRejectReason_TAKE_PROFIT_ON_FILL_PRICE_INVALID TransactionRejectReason = "TAKE_PROFIT_ON_FILL_PRICE_INVALID" // The Take Profit on fill specified contains a price with more precision than is allowed // by the Order’s instrument TransactionRejectReason_TAKE_PROFIT_ON_FILL_PRICE_PRECISION_EXCEEDED TransactionRejectReason = "TAKE_PROFIT_ON_FILL_PRICE_PRECISION_EXCEEDED" // The Take Profit on fill specified does not provide a TimeInForce TransactionRejectReason_TAKE_PROFIT_ON_FILL_TIME_IN_FORCE_MISSING TransactionRejectReason = "TAKE_PROFIT_ON_FILL_TIME_IN_FORCE_MISSING" // The Take Profit on fill specifies an invalid TimeInForce TransactionRejectReason_TAKE_PROFIT_ON_FILL_TIME_IN_FORCE_INVALID TransactionRejectReason = "TAKE_PROFIT_ON_FILL_TIME_IN_FORCE_INVALID" // The Take Profit on fill specifies a GTD TimeInForce but does not provide a GTD timestamp TransactionRejectReason_TAKE_PROFIT_ON_FILL_GTD_TIMESTAMP_MISSING TransactionRejectReason = "TAKE_PROFIT_ON_FILL_GTD_TIMESTAMP_MISSING" // The Take Profit on fill specifies a GTD timestamp that is in the past TransactionRejectReason_TAKE_PROFIT_ON_FILL_GTD_TIMESTAMP_IN_PAST TransactionRejectReason = "TAKE_PROFIT_ON_FILL_GTD_TIMESTAMP_IN_PAST" // The Take Profit on fill client Order ID specified is invalid TransactionRejectReason_TAKE_PROFIT_ON_FILL_CLIENT_ORDER_ID_INVALID TransactionRejectReason = "TAKE_PROFIT_ON_FILL_CLIENT_ORDER_ID_INVALID" // The Take Profit on fill client Order tag specified is invalid TransactionRejectReason_TAKE_PROFIT_ON_FILL_CLIENT_ORDER_TAG_INVALID TransactionRejectReason = "TAKE_PROFIT_ON_FILL_CLIENT_ORDER_TAG_INVALID" // The Take Profit on fill client Order comment specified is invalid TransactionRejectReason_TAKE_PROFIT_ON_FILL_CLIENT_ORDER_COMMENT_INVALID TransactionRejectReason = "TAKE_PROFIT_ON_FILL_CLIENT_ORDER_COMMENT_INVALID" // The Take Profit on fill specified does not provide a TriggerCondition TransactionRejectReason_TAKE_PROFIT_ON_FILL_TRIGGER_CONDITION_MISSING TransactionRejectReason = "TAKE_PROFIT_ON_FILL_TRIGGER_CONDITION_MISSING" // The Take Profit on fill specifies an invalid TriggerCondition TransactionRejectReason_TAKE_PROFIT_ON_FILL_TRIGGER_CONDITION_INVALID TransactionRejectReason = "TAKE_PROFIT_ON_FILL_TRIGGER_CONDITION_INVALID" // A Stop Loss Order for the specified Trade already exists TransactionRejectReason_STOP_LOSS_ORDER_ALREADY_EXISTS TransactionRejectReason = "STOP_LOSS_ORDER_ALREADY_EXISTS" // An attempt was made to to create a non-guaranteed stop loss order in an account that // requires all stop loss orders to be guaranteed. TransactionRejectReason_STOP_LOSS_ORDER_GUARANTEED_REQUIRED TransactionRejectReason = "STOP_LOSS_ORDER_GUARANTEED_REQUIRED" // An attempt to create a guaranteed stop loss order with a price that is within the // current tradeable spread. TransactionRejectReason_STOP_LOSS_ORDER_GUARANTEED_PRICE_WITHIN_SPREAD TransactionRejectReason = "STOP_LOSS_ORDER_GUARANTEED_PRICE_WITHIN_SPREAD" // An attempt was made to create a guaranteed Stop Loss Order, however the Account’s // configuration does not allow guaranteed Stop Loss Orders. TransactionRejectReason_STOP_LOSS_ORDER_GUARANTEED_NOT_ALLOWED TransactionRejectReason = "STOP_LOSS_ORDER_GUARANTEED_NOT_ALLOWED" // An attempt was made to create a guaranteed Stop Loss Order when the market was halted. TransactionRejectReason_STOP_LOSS_ORDER_GUARANTEED_HALTED_CREATE_VIOLATION TransactionRejectReason = "STOP_LOSS_ORDER_GUARANTEED_HALTED_CREATE_VIOLATION" // An attempt was made to re-create a guaranteed Stop Loss Order with a tighter fill // price when the market was halted. TransactionRejectReason_STOP_LOSS_ORDER_GUARANTEED_HALTED_TIGHTEN_VIOLATION TransactionRejectReason = "STOP_LOSS_ORDER_GUARANTEED_HALTED_TIGHTEN_VIOLATION" // An attempt was made to create a guaranteed Stop Loss Order on a hedged Trade (ie // there is an existing open Trade in the opposing direction), however the Account’s // configuration does not allow guaranteed Stop Loss Orders for hedged Trades/Positions. TransactionRejectReason_STOP_LOSS_ORDER_GUARANTEED_HEDGING_NOT_ALLOWED TransactionRejectReason = "STOP_LOSS_ORDER_GUARANTEED_HEDGING_NOT_ALLOWED" // An attempt was made to create a guaranteed Stop Loss Order, however the distance // between the current price and the trigger price does not meet the Account’s configured // minimum Guaranteed Stop Loss distance. TransactionRejectReason_STOP_LOSS_ORDER_GUARANTEED_MINIMUM_DISTANCE_NOT_MET TransactionRejectReason = "STOP_LOSS_ORDER_GUARANTEED_MINIMUM_DISTANCE_NOT_MET" // An attempt was made to cancel a Stop Loss Order, however the Account’s configuration // requires every Trade have an associated Stop Loss Order. TransactionRejectReason_STOP_LOSS_ORDER_NOT_CANCELABLE TransactionRejectReason = "STOP_LOSS_ORDER_NOT_CANCELABLE" // An attempt was made to cancel and replace a Stop Loss Order, however the Account’s // configuration prevents the modification of Stop Loss Orders. TransactionRejectReason_STOP_LOSS_ORDER_NOT_REPLACEABLE TransactionRejectReason = "STOP_LOSS_ORDER_NOT_REPLACEABLE" // An attempt was made to create a guaranteed Stop Loss Order, however doing so would // exceed the Account’s configured guaranteed StopLoss Order level restriction volume. TransactionRejectReason_STOP_LOSS_ORDER_GUARANTEED_LEVEL_RESTRICTION_EXCEEDED TransactionRejectReason = "STOP_LOSS_ORDER_GUARANTEED_LEVEL_RESTRICTION_EXCEEDED" // The Stop Loss Order request contains both the price and distance fields. TransactionRejectReason_STOP_LOSS_ORDER_PRICE_AND_DISTANCE_BOTH_SPECIFIED TransactionRejectReason = "STOP_LOSS_ORDER_PRICE_AND_DISTANCE_BOTH_SPECIFIED" // The Stop Loss Order request contains neither the price nor distance fields. TransactionRejectReason_STOP_LOSS_ORDER_PRICE_AND_DISTANCE_BOTH_MISSING TransactionRejectReason = "STOP_LOSS_ORDER_PRICE_AND_DISTANCE_BOTH_MISSING" // The Stop Loss Order would cause the associated Trade to be in violation of the FIFO // violation safeguard constraints TransactionRejectReason_STOP_LOSS_ORDER_WOULD_VIOLATE_FIFO_VIOLATION_SAFEGUARD TransactionRejectReason = "STOP_LOSS_ORDER_WOULD_VIOLATE_FIFO_VIOLATION_SAFEGUARD" // The Stop Loss Order would be in violation of the risk management Order mutual exclusivity // configuration specifying that only one risk management order can be attached to a // Trade. TransactionRejectReason_STOP_LOSS_ORDER_RMO_MUTUAL_EXCLUSIVITY_MUTUALLY_EXCLUSIVE_VIOLATION TransactionRejectReason = "STOP_LOSS_ORDER_RMO_MUTUAL_EXCLUSIVITY_MUTUALLY_EXCLUSIVE_VIOLATION" // The Stop Loss Order would be in violation of the risk management Order mutual exclusivity // configuration specifying that if a GSLO is already attached to a Trade, no other // risk management Order can be attached to the same Trade. TransactionRejectReason_STOP_LOSS_ORDER_RMO_MUTUAL_EXCLUSIVITY_GSLO_EXCLUDES_OTHERS_VIOLATION TransactionRejectReason = "STOP_LOSS_ORDER_RMO_MUTUAL_EXCLUSIVITY_GSLO_EXCLUDES_OTHERS_VIOLATION" // An attempt to create a pending Order was made with no Stop Loss Order on fill specified // and the Account’s configuration requires that every Trade have an associated Stop // Loss Order. TransactionRejectReason_STOP_LOSS_ON_FILL_REQUIRED_FOR_PENDING_ORDER TransactionRejectReason = "STOP_LOSS_ON_FILL_REQUIRED_FOR_PENDING_ORDER" // An attempt to create a pending Order was made with a Stop Loss Order on fill that // was explicitly configured to be guaranteed, however the Account’s configuration // does not allow guaranteed Stop Loss Orders. TransactionRejectReason_STOP_LOSS_ON_FILL_GUARANTEED_NOT_ALLOWED TransactionRejectReason = "STOP_LOSS_ON_FILL_GUARANTEED_NOT_ALLOWED" // An attempt to create a pending Order was made with a Stop Loss Order on fill that // was explicitly configured to be not guaranteed, however the Account’s configuration // requires guaranteed Stop Loss Orders. TransactionRejectReason_STOP_LOSS_ON_FILL_GUARANTEED_REQUIRED TransactionRejectReason = "STOP_LOSS_ON_FILL_GUARANTEED_REQUIRED" // The Stop Loss on fill specified does not provide a price TransactionRejectReason_STOP_LOSS_ON_FILL_PRICE_MISSING TransactionRejectReason = "STOP_LOSS_ON_FILL_PRICE_MISSING" // The Stop Loss on fill specifies an invalid price TransactionRejectReason_STOP_LOSS_ON_FILL_PRICE_INVALID TransactionRejectReason = "STOP_LOSS_ON_FILL_PRICE_INVALID" // The Stop Loss on fill specifies a price with more precision than is allowed by the // Order’s instrument TransactionRejectReason_STOP_LOSS_ON_FILL_PRICE_PRECISION_EXCEEDED TransactionRejectReason = "STOP_LOSS_ON_FILL_PRICE_PRECISION_EXCEEDED" // An attempt to create a pending Order was made with the distance between the guaranteed // Stop Loss Order on fill’s price and the pending Order’s price is less than the // Account’s configured minimum guaranteed stop loss distance. TransactionRejectReason_STOP_LOSS_ON_FILL_GUARANTEED_MINIMUM_DISTANCE_NOT_MET TransactionRejectReason = "STOP_LOSS_ON_FILL_GUARANTEED_MINIMUM_DISTANCE_NOT_MET" // An attempt to create a pending Order was made with a guaranteed Stop Loss Order on // fill configured, and the Order’s units exceed the Account’s configured guaranteed // StopLoss Order level restriction volume. TransactionRejectReason_STOP_LOSS_ON_FILL_GUARANTEED_LEVEL_RESTRICTION_EXCEEDED TransactionRejectReason = "STOP_LOSS_ON_FILL_GUARANTEED_LEVEL_RESTRICTION_EXCEEDED" // The Stop Loss on fill distance is invalid TransactionRejectReason_STOP_LOSS_ON_FILL_DISTANCE_INVALID TransactionRejectReason = "STOP_LOSS_ON_FILL_DISTANCE_INVALID" // The Stop Loss on fill price distance exceeds the maximum allowed amount TransactionRejectReason_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED TransactionRejectReason = "STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED" // The Stop Loss on fill distance contains more precision than is allowed by the instrument TransactionRejectReason_STOP_LOSS_ON_FILL_DISTANCE_PRECISION_EXCEEDED TransactionRejectReason = "STOP_LOSS_ON_FILL_DISTANCE_PRECISION_EXCEEDED" // The Stop Loss on fill contains both the price and distance fields. TransactionRejectReason_STOP_LOSS_ON_FILL_PRICE_AND_DISTANCE_BOTH_SPECIFIED TransactionRejectReason = "STOP_LOSS_ON_FILL_PRICE_AND_DISTANCE_BOTH_SPECIFIED" // The Stop Loss on fill contains neither the price nor distance fields. TransactionRejectReason_STOP_LOSS_ON_FILL_PRICE_AND_DISTANCE_BOTH_MISSING TransactionRejectReason = "STOP_LOSS_ON_FILL_PRICE_AND_DISTANCE_BOTH_MISSING" // The Stop Loss on fill specified does not provide a TimeInForce TransactionRejectReason_STOP_LOSS_ON_FILL_TIME_IN_FORCE_MISSING TransactionRejectReason = "STOP_LOSS_ON_FILL_TIME_IN_FORCE_MISSING" // The Stop Loss on fill specifies an invalid TimeInForce TransactionRejectReason_STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID TransactionRejectReason = "STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID" // The Stop Loss on fill specifies a GTD TimeInForce but does not provide a GTD timestamp TransactionRejectReason_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_MISSING TransactionRejectReason = "STOP_LOSS_ON_FILL_GTD_TIMESTAMP_MISSING" // The Stop Loss on fill specifies a GTD timestamp that is in the past TransactionRejectReason_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST TransactionRejectReason = "STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST" // The Stop Loss on fill client Order ID specified is invalid TransactionRejectReason_STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_INVALID TransactionRejectReason = "STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_INVALID" // The Stop Loss on fill client Order tag specified is invalid TransactionRejectReason_STOP_LOSS_ON_FILL_CLIENT_ORDER_TAG_INVALID TransactionRejectReason = "STOP_LOSS_ON_FILL_CLIENT_ORDER_TAG_INVALID" // The Stop Loss on fill client Order comment specified is invalid TransactionRejectReason_STOP_LOSS_ON_FILL_CLIENT_ORDER_COMMENT_INVALID TransactionRejectReason = "STOP_LOSS_ON_FILL_CLIENT_ORDER_COMMENT_INVALID" // The Stop Loss on fill specified does not provide a TriggerCondition TransactionRejectReason_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_MISSING TransactionRejectReason = "STOP_LOSS_ON_FILL_TRIGGER_CONDITION_MISSING" // The Stop Loss on fill specifies an invalid TriggerCondition TransactionRejectReason_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID TransactionRejectReason = "STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID" // A Guaranteed Stop Loss Order for the specified Trade already exists TransactionRejectReason_GUARANTEED_STOP_LOSS_ORDER_ALREADY_EXISTS TransactionRejectReason = "GUARANTEED_STOP_LOSS_ORDER_ALREADY_EXISTS" // An attempt was made to to create a non-guaranteed stop loss order in an account that // requires all stop loss orders to be guaranteed. TransactionRejectReason_GUARANTEED_STOP_LOSS_ORDER_REQUIRED TransactionRejectReason = "GUARANTEED_STOP_LOSS_ORDER_REQUIRED" // An attempt to create a guaranteed stop loss order with a price that is within the // current tradeable spread. TransactionRejectReason_GUARANTEED_STOP_LOSS_ORDER_PRICE_WITHIN_SPREAD TransactionRejectReason = "GUARANTEED_STOP_LOSS_ORDER_PRICE_WITHIN_SPREAD" // An attempt was made to create a Guaranteed Stop Loss Order, however the Account’s // configuration does not allow Guaranteed Stop Loss Orders. TransactionRejectReason_GUARANTEED_STOP_LOSS_ORDER_NOT_ALLOWED TransactionRejectReason = "GUARANTEED_STOP_LOSS_ORDER_NOT_ALLOWED" // An attempt was made to create a Guaranteed Stop Loss Order when the market was halted. TransactionRejectReason_GUARANTEED_STOP_LOSS_ORDER_HALTED_CREATE_VIOLATION TransactionRejectReason = "GUARANTEED_STOP_LOSS_ORDER_HALTED_CREATE_VIOLATION" // An attempt was made to create a Guaranteed Stop Loss Order when the market was open. TransactionRejectReason_GUARANTEED_STOP_LOSS_ORDER_CREATE_VIOLATION TransactionRejectReason = "GUARANTEED_STOP_LOSS_ORDER_CREATE_VIOLATION" // An attempt was made to re-create a Guaranteed Stop Loss Order with a tighter fill // price when the market was halted. TransactionRejectReason_GUARANTEED_STOP_LOSS_ORDER_HALTED_TIGHTEN_VIOLATION TransactionRejectReason = "GUARANTEED_STOP_LOSS_ORDER_HALTED_TIGHTEN_VIOLATION" // An attempt was made to re-create a Guaranteed Stop Loss Order with a tighter fill // price when the market was open. TransactionRejectReason_GUARANTEED_STOP_LOSS_ORDER_TIGHTEN_VIOLATION TransactionRejectReason = "GUARANTEED_STOP_LOSS_ORDER_TIGHTEN_VIOLATION" // An attempt was made to create a Guaranteed Stop Loss Order on a hedged Trade (ie // there is an existing open Trade in the opposing direction), however the Account’s // configuration does not allow Guaranteed Stop Loss Orders for hedged Trades/Positions. TransactionRejectReason_GUARANTEED_STOP_LOSS_ORDER_HEDGING_NOT_ALLOWED TransactionRejectReason = "GUARANTEED_STOP_LOSS_ORDER_HEDGING_NOT_ALLOWED" // An attempt was made to create a Guaranteed Stop Loss Order, however the distance // between the current price and the trigger price does not meet the Account’s configured // minimum Guaranteed Stop Loss distance. TransactionRejectReason_GUARANTEED_STOP_LOSS_ORDER_MINIMUM_DISTANCE_NOT_MET TransactionRejectReason = "GUARANTEED_STOP_LOSS_ORDER_MINIMUM_DISTANCE_NOT_MET" // An attempt was made to cancel a Guaranteed Stop Loss Order when the market is open, // however the Account’s configuration requires every Trade have an associated Guaranteed // Stop Loss Order. TransactionRejectReason_GUARANTEED_STOP_LOSS_ORDER_NOT_CANCELABLE TransactionRejectReason = "GUARANTEED_STOP_LOSS_ORDER_NOT_CANCELABLE" // An attempt was made to cancel a Guaranteed Stop Loss Order when the market is halted, // however the Account’s configuration requires every Trade have an associated Guaranteed // Stop Loss Order. TransactionRejectReason_GUARANTEED_STOP_LOSS_ORDER_HALTED_NOT_CANCELABLE TransactionRejectReason = "GUARANTEED_STOP_LOSS_ORDER_HALTED_NOT_CANCELABLE" // An attempt was made to cancel and replace a Guaranteed Stop Loss Order when the market // is open, however the Account’s configuration prevents the modification of Guaranteed // Stop Loss Orders. TransactionRejectReason_GUARANTEED_STOP_LOSS_ORDER_NOT_REPLACEABLE TransactionRejectReason = "GUARANTEED_STOP_LOSS_ORDER_NOT_REPLACEABLE" // An attempt was made to cancel and replace a Guaranteed Stop Loss Order when the market // is halted, however the Account’s configuration prevents the modification of Guaranteed // Stop Loss Orders. TransactionRejectReason_GUARANTEED_STOP_LOSS_ORDER_HALTED_NOT_REPLACEABLE TransactionRejectReason = "GUARANTEED_STOP_LOSS_ORDER_HALTED_NOT_REPLACEABLE" // An attempt was made to create a Guaranteed Stop Loss Order, however doing so would // exceed the Account’s configured guaranteed StopLoss Order level restriction volume. TransactionRejectReason_GUARANTEED_STOP_LOSS_ORDER_LEVEL_RESTRICTION_VOLUME_EXCEEDED TransactionRejectReason = "GUARANTEED_STOP_LOSS_ORDER_LEVEL_RESTRICTION_VOLUME_EXCEEDED" // An attempt was made to create a Guaranteed Stop Loss Order, however doing so would // exceed the Account’s configured guaranteed StopLoss Order level restriction price // range. TransactionRejectReason_GUARANTEED_STOP_LOSS_ORDER_LEVEL_RESTRICTION_PRICE_RANGE_EXCEEDED TransactionRejectReason = "GUARANTEED_STOP_LOSS_ORDER_LEVEL_RESTRICTION_PRICE_RANGE_EXCEEDED" // The Guaranteed Stop Loss Order request contains both the price and distance fields. TransactionRejectReason_GUARANTEED_STOP_LOSS_ORDER_PRICE_AND_DISTANCE_BOTH_SPECIFIED TransactionRejectReason = "GUARANTEED_STOP_LOSS_ORDER_PRICE_AND_DISTANCE_BOTH_SPECIFIED" // The Guaranteed Stop Loss Order request contains neither the price nor distance fields. TransactionRejectReason_GUARANTEED_STOP_LOSS_ORDER_PRICE_AND_DISTANCE_BOTH_MISSING TransactionRejectReason = "GUARANTEED_STOP_LOSS_ORDER_PRICE_AND_DISTANCE_BOTH_MISSING" // The Guaranteed Stop Loss Order would cause the associated Trade to be in violation // of the FIFO violation safeguard constraints TransactionRejectReason_GUARANTEED_STOP_LOSS_ORDER_WOULD_VIOLATE_FIFO_VIOLATION_SAFEGUARD TransactionRejectReason = "GUARANTEED_STOP_LOSS_ORDER_WOULD_VIOLATE_FIFO_VIOLATION_SAFEGUARD" // The Guaranteed Stop Loss Order would be in violation of the risk management Order // mutual exclusivity configuration specifying that only one risk management order can // be attached to a Trade. TransactionRejectReason_GUARANTEED_STOP_LOSS_ORDER_RMO_MUTUAL_EXCLUSIVITY_MUTUALLY_EXCLUSIVE_VIOLATION TransactionRejectReason = "GUARANTEED_STOP_LOSS_ORDER_RMO_MUTUAL_EXCLUSIVITY_MUTUALLY_EXCLUSIVE_VIOLATION" // The Guaranteed Stop Loss Order would be in violation of the risk management Order // mutual exclusivity configuration specifying that if a GSLO is already attached to // a Trade, no other risk management Order can be attached to the same Trade. TransactionRejectReason_GUARANTEED_STOP_LOSS_ORDER_RMO_MUTUAL_EXCLUSIVITY_GSLO_EXCLUDES_OTHERS_VIOLATION TransactionRejectReason = "GUARANTEED_STOP_LOSS_ORDER_RMO_MUTUAL_EXCLUSIVITY_GSLO_EXCLUDES_OTHERS_VIOLATION" // An attempt to create a pending Order was made with no Guaranteed Stop Loss Order // on fill specified and the Account’s configuration requires that every Trade have // an associated Guaranteed Stop Loss Order. TransactionRejectReason_GUARANTEED_STOP_LOSS_ON_FILL_REQUIRED_FOR_PENDING_ORDER TransactionRejectReason = "GUARANTEED_STOP_LOSS_ON_FILL_REQUIRED_FOR_PENDING_ORDER" // An attempt to create a pending Order was made with a Guaranteed Stop Loss Order on // fill that was explicitly configured to be guaranteed, however the Account’s configuration // does not allow guaranteed Stop Loss Orders. TransactionRejectReason_GUARANTEED_STOP_LOSS_ON_FILL_NOT_ALLOWED TransactionRejectReason = "GUARANTEED_STOP_LOSS_ON_FILL_NOT_ALLOWED" // An attempt to create a pending Order was made with a Guaranteed Stop Loss Order on // fill that was explicitly configured to be not guaranteed, however the Account’s // configuration requires Guaranteed Stop Loss Orders. TransactionRejectReason_GUARANTEED_STOP_LOSS_ON_FILL_REQUIRED TransactionRejectReason = "GUARANTEED_STOP_LOSS_ON_FILL_REQUIRED" // The Guaranteed Stop Loss on fill specified does not provide a price TransactionRejectReason_GUARANTEED_STOP_LOSS_ON_FILL_PRICE_MISSING TransactionRejectReason = "GUARANTEED_STOP_LOSS_ON_FILL_PRICE_MISSING" // The Guaranteed Stop Loss on fill specifies an invalid price TransactionRejectReason_GUARANTEED_STOP_LOSS_ON_FILL_PRICE_INVALID TransactionRejectReason = "GUARANTEED_STOP_LOSS_ON_FILL_PRICE_INVALID" // The Guaranteed Stop Loss on fill specifies a price with more precision than is allowed // by the Order’s instrument TransactionRejectReason_GUARANTEED_STOP_LOSS_ON_FILL_PRICE_PRECISION_EXCEEDED TransactionRejectReason = "GUARANTEED_STOP_LOSS_ON_FILL_PRICE_PRECISION_EXCEEDED" // An attempt to create a pending Order was made with the distance between the Guaranteed // Stop Loss Order on fill’s price and the pending Order’s price is less than the // Account’s configured minimum guaranteed stop loss distance. TransactionRejectReason_GUARANTEED_STOP_LOSS_ON_FILL_MINIMUM_DISTANCE_NOT_MET TransactionRejectReason = "GUARANTEED_STOP_LOSS_ON_FILL_MINIMUM_DISTANCE_NOT_MET" // Filling the Order would result in the creation of a Guaranteed Stop Loss Order with // trigger number of units that violates the account’s Guaranteed Stop Loss Order // level restriction volume. TransactionRejectReason_GUARANTEED_STOP_LOSS_ON_FILL_LEVEL_RESTRICTION_VOLUME_EXCEEDED TransactionRejectReason = "GUARANTEED_STOP_LOSS_ON_FILL_LEVEL_RESTRICTION_VOLUME_EXCEEDED" // Filling the Order would result in the creation of a Guaranteed Stop Loss Order with // trigger price that violates the account’s Guaranteed Stop Loss Order level restriction // price range. TransactionRejectReason_GUARANTEED_STOP_LOSS_ON_FILL_LEVEL_RESTRICTION_PRICE_RANGE_EXCEEDED TransactionRejectReason = "GUARANTEED_STOP_LOSS_ON_FILL_LEVEL_RESTRICTION_PRICE_RANGE_EXCEEDED" // The Guaranteed Stop Loss on fill distance is invalid TransactionRejectReason_GUARANTEED_STOP_LOSS_ON_FILL_DISTANCE_INVALID TransactionRejectReason = "GUARANTEED_STOP_LOSS_ON_FILL_DISTANCE_INVALID" // The Guaranteed Stop Loss on fill price distance exceeds the maximum allowed amount. TransactionRejectReason_GUARANTEED_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED TransactionRejectReason = "GUARANTEED_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED" // The Guaranteed Stop Loss on fill distance contains more precision than is allowed // by the instrument TransactionRejectReason_GUARANTEED_STOP_LOSS_ON_FILL_DISTANCE_PRECISION_EXCEEDED TransactionRejectReason = "GUARANTEED_STOP_LOSS_ON_FILL_DISTANCE_PRECISION_EXCEEDED" // The Guaranteed Stop Loss on fill contains both the price and distance fields. TransactionRejectReason_GUARANTEED_STOP_LOSS_ON_FILL_PRICE_AND_DISTANCE_BOTH_SPECIFIED TransactionRejectReason = "GUARANTEED_STOP_LOSS_ON_FILL_PRICE_AND_DISTANCE_BOTH_SPECIFIED" // The Guaranteed Stop Loss on fill contains neither the price nor distance fields. TransactionRejectReason_GUARANTEED_STOP_LOSS_ON_FILL_PRICE_AND_DISTANCE_BOTH_MISSING TransactionRejectReason = "GUARANTEED_STOP_LOSS_ON_FILL_PRICE_AND_DISTANCE_BOTH_MISSING" // The Guaranteed Stop Loss on fill specified does not provide a TimeInForce TransactionRejectReason_GUARANTEED_STOP_LOSS_ON_FILL_TIME_IN_FORCE_MISSING TransactionRejectReason = "GUARANTEED_STOP_LOSS_ON_FILL_TIME_IN_FORCE_MISSING" // The Guaranteed Stop Loss on fill specifies an invalid TimeInForce TransactionRejectReason_GUARANTEED_STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID TransactionRejectReason = "GUARANTEED_STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID" // The Guaranteed Stop Loss on fill specifies a GTD TimeInForce but does not provide // a GTD timestamp TransactionRejectReason_GUARANTEED_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_MISSING TransactionRejectReason = "GUARANTEED_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_MISSING" // The Guaranteed Stop Loss on fill specifies a GTD timestamp that is in the past. TransactionRejectReason_GUARANTEED_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST TransactionRejectReason = "GUARANTEED_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST" // The Guaranteed Stop Loss on fill client Order ID specified is invalid TransactionRejectReason_GUARANTEED_STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_INVALID TransactionRejectReason = "GUARANTEED_STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_INVALID" // The Guaranteed Stop Loss on fill client Order tag specified is invalid TransactionRejectReason_GUARANTEED_STOP_LOSS_ON_FILL_CLIENT_ORDER_TAG_INVALID TransactionRejectReason = "GUARANTEED_STOP_LOSS_ON_FILL_CLIENT_ORDER_TAG_INVALID" // The Guaranteed Stop Loss on fill client Order comment specified is invalid. TransactionRejectReason_GUARANTEED_STOP_LOSS_ON_FILL_CLIENT_ORDER_COMMENT_INVALID TransactionRejectReason = "GUARANTEED_STOP_LOSS_ON_FILL_CLIENT_ORDER_COMMENT_INVALID" // The Guaranteed Stop Loss on fill specified does not provide a TriggerCondition. TransactionRejectReason_GUARANTEED_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_MISSING TransactionRejectReason = "GUARANTEED_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_MISSING" // The Guaranteed Stop Loss on fill specifies an invalid TriggerCondition. TransactionRejectReason_GUARANTEED_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID TransactionRejectReason = "GUARANTEED_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID" // A Trailing Stop Loss Order for the specified Trade already exists TransactionRejectReason_TRAILING_STOP_LOSS_ORDER_ALREADY_EXISTS TransactionRejectReason = "TRAILING_STOP_LOSS_ORDER_ALREADY_EXISTS" // The Trailing Stop Loss Order would cause the associated Trade to be in violation // of the FIFO violation safeguard constraints TransactionRejectReason_TRAILING_STOP_LOSS_ORDER_WOULD_VIOLATE_FIFO_VIOLATION_SAFEGUARD TransactionRejectReason = "TRAILING_STOP_LOSS_ORDER_WOULD_VIOLATE_FIFO_VIOLATION_SAFEGUARD" // The Trailing Stop Loss Order would be in violation of the risk management Order mutual // exclusivity configuration specifying that only one risk management order can be attached // to a Trade. TransactionRejectReason_TRAILING_STOP_LOSS_ORDER_RMO_MUTUAL_EXCLUSIVITY_MUTUALLY_EXCLUSIVE_VIOLATION TransactionRejectReason = "TRAILING_STOP_LOSS_ORDER_RMO_MUTUAL_EXCLUSIVITY_MUTUALLY_EXCLUSIVE_VIOLATION" // The Trailing Stop Loss Order would be in violation of the risk management Order mutual // exclusivity configuration specifying that if a GSLO is already attached to a Trade, // no other risk management Order can be attached to the same Trade. TransactionRejectReason_TRAILING_STOP_LOSS_ORDER_RMO_MUTUAL_EXCLUSIVITY_GSLO_EXCLUDES_OTHERS_VIOLATION TransactionRejectReason = "TRAILING_STOP_LOSS_ORDER_RMO_MUTUAL_EXCLUSIVITY_GSLO_EXCLUDES_OTHERS_VIOLATION" // The Trailing Stop Loss on fill specified does not provide a distance TransactionRejectReason_TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MISSING TransactionRejectReason = "TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MISSING" // The Trailing Stop Loss on fill distance is invalid TransactionRejectReason_TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_INVALID TransactionRejectReason = "TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_INVALID" // The Trailing Stop Loss on fill distance contains more precision than is allowed by // the instrument TransactionRejectReason_TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_PRECISION_EXCEEDED TransactionRejectReason = "TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_PRECISION_EXCEEDED" // The Trailing Stop Loss on fill price distance exceeds the maximum allowed amount TransactionRejectReason_TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED TransactionRejectReason = "TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED" // The Trailing Stop Loss on fill price distance does not meet the minimum allowed amount TransactionRejectReason_TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MINIMUM_NOT_MET TransactionRejectReason = "TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MINIMUM_NOT_MET" // The Trailing Stop Loss on fill specified does not provide a TimeInForce TransactionRejectReason_TRAILING_STOP_LOSS_ON_FILL_TIME_IN_FORCE_MISSING TransactionRejectReason = "TRAILING_STOP_LOSS_ON_FILL_TIME_IN_FORCE_MISSING" // The Trailing Stop Loss on fill specifies an invalid TimeInForce TransactionRejectReason_TRAILING_STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID TransactionRejectReason = "TRAILING_STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID" // The Trailing Stop Loss on fill TimeInForce is specified as GTD but no GTD timestamp // is provided TransactionRejectReason_TRAILING_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_MISSING TransactionRejectReason = "TRAILING_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_MISSING" // The Trailing Stop Loss on fill GTD timestamp is in the past TransactionRejectReason_TRAILING_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST TransactionRejectReason = "TRAILING_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST" // The Trailing Stop Loss on fill client Order ID specified is invalid TransactionRejectReason_TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_INVALID TransactionRejectReason = "TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_INVALID" // The Trailing Stop Loss on fill client Order tag specified is invalid TransactionRejectReason_TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_TAG_INVALID TransactionRejectReason = "TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_TAG_INVALID" // The Trailing Stop Loss on fill client Order comment specified is invalid TransactionRejectReason_TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_COMMENT_INVALID TransactionRejectReason = "TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_COMMENT_INVALID" // A client attempted to create either a Trailing Stop Loss order or an order with a // Trailing Stop Loss On Fill specified, which may not yet be supported. TransactionRejectReason_TRAILING_STOP_LOSS_ORDERS_NOT_SUPPORTED TransactionRejectReason = "TRAILING_STOP_LOSS_ORDERS_NOT_SUPPORTED" // The Trailing Stop Loss on fill specified does not provide a TriggerCondition TransactionRejectReason_TRAILING_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_MISSING TransactionRejectReason = "TRAILING_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_MISSING" // The Tailing Stop Loss on fill specifies an invalid TriggerCondition TransactionRejectReason_TRAILING_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID TransactionRejectReason = "TRAILING_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID" // The request to close a Trade does not specify a full or partial close TransactionRejectReason_CLOSE_TRADE_TYPE_MISSING TransactionRejectReason = "CLOSE_TRADE_TYPE_MISSING" // The request to close a Trade partially did not specify the number of units to close TransactionRejectReason_CLOSE_TRADE_PARTIAL_UNITS_MISSING TransactionRejectReason = "CLOSE_TRADE_PARTIAL_UNITS_MISSING" // The request to partially close a Trade specifies a number of units that exceeds the // current size of the given Trade TransactionRejectReason_CLOSE_TRADE_UNITS_EXCEED_TRADE_SIZE TransactionRejectReason = "CLOSE_TRADE_UNITS_EXCEED_TRADE_SIZE" // The Position requested to be closed out does not exist TransactionRejectReason_CLOSEOUT_POSITION_DOESNT_EXIST TransactionRejectReason = "CLOSEOUT_POSITION_DOESNT_EXIST" // The request to closeout a Position was specified incompletely TransactionRejectReason_CLOSEOUT_POSITION_INCOMPLETE_SPECIFICATION TransactionRejectReason = "CLOSEOUT_POSITION_INCOMPLETE_SPECIFICATION" // A partial Position closeout request specifies a number of units that exceeds the // current Position TransactionRejectReason_CLOSEOUT_POSITION_UNITS_EXCEED_POSITION_SIZE TransactionRejectReason = "CLOSEOUT_POSITION_UNITS_EXCEED_POSITION_SIZE" // The request to closeout a Position could not be fully satisfied TransactionRejectReason_CLOSEOUT_POSITION_REJECT TransactionRejectReason = "CLOSEOUT_POSITION_REJECT" // The request to partially closeout a Position did not specify the number of units // to close. TransactionRejectReason_CLOSEOUT_POSITION_PARTIAL_UNITS_MISSING TransactionRejectReason = "CLOSEOUT_POSITION_PARTIAL_UNITS_MISSING" // The markup group ID provided is invalid TransactionRejectReason_MARKUP_GROUP_ID_INVALID TransactionRejectReason = "MARKUP_GROUP_ID_INVALID" // The PositionAggregationMode provided is not supported/valid. TransactionRejectReason_POSITION_AGGREGATION_MODE_INVALID TransactionRejectReason = "POSITION_AGGREGATION_MODE_INVALID" // No configuration parameters provided TransactionRejectReason_ADMIN_CONFIGURE_DATA_MISSING TransactionRejectReason = "ADMIN_CONFIGURE_DATA_MISSING" // The margin rate provided is invalid TransactionRejectReason_MARGIN_RATE_INVALID TransactionRejectReason = "MARGIN_RATE_INVALID" // The margin rate provided would cause an immediate margin closeout TransactionRejectReason_MARGIN_RATE_WOULD_TRIGGER_CLOSEOUT TransactionRejectReason = "MARGIN_RATE_WOULD_TRIGGER_CLOSEOUT" // The account alias string provided is invalid TransactionRejectReason_ALIAS_INVALID TransactionRejectReason = "ALIAS_INVALID" // No configuration parameters provided TransactionRejectReason_CLIENT_CONFIGURE_DATA_MISSING TransactionRejectReason = "CLIENT_CONFIGURE_DATA_MISSING" // The margin rate provided would cause the Account to enter a margin call state. TransactionRejectReason_MARGIN_RATE_WOULD_TRIGGER_MARGIN_CALL TransactionRejectReason = "MARGIN_RATE_WOULD_TRIGGER_MARGIN_CALL" // Funding is not possible because the requested transfer amount is invalid TransactionRejectReason_AMOUNT_INVALID TransactionRejectReason = "AMOUNT_INVALID" // The Account does not have sufficient balance to complete the funding request TransactionRejectReason_INSUFFICIENT_FUNDS TransactionRejectReason = "INSUFFICIENT_FUNDS" // Funding amount has not been specified TransactionRejectReason_AMOUNT_MISSING TransactionRejectReason = "AMOUNT_MISSING" // Funding reason has not been specified TransactionRejectReason_FUNDING_REASON_MISSING TransactionRejectReason = "FUNDING_REASON_MISSING" // The list of Order Identifiers provided for a One Cancels All Order contains an Order // Identifier that refers to a Stop Loss Order. OCA groups cannot contain Stop Loss // Orders. TransactionRejectReason_OCA_ORDER_IDS_STOP_LOSS_NOT_ALLOWED TransactionRejectReason = "OCA_ORDER_IDS_STOP_LOSS_NOT_ALLOWED" // Neither Order nor Trade on Fill client extensions were provided for modification TransactionRejectReason_CLIENT_EXTENSIONS_DATA_MISSING TransactionRejectReason = "CLIENT_EXTENSIONS_DATA_MISSING" // The Order to be replaced has a different type than the replacing Order. TransactionRejectReason_REPLACING_ORDER_INVALID TransactionRejectReason = "REPLACING_ORDER_INVALID" // The replacing Order refers to a different Trade than the Order that is being replaced. TransactionRejectReason_REPLACING_TRADE_ID_INVALID TransactionRejectReason = "REPLACING_TRADE_ID_INVALID" // Canceling the order would cause an immediate margin closeout. TransactionRejectReason_ORDER_CANCEL_WOULD_TRIGGER_CLOSEOUT TransactionRejectReason = "ORDER_CANCEL_WOULD_TRIGGER_CLOSEOUT" )
type TransactionResponse ¶
type TransactionResponse struct { // The details of the Transaction requested Transaction *TransactionParser `json:"transaction"` // The ID of the most recent Transaction created for the Account LastTransactionID TransactionID `json:"lastTransactionID"` }
func (TransactionResponse) MarshalEasyJSON ¶
func (v TransactionResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (TransactionResponse) MarshalJSON ¶
func (v TransactionResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*TransactionResponse) UnmarshalEasyJSON ¶
func (v *TransactionResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*TransactionResponse) UnmarshalJSON ¶
func (v *TransactionResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type TransactionType ¶
type TransactionType string
The possible types of a Transaction
const ( // Account Create Transaction TransactionType_CREATE TransactionType = "CREATE" // Account Close Transaction TransactionType_CLOSE TransactionType = "CLOSE" // Account Reopen Transaction TransactionType_REOPEN TransactionType = "REOPEN" // Client Configuration Transaction TransactionType_CLIENT_CONFIGURE TransactionType = "CLIENT_CONFIGURE" // Client Configuration Reject Transaction TransactionType_CLIENT_CONFIGURE_REJECT TransactionType = "CLIENT_CONFIGURE_REJECT" // Transfer Funds Transaction TransactionType_TRANSFER_FUNDS TransactionType = "TRANSFER_FUNDS" // Transfer Funds Reject Transaction TransactionType_TRANSFER_FUNDS_REJECT TransactionType = "TRANSFER_FUNDS_REJECT" // Market Order Transaction TransactionType_MARKET_ORDER TransactionType = "MARKET_ORDER" // Market Order Reject Transaction TransactionType_MARKET_ORDER_REJECT TransactionType = "MARKET_ORDER_REJECT" // Fixed Price Order Transaction TransactionType_FIXED_PRICE_ORDER TransactionType = "FIXED_PRICE_ORDER" // Order Transaction TransactionType_LIMIT_ORDER TransactionType = "LIMIT_ORDER" // Limit Order Reject Transaction TransactionType_LIMIT_ORDER_REJECT TransactionType = "LIMIT_ORDER_REJECT" // Stop Order Transaction TransactionType_STOP_ORDER TransactionType = "STOP_ORDER" // Stop Order Reject Transaction TransactionType_STOP_ORDER_REJECT TransactionType = "STOP_ORDER_REJECT" // Market if Touched Order Transaction TransactionType_MARKET_IF_TOUCHED_ORDER TransactionType = "MARKET_IF_TOUCHED_ORDER" // Market if Touched Order Reject Transaction TransactionType_MARKET_IF_TOUCHED_ORDER_REJECT TransactionType = "MARKET_IF_TOUCHED_ORDER_REJECT" // Take Profit Order Transaction TransactionType_TAKE_PROFIT_ORDER TransactionType = "TAKE_PROFIT_ORDER" // Take Profit Order Reject Transaction TransactionType_TAKE_PROFIT_ORDER_REJECT TransactionType = "TAKE_PROFIT_ORDER_REJECT" // Stop Loss Order Transaction TransactionType_STOP_LOSS_ORDER TransactionType = "STOP_LOSS_ORDER" // Stop Loss Order Reject Transaction TransactionType_STOP_LOSS_ORDER_REJECT TransactionType = "STOP_LOSS_ORDER_REJECT" // Guaranteed Stop Loss Order Transaction TransactionType_GUARANTEED_STOP_LOSS_ORDER TransactionType = "GUARANTEED_STOP_LOSS_ORDER" // Guaranteed Stop Loss Order Reject Transaction TransactionType_GUARANTEED_STOP_LOSS_ORDER_REJECT TransactionType = "GUARANTEED_STOP_LOSS_ORDER_REJECT" // Trailing Stop Loss Order Transaction TransactionType_TRAILING_STOP_LOSS_ORDER TransactionType = "TRAILING_STOP_LOSS_ORDER" // Trailing Stop Loss Order Reject Transaction TransactionType_TRAILING_STOP_LOSS_ORDER_REJECT TransactionType = "TRAILING_STOP_LOSS_ORDER_REJECT" // Order Fill Transaction TransactionType_ORDER_FILL TransactionType = "ORDER_FILL" // Order Cancel Transaction TransactionType_ORDER_CANCEL TransactionType = "ORDER_CANCEL" // Order Cancel Reject Transaction TransactionType_ORDER_CANCEL_REJECT TransactionType = "ORDER_CANCEL_REJECT" // Order Client Extensions Modify Transaction TransactionType_ORDER_CLIENT_EXTENSIONS_MODIFY TransactionType = "ORDER_CLIENT_EXTENSIONS_MODIFY" // Order Client Extensions Modify Reject Transaction TransactionType_ORDER_CLIENT_EXTENSIONS_MODIFY_REJECT TransactionType = "ORDER_CLIENT_EXTENSIONS_MODIFY_REJECT" // Trade Client Extensions Modify Transaction TransactionType_TRADE_CLIENT_EXTENSIONS_MODIFY TransactionType = "TRADE_CLIENT_EXTENSIONS_MODIFY" // Trade Client Extensions Modify Reject Transaction TransactionType_TRADE_CLIENT_EXTENSIONS_MODIFY_REJECT TransactionType = "TRADE_CLIENT_EXTENSIONS_MODIFY_REJECT" // Margin Call Enter Transaction TransactionType_MARGIN_CALL_ENTER TransactionType = "MARGIN_CALL_ENTER" // Margin Call Extend Transaction TransactionType_MARGIN_CALL_EXTEND TransactionType = "MARGIN_CALL_EXTEND" // Margin Call Exit Transaction TransactionType_MARGIN_CALL_EXIT TransactionType = "MARGIN_CALL_EXIT" // Delayed Trade Closure Transaction TransactionType_DELAYED_TRADE_CLOSURE TransactionType = "DELAYED_TRADE_CLOSURE" // Daily Financing Transaction TransactionType_DAILY_FINANCING TransactionType = "DAILY_FINANCING" // Dividend Adjustment Transaction TransactionType_DIVIDEND_ADJUSTMENT TransactionType = "DIVIDEND_ADJUSTMENT" // Reset Resettable PL Transaction TransactionType_RESET_RESETTABLE_PL TransactionType = "RESET_RESETTABLE_PL" )
type TransactionsIDRangeRequest ¶
type TransactionsIDRangeRequest struct { // The starting Transaction ID (inclusive) to fetch. // [required] From TransactionID `json:"from"` // The ending Transaction ID (inclusive) to fetch. // [required] To TransactionID `json:"to"` // A filter for restricting the types of Transactions to retrieve. Type []TransactionFilter `json:"type"` }
func NewTransactionsIDRangeRequest ¶
func NewTransactionsIDRangeRequest(from, to TransactionID, types ...TransactionFilter) *TransactionsIDRangeRequest
func (*TransactionsIDRangeRequest) AppendQuery ¶
func (g *TransactionsIDRangeRequest) AppendQuery(b *bytebufferpool.ByteBuffer)
func (TransactionsIDRangeRequest) MarshalEasyJSON ¶
func (v TransactionsIDRangeRequest) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (TransactionsIDRangeRequest) MarshalJSON ¶
func (v TransactionsIDRangeRequest) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*TransactionsIDRangeRequest) UnmarshalEasyJSON ¶
func (v *TransactionsIDRangeRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*TransactionsIDRangeRequest) UnmarshalJSON ¶
func (v *TransactionsIDRangeRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
func (*TransactionsIDRangeRequest) WithFrom ¶
func (t *TransactionsIDRangeRequest) WithFrom(from TransactionID) *TransactionsIDRangeRequest
The starting Transaction ID (inclusive) to fetch. [required]
func (*TransactionsIDRangeRequest) WithRange ¶
func (t *TransactionsIDRangeRequest) WithRange(from, to TransactionID) *TransactionsIDRangeRequest
The starting Transaction ID (inclusive) to fetch. The ending Transaction ID (inclusive) to fetch. [required]
func (*TransactionsIDRangeRequest) WithTo ¶
func (t *TransactionsIDRangeRequest) WithTo(to TransactionID) *TransactionsIDRangeRequest
The ending Transaction ID (inclusive) to fetch. [required]
func (*TransactionsIDRangeRequest) WithType ¶
func (t *TransactionsIDRangeRequest) WithType(types ...TransactionFilter) *TransactionsIDRangeRequest
A filter for restricting the types of Transactions to retrieve.
type TransactionsPagesResponse ¶
type TransactionsPagesResponse struct { // The starting time provided in the request. From DateTime `json:"from"` // The ending time provided in the request. To DateTime `json:"to"` // The pageSize provided in the request PageSize int64 `json:"pageSize"` // The Transaction-type filter provided in the request Type []TransactionFilter `json:"type"` // The number of Transactions that are contained in the pages returned Count int64 `json:"count"` // The list of URLs that represent idrange queries providing the data for // each page in the query results Pages []string `json:"pages"` // The ID of the most recent Transaction created for the Account LastTransactionID TransactionID `json:"lastTransactionID"` }
func (TransactionsPagesResponse) MarshalEasyJSON ¶
func (v TransactionsPagesResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (TransactionsPagesResponse) MarshalJSON ¶
func (v TransactionsPagesResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*TransactionsPagesResponse) UnmarshalEasyJSON ¶
func (v *TransactionsPagesResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*TransactionsPagesResponse) UnmarshalJSON ¶
func (v *TransactionsPagesResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type TransactionsRequest ¶
type TransactionsRequest struct { // The starting time (inclusive) of the time range for the // Transactions being queried. // [default=Account Creation Time] From DateTime `json:"from"` // The ending time (inclusive) of the time range for the Transactions // being queried. // [default=Request Time] To DateTime `json:"to"` // The number of Transactions to include in each page of the results. // [default=100, maximum=1000] PageSize int `json:"pageSize"` // A filter for restricting the types of Transactions to retrieve. Type []TransactionFilter `json:"type"` }
func NewTransactionsRequest ¶
func NewTransactionsRequest(types ...TransactionFilter) *TransactionsRequest
func (*TransactionsRequest) AppendQuery ¶
func (g *TransactionsRequest) AppendQuery(b *bytebufferpool.ByteBuffer)
func (TransactionsRequest) MarshalEasyJSON ¶
func (v TransactionsRequest) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (TransactionsRequest) MarshalJSON ¶
func (v TransactionsRequest) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*TransactionsRequest) UnmarshalEasyJSON ¶
func (v *TransactionsRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*TransactionsRequest) UnmarshalJSON ¶
func (v *TransactionsRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
func (*TransactionsRequest) WithFrom ¶
func (t *TransactionsRequest) WithFrom(from DateTime) *TransactionsRequest
The starting time (inclusive) of the time range for the Transactions being queried. [default=Account Creation Time]
func (*TransactionsRequest) WithPageSize ¶
func (t *TransactionsRequest) WithPageSize(pageSize int) *TransactionsRequest
The number of Transactions to include in each page of the results. [default=100, maximum=1000]
func (*TransactionsRequest) WithRange ¶
func (t *TransactionsRequest) WithRange(from, to DateTime) *TransactionsRequest
The starting time (inclusive) of the time range for the Transactions being queried. [default=Account Creation Time]
The ending time (inclusive) of the time range for the Transactions being queried. [default=Request Time]
func (*TransactionsRequest) WithTo ¶
func (t *TransactionsRequest) WithTo(to DateTime) *TransactionsRequest
The ending time (inclusive) of the time range for the Transactions being queried. [default=Request Time]
func (*TransactionsRequest) WithType ¶
func (t *TransactionsRequest) WithType(types ...TransactionFilter) *TransactionsRequest
A filter for restricting the types of Transactions to retrieve.
type TransactionsResponse ¶
type TransactionsResponse struct { // The list of Transactions that satisfy the request. Transactions []*TransactionParser `json:"transactions"` // The ID of the most recent Transaction created for the Account LastTransactionID TransactionID `json:"lastTransactionID"` }
func (TransactionsResponse) MarshalEasyJSON ¶
func (v TransactionsResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (TransactionsResponse) MarshalJSON ¶
func (v TransactionsResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*TransactionsResponse) UnmarshalEasyJSON ¶
func (v *TransactionsResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*TransactionsResponse) UnmarshalJSON ¶
func (v *TransactionsResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type TransactionsSinceIDRequest ¶
type TransactionsSinceIDRequest struct { // The ID of the last Transaction fetched. This query will return all // Transactions newer than the TransactionID. // [required] ID TransactionID `json:"id"` // A filter for restricting the types of Transactions to retrieve. Type []TransactionFilter `json:"type"` }
func NewTransactionsSinceIDRequest ¶
func NewTransactionsSinceIDRequest(id TransactionID, types ...TransactionFilter) *TransactionsSinceIDRequest
func (*TransactionsSinceIDRequest) AppendQuery ¶
func (g *TransactionsSinceIDRequest) AppendQuery(b *bytebufferpool.ByteBuffer)
func (TransactionsSinceIDRequest) MarshalEasyJSON ¶
func (v TransactionsSinceIDRequest) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (TransactionsSinceIDRequest) MarshalJSON ¶
func (v TransactionsSinceIDRequest) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*TransactionsSinceIDRequest) UnmarshalEasyJSON ¶
func (v *TransactionsSinceIDRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*TransactionsSinceIDRequest) UnmarshalJSON ¶
func (v *TransactionsSinceIDRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
func (*TransactionsSinceIDRequest) WithID ¶
func (t *TransactionsSinceIDRequest) WithID(id TransactionID) *TransactionsSinceIDRequest
The ID of the last Transaction fetched. This query will return all Transactions newer than the TransactionID. [required]
func (*TransactionsSinceIDRequest) WithType ¶
func (t *TransactionsSinceIDRequest) WithType(types ...TransactionFilter) *TransactionsSinceIDRequest
A filter for restricting the types of Transactions to retrieve.
type TransferFundsRejectTransaction ¶
type TransferFundsRejectTransaction struct { Transaction // The Type of the Transaction. Always set to “TRANSFER_FUNDS_REJECT” in a TransferFundsRejectTransaction. Type TransactionType `json:"type"` // The amount to deposit/withdraw from the Account in the Account’s home currency. // A positive value indicates a deposit, a negative value indicates a withdrawal. Amount AccountUnits `json:"amount"` // The reason that an Account is being funded. FundingReason FundingReason `json:"fundingReason"` // An optional comment that may be attached to a fund transfer for audit purposes Comment string `json:"comment"` // The reason that the Reject Transaction was created RejectReason TransactionRejectReason `json:"rejectReason"` }
A TransferFundsRejectTransaction represents the rejection of the transfer of funds in/out of an Account.
func (TransferFundsRejectTransaction) MarshalEasyJSON ¶
func (v TransferFundsRejectTransaction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (TransferFundsRejectTransaction) MarshalJSON ¶
func (v TransferFundsRejectTransaction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*TransferFundsRejectTransaction) UnmarshalEasyJSON ¶
func (v *TransferFundsRejectTransaction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*TransferFundsRejectTransaction) UnmarshalJSON ¶
func (v *TransferFundsRejectTransaction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type TransferFundsTransaction ¶
type TransferFundsTransaction struct { Transaction // The Type of the Transaction. Always set to “TRANSFER_FUNDS” in a TransferFundsTransaction. Type TransactionType `json:"type"` // The amount to deposit/withdraw from the Account in the Account’s home currency. // A positive value indicates a deposit, a negative value indicates a withdrawal. Amount AccountUnits `json:"amount"` // The reason that an Account is being funded. FundingReason FundingReason `json:"fundingReason"` // An optional comment that may be attached to a fund transfer for audit purposes Comment string `json:"comment"` // The Account’s balance after funds are transferred. AccountBalance AccountUnits `json:"accountBalance"` }
A TransferFundsTransaction represents the transfer of funds in/out of an Account.
func (TransferFundsTransaction) MarshalEasyJSON ¶
func (v TransferFundsTransaction) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (TransferFundsTransaction) MarshalJSON ¶
func (v TransferFundsTransaction) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*TransferFundsTransaction) UnmarshalEasyJSON ¶
func (v *TransferFundsTransaction) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*TransferFundsTransaction) UnmarshalJSON ¶
func (v *TransferFundsTransaction) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type UnitsAvailable ¶
type UnitsAvailable struct { // The number of units that are available to be traded using an Order with a // positionFill option of “DEFAULT”. For an Account with hedging enabled, // this value will be the same as the “OPEN_ONLY” value. For an Account // without hedging enabled, this value will be the same as the // “REDUCE_FIRST” value. Default *UnitsAvailableDetails `json:"default"` // The number of units that may are available to be traded with an Order // with a positionFill option of “REDUCE_FIRST”. ReduceFirst *UnitsAvailableDetails `json:"reduceFirst"` // The number of units that may are available to be traded with an Order // with a positionFill option of “REDUCE_ONLY”. ReduceOnly *UnitsAvailableDetails `json:"reduceOnly"` // The number of units that may are available to be traded with an Order // with a positionFill option of “OPEN_ONLY”. OpenOnly *UnitsAvailableDetails `json:"openOnly"` }
Representation of how many units of an Instrument are available to be traded by an Order depending on its positionFill option.
func (UnitsAvailable) MarshalEasyJSON ¶
func (v UnitsAvailable) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (UnitsAvailable) MarshalJSON ¶
func (v UnitsAvailable) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*UnitsAvailable) UnmarshalEasyJSON ¶
func (v *UnitsAvailable) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*UnitsAvailable) UnmarshalJSON ¶
func (v *UnitsAvailable) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type UnitsAvailableDetails ¶
type UnitsAvailableDetails struct { // The units available for long Orders. Long DecimalNumber `json:"long"` // The units available for short Orders. Short DecimalNumber `json:"short"` }
Representation of many units of an Instrument are available to be traded for both long and short Orders.
func (UnitsAvailableDetails) MarshalEasyJSON ¶
func (v UnitsAvailableDetails) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (UnitsAvailableDetails) MarshalJSON ¶
func (v UnitsAvailableDetails) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*UnitsAvailableDetails) UnmarshalEasyJSON ¶
func (v *UnitsAvailableDetails) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*UnitsAvailableDetails) UnmarshalJSON ¶
func (v *UnitsAvailableDetails) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type UserAttributes ¶
type UserAttributes struct { // The user’s OANDA-assigned user AccountID. UserID int64 `json:"userID"` // The user-provided username. Username string `json:"username"` // The user’s title. Title string `json:"title"` // The user’s name. Name string `json:"name"` // The user’s email address. Email string `json:"email"` // The OANDA division the user belongs to. DivisionAbbreviation string `json:"divisionAbbreviation"` // The user’s preferred language. LanguageAbbreviation string `json:"languageAbbreviation"` // The home currency of the Account. HomeCurrency Currency `json:"homeCurrency"` }
Contains the attributes of a user.
func (UserAttributes) MarshalEasyJSON ¶
func (v UserAttributes) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (UserAttributes) MarshalJSON ¶
func (v UserAttributes) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*UserAttributes) UnmarshalEasyJSON ¶
func (v *UserAttributes) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*UserAttributes) UnmarshalJSON ¶
func (v *UserAttributes) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type WeeklyAlignment ¶
type WeeklyAlignment string
The day of the week to use for candlestick granularity with weekly alignment.
const ( WeeklyAlignment_Monday WeeklyAlignment = "Monday" WeeklyAlignment_Tuesday WeeklyAlignment = "Tuesday" WeeklyAlignment_Wednesday WeeklyAlignment = "Wednesday" WeeklyAlignment_Thursday WeeklyAlignment = "Thursday" WeeklyAlignment_Friday WeeklyAlignment = "Friday" WeeklyAlignment_Saturday WeeklyAlignment = "Saturday" WeeklyAlignment_Sunday WeeklyAlignment = "Sunday" )
Source Files
¶
- account.go
- account_easyjson.go
- account_endpoint.go
- account_endpoint_easyjson.go
- account_types.go
- account_types_easyjson.go
- instrument.go
- instrument_easyjson.go
- instrument_request.go
- instrument_request_easyjson.go
- message.go
- order.go
- order_easyjson.go
- order_endpoint.go
- order_endpoint_easyjson.go
- order_request.go
- order_request_easyjson.go
- order_types.go
- order_types_easyjson.go
- position.go
- position_easyjson.go
- position_endpoint.go
- position_endpoint_easyjson.go
- pricing.go
- pricing_easyjson.go
- pricing_endpoint.go
- pricing_endpoint_easyjson.go
- primitives.go
- primitives_easyjson.go
- trade.go
- trade_easyjson.go
- trade_endpoint.go
- trade_endpoint_easyjson.go
- transaction.go
- transaction_easyjson.go
- transaction_endpoint.go
- transaction_endpoint_easyjson.go
- transaction_types.go
- transaction_types_easyjson.go
- util.go