资源加载中... loading...

exchange.SetBase


exchange.SetBase(s)

```s```参数用于指定交易所API接口基地址。
s
true
string

```javascript
function main() {
    // 使用默认基地址
    Log(exchange.GetTicker())
    // 切换为https://aws.okx.com
    exchange.SetBase("https://aws.okx.com")
    Log(exchange.GetTicker())
}
def main():
    Log(exchange.GetTicker())
    exchange.SetBase("https://aws.okx.com")
    Log(exchange.GetTicker())
void main() {
    Log(exchange.GetTicker());
    exchange.SetBase("https://aws.okx.com");
    Log(exchange.GetTicker());
}

回测系统中不支持切换交易所API基地址,因为回测系统是一个沙盒模拟环境,并不会真正访问交易所的API接口。

{@fun/Trade/exchange.IO exchange.IO}

Futures exchange.GetBase