TradableInstrument
@objc public class TradableInstrument: NSObject
Contains instrument data, such as symbol, type, precision and more.
-
The unique identifier for this instrument.
Declaration
Swift
@objc public let id: String
-
The symbol that is used to represent the instrument in the brokerage account.
Declaration
Swift
@objc public let brokerageAccountSymbol: String
-
The instrument display name.
Declaration
Swift
@objc public let displayName: String
-
The exchange this instrument is traded on. May be not available if the exchange is unknown.
Declaration
Swift
@objc public let exchangeId: String?
-
The maximum long order amount for this instrument.
Declaration
Swift
@objc public let maxAmount: Double
-
The maximum short order amount for this instrument. If 0, the instrument cannot be shorted.
Declaration
Swift
@objc public let maxShortAmount: Double
-
The pip precision for the instrument; specifies at which decimal place the pip is placed. This may be nil for stocks and other instrument types that do not have notion of pips.
Declaration
Swift
public let pipPrecision: Int?
-
The quote currency of the instrument
Declaration
Swift
@objc public let quoteCurrency: String
-
A short description of the instrument.
Declaration
Swift
@objc public let shortDescription: String
-
The instrument symbol. The Tradable symbol for this instrument.
Declaration
Swift
@objc public let symbol: String
-
The instrument type.
Declaration
Swift
@objc public let type: TradableInstrumentType
-
The order size increments at different size ranges.
Declaration
Swift
@objc public let orderSizeIncrements: TradableOrderSizeIncrementBands
-
The price increments defining the decimal precision at different price levels.
Declaration
Swift
@objc public let priceIncrements: TradablePriceIncrementBands
-
The minimum order amount for this instrument. Computed from the lowest of order size increments.
Declaration
Swift
@objc public var minAmount: Double
-
Simple description of this object.
Declaration
Swift
public override var description: String
-
Calculates a number of decimals used in price needed to send a correct order for an instrument.
Throws
TradableArgumentError.incorrectPrice if the price is incorrect, i.e. negative.
Declaration
Swift
public func getPriceDecimals(forPrice price: Double) throws -> Int
Parameters
price
The price from which the decimals should be calculated.
Return Value
A number of decimals used to format the price.
-
Calculates a number of decimals used in order size needed to send a correct order for an instrument.
Throws
TradableArgumentError.incorrectOrderSize if the order size is incorrect, i.e. negative.
Declaration
Swift
public func getOrderSizeDecimals(forOrderSize orderSize: Double) throws -> Int
Parameters
orderSize
The order size from which the decimals should be calculated.
Return Value
A number of decimals used to format the order size.
-
Calculates the next valid price for an instrument.
Declaration
Swift
@objc public func getNextValidPrice(fromPrice price: Double) -> Double
Parameters
price
The price for which the next valid price should be calculated.
Return Value
The next valid price.
-
Calculates the previous valid price for an instrument.
Declaration
Swift
@objc public func getPreviousValidPrice(fromPrice price: Double) -> Double
Parameters
price
The price for which the previous valid price should be calculated.
Return Value
The previous valid price.
-
Calculates the next valid order size for an instrument.
Declaration
Swift
@objc public func getNextValidOrderSize(fromOrderSize orderSize: Double) -> Double
Parameters
orderSize
The order size for which the next valid order size should be calculated.
Return Value
The next valid order size.
-
Calculates the previous valid order size for an instrument.
Declaration
Swift
@objc public func getPreviousValidOrderSize(fromOrderSize orderSize: Double) -> Double
Parameters
price
The order size for which the previous valid order size should be calculated.
Return Value
The previous valid order size.