Get the exchange rate currently set for the exchange object.
The current value of the exchange rate of the exchange object. number
exchange.GetRate()
function main(){
Log(exchange.GetTicker())
// Set up exchange rate conversion
exchange.SetRate(7)
Log(exchange.GetTicker())
Log("Current exchange rate:", exchange.GetRate())
}
def main():
Log(exchange.GetTicker())
exchange.SetRate(7)
Log(exchange.GetTicker())
Log("Current exchange rate:", exchange.GetRate())
void main() {
Log(exchange.GetTicker());
exchange.SetRate(7);
Log(exchange.GetTicker());
Log("Current exchange rate:", exchange.GetRate());
}
If exchange.SetRate()
has not been called to set the conversion rate, the exchange.GetRate()
function returns a default rate value of 1. That is, the data related to the currently displayed currency (quoteCurrency) has not been converted.
If an exchange rate value has been set using exchange.SetRate()
, for example, exchange.SetRate(7)
. Then all price information, such as quotes, depths, and order prices obtained through the exchange
exchange object will be converted by multiplying by the set exchange rate 7
.
If exchange
corresponds to an exchange with USD as the denomination currency, after calling exchange.SetRate(7)
, all prices in the live market will be converted to a price close to CNY by multiplying 7
. At this point, the exchange rate value obtained using exchange.GetRate()
is 7
.
{@fun/Trade/exchange.SetRate exchange.SetRate}
exchange.GetRawJSON exchange.SetData