The resource loading... loading...

Inventors quantify trading platform API upgrades: enhancing the strategic design experience

Author: Inventors quantify - small dreams, Created: 2024-06-28 09:08:29, Updated: 2024-11-01 10:08:12

[TOC]

img

The Foreword

The inventors of the Quantitative Trading Platform underwent a number of redesigns after nine years of technological iterations, although we as users may not have noticed. In the past two years, the platform has undergone a number of optimizations and upgrades in terms of user experience, including a comprehensive upgrade of the UI interface, a wealth of commonly used Quantitative Trading tools, and the addition of more retrieval data support.

In order to make the policy design easier, the trading logic clearer and the API interface easier to use for beginners, the platform upgraded the API interface used by the policy. These new features can be enabled with the latest version of the hosts. The platform remains fully compatible with the old interface calls. Information about the new features of the API interface has been updated in sync with the inventors' API documentation to quantify the trading platform:

So let's take a look through this article to see what interface upgrades are available and what changes are needed to make the old policies compatible with the current API.

1st, the new API interface

exchange.GetTickers函数

Such aggregated market interfaces are essential for designing multi-variety strategies, market-wide market monitoring strategies. This is to make strategies easier to develop and avoid duplication of the wheel. The inventors of the quantitative trading platform packaged such APIs for exchanges.

If the exchange does not have such an interface (individual exchange), callexchange.GetTickers()In the meantime, I'm going to try to get some answers.

The function has no parameters and returns real-time market data of all varieties in the market interface.

exchange.GetTickers()The function isexchange.GetTicker()The full variation of the requested version of the function (look carefully, the difference between the two function names is only a single plural) ‒

We tested the environment using OKX Live Simulation Disks:

function main() {
    exchange.IO("simulate", true)

    var tickers = exchange.GetTickers()
    if (!tickers) {
        throw "tickers error"
    }

    var tbl = {type: "table", title: "test tickers", cols: ["Symbol", "High", "Open", "Low", "Last", "Buy", "Sell", "Time", "Volume"], rows: []}
    for (var i in tickers) {
        var ticker = tickers[i]
        tbl.rows.push([ticker.Symbol, ticker.High, ticker.Open, ticker.Low, ticker.Last, ticker.Buy, ticker.Sell, ticker.Time, ticker.Volume])
    }

    LogStatus("`" + JSON.stringify(tbl) +  "`")
    return tickers.length
}

img

exchange.CreateOrder函数

The Newexchange.CreateOrder()Functions are the focus of this upgrade.exchange.CreateOrder()The biggest function is to specify the order type, direction, etc. directly in the function's parameters. This eliminates the need to depend on the current settings of the system.

In multi-transaction scenario, the design complexity is greatly reduced in the concurrent scenario.exchange.CreateOrder()So the four parameters of the function aresymbolsidepriceamount

Testing the environment using the OKX futures simulation:

function main() {
    exchange.IO("simulate", true)

    var id1 = exchange.CreateOrder("ETH_USDT.swap", "buy", 3300, 1)
    var id2 = exchange.CreateOrder("BTC_USDC.swap", "closebuy", 70000, 1)
    var id3 = exchange.CreateOrder("LTC_USDT.swap", "sell", 110, 1)

    Log("id1:", id1, ", id2:", id2, ", id3:", id3)
}

img

So that's only three times.exchange.CreateOrder()Function calls result in three different types of futures orders, in different directions.

exchange.GetHistoryOrders函数

The Newexchange.GetHistoryOrders()The function is used to obtain historical trading orders of a certain variety, which also requires exchange interface support.

The interfaces implemented by exchanges vary greatly when it comes to querying historical orders:

  • Some support split-page queries, some do not.
  • Some deals are not available for all query window periods, i.e. orders that exceed N days.
  • Most exchanges support time-stamped queries, some do not.

For this type of interface to be packaged to the maximum degree of compatibility, it is necessary to consider whether it meets the needs and expectations of the policy in actual use.

