exchange.SetBase
Sets the base URL of the exchange API interface used by the exchange object.
exchange.SetBase(s)Examples
Switch the API base URL and fetch the ticker before and after.
javascript
function main() {
// Use the default base URL
Log(exchange.GetTicker())
// Switch to https://aws.okx.com
exchange.SetBase("https://aws.okx.com")
Log(exchange.GetTicker())
}
python
def main():
Log(exchange.GetTicker())
exchange.SetBase("https://aws.okx.com")
Log(exchange.GetTicker())
rust
fn main() {
// Use the default base URL
Log!(exchange.GetTicker(None));
// Switch to https://aws.okx.com
exchange.SetBase("https://aws.okx.com");
Log!(exchange.GetTicker(None));
}Arguments
| Name | Type | Required | Description |
s | string | Yes | Base URL of the exchange API interface. |
See Also
Remarks
The backtesting system does not support switching the base URL of the exchange API interface, because the backtesting system is a sandbox simulation environment and does not actually access the exchange's API interface.