The resource loading... loading...

exchange.SetBase

The exchange.SetBase() function is used to set the base address of the exchange API interface configured in the {@var/EXCHANGE exchange} exchange object.

exchange.SetBase(s)

The s parameter is used to specify the exchange API interface base address. s true string

function main() {
    // Use default base address
    Log(exchange.GetTicker())
    // Switch to 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());
}

Switching the exchange API base address is not supported in the backtesting system, because the backtesting system is a sandbox simulation environment and it does not really access the exchange API interface.

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

Futures exchange.GetBase