For more details on the functions, see the syntax manual in the API documentation:

https://www.fmz.com/syntax-guide#fun_exchange.gethistoryorders

Testing in real-world environments using the Binance spot market:

function main() {
    var orders = exchange.GetHistoryOrders("ETH_USDT")

    // 写入图表
    var tbl = {type: "table", title: "test GetHistoryOrders", cols: ["Symbol", "Id", "Price", "Amount", "DealAmount", "AvgPrice", "Status", "Type", "Offset", "ContractType"], rows: []}
    for (var order of orders) {
        tbl.rows.push([order.Symbol, order.Id, order.Price, order.Amount, order.DealAmount, order.AvgPrice, order.Status, order.Type, order.Offset, order.ContractType])
    }
    
    LogStatus("orders.length:", orders.length, "\n", "`" + JSON.stringify(tbl) +  "`")
}

img

exchange.GetPositions函数

The old version of the get hold data function wasexchange.GetPosition()The upgraded version adds a new access hold function to better fit the semantics of the function name:exchange.GetPositions()│ while still being compatible/upgrading the GetPosition function│

Note that the two function names only differ by an s ending, as GetPositions is more semantically consistent, so it is recommended that all subsequent ones use GetPositions.

exchange.GetPositions()There are three ways to call a function:

  • Exchange.GetPositions is a free exchange. When no parameters are passed, the currentThe deal. / Contract codeThe settings for this request store data for all varieties of the current dimension.

  • exchange.GetPositions ((ETH_USDT.swap button)) When specifying a specific variety (ETH_USDT.swap, as defined by the FMZ platform), hold data for a specific variety is requested. For example:BTC_USD.swapETH_USDT.swapETH_USDT.quarterAnd so on and so forth. BTC_USD.swap: A futures contract for the price of BTC. ETH_USDT.swap: A U-bit perpetual contract for ETH. ETH_USDC.swap: The USDC-based perpetual contract for ETH. (In addition to USDT, you can specify a different quote Currency, no more comment) ETH_USDT.quarter: The U-bit quarterly exchange rate of ETH is approx. BTC_USD. BTC-USD-201226-24250-C: The currency spot option contract for BTC.

  • exchange.GetPositions ((USDT.swap button)) Request storage data for all varieties according to the specified range of dimensions. USDT.swap: The scope of the U-bit perpetual contract. USDT.futures: U-bit exchange rate approximate range. USDC.swap: USDC-based perpetual contract scope. (In addition to USDT, a different quote Currency can be specified, no further comment) USDC.futures: USDC exchange rate approximate range. USD.swap: The scope of the currency's fixed-term contract. USD.futures: Currency exchange rate approximate range. USDT.option: The scope of the U-bit option contract. USD.option: The scope of the option contract.

    Some special exchanges are divided by contract dimensions: USDT.futures_combo:Futures_Deribit is a futures exchange for the USDT. USD.futures_ff:Futures_Kraken exchange's mixed collateral exchange rate is approx. USD.swap_pf:Futures_Kraken is a mixed security futures exchange.

    For dimensions that are not supported by the exchange API interface, the call will return an error and a blank value.

Testing the environment using the OKX futures simulation:

function main() {
    exchange.IO("simulate", true)

    exchange.SetCurrency("BTC_USDT")
    exchange.SetContractType("swap")

    var p1 = exchange.GetPositions()
    var p2 = exchange.GetPositions("BTC_USDT.swap")

    var tbls = []
    for (var positions of [p1, p2]) {
        var tbl = {type: "table", title: "test GetPosition/GetPositions", cols: ["Symbol", "Amount", "Price", "FrozenAmount", "Type", "Profit", "Margin", "ContractType", "MarginLevel"], rows: []}
        for (var p of positions) {
            tbl.rows.push([p.Symbol, p.Amount, p.Price, p.FrozenAmount, p.Type, p.Profit, p.Margin, p.ContractType, p.MarginLevel])
        } 
        tbls.push(tbl)
    }

    LogStatus("`" + JSON.stringify(tbls) +  "`")
}

