Type/to search
Built-in Functions
Global
Log
Market
Trade
Account
Futures
exchange.SetContractType
exchange.GetContractType
exchange.SetDirection
exchange.SetMarginLevel
exchange.GetPositions
exchange.GetFundings
Exchange
IO
Network
Storage
Threads
TA
Talib
OS
Structures
Built-in Variables and Constants
Conventions
Exchanges

Set contract trading parameters and query positions: contract code, open/close direction, leverage, positions and funding rates. They apply to futures exchange objects only.

Usually select the contract with exchange.SetContractType first (or write the full symbol in a function's symbol argument, see Symbols), then trade and query positions. The contract codes, margin modes and position modes of each exchange are on its exchange page.

In this sectionRead the whole section

NameDescription
exchange.SetContractTypeSets the current contract code of the exchange object.
exchange.GetContractTypeGets the contract code currently set for the exchange object.
exchange.SetDirectionSets the order direction when calling the exchange.Buy function or exchange.Sell function to place futures contract orders.
exchange.SetMarginLevelSets the leverage value for the trading pair or contract specified by the symbol parameter.
exchange.GetPositionsGets position information.
exchange.GetFundingsObtains the funding rate data for the current period.