Documentation ¶
Index ¶
- Constants
- type AccountChanges
- type AccountInfo
- type AccountInstruments
- type AccountProperties
- type AccountSummary
- type BidAskCandles
- type BrokerBook
- type Bucket
- type CancelledOrder
- type Candle
- type Candles
- type ClosePositionPayload
- type CloseTradePayload
- type Connection
- type Headers
- type InstrumentHistory
- type InstrumentPricing
- type ModifiedTrade
- type OandaConnection
- func (c *OandaConnection) CancelOrder(orderSpecifier string) CancelledOrder
- func (c *OandaConnection) ClosePosition(instrument string, body ClosePositionPayload) ModifiedTrade
- func (c *OandaConnection) CreateOrder(body OrderPayload) OrderResponse
- func (c *OandaConnection) GetAccount(id string) AccountInfo
- func (c *OandaConnection) GetAccountChanges(id string, transactionId string) AccountChanges
- func (c *OandaConnection) GetAccountInstruments(id string) AccountInstruments
- func (c *OandaConnection) GetAccountSummary() AccountSummary
- func (c *OandaConnection) GetAccounts() AccountProperties
- func (c *OandaConnection) GetBidAskCandles(instrument string, count string, granularity string) BidAskCandles
- func (c *OandaConnection) GetCandles(instrument string, count string, granularity string) InstrumentHistory
- func (c *OandaConnection) GetInstrumentPrice(instrument string) InstrumentPricing
- func (c *OandaConnection) GetOpenPositions() OpenPositions
- func (c *OandaConnection) GetOpenTrades() ReceivedTrades
- func (c *OandaConnection) GetOrder(orderSpecifier string) RetrievedOrder
- func (c *OandaConnection) GetOrderDetails(instrument string, units string) OrderDetails
- func (c *OandaConnection) GetOrders(instrument string) RetrievedOrders
- func (c *OandaConnection) GetPendingOrders() RetrievedOrders
- func (c *OandaConnection) GetPricingForInstruments(instruments []string) Pricings
- func (c *OandaConnection) GetTrade(ticket string) ReceivedTrade
- func (c *OandaConnection) GetTradesForInstrument(instrument string) ReceivedTrades
- func (c *OandaConnection) GetTransaction(ticket string) Transaction
- func (c *OandaConnection) GetTransactions(from time.Time, to time.Time) TransactionPages
- func (c *OandaConnection) GetTransactionsSinceId(id string) Transactions
- func (c *OandaConnection) OrderBook(instrument string) BrokerBook
- func (c *OandaConnection) PositionBook(instrument string) BrokerBook
- func (c *OandaConnection) ReduceTradeSize(ticket string, body CloseTradePayload) ModifiedTrade
- func (c *OandaConnection) Request(endpoint string) []byte
- func (c *OandaConnection) Send(endpoint string, data []byte) []byte
- func (c *OandaConnection) Update(endpoint string, data []byte) []byte
- func (c *OandaConnection) UpdateOrder(orderSpecifier string, body OrderPayload) RetrievedOrder
- type OnFill
- type OpenPositions
- type OrderBody
- type OrderDetails
- type OrderExtensions
- type OrderInfo
- type OrderPayload
- type OrderResponse
- type Position
- type PositionSide
- type Pricings
- type ReceivedTrade
- type ReceivedTrades
- type RetrievedOrder
- type RetrievedOrders
- type TrailingStopLossDetails
- type Transaction
- type TransactionPages
- type Transactions
Constants ¶
View Source
const OANDA_AGENT string = "v20-golang/0.0.1"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountChanges ¶
type AccountChanges struct { Changes struct { OrdersCancelled []interface{} `json:"ordersCancelled"` OrdersCreated []interface{} `json:"ordersCreated"` OrdersFilled []struct { CreateTime time.Time `json:"createTime"` FilledTime time.Time `json:"filledTime"` FillingTransactionID string `json:"fillingTransactionID"` ID string `json:"id"` Instrument string `json:"instrument"` PositionFill string `json:"positionFill"` State string `json:"state"` TimeInForce string `json:"timeInForce"` TradeOpenedID string `json:"tradeOpenedID"` Type string `json:"type"` Units string `json:"units"` } `json:"ordersFilled"` OrdersTriggered []interface{} `json:"ordersTriggered"` Positions []Position `json:"positions"` TradesClosed []interface{} `json:"tradesClosed"` TradesOpened []struct { CurrentUnits string `json:"currentUnits"` Financing string `json:"financing"` ID string `json:"id"` InitialUnits string `json:"initialUnits"` Instrument string `json:"instrument"` OpenTime time.Time `json:"openTime"` Price string `json:"price"` RealizedPL string `json:"realizedPL"` State string `json:"state"` } `json:"tradesOpened"` TradesReduced []interface{} `json:"tradesReduced"` Transactions []struct { AccountID string `json:"accountID"` BatchID string `json:"batchID"` ID string `json:"id"` Instrument string `json:"instrument"` PositionFill string `json:"positionFill,omitempty"` Reason string `json:"reason"` Time time.Time `json:"time"` TimeInForce string `json:"timeInForce,omitempty"` Type string `json:"type"` Units string `json:"units"` UserID int `json:"userID"` AccountBalance string `json:"accountBalance,omitempty"` Financing string `json:"financing,omitempty"` OrderID string `json:"orderID,omitempty"` Pl string `json:"pl,omitempty"` Price string `json:"price,omitempty"` TradeOpened struct { TradeID string `json:"tradeID"` Units string `json:"units"` } `json:"tradeOpened,omitempty"` } `json:"transactions"` } `json:"changes"` LastTransactionID string `json:"lastTransactionID"` State struct { NAV string `json:"NAV"` MarginAvailable string `json:"marginAvailable"` MarginCloseoutMarginUsed string `json:"marginCloseoutMarginUsed"` MarginCloseoutNAV string `json:"marginCloseoutNAV"` MarginCloseoutPercent string `json:"marginCloseoutPercent"` MarginCloseoutUnrealizedPL string `json:"marginCloseoutUnrealizedPL"` MarginUsed string `json:"marginUsed"` Orders []interface{} `json:"orders"` PositionValue string `json:"positionValue"` Positions []struct { Instrument string `json:"instrument"` LongUnrealizedPL string `json:"longUnrealizedPL"` NetUnrealizedPL string `json:"netUnrealizedPL"` ShortUnrealizedPL string `json:"shortUnrealizedPL"` } `json:"positions"` Trades []struct { ID string `json:"id"` UnrealizedPL string `json:"unrealizedPL"` } `json:"trades"` UnrealizedPL string `json:"unrealizedPL"` WithdrawalLimit string `json:"withdrawalLimit"` } `json:"state"` }
type AccountInfo ¶
type AccountInfo struct { Account struct { NAV string `json:"NAV"` Alias string `json:"alias"` Balance string `json:"balance"` CreatedByUserID int `json:"createdByUserID"` CreatedTime time.Time `json:"createdTime"` Currency string `json:"currency"` HedgingEnabled bool `json:"hedgingEnabled"` ID string `json:"id"` LastTransactionID string `json:"lastTransactionID"` MarginAvailable string `json:"marginAvailable"` MarginCloseoutMarginUsed string `json:"marginCloseoutMarginUsed"` MarginCloseoutNAV string `json:"marginCloseoutNAV"` MarginCloseoutPercent string `json:"marginCloseoutPercent"` MarginCloseoutPositionValue string `json:"marginCloseoutPositionValue"` MarginCloseoutUnrealizedPL string `json:"marginCloseoutUnrealizedPL"` MarginRate string `json:"marginRate"` MarginUsed string `json:"marginUsed"` OpenPositionCount int `json:"openPositionCount"` OpenTradeCount int `json:"openTradeCount"` Orders []interface{} `json:"orders"` PendingOrderCount int `json:"pendingOrderCount"` Pl string `json:"pl"` PositionValue string `json:"positionValue"` Positions []Position `json:"positions"` ResettablePL string `json:"resettablePL"` Trades []interface{} `json:"trades"` UnrealizedPL string `json:"unrealizedPL"` WithdrawalLimit string `json:"withdrawalLimit"` } `json:"account"` LastTransactionID string `json:"lastTransactionID"` }
type AccountInstruments ¶
type AccountInstruments struct { Instruments []struct { DisplayName string `json:"displayName"` DisplayPrecision int `json:"displayPrecision"` MarginRate string `json:"marginRate"` MaximumOrderUnits string `json:"maximumOrderUnits"` MaximumPositionSize string `json:"maximumPositionSize"` MaximumTrailingStopDistance string `json:"maximumTrailingStopDistance"` MinimumTradeSize string `json:"minimumTradeSize"` MinimumTrailingStopDistance string `json:"minimumTrailingStopDistance"` Name string `json:"name"` PipLocation int `json:"pipLocation"` TradeUnitsPrecision int `json:"tradeUnitsPrecision"` Type string `json:"type"` } `json:"instruments"` }
type AccountProperties ¶
type AccountSummary ¶
type AccountSummary struct { Account struct { NAV string `json:"NAV"` Alias string `json:"alias"` Balance float64 `json:"balance,string"` CreatedByUserID int `json:"createdByUserID"` CreatedTime time.Time `json:"createdTime"` Currency string `json:"currency"` HedgingEnabled bool `json:"hedgingEnabled"` ID string `json:"id"` LastTransactionID string `json:"lastTransactionID"` MarginAvailable float64 `json:"marginAvailable,string"` MarginCloseoutMarginUsed string `json:"marginCloseoutMarginUsed"` MarginCloseoutNAV string `json:"marginCloseoutNAV"` MarginCloseoutPercent string `json:"marginCloseoutPercent"` MarginCloseoutPositionValue string `json:"marginCloseoutPositionValue"` MarginCloseoutUnrealizedPL string `json:"marginCloseoutUnrealizedPL"` MarginRate string `json:"marginRate"` MarginUsed string `json:"marginUsed"` OpenPositionCount int `json:"openPositionCount"` OpenTradeCount int `json:"openTradeCount"` PendingOrderCount int `json:"pendingOrderCount"` Pl string `json:"pl"` PositionValue string `json:"positionValue"` ResettablePL string `json:"resettablePL"` UnrealizedPL string `json:"unrealizedPL"` WithdrawalLimit string `json:"withdrawalLimit"` } `json:"account"` LastTransactionID string `json:"lastTransactionID"` }
type BidAskCandles ¶
type BidAskCandles struct { Candles []struct { Ask struct { C decimal.Decimal `json:"c,string"` H decimal.Decimal `json:"h,string"` L decimal.Decimal `json:"l,string"` O decimal.Decimal `json:"o,string"` } `json:"ask"` Bid struct { C decimal.Decimal `json:"c,string"` H decimal.Decimal `json:"h,string"` L decimal.Decimal `json:"l,string"` O decimal.Decimal `json:"o,string"` } `json:"bid"` Complete bool `json:"complete"` Time time.Time `json:"time"` Volume int `json:"volume"` } `json:"candles"` }
type BrokerBook ¶
type CancelledOrder ¶
type CancelledOrder struct { OrderCancelTransaction struct { ID string `json:"id"` Time time.Time `json:"time"` UserID int `json:"userID"` AccountID string `json:"accountID"` BatchID string `json:"batchID"` RequestID string `json:"requestID"` Type string `json:"type"` OrderID string `json:"orderID"` ClientOrderID string `json:"clientOrderID"` Reason string `json:"reason"` ReplacedByOrderID string `json:"replacedByOrderID"` } `json:"orderCancelTransaction"` RelatedTransactionIDs []string `json:"relatedTransactionIDs"` LastTransactionID string `json:"lastTransactionID"` }
type ClosePositionPayload ¶
type CloseTradePayload ¶
type CloseTradePayload struct {
Units string
}
type Connection ¶
type Connection interface { Request(endpoint string) []byte Send(endpoint string, data []byte) []byte Update(endpoint string, data []byte) []byte GetOrderDetails(instrument string, units string) OrderDetails GetAccountSummary() AccountSummary CreateOrder(body OrderPayload) OrderResponse }
type Headers ¶
type Headers struct { DatetimeFormat string // contains filtered or unexported fields }
type InstrumentHistory ¶
type InstrumentPricing ¶
type InstrumentPricing struct { Time time.Time `json:"time"` Prices []struct { Type string `json:"type"` Time time.Time `json:"time"` Bids []struct { Price decimal.Decimal `json:"price,string"` Liquidity int `json:"liquidity"` } `json:"bids"` Asks []struct { Price decimal.Decimal `json:"price,string"` Liquidity int `json:"liquidity"` } `json:"asks"` CloseoutBid decimal.Decimal `json:"closeoutBid,string"` CloseoutAsk decimal.Decimal `json:"closeoutAsk,string"` Status string `json:"status"` Tradeable bool `json:"tradeable"` UnitsAvailable struct { Default struct { Long string `json:"long"` Short string `json:"short"` } `json:"default"` OpenOnly struct { Long string `json:"long"` Short string `json:"short"` } `json:"openOnly"` ReduceFirst struct { Long string `json:"long"` Short string `json:"short"` } `json:"reduceFirst"` ReduceOnly struct { Long string `json:"long"` Short string `json:"short"` } `json:"reduceOnly"` } `json:"unitsAvailable"` QuoteHomeConversionFactors struct { PositiveUnits string `json:"positiveUnits"` NegativeUnits string `json:"negativeUnits"` } `json:"quoteHomeConversionFactors"` Instrument string `json:"instrument"` } `json:"prices"` }
type ModifiedTrade ¶
type ModifiedTrade struct { OrderCreateTransaction struct { Type string `json:"type"` Instrument string `json:"instrument"` Units string `json:"units"` TimeInForce string `json:"timeInForce"` PositionFill string `json:"positionFill"` Reason string `json:"reason"` TradeClose struct { Units string `json:"units"` TradeID string `json:"tradeID"` } `json:"tradeClose"` ID string `json:"id"` UserID int `json:"userID"` AccountID string `json:"accountID"` BatchID string `json:"batchID"` RequestID string `json:"requestID"` Time time.Time `json:"time"` } `json:"orderCreateTransaction"` OrderFillTransaction struct { Type string `json:"type"` Instrument string `json:"instrument"` Units string `json:"units"` Price string `json:"price"` FullPrice string `json:"fullPrice"` PL string `json:"pl"` Financing string `json:"financing"` Commission string `json:"commission"` AccountBalance string `json:"accountBalance"` TradeOpened string `json:"tradeOpened"` TimeInForce string `json:"timeInForce"` PositionFill string `json:"positionFill"` Reason string `json:"reason"` TradesClosed []struct { TradeID string `json:"tradeID"` Units string `json:"units"` RealizedPL string `json:"realizedPL"` Financing string `json:"financing"` } `json:"tradesClosed"` TradeReduced struct { TradeID string `json:"tradeID"` Units string `json:"units"` RealizedPL string `json:"realizedPL"` Financing string `json:"financing"` } `json:"tradeReduced"` ID string `json:"id"` UserID int `json:"userID"` AccountID string `json:"accountID"` BatchID string `json:"batchID"` RequestID string `json:"requestID"` OrderID string `json:"orderId"` ClientOrderID string `json:"clientOrderId"` Time time.Time `json:"time"` } `json:"orderFillTransaction"` OrderCancelTransaction struct { Type string `json:"type"` OrderID string `json:"orderID"` Reason string `json:"reason"` ID string `json:"id"` UserID int `json:"userID"` AccountID string `json:"accountID"` BatchID string `json:"batchID"` RequestID string `json:"requestID"` Time time.Time `json:"time"` } `json:"orderCancelTransaction"` RelatedTransactionIDs []string `json:"relatedTransactionIDs"` LastTransactionID string `json:"lastTransactionID"` }
type OandaConnection ¶
type OandaConnection struct { DatetimeFormat string // contains filtered or unexported fields }
func NewConnection ¶
func NewConnection(accountID string, token string, live bool) *OandaConnection
func (*OandaConnection) CancelOrder ¶
func (c *OandaConnection) CancelOrder(orderSpecifier string) CancelledOrder
func (*OandaConnection) ClosePosition ¶
func (c *OandaConnection) ClosePosition(instrument string, body ClosePositionPayload) ModifiedTrade
func (*OandaConnection) CreateOrder ¶
func (c *OandaConnection) CreateOrder(body OrderPayload) OrderResponse
func (*OandaConnection) GetAccount ¶
func (c *OandaConnection) GetAccount(id string) AccountInfo
func (*OandaConnection) GetAccountChanges ¶
func (c *OandaConnection) GetAccountChanges(id string, transactionId string) AccountChanges
func (*OandaConnection) GetAccountInstruments ¶
func (c *OandaConnection) GetAccountInstruments(id string) AccountInstruments
func (*OandaConnection) GetAccountSummary ¶
func (c *OandaConnection) GetAccountSummary() AccountSummary
func (*OandaConnection) GetAccounts ¶
func (c *OandaConnection) GetAccounts() AccountProperties
func (*OandaConnection) GetBidAskCandles ¶
func (c *OandaConnection) GetBidAskCandles(instrument string, count string, granularity string) BidAskCandles
func (*OandaConnection) GetCandles ¶
func (c *OandaConnection) GetCandles(instrument string, count string, granularity string) InstrumentHistory
func (*OandaConnection) GetInstrumentPrice ¶
func (c *OandaConnection) GetInstrumentPrice(instrument string) InstrumentPricing
func (*OandaConnection) GetOpenPositions ¶
func (c *OandaConnection) GetOpenPositions() OpenPositions
func (*OandaConnection) GetOpenTrades ¶
func (c *OandaConnection) GetOpenTrades() ReceivedTrades
func (*OandaConnection) GetOrder ¶
func (c *OandaConnection) GetOrder(orderSpecifier string) RetrievedOrder
func (*OandaConnection) GetOrderDetails ¶
func (c *OandaConnection) GetOrderDetails(instrument string, units string) OrderDetails
func (*OandaConnection) GetOrders ¶
func (c *OandaConnection) GetOrders(instrument string) RetrievedOrders
func (*OandaConnection) GetPendingOrders ¶
func (c *OandaConnection) GetPendingOrders() RetrievedOrders
func (*OandaConnection) GetPricingForInstruments ¶
func (c *OandaConnection) GetPricingForInstruments(instruments []string) Pricings
func (*OandaConnection) GetTrade ¶
func (c *OandaConnection) GetTrade(ticket string) ReceivedTrade
func (*OandaConnection) GetTradesForInstrument ¶
func (c *OandaConnection) GetTradesForInstrument(instrument string) ReceivedTrades
func (*OandaConnection) GetTransaction ¶
func (c *OandaConnection) GetTransaction(ticket string) Transaction
func (*OandaConnection) GetTransactions ¶
func (c *OandaConnection) GetTransactions(from time.Time, to time.Time) TransactionPages
https://golang.org/pkg/time/#Time.AddDate https://play.golang.org/p/Dw7D4JJ7EC
func (*OandaConnection) GetTransactionsSinceId ¶
func (c *OandaConnection) GetTransactionsSinceId(id string) Transactions
func (*OandaConnection) OrderBook ¶
func (c *OandaConnection) OrderBook(instrument string) BrokerBook
func (*OandaConnection) PositionBook ¶
func (c *OandaConnection) PositionBook(instrument string) BrokerBook
func (*OandaConnection) ReduceTradeSize ¶
func (c *OandaConnection) ReduceTradeSize(ticket string, body CloseTradePayload) ModifiedTrade
Default is close the whole position using the string "ALL" in body.units
func (*OandaConnection) Request ¶
func (c *OandaConnection) Request(endpoint string) []byte
TODO: include params as a second option
func (*OandaConnection) Update ¶
func (c *OandaConnection) Update(endpoint string, data []byte) []byte
func (*OandaConnection) UpdateOrder ¶
func (c *OandaConnection) UpdateOrder(orderSpecifier string, body OrderPayload) RetrievedOrder
type OpenPositions ¶
type OrderBody ¶
type OrderBody struct { Units decimal.Decimal `json:"units"` Instrument string `json:"instrument"` TimeInForce string `json:"timeInForce"` Type string `json:"type"` PositionFill string `json:"positionFill,omitempty"` Price string `json:"price,omitempty"` TakeProfitOnFill *OnFill `json:"takeProfitOnFill,omitempty"` StopLossOnFill *OnFill `json:"stopLossOnFill,omitempty"` TrailingStopLossOnFill *TrailingStopLossDetails `json:"trailingStopLossOnFill,omitempty"` ClientExtensions *OrderExtensions `json:"clientExtensions,omitempty"` TradeID string `json:"tradeId,omitempty"` }
type OrderDetails ¶
type OrderDetails struct { GainPerPipPerMillionUnits float64 `json:"gainPerPipPerMillionUnits,string"` LossPerPipPerMillionUnits float64 `json:"lossPerPipPerMillionUnits,string"` UnitsAvailable struct { Default struct { Long float64 `json:"long,string"` Short float64 `json:"short,string"` } `json:"default"` OpenOnly struct { Long float64 `json:"long,string"` Short float64 `json:"short,string"` } `json:"openOnly"` ReduceFirst struct { Long float64 `json:"long,string"` Short float64 `json:"short,string"` } `json:"reduceFirst"` ReduceOnly struct { Long float64 `json:"long,string"` Short float64 `json:"short,string"` } `json:"reduceOnly"` } `json:"unitsAvailable"` UnitValues struct { Isolation struct { Units float64 `json:"units,string"` Commission float64 `json:"commission,string"` PositionValueChange float64 `json:"positionValueChange,string"` PositionValue float64 `json:"positionValue,string"` MarginRequired float64 `json:"marginRequired,string"` MarginUsed float64 `json:"marginUsed,string"` } `json:"isolation"` PositionDefault struct { Units float64 `json:"units,string"` Commission float64 `json:"commission,string"` PositionValueChange float64 `json:"positionValueChange,string"` PositionValue float64 `json:"positionValue,string"` MarginRequired float64 `json:"marginRequired,string"` MarginUsed float64 `json:"marginUsed,string"` } `json:"positionDefault"` PositionOpenOnly struct { Units float64 `json:"units,string"` Commission float64 `json:"commission,string"` PositionValueChange float64 `json:"positionValueChange,string"` PositionValue float64 `json:"positionValue,string"` MarginRequired float64 `json:"marginRequired,string"` MarginUsed float64 `json:"marginUsed,string"` } `json:"positionOpenOnly"` PositionReduceFirst struct { Units float64 `json:"units,string"` Commission float64 `json:"commission,string"` PositionValueChange float64 `json:"positionValueChange,string"` PositionValue float64 `json:"positionValue,string"` MarginRequired float64 `json:"marginRequired,string"` MarginUsed float64 `json:"marginUsed,string"` } `json:"positionReduceFirst"` PositionReduceOnly struct { Units float64 `json:"units,string"` Commission float64 `json:"commission,string"` PositionValueChange float64 `json:"positionValueChange,string"` PositionValue float64 `json:"positionValue,string"` MarginRequired float64 `json:"marginRequired,string"` MarginUsed float64 `json:"marginUsed,string"` } `json:"positionReduceOnly"` } `json:"unitValues"` ValueTables struct { CommissionTable []struct { Units string `json:"units"` Value string `json:"value"` } `json:"commissionTable"` } `json:"valueTables"` LastTransactionID string `json:"lastTransactionID"` }
type OrderExtensions ¶
type OrderInfo ¶
type OrderInfo struct { ClientExtensions struct { Comment string `json:"comment,omitempty"` ID string `json:"id,omitempty"` Tag string `json:"tag,omitempty"` } `json:"clientExtensions,omitempty"` CreateTime time.Time `json:"createTime"` ID string `json:"id"` Instrument string `json:"instrument,omitempty"` PartialFill string `json:"partialFill"` PositionFill string `json:"positionFill"` Price string `json:"price"` ReplacesOrderID string `json:"replacesOrderID,omitempty"` State string `json:"state"` TimeInForce string `json:"timeInForce"` TriggerCondition string `json:"triggerCondition"` Type string `json:"type"` Units string `json:"units,omitempty"` }
type OrderPayload ¶
type OrderPayload struct {
Order OrderBody `json:"order"`
}
type OrderResponse ¶
type OrderResponse struct { LastTransactionID string `json:"lastTransactionID"` OrderCreateTransaction struct { AccountID string `json:"accountID"` BatchID string `json:"batchID"` ID string `json:"id"` Instrument string `json:"instrument"` PositionFill string `json:"positionFill"` Reason string `json:"reason"` Time time.Time `json:"time"` TimeInForce string `json:"timeInForce"` Type string `json:"type"` Units string `json:"units"` UserID int `json:"userID"` } `json:"orderCreateTransaction"` OrderFillTransaction struct { AccountBalance string `json:"accountBalance"` AccountID string `json:"accountID"` BatchID string `json:"batchID"` Financing string `json:"financing"` ID string `json:"id"` Instrument string `json:"instrument"` OrderID string `json:"orderID"` Pl string `json:"pl"` Price string `json:"price"` Reason string `json:"reason"` Time time.Time `json:"time"` TradeOpened struct { TradeID string `json:"tradeID"` Units string `json:"units"` } `json:"tradeOpened"` Type string `json:"type"` Units string `json:"units"` UserID int `json:"userID"` } `json:"orderFillTransaction"` RelatedTransactionIDs []string `json:"relatedTransactionIDs"` }
type Position ¶
type Position struct { Instrument string `json:"instrument"` Long PositionSide `json:"long"` Pl string `json:"pl"` ResettablePL string `json:"resettablePL"` Short PositionSide `json:"short"` UnrealizedPL string `json:"unrealizedPL"` }
type PositionSide ¶
type Pricings ¶
type Pricings struct { Prices []struct { Asks []struct { Liquidity int `json:"liquidity"` Price string `json:"price"` } `json:"asks"` Bids []struct { Liquidity int `json:"liquidity"` Price string `json:"price"` } `json:"bids"` CloseoutAsk string `json:"closeoutAsk"` CloseoutBid string `json:"closeoutBid"` Instrument string `json:"instrument"` QuoteHomeConversionFactors struct { NegativeUnits string `json:"negativeUnits"` PositiveUnits string `json:"positiveUnits"` } `json:"quoteHomeConversionFactors"` Status string `json:"status"` Time time.Time `json:"time"` UnitsAvailable struct { Default struct { Long string `json:"long"` Short string `json:"short"` } `json:"default"` OpenOnly struct { Long string `json:"long"` Short string `json:"short"` } `json:"openOnly"` ReduceFirst struct { Long string `json:"long"` Short string `json:"short"` } `json:"reduceFirst"` ReduceOnly struct { Long string `json:"long"` Short string `json:"short"` } `json:"reduceOnly"` } `json:"unitsAvailable"` } `json:"prices"` }
type ReceivedTrade ¶
type ReceivedTrade struct { LastTransactionID string `json:"lastTransactionID"` Trades struct { CurrentUnits string `json:"currentUnits"` Financing string `json:"financing"` ID string `json:"id"` InitialUnits string `json:"initialUnits"` Instrument string `json:"instrument"` OpenTime time.Time `json:"openTime"` Price string `json:"price"` RealizedPL string `json:"realizedPL"` State string `json:"state"` UnrealizedPL string `json:"unrealizedPL"` } `json:"trade"` }
type ReceivedTrades ¶
type ReceivedTrades struct { LastTransactionID string `json:"lastTransactionID"` Trades []struct { CurrentUnits string `json:"currentUnits"` Financing string `json:"financing"` ID string `json:"id"` InitialUnits string `json:"initialUnits"` Instrument string `json:"instrument"` OpenTime time.Time `json:"openTime"` Price string `json:"price"` RealizedPL string `json:"realizedPL"` State string `json:"state"` UnrealizedPL string `json:"unrealizedPL"` } `json:"trades"` }
type RetrievedOrder ¶
type RetrievedOrder struct {
Order OrderInfo `json:"order"`
}
type RetrievedOrders ¶
type TrailingStopLossDetails ¶
type Transaction ¶
type Transaction struct { LastTransactionID string `json:"lastTransactionID"` Transaction struct { AccountBalance string `json:"accountBalance"` AccountID string `json:"accountID"` BatchID string `json:"batchID"` Financing string `json:"financing"` ID string `json:"id"` Instrument string `json:"instrument"` OrderID string `json:"orderID"` Pl string `json:"pl"` Price string `json:"price"` Reason string `json:"reason"` Time time.Time `json:"time"` TradeOpened struct { TradeID string `json:"tradeID"` Units string `json:"units"` } `json:"tradeOpened"` Type string `json:"type"` Units string `json:"units"` UserID int `json:"userID"` } `json:"transaction"` }
type TransactionPages ¶
type Transactions ¶
type Transactions struct { LastTransactionID string `json:"lastTransactionID"` Transactions []struct { AccountBalance string `json:"accountBalance"` AccountID string `json:"accountID"` BatchID string `json:"batchID"` Financing string `json:"financing"` ID string `json:"id"` Instrument string `json:"instrument"` OrderID string `json:"orderID"` Pl string `json:"pl"` Price string `json:"price"` Reason string `json:"reason"` Time time.Time `json:"time"` TradeOpened struct { TradeID string `json:"tradeID"` Units string `json:"units"` } `json:"tradeOpened"` Type string `json:"type"` Units string `json:"units"` UserID int `json:"userID"` } `json:"transactions"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.