img

When transmittedexchange.GetPositions()The parameters of the function areETH_USDT.swapIn this case, you can get the holdings data of ETH's U-bit perpetual contracts.

When not transmittedexchange.GetPositions()When the function's parameters are used, it is possible to obtain the holdings of all U-bit perpetual contracts that are listed on the exchange (because the current trading pair is BTC_USDT, the contract is a swap, according to the current trading pair, contract scope request), at which point the value is equal to the call.exchange.GetPositions("USDT.swap"), specify a request scope.

exchange.GetFundings函数

The newly added GetFundings function can obtain the capital rate of a futures exchange's perpetual contract. The function has a parameter symbol. The function returns an array of Funding structures.

  • Specify symbol parameters: Returns the funding rate information structure array (Funding array) of the specified variety. The symbol parameters can be set to a range, similar to the symbol parameters of the GetOrders/GetPositions functions.
  • No symbol parameters specified: Returns all varieties of data in the current dimension according to the current transaction pair, the dimension of the contract code, mechanisms such as the GetOrders/GetPositions function.
  • If an exchange must specify a specific variety, it must pass symbol parameters, i.e. the code for the specific variety, such as:BTC_USDT.swap│ Not passing parameters or passing range functions will return an error symbol parameters are not supported│

2 API upgraded

exchange.GetTicker函数

Field functionsexchange.GetTicker()This upgrade is mainly due to the addition of symbol parameters. It allows the function to be detached from the current transaction pair, contract code directly according to the parameters specified by the variety information, request market data. It simplifies the code writing process.

ParameterssymbolFor exchange objectsexchangeIt is a spot/future with different formats:

  • The object of the spot exchange The format is:AAA_BBBThe AAA stands for base currency, the BBB stands for quote currency, and the names of the currencies are capitalized. For example: BTC_USDT spot currency pair.
  • Object of the futures exchange The format is:AAA_BBB.XXXAAA stands for base currency, BBB stands for quote currency, and XXX stands for contract code, such as perpetual contract swap. Currency names are capitalized and contract codes are lower case. For example: BTC_USDT.swap, BTC's U-bit perpetual contract.

Testing in real-world environments using the Binance futures:

var symbols = ["BTC_USDT.swap", "BTC_USDT.quarter", "BTC_USD.swap", "BTC_USD.next_quarter", "ETH_USDT.swap"]

function main() {
    exchange.SetCurrency("ETH_USD")
    exchange.SetContractType("swap")

    var arr = []
    var t = exchange.GetTicker()
    arr.push(t)

    for (var symbol of symbols) {
        var ticker = exchange.GetTicker(symbol)
        arr.push(ticker)
    }

    var tbl = {type: "table", title: "test GetTicker", cols: ["Symbol", "High", "Open", "Low", "Last", "Buy", "Sell", "Time", "Volume"], rows: []}
    for (var ticker of arr) {
        tbl.rows.push([ticker.Symbol, ticker.High, ticker.Open, ticker.Low, ticker.Last, ticker.Buy, ticker.Sell, ticker.Time, ticker.Volume])
    }

    LogStatus("`" + JSON.stringify(tbl) +  "`")
    return arr
}

img

The design of market data for a set of specified varieties is simplified.

exchange.GetDepth函数

The same as the GetTicker function.exchange.GetDepth()The function also adds symbol parameters. It is possible to specify the variety directly when requesting depth data.

Testing in real-world environments using the Binance futures:

function main() {
    exchange.SetCurrency("LTC_USD")
    exchange.SetContractType("swap")

    Log(exchange.GetDepth())
    Log(exchange.GetDepth("ETH_USDT.quarter"))
    Log(exchange.GetDepth("BTC_USD.swap"))
}

img

exchange.GetTrades函数

The same as the GetTicker function.exchange.GetTrades()The function also adds symbol parameters. It is possible to specify the variety directly when requesting market transaction data.

