Type/to search
Built-in Functions
Global
Log
Market
Trade
Account
Futures
Exchange
exchange.GetName
exchange.GetLabel
exchange.GetCurrency
exchange.SetCurrency
exchange.GetQuoteCurrency
exchange.GetPeriod
exchange.SetMaxBarLen
exchange.SetPrecision
exchange.GetRate
exchange.SetRate
exchange.SetBase
exchange.GetBase
exchange.SetProxy
exchange.SetTimeout
exchange.Encode
IO
Network
Storage
Threads
TA
Talib
OS
Structures
Built-in Variables and Constants
Conventions
Exchanges

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

NameTypeRequiredDescription

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.