Testing in real-world environments using the Binance futures:

function main() {
    var arr = []
    var arrR = []
    var symbols = ["LTC_USDT.swap", "ETH_USDT.quarter", "BTC_USD.swap"]    

    for (var symbol of symbols) {
        var r = exchange.Go("GetTrades", symbol)
        arrR.push(r)
    }

    for (var r of arrR) {
        arr.push(r.wait())
    }
    
    var tbls = []
    for (var i = 0; i < arr.length; i++) {
        var trades = arr[i]
        var symbol = symbols[i]

        var tbl = {type: "table", title: symbol, cols: ["Time", "Amount", "Price", "Type", "Id"], rows: []}
        for (var trade of trades) {
            tbl.rows.push([trade.Time, trade.Amount, trade.Price, trade.Type, trade.Id])
        }

        tbls.push(tbl)
    }

    LogStatus("`" + JSON.stringify(tbls) +  "`")
}

img

This upgrade is also compatible with the pass.exchange.Go()The function simultaneously invokes the symbol parameter to specify the variety information when the platform API interface is passed.

exchange.GetRecords函数

The GetRecords function made a major adjustment this time, in addition to supporting the variety of K-line data that the symbol parameter directly specifies for the request. The original period parameter was retained to specify the period of the K-line, and a limit parameter was added to specify the desired length of the K-line for the period of the request. It is also compatible with the older version of the GetRecords function, which only calls the period parameter.

exchange.GetRecords()How to call the function:

  • exchange.GetRecords When no parameters are specified, the K-line data of the current transaction pair/contract code-corresponding variety is requested, and the K-line cycle is the default K-line cycle set at the time of the policy review interface or real-time.
  • exchange.GetRecords ((60 * 15) is the name of the When only the K-line cycle parameter is specified, the K-line data of the current transaction pair/contract code corresponding to the variety is requested.
  • exchange.GetRecords (((BTC_USDT.swap button))) is a free and open-source exchange. When specifying only the variety information, the K-line data for the specification of the variety is requested, and the K-line cycle is the default K-line cycle set at the time of the policy retrieval interface or the real disk.
  • exchange.GetRecords (( BTC_USDT.swap bar, 60 * 60)) Specify the species information, specify the specific K-line cycle requesting K-line data.
  • exchange.GetRecords (((BTC_USDT.swap, 60, 1000) is a free online exchange that allows users to exchange information on the exchange. Specify the species information, specify the specific K-line cycle, refer to the K-line length requested for the K-line data to be obtained on a regular basis. Note that a page split request (i.e. multiple calls to the exchange's K-line interface) is generated when the limit parameter exceeds the maximum length of the exchange's one request.

Testing in real-world environments using the Binance futures:

function main() {
    exchange.SetCurrency("ETH_USDT")
    exchange.SetContractType("swap")
    
    var r1 = exchange.GetRecords()
    var r2 = exchange.GetRecords(60 * 60)
    var r3 = exchange.GetRecords("BTC_USDT.swap")
    var r4 = exchange.GetRecords("BTC_USDT.swap", 60)
    var r5 = exchange.GetRecords("LTC_USDT.swap", 60, 3000)

    Log("r1相邻Bar时间差值:", r1[1].Time - r1[0].Time, "毫秒, Bar长度:", r1.length)
    Log("r2相邻Bar时间差值:", r2[1].Time - r2[0].Time, "毫秒, Bar长度:", r2.length)
    Log("r3相邻Bar时间差值:", r3[1].Time - r3[0].Time, "毫秒, Bar长度:", r3.length)
    Log("r4相邻Bar时间差值:", r4[1].Time - r4[0].Time, "毫秒, Bar长度:", r4.length)
    Log("r5相邻Bar时间差值:", r5[1].Time - r5[0].Time, "毫秒, Bar长度:", r5.length)
}

img

exchange.GetOrders函数

The GetOrders function has also been added.symbolParameters that can specify a specific variety and query unfinished orders for that variety ("hanging lists"); also support querying unfinished orders for all varieties within the specified dimensional range ("hanging lists").

exchange.GetOrders()The function can be called in the following ways:

  • exchange.GetOrders ((() For futures exchanges: when no parameters are transmitted, the currentThe deal. / Contract codeSetup of the request for all unfinished orders (hanging lists) for all varieties in the current dimension range.
    For spot exchanges: When no parameters are transmitted, unfinished orders for all spot varieties are requested.
  • exchange.GetOrders (BTC_USDT.swap) or exchange.GetOrders (BTC_USDT) For futures exchanges: exchange.GetOrders (BTC_USDT.swap), search for all unfinished orders (Pending Orders) on BTC's USDT futures contracts. For the spot exchange: exchange.GetOrders, search for all unfinished orders in the BTC_USDT spot exchange pair.
  • Exchange.GetOrders (USDT.swap) is supported for futures exchanges only. Specify the range of dimensions requested for all varieties of pending orders ( pending lists) The range of the dimensional partition is consistent with the range in the GetPositions function. For example: exchange.GetOrders (USDT.swap) Requests pending orders for all varieties of the U-bits permanent contract range.

Testing the environment using the OKX futures simulation:

function main() {
    exchange.IO("simulate", true)

    exchange.SetCurrency("BTC_USDT")
    exchange.SetContractType("swap")

    // 写入图表
    var tbls = []
    for (var symbol of ["null", "ETH_USDT.swap", "USDT.swap"]) {
        var tbl = {type: "table", title: symbol, cols: ["Symbol", "Id", "Price", "Amount", "DealAmount", "AvgPrice", "Status", "Type", "Offset", "ContractType"], rows: []}

        var orders = null
        if (symbol == "null") {
            orders = exchange.GetOrders()
        } else {
            orders = exchange.GetOrders(symbol)
        }

        for (var order of orders) {
            tbl.rows.push([order.Symbol, order.Id, order.Price, order.Amount, order.DealAmount, order.AvgPrice, order.Status, order.Type, order.Offset, order.ContractType])
        }

        tbls.push(tbl)
    }
    
    LogStatus("`" + JSON.stringify(tbls) +  "`")
}
  • When not passing the parameter, request unfinished orders for all varieties of the current transaction pair (BTC_USDT), contract code (swap) and dimension range (pending order).
  • Specify parametersETH_USDT.swapWhen the parameter requests ETH, the USDT is placed on the pending order ("pending order").
  • Passing the string"USDT.swap"In the case of a pending order, all pending orders for USDT's permanent contracts are requested.

exchange.GetPosition函数

It is still compatible with the old stored access function naming, and also adds symbol parameters to specify the variety of stored data for specific requests.exchange.GetPositions()I'm sure you'll agree.

exchange.IO函数

For theexchange.IO("api", ...)Function call mode, upgraded to support full direct-to-complete request address functionality for all exchange objects.

For example, if you want to call the OKX interface:

GET https://www.okx.com /api/v5/account/max-withdrawal ccy: BTC

Support for direct data entryhttps://www.okx.com, you don't need to switch the base address to call the IO function again.

Testing the environment using the OKX futures simulation:

function main() {
    exchange.IO("simulate", true)

    return exchange.IO("api", "GET", "https://www.okx.com/api/v5/account/max-withdrawal", "ccy=BTC")
}

img

3 The impact of the API

exchange.GetOrder函数

This upgrade has had a major impact.exchange.GetOrder(id)Parameters of the functionidThe id parameter has been changed from the original exchange order id to a string format containing the transaction variety. All order id packages on the FMZ platform are in this format.

For example:

  • The exchange's original order ID is defined in the exchange order as:123456Before this upgrade, if you were to call the GetOrder function, the order ID that was passed was123456
  • The product code of the name of the exchange defined in the exchange order:BTC-USDTI'm not sure. Note that this refers to the exchange-named transaction variety codes, not the FMZ platform-defined pairs.

I'm not sure if this is a good idea, but I'm not sure.exchange.GetOrder(id)The format of the parameter id that the function needs to pass is adjusted to:BTC-USDT,123456

  • I'll start by explaining why this design was chosen: Because the CreateOrder function has been upgraded to specify the variety of the order directly (the variety of the order and the current set of transaction pairs, the contract code may be different), if the returned order ID does not contain the variety information, then the order ID will not be used. Because it is not known what the order is for at the time of the specific order, most exchange orders and withdrawals require the specification of parameters describing the variety code.

  • How to combine this influence: If the order is placed using the exchange.IO function, which calls the exchange's order interface directly to place the order, the return value usually contains the exchange's original symbol (variety code) and the original order id. Similarly, if the order is placed using the FMZ platform wrapped in the order sub-interface, since the order ID is the transaction variety code at the beginning, it is enough to remove the variety code and commas if the original ID of the order is needed.

exchange.CancelOrder函数

This upgrade is forexchange.CancelOrder()The effect of functionsexchange.GetOrder()The function is the same.

exchange.Buy函数

This upgrade is forexchange.Buy()The effect of functionsexchange.GetOrder()The function is the same.exchange.Buy()The function returns an order Id for a new structure, such as the Id returned when the OKX futures exchange placed an order:LTC-USDT-SWAP,1578360858053058560

exchange.Sell函数

This upgrade is forexchange.Sell()The effect of functionsexchange.GetOrder()The function is the same.exchange.Sell()The function returns an order Id for a new structure, such as the Id returned when the OKX futures exchange placed an order:ETH-USDT-SWAP,1578360832820125696

exchange.GetPosition函数

Only futures exchange objects support this function, and the behavior of the two functions is perfectly consistent for obtaining hold data functions named exchange.GetPosition (), and new exchange.GetPositions ().

The old definition: exchange.GetPosition () function, which does not specify any parameters when called, retrieves the holdings data of the current transaction pair, the specific contract set by the contract code.

Modified, redefined: exchange.GetPosition function, which, without specifying any parameter calls, obtains holdings of all varieties of the current set of transaction pairs, within the dimension range defined by the contract code.

For example, the current trading pair is BTC_USDT and the contract code is swap.

exchange.GetPosition() // 等价于调用 exchange.GetPosition("USDT.swap")

The function asks for the U-bit holdings of all currencies.

exchange.GetOrders函数

1, for spot exchanges:

The old definition: exchange.GetOrders () function, when called without specifying any parameters, retrieves all uncompleted orders in the current transaction pair.

Modified, redefined: exchange.GetOrders () function, when no parameters are specified, all unfinished orders of the varieties of spot transactions are obtained.

2 For futures exchanges:

The old definition: exchange.GetOrders () function, when called without specifying any parameters, retrieves all unfinished orders for the current transaction pair, the specific contract set by the contract code.

Modified, redefined: exchange.GetOrders () function, which retrieves all unfinished orders within the range of dimensions defined by the current set of transaction pairs, contract code, without specifying any parameters.

For example, the current trading pair is BTC_USD and the contract code is quarter.

exchange.GetOrders()   // 等价于调用 exchange.GetOrders("USD.futures")

The function asks for unfinished order data for all currencies.

4 Structural adjustments

Ticker structure

This update adds a symbol field to the ticker construct, which records information about which varieties the current ticker structure is for.exchange.GetTicker()The symbol parameter format of the function is perfectly consistent.

Order structure

This update to the Order constructor adds a Symbol field, which is formatted with the symbol of the field.exchange.GetTicker()The symbol parameter format of the function is completely consistent. The update also modifies the Id field of the Order construct to record variety information, original order information, and new order Id format.exchange.GetOrder()An explanation of the order Id in the function, which is no longer discussed here.

Positioned Structure

This update to the Position constructor adds the Symbol field, which is formatted with theexchange.GetTicker()The symbol parameter format of the function is perfectly consistent.

Funding structure

The GetFundings function returns an array of Funding constructs.

{
    "Info": {...},               // 交易所资金费率接口原始应答数据
    "Symbol": "BTC_USDT.swap",   // FMZ平台定义的品种名称
    "Interval": 28800000,        // 8小时间隔,单位毫秒
    "Time": 1729728000000,       // 本期资金费率收取时间
    "Rate": 0.0001,              // 资金费率,即 0.01 %
}

5, the retesting system

This upgrade is designed to meet the needs of users by first making the disk compatible, and the retesting system will complete the adaptation within a week. If individual policy code is affected, please change the adaptation as described in this article.

As a result of the platform strategy API upgrade, all the API interfaces in the platform's feedback system have been updated in sync; In addition, the feedback system adds support for:

  • Support for more exchange retesting data.
  • Support for all kinds of exchange retesting data.
  • U-Bits, currency-based delivery, mixed-trade of perpetual contracts.
  • During the review period, commodity exchange objects supported switching pairs.
  • Added support for new functions such as GetTickers and GetMarkets.

Additional updates

1, Account Structure New fields added Equity, UPnL

Member functions for futures exchange objectsGetAccountReturnedAccountThe structure has been extended to fields.

  • Equity Currently, the total equity of the collateralized assets, with the exception of very specific futures exchanges, mostly supports this field. It is mainly used to calculate real-time account collateral gains and losses.
  • UPnL Unrealized gains and losses on all positions currently held in the underlying asset class, with the exception of very specific futures exchanges that do not support the field.

2, SetMarginLevel function upgraded symbols supported

The member function SetMarginLevel for futures exchange objects has been upgraded with the addition of the parameter symbol.

Test example:

function main() {
    exchange.SetCurrency("ETH_USDT")
    exchange.SetContractType("swap")
    
    // 当前交易对为ETH_USDT,合约代码为swap,设置杠杆值为10
    exchange.SetMarginLevel(10)
    
    // 直接指定交易对BTC_USDT,合约代码swap,设置杠杆值20
    exchange.SetMarginLevel("BTC_USDT.swap", 20)
}

3, the GetMarkets function returns the Market Structure to add the CtValCcy field

  • FieldsCtValCcyThe unit of value of a contract can be: BTC, USD, ETH, etc.
  • FieldsCtValRecord the corresponding value of a contract on an exchange of that transaction type, in units ofCtValCcyThe currency of the field is recorded.CtValIt's 0.01,CtValCcyFor "BTC", a contract is worth 0.01 BTC.

More

Wa-emmnn_I said what happened to my new robot, the return ID also has a transaction pair name, I studied it for a long time, and the log information of the post-order box is not showing now, also because of the administrator update?

I'm not going to lie./upload/asset/2ffc0f961149326b78aed.png This page is about the website. Is this problem caused by this interface update?

ecnemuse 希望exchange.Buy函数能增加开止损单的功能。。

NanSegFront row outline

Wa-emmnn_Good for you

Inventors quantify - small dreamsWell, check it out here. Thank you for asking. We'll deal with it as soon as possible.

Wa-emmnn_Yes, extMsg1, extMsg2 is not showing.

Inventors quantify - small dreamsHello, Order ID is a necessary change, because the upgrade to directly specify the variety order, the order ID must contain the variety information, otherwise it is impossible to determine which variety of the order is, and can not be called at the time of withdrawal ((because most exchanges require to specify the variety when withdrawing, and specify the ID)). The message you said after the order is not displayed, which means: exchange.Buy ((price, amount, extMsg1, extMsg2) when called, extMsg1, extMsg2 is not displayed in the log?

Inventors quantify - small dreamsHello, you are sending the current exchange settings, trading pairs, contract code settings.

Inventors quantifiedPlease send the details of the test code and configuration to the form and the engineer will get back to you at the earliest.

Inventors quantify - small dreamsThe exchange's terms and conditions vary widely, and the level of support varies, so we'll see if that's possible.

Inventors quantify - small dreamsThank you for your support, and if you have any problems, please send us a form or